github.com/pingcap/br@v5.3.0-alpha.0.20220125034240-ec59c7b6ce30+incompatible/tests/lightning_tool_135/run.sh (about) 1 #!/bin/sh 2 # 3 # Copyright 2019 PingCAP, Inc. 4 # 5 # Licensed under the Apache License, Version 2.0 (the "License"); 6 # you may not use this file except in compliance with the License. 7 # You may obtain a copy of the License at 8 # 9 # http://www.apache.org/licenses/LICENSE-2.0 10 # 11 # Unless required by applicable law or agreed to in writing, software 12 # distributed under the License is distributed on an "AS IS" BASIS, 13 # See the License for the specific language governing permissions and 14 # limitations under the License. 15 16 # This test verifies if TOOL-135 is fixed. 17 18 set -eu 19 20 run_sql 'DROP DATABASE IF EXISTS tool_135;' 21 run_lightning 22 echo 'Import finished' 23 24 run_sql 'SELECT count(a), sum(a), min(a), max(a) FROM tool_135.bar1;' 25 check_contains 'count(a): 1000' 26 check_contains 'sum(a): 601500' 27 check_contains 'min(a): 102' 28 check_contains 'max(a): 1101' 29 run_sql 'INSERT INTO tool_135.bar1 () VALUES ();' 30 run_sql 'SELECT count(a), min(a), max(a) > 1101 FROM tool_135.bar1;' 31 check_contains 'count(a): 1001' 32 check_contains 'min(a): 102' 33 check_contains 'max(a) > 1101: 1' 34 35 run_sql 'SELECT count(a), sum(a), min(a), max(a) FROM tool_135.bar2;' 36 check_contains 'count(a): 1000' 37 check_contains 'sum(a): 548500' 38 check_contains 'min(a): 49' 39 check_contains 'max(a): 1048' 40 run_sql 'INSERT INTO tool_135.bar2 () VALUES ();' 41 run_sql 'SELECT count(a), min(a), max(a) > 1048 FROM tool_135.bar2;' 42 check_contains 'count(a): 1001' 43 check_contains 'min(a): 49' 44 check_contains 'max(a) > 1048: 1' 45 46 run_sql 'SELECT count(a), sum(a), min(a), max(a), count(b), sum(b), min(b), max(b) FROM tool_135.bar3;' 47 check_contains 'count(a): 1000' 48 check_contains 'sum(a): 532218793' 49 check_contains 'min(a): 1071' 50 check_contains 'max(a): 1048054' 51 check_contains 'count(b): 1000' 52 check_contains 'sum(b): 645500' 53 check_contains 'min(b): 146' 54 check_contains 'max(b): 1145' 55 run_sql 'INSERT INTO tool_135.bar3 (a) VALUES (229267);' 56 run_sql 'SELECT count(a), sum(a), min(a), max(a), count(b), min(b), max(b) > 1145 FROM tool_135.bar3;' 57 check_contains 'count(a): 1001' 58 check_contains 'sum(a): 532448060' 59 check_contains 'min(a): 1071' 60 check_contains 'max(a): 1048054' 61 check_contains 'count(b): 1001' 62 check_contains 'min(b): 146' 63 check_contains 'max(b) > 1145: 1' 64 65 run_sql 'SELECT count(a), sum(a), min(a), max(a) FROM tool_135.bar4;' 66 check_contains 'count(a): 1000' 67 check_contains 'sum(a): 588500' 68 check_contains 'min(a): 89' 69 check_contains 'max(a): 1088' 70 run_sql 'INSERT INTO tool_135.bar4 () VALUES ();' 71 run_sql 'SELECT count(a), min(a), max(a) > 1088 FROM tool_135.bar4;' 72 check_contains 'count(a): 1001' 73 check_contains 'min(a): 89' 74 check_contains 'max(a) > 1088: 1' 75 76 run_sql 'SELECT count(a), sum(a), min(a), max(a), count(b), sum(b), min(b), max(b) FROM tool_135.bar5;' 77 check_contains 'count(a): 1000' 78 check_contains 'sum(a): 534846115' 79 check_contains 'min(a): 970' 80 check_contains 'max(a): 1045357' 81 check_contains 'count(b): 1000' 82 check_contains 'sum(b): 563500' 83 check_contains 'min(b): 64' 84 check_contains 'max(b): 1063' 85 run_sql 'INSERT INTO tool_135.bar5 (a) VALUES (668233);' 86 run_sql 'SELECT count(a), sum(a), min(a), max(a), count(b), min(b), max(b) > 1063 FROM tool_135.bar5;' 87 check_contains 'count(a): 1001' 88 check_contains 'sum(a): 535514348' 89 check_contains 'min(a): 970' 90 check_contains 'max(a): 1045357' 91 check_contains 'count(b): 1001' 92 check_contains 'min(b): 64' 93 check_contains 'max(b) > 1063: 1' 94