github.com/pingcap/tiflow@v0.0.0-20240520035814-5bf52d54e205/tests/integration_tests/_utils/run_sql_file (about)

     1  #!/bin/bash
     2  # parameter 1: path to sql file
     3  # parameter 2: database host
     4  # parameter 3: database port
     5  
     6  set -eu
     7  
     8  prepare="set global tidb_enable_clustered_index = 'int_only';"
     9  
    10  echo "[$(date)] Executing SQL: $1" >"$OUT_DIR/sql_res.$TEST_NAME.txt"
    11  mysql -uroot -h$2 -P$3 --default-character-set utf8mb4 -E -e "${prepare}" >"$OUT_DIR/sql_res.$TEST_NAME.txt"
    12  mysql -uroot -h$2 -P$3 --default-character-set utf8mb4 -vv <"$1" >>"$OUT_DIR/sql_res.$TEST_NAME.txt"