Rate This Document
Findability
Accuracy
Completeness
Readability

Installing the Patch

  • The feature used for optimization is provided in a patch. Apply the patch in the MySQL source code, and then compile and install the MySQL database.
  • The patch is developed for MySQL 5.7.27.
  1. Create a MySQL user. See Creating a User Group and User" in the MySQL Porting Guide.
  2. Use the MySQL account to log in to the server, and download and decompress the MySQL 5.7.27 source package.
    1
    2
    3
    4
    cd /home
    wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-boost-5.7.27.tar.gz --no-check-certificate
    tar -zxvf mysql-boost-5.7.27.tar.gz
    cd mysql-5.7.27
    
  3. Initialize the source code using Git.
    1
    2
    3
    git init
    git add -A
    git commit -m "init"
    
    • Generally, Git is provided by the system. Configure the Yum source by following instructions in "Configuring the Yum Source" in MySQL Porting Guide and then install Git.
      1
      yum install git
      
    • If the Git submission user information is not configured, configure the user email and user name before running the git commit command.
      1
      2
      git config user.email "123@example.com"
      git config user.name "123"
      
  4. Download the patch file.
    1
    wget https://gitee.com/kunpengcompute/mysql-server/releases/download/KunpengBoostKit21.0.0-threadpool5/0001-THREAD_POOL_5.patch --no-check-certificate
    
  5. Check whether the content is modified.
    1
    git status
    
    The following shows that a 0001-THREAD_POOL_5.patch file is added.
    1
    2
    3
    4
    5
    6
    # On branch master
    # Untracked files:
    #   (use "git add <file>..." to include in what will be committed)
    #
    #       0001-THREAD_POOL_5.patch
    nothing added to commit but untracked files present (use "git add" to track)
    
  6. Check whether the patch file conflicts with the MySQL source code.
    1
    git apply --check 0001-THREAD_POOL_5.patch
    
    Check the output information. If no error is reported, the patch can be applied.
    1
    2
    [mysql-5.7.27]# git apply --check 0001-THREAD_POOL_5.patch
    [mysql-5.7.27]# 
    
  7. Apply the patch file.
    1
    git apply --whitespace=nowarn 0001-THREAD_POOL_5.patch
    

    The following information is displayed. Warning information can be ignored. If no error information is displayed, the patch is successfully installed.

    1
    2
    [mysql-5.7.27]# git apply --whitespace=nowarn 0001-THREAD_POOL_5.patch
    [mysql-5.7.27]# 
    

    After the patch is applied, you can compile and install MySQL. For details, see MySQL Porting Guide.

    After the patch is successfully installed, check the new information_schema table in the thread pool to ensure that the patch has taken effect. For details, see New information_schema Tables.