github.com/pingcap/br@v5.3.0-alpha.0.20220125034240-ec59c7b6ce30+incompatible/tests/lightning_csv/run.sh (about)

     1  #!/bin/sh
     2  
     3  set -eu
     4  
     5  for BACKEND in importer tidb local; do
     6    if [ "$BACKEND" = 'local' ]; then
     7      check_cluster_version 4 0 0 'local backend' || continue
     8    fi
     9  
    10    run_sql 'DROP DATABASE IF EXISTS csv'
    11  
    12    run_lightning --backend $BACKEND
    13  
    14    run_sql 'SELECT count(*), sum(PROCESSLIST_TIME), sum(THREAD_OS_ID), count(PROCESSLIST_STATE) FROM csv.threads'
    15    check_contains 'count(*): 43'
    16    check_contains 'sum(PROCESSLIST_TIME): 322253'
    17    check_contains 'sum(THREAD_OS_ID): 303775702'
    18    check_contains 'count(PROCESSLIST_STATE): 3'
    19  
    20    run_sql 'SELECT count(*) FROM csv.threads WHERE PROCESSLIST_TIME IS NOT NULL'
    21    check_contains 'count(*): 12'
    22  
    23    run_sql 'SELECT hex(t), j, hex(b) FROM csv.escapes WHERE i = 1'
    24    check_contains 'hex(t): 5C'
    25    check_contains 'j: {"?": []}'
    26    check_contains 'hex(b): FFFFFFFF'
    27  
    28    run_sql 'SELECT hex(t), j, hex(b) FROM csv.escapes WHERE i = 2'
    29    check_contains 'hex(t): 22'
    30    check_contains 'j: "\n\n\n"'
    31    check_contains 'hex(b): 0D0A0D0A'
    32  
    33    run_sql 'SELECT hex(t), j, hex(b) FROM csv.escapes WHERE i = 3'
    34    check_contains 'hex(t): 0A'
    35    check_contains 'j: [",,,"]'
    36    check_contains 'hex(b): 5C2C5C2C'
    37  
    38    run_sql 'SELECT id FROM csv.empty_strings WHERE a = """"'
    39    check_contains 'id: 3'
    40    run_sql 'SELECT id FROM csv.empty_strings WHERE b <> ""'
    41    check_not_contains 'id:'
    42  
    43  done