From 77e94129c6ba915425db56f251a3af3e9cae45a2 Mon Sep 17 00:00:00 2001 From: Jianjun Liao <36503113+Leavrth@users.noreply.github.com> Date: Tue, 9 Apr 2024 17:00:20 +0800 Subject: [PATCH 1/3] This is an automated cherry-pick of #51988 Signed-off-by: ti-chi-bot --- br/tests/br_pitr/check/check_ingest_repair.sh | 110 ++++++++++++++++++ .../incremental_data/ingest_repair.sql | 48 ++++++++ .../br_pitr/prepare_data/ingest_repair.sql | 46 ++++++++ br/tests/br_pitr/run.sh | 5 + br/tests/run_group_br_tests.sh | 70 +++++++++++ 5 files changed, 279 insertions(+) create mode 100644 br/tests/br_pitr/check/check_ingest_repair.sh create mode 100644 br/tests/br_pitr/incremental_data/ingest_repair.sql create mode 100644 br/tests/br_pitr/prepare_data/ingest_repair.sql create mode 100755 br/tests/run_group_br_tests.sh diff --git a/br/tests/br_pitr/check/check_ingest_repair.sh b/br/tests/br_pitr/check/check_ingest_repair.sh new file mode 100644 index 0000000000000..e7092b1871f43 --- /dev/null +++ b/br/tests/br_pitr/check/check_ingest_repair.sh @@ -0,0 +1,110 @@ +#!/bin/bash +# +# Copyright 2023 PingCAP, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eu +# check index schema +## check table test.pairs +run_sql "SHOW INDEX FROM test.pairs WHERE Key_name = 'i1' AND Index_type = 'HASH' AND Index_comment = 'edelw;fe?fewfe\nefwe' AND Visible = 'NO';" +check_contains "Column_name: y" +check_contains "Column_name: z" + +run_sql "SHOW INDEX FROM test.pairs WHERE Key_name = 'u1' AND Index_type = 'RTREE' AND Index_comment = '' AND Visible = 'YES';" +check_contains "Column_name: x" +check_contains "Column_name: y" + +run_sql "SHOW INDEX FROM test.pairs WHERE Key_name = 'i2' AND Index_type = 'BTREE' AND Index_comment = '123' AND Visible = 'YES';" +check_contains "Column_name: y" +check_contains "Expression: \`z\` + 1" + +run_sql "SHOW INDEX FROM test.pairs WHERE Key_name = 'u2' AND Index_type = 'HASH' AND Index_comment = '243' AND Visible = 'YES';" +check_contains "Column_name: x" +check_contains "Expression: \`y\` + 1" + +## check table test.pairs2 +run_sql "SHOW INDEX FROM test.pairs2 WHERE Key_name = 'i1' AND Visible = 'YES';" +check_contains "Column_name: y" +check_contains "Column_name: z" +run_sql "SHOW INDEX FROM test.pairs2 WHERE Column_name = 'z' AND Key_name = 'i1' AND Visible = 'YES';" +check_contains "Sub_part: 10" + +run_sql "SHOW INDEX FROM test.pairs2 WHERE Key_name = 'u1' AND Index_type = 'RTREE' AND Visible = 'YES';" +check_contains "Column_name: y" +check_contains "Column_name: z" +check_contains "Expression: \`y\` * 2" +run_sql "SHOW INDEX FROM test.pairs2 WHERE Column_name = 'z' AND Key_name = 'u1' AND Index_type = 'RTREE' AND Visible = 'YES';" +check_contains "Sub_part: 10" + +run_sql "SHOW INDEX FROM test.pairs2 WHERE Key_name = 'PRIMARY' AND Index_type = 'HASH' AND Visible = 'YES';" +check_contains "Column_name: x" + +## check table test.pairs3 +run_sql "SHOW INDEX FROM test.pairs3 WHERE Key_name = 'zips2' AND Index_type = 'BTREE' AND Visible = 'YES';" +check_contains "Expression: cast(json_extract(\`custinfo\`, _utf8'$.zipcode') as unsigned array)" + +## check table test.pairs4 +run_sql "SHOW INDEX FROM test.pairs4 WHERE Key_name != 'PRIMARY';" +check_not_contains "1. row" ## the result should be empty + +## check table test.pairs5 +run_sql "SHOW INDEX FROM test.pairs5;" +check_not_contains "1. row" ## the result should be empty + +## check table test.pairs7 +run_sql "SHOW INDEX FROM test.pairs7 WHERE Key_name = 'zips2' AND Visible = 'YES';" +check_contains "Expression: cast(json_extract(\`cust\`\`;info\`, _utf8'$.zipcode') as unsigned array)" +run_sql "SHOW INDEX FROM test.pairs7 WHERE Key_name = 'i2' AND Seq_in_index = 1 AND Visible = 'YES';" +check_contains "Column_name: nam\`;e" +run_sql "SHOW INDEX FROM test.pairs7 WHERE Key_name = 'i2' AND Seq_in_index = 2 AND Visible = 'YES';" +check_contains "Expression: \`nam\`\`;e\` * 2" + +## check table test.pairs11 +run_sql "SELECT count(*) AS RESCNT FROM INFORMATION_SCHEMA.TIDB_INDEXES WHERE INDEX_ID = 1 AND TABLE_NAME = 'pairs11' AND KEY_NAME = 'u1';" +check_contains "RESCNT: 2" + +# adjust some index to be visible +run_sql "ALTER TABLE test.pairs ALTER INDEX i1 VISIBLE;" + +# check index data +run_sql "select count(*) AS RESCNT from test.pairs use index(i1) where y = 0 and z = 0;" +check_not_contains "RESCNT: 0" +run_sql "select count(*) AS RESCNT from test.pairs use index(u1) where x = 1 and y = 0;" +check_not_contains "RESCNT: 0" +run_sql "select count(*) AS RESCNT from test.pairs use index(i2) where y = 1 and z+1 = 1;" +check_not_contains "RESCNT: 0" +run_sql "select count(*) AS RESCNT from test.pairs use index(u2) where x = 1 and y+1 = 1;" +check_not_contains "RESCNT: 0" +run_sql "select count(*) AS RESCNT from test.pairs2 use index(i1) where y = 1 and z = '1';" +check_not_contains "RESCNT: 0" +run_sql "select count(*) AS RESCNT from test.pairs2 use index(u1) where y = 1 and z = '1' and y*2=2;" +check_not_contains "RESCNT: 0" +run_sql "select count(*) AS RESCNT from test.pairs2 use index(PRIMARY) where x = 1;" +check_not_contains "RESCNT: 0" +run_sql "select count(*) AS RESCNT from test.pairs3 use index(zips2) where custinfo->'$.zipcode' = json_array(1,2);" +check_not_contains "RESCNT: 0" +run_sql "select count(*) AS RESCNT from test.pairs7 use index(zips2) where \`cust\`\`;info\`->'$.zipcode' =json_array(1,2);" +check_not_contains "RESCNT: 0" +run_sql "select count(*) AS RESCNT from test.pairs7 use index(i2) where \`nam\`\`;e\` = 1 and \`nam\`\`;e\` * 2 = 2;" +check_not_contains "RESCNT: 0" +run_sql "select count(*) AS RESCNT from test.pairs8 use index(i1) where y = '1';" +check_not_contains "RESCNT: 0" +run_sql "select count(*) AS RESCNT from test.pairs9 use index(i1) where y2 = '1';" +check_not_contains "RESCNT: 0" +run_sql "select count(*) AS RESCNT from test.pairs10 use index(i1) where y = 1;" +check_not_contains "RESCNT: 0" +run_sql "select count(*) AS RESCNT from test.pairs10 use index(i1) where y = 101;" +check_not_contains "RESCNT: 0" +run_sql "select count(*) AS RESCNT from test.pairs10 use index(i1) where y = 201;" +check_not_contains "RESCNT: 0" diff --git a/br/tests/br_pitr/incremental_data/ingest_repair.sql b/br/tests/br_pitr/incremental_data/ingest_repair.sql new file mode 100644 index 0000000000000..f82a78e6df3cd --- /dev/null +++ b/br/tests/br_pitr/incremental_data/ingest_repair.sql @@ -0,0 +1,48 @@ +-- basic test: [INDEX/UNIQUE], [COMMENT], [INDEXTYPE], [INVISIBLE], [EXPRESSION] +ALTER TABLE test.pairs ADD INDEX i1(y, z) USING HASH COMMENT "edelw;fe?fewfe\nefwe" INVISIBLE; +ALTER TABLE test.pairs ADD UNIQUE KEY u1(x, y) USING RTREE VISIBLE; +ALTER TABLE test.pairs ADD INDEX i2(y, (z + 1)) USING BTREE COMMENT "123"; +ALTER TABLE test.pairs ADD UNIQUE KEY u2(x, (y+1)) USING HASH COMMENT "243"; + +-- test: [COLUMN LENGTH], [EXPRESSION], [PRIMARY] +ALTER TABLE test.pairs2 ADD INDEX i1(y, z(10)); +ALTER TABLE test.pairs2 ADD UNIQUE KEY u1(y, z(10), (y * 2)) USING RTREE VISIBLE; +ALTER TABLE test.pairs2 ADD PRIMARY KEY (x) USING HASH; + +-- test: [MULTIVALUED] +ALTER TABLE test.pairs3 ADD INDEX zips2((CAST(custinfo->'$.zipcode' AS UNSIGNED ARRAY))); + +-- test: DROP operation +ALTER TABLE test.pairs4 ADD INDEX i1(y, z) USING HASH COMMENT "edelw;fe?fewfe\nefwe" INVISIBLE; +ALTER TABLE test.pairs4 ADD UNIQUE KEY u1(x, y) USING RTREE VISIBLE; +ALTER TABLE test.pairs4 ADD INDEX i2(y, (z + 1)) USING BTREE COMMENT "123"; +ALTER TABLE test.pairs4 ADD UNIQUE KEY u2(x, (y+1)) USING HASH COMMENT "243"; +ALTER TABLE test.pairs4 DROP INDEX i1; +ALTER TABLE test.pairs4 DROP INDEX u1; +ALTER TABLE test.pairs4 DROP INDEX i2; +ALTER TABLE test.pairs4 DROP INDEX u2; + +-- test: DROP operation +ALTER TABLE test.pairs5 ADD INDEX i1(y, z(10)); +ALTER TABLE test.pairs5 ADD UNIQUE KEY u1(y, z(10), (y * 2)) USING RTREE VISIBLE; +ALTER TABLE test.pairs5 ADD PRIMARY KEY (x) USING HASH; +ALTER TABLE test.pairs5 DROP INDEX i1; +ALTER TABLE test.pairs5 DROP INDEX u1; +ALTER TABLE test.pairs5 DROP INDEX `PRIMARY`; + +-- test: [strange string in EXPRESSION], [rename operation] +ALTER TABLE test.pairs6 ADD INDEX zips2((CAST(`cust``;info`->'$.zipcode' AS UNSIGNED ARRAY))); +ALTER TABLE test.pairs6 ADD INDEX i1(`nam``;e`, (`nam``;e` * 2)); +RENAME TABLE test.pairs6 TO test.pairs7; +ALTER TABLE test.pairs7 RENAME INDEX i1 to i2; + +-- future test: [MODIFY COLUMN operation] +ALTER TABLE test.pairs8 ADD INDEX i1(y); +ALTER TABLE test.pairs8 MODIFY y varchar(20); + +-- future test: [CHANGE COLUMN operation] +ALTER TABLE test.pairs9 ADD INDEX i1(y); +ALTER TABLE test.pairs9 CHANGE y y2 varchar(20); + +-- test partition +ALTER TABLE test.pairs10 ADD INDEX i1(y); diff --git a/br/tests/br_pitr/prepare_data/ingest_repair.sql b/br/tests/br_pitr/prepare_data/ingest_repair.sql new file mode 100644 index 0000000000000..fc81fa1ced06e --- /dev/null +++ b/br/tests/br_pitr/prepare_data/ingest_repair.sql @@ -0,0 +1,46 @@ +-- basic test: [INDEX/UNIQUE], [COMMENT], [INDEXTYPE], [INVISIBLE], [EXPRESSION] +CREATE TABLE test.pairs(x int auto_increment primary key, y int DEFAULT RAND(), z int DEFAULT RAND()); +INSERT INTO test.pairs (y,z) VALUES (0,0); +INSERT INTO test.pairs VALUES (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(); + +-- test: [COLUMN LENGTH], [EXPRESSION], [PRIMARY] +CREATE TABLE test.pairs2(x int, y int, z varchar(20)); +INSERT INTO test.pairs2 VALUES (1,1,"1"),(2,2,"2"),(3,3,"3"),(4,4,"4"),(5,5,"5"),(6,6,"6"),(7,7,"7"),(8,8,"8"),(9,9,"9"),(10,10,"10"),(11,11,"11"),(12,12,"12"),(13,13,"13"),(14,14,"14"),(15,15,"15"),(16,16,"16"),(17,17,"17"),(18,18,"18"),(19,19,"19"),(20,20,"20"),(21,21,"21"),(22,22,"22"),(23,23,"23"),(24,24,"24"),(25,25,"25"),(26,26,"26"),(27,27,"27"),(28,28,"28"),(29,29,"29"),(30,30,"30"),(31,31,"31"),(32,32,"32"),(33,33,"33"),(34,34,"34"),(35,35,"35"),(36,36,"36"),(37,37,"37"),(38,38,"38"),(39,39,"39"),(40,40,"40"),(41,41,"41"),(42,42,"42"),(43,43,"43"),(44,44,"44"),(45,45,"45"),(46,46,"46"),(47,47,"47"),(48,48,"48"),(49,49,"49"),(50,50,"50"),(51,51,"51"),(52,52,"52"),(53,53,"53"),(54,54,"54"),(55,55,"55"),(56,56,"56"),(57,57,"57"),(58,58,"58"),(59,59,"59"),(60,60,"60"),(61,61,"61"),(62,62,"62"),(63,63,"63"),(64,64,"64"),(65,65,"65"),(66,66,"66"),(67,67,"67"),(68,68,"68"),(69,69,"69"),(70,70,"70"),(71,71,"71"),(72,72,"72"),(73,73,"73"),(74,74,"74"),(75,75,"75"),(76,76,"76"),(77,77,"77"),(78,78,"78"),(79,79,"79"),(80,80,"80"),(81,81,"81"),(82,82,"82"),(83,83,"83"),(84,84,"84"),(85,85,"85"),(86,86,"86"),(87,87,"87"),(88,88,"88"),(89,89,"89"),(90,90,"90"),(91,91,"91"),(92,92,"92"),(93,93,"93"),(94,94,"94"),(95,95,"95"),(96,96,"96"),(97,97,"97"),(98,98,"98"),(99,99,"99"),(100,100,"100"),(101,101,"101"),(102,102,"102"),(103,103,"103"),(104,104,"104"),(105,105,"105"),(106,106,"106"),(107,107,"107"),(108,108,"108"),(109,109,"109"),(110,110,"110"),(111,111,"111"),(112,112,"112"),(113,113,"113"),(114,114,"114"),(115,115,"115"),(116,116,"116"),(117,117,"117"),(118,118,"118"),(119,119,"119"),(120,120,"120"),(121,121,"121"),(122,122,"122"),(123,123,"123"),(124,124,"124"),(125,125,"125"),(126,126,"126"),(127,127,"127"),(128,128,"128"),(129,129,"129"),(130,130,"130"),(131,131,"131"),(132,132,"132"),(133,133,"133"),(134,134,"134"),(135,135,"135"),(136,136,"136"),(137,137,"137"),(138,138,"138"),(139,139,"139"),(140,140,"140"),(141,141,"141"),(142,142,"142"),(143,143,"143"),(144,144,"144"),(145,145,"145"),(146,146,"146"),(147,147,"147"),(148,148,"148"),(149,149,"149"),(150,150,"150"),(151,151,"151"),(152,152,"152"),(153,153,"153"),(154,154,"154"),(155,155,"155"),(156,156,"156"),(157,157,"157"),(158,158,"158"),(159,159,"159"),(160,160,"160"),(161,161,"161"),(162,162,"162"),(163,163,"163"),(164,164,"164"),(165,165,"165"),(166,166,"166"),(167,167,"167"),(168,168,"168"),(169,169,"169"),(170,170,"170"),(171,171,"171"),(172,172,"172"),(173,173,"173"),(174,174,"174"),(175,175,"175"),(176,176,"176"),(177,177,"177"),(178,178,"178"),(179,179,"179"),(180,180,"180"),(181,181,"181"),(182,182,"182"),(183,183,"183"),(184,184,"184"),(185,185,"185"),(186,186,"186"),(187,187,"187"),(188,188,"188"),(189,189,"189"),(190,190,"190"),(191,191,"191"),(192,192,"192"),(193,193,"193"),(194,194,"194"),(195,195,"195"),(196,196,"196"),(197,197,"197"),(198,198,"198"),(199,199,"199"),(200,200,"200"),(201,201,"201"),(202,202,"202"),(203,203,"203"),(204,204,"204"),(205,205,"205"),(206,206,"206"),(207,207,"207"),(208,208,"208"),(209,209,"209"),(210,210,"210"),(211,211,"211"),(212,212,"212"),(213,213,"213"),(214,214,"214"),(215,215,"215"),(216,216,"216"),(217,217,"217"),(218,218,"218"),(219,219,"219"),(220,220,"220"),(221,221,"221"),(222,222,"222"),(223,223,"223"),(224,224,"224"),(225,225,"225"),(226,226,"226"),(227,227,"227"),(228,228,"228"),(229,229,"229"),(230,230,"230"),(231,231,"231"),(232,232,"232"),(233,233,"233"),(234,234,"234"),(235,235,"235"),(236,236,"236"),(237,237,"237"),(238,238,"238"),(239,239,"239"),(240,240,"240"),(241,241,"241"),(242,242,"242"),(243,243,"243"),(244,244,"244"),(245,245,"245"),(246,246,"246"),(247,247,"247"),(248,248,"248"),(249,249,"249"),(250,250,"250"),(251,251,"251"),(252,252,"252"),(253,253,"253"),(254,254,"254"),(255,255,"255"),(256,256,"256"),(257,257,"257"),(258,258,"258"),(259,259,"259"),(260,260,"260"),(261,261,"261"),(262,262,"262"),(263,263,"263"),(264,264,"264"),(265,265,"265"),(266,266,"266"),(267,267,"267"),(268,268,"268"),(269,269,"269"),(270,270,"270"),(271,271,"271"),(272,272,"272"),(273,273,"273"),(274,274,"274"),(275,275,"275"),(276,276,"276"),(277,277,"277"),(278,278,"278"),(279,279,"279"),(280,280,"280"),(281,281,"281"),(282,282,"282"),(283,283,"283"),(284,284,"284"),(285,285,"285"),(286,286,"286"),(287,287,"287"),(288,288,"288"),(289,289,"289"),(290,290,"290"),(291,291,"291"),(292,292,"292"),(293,293,"293"),(294,294,"294"),(295,295,"295"),(296,296,"296"),(297,297,"297"),(298,298,"298"),(299,299,"299"),(300,300,"300"),(301,301,"301"),(302,302,"302"),(303,303,"303"),(304,304,"304"),(305,305,"305"),(306,306,"306"),(307,307,"307"),(308,308,"308"),(309,309,"309"),(310,310,"310"),(311,311,"311"),(312,312,"312"),(313,313,"313"),(314,314,"314"),(315,315,"315"),(316,316,"316"),(317,317,"317"),(318,318,"318"),(319,319,"319"),(320,320,"320"),(321,321,"321"),(322,322,"322"),(323,323,"323"),(324,324,"324"),(325,325,"325"),(326,326,"326"),(327,327,"327"),(328,328,"328"),(329,329,"329"),(330,330,"330"),(331,331,"331"),(332,332,"332"),(333,333,"333"),(334,334,"334"),(335,335,"335"),(336,336,"336"),(337,337,"337"),(338,338,"338"),(339,339,"339"),(340,340,"340"),(341,341,"341"),(342,342,"342"),(343,343,"343"),(344,344,"344"),(345,345,"345"),(346,346,"346"),(347,347,"347"),(348,348,"348"),(349,349,"349"),(350,350,"350"),(351,351,"351"),(352,352,"352"),(353,353,"353"),(354,354,"354"),(355,355,"355"),(356,356,"356"),(357,357,"357"),(358,358,"358"),(359,359,"359"),(360,360,"360"),(361,361,"361"),(362,362,"362"),(363,363,"363"),(364,364,"364"),(365,365,"365"),(366,366,"366"),(367,367,"367"),(368,368,"368"),(369,369,"369"),(370,370,"370"),(371,371,"371"),(372,372,"372"),(373,373,"373"),(374,374,"374"),(375,375,"375"),(376,376,"376"),(377,377,"377"),(378,378,"378"),(379,379,"379"),(380,380,"380"),(381,381,"381"),(382,382,"382"),(383,383,"383"),(384,384,"384"),(385,385,"385"),(386,386,"386"),(387,387,"387"),(388,388,"388"),(389,389,"389"),(390,390,"390"),(391,391,"391"),(392,392,"392"),(393,393,"393"),(394,394,"394"),(395,395,"395"),(396,396,"396"),(397,397,"397"),(398,398,"398"),(399,399,"399"),(400,400,"400"),(401,401,"401"),(402,402,"402"),(403,403,"403"),(404,404,"404"),(405,405,"405"),(406,406,"406"),(407,407,"407"),(408,408,"408"),(409,409,"409"),(410,410,"410"),(411,411,"411"),(412,412,"412"),(413,413,"413"),(414,414,"414"),(415,415,"415"),(416,416,"416"),(417,417,"417"),(418,418,"418"),(419,419,"419"),(420,420,"420"),(421,421,"421"),(422,422,"422"),(423,423,"423"),(424,424,"424"),(425,425,"425"),(426,426,"426"),(427,427,"427"),(428,428,"428"),(429,429,"429"),(430,430,"430"),(431,431,"431"),(432,432,"432"),(433,433,"433"),(434,434,"434"),(435,435,"435"),(436,436,"436"),(437,437,"437"),(438,438,"438"),(439,439,"439"),(440,440,"440"),(441,441,"441"),(442,442,"442"),(443,443,"443"),(444,444,"444"),(445,445,"445"),(446,446,"446"),(447,447,"447"),(448,448,"448"),(449,449,"449"),(450,450,"450"),(451,451,"451"),(452,452,"452"),(453,453,"453"),(454,454,"454"),(455,455,"455"),(456,456,"456"),(457,457,"457"),(458,458,"458"),(459,459,"459"),(460,460,"460"),(461,461,"461"),(462,462,"462"),(463,463,"463"),(464,464,"464"),(465,465,"465"),(466,466,"466"),(467,467,"467"),(468,468,"468"),(469,469,"469"),(470,470,"470"),(471,471,"471"),(472,472,"472"),(473,473,"473"),(474,474,"474"),(475,475,"475"),(476,476,"476"),(477,477,"477"),(478,478,"478"),(479,479,"479"),(480,480,"480"),(481,481,"481"),(482,482,"482"),(483,483,"483"),(484,484,"484"),(485,485,"485"),(486,486,"486"),(487,487,"487"),(488,488,"488"),(489,489,"489"),(490,490,"490"),(491,491,"491"),(492,492,"492"),(493,493,"493"),(494,494,"494"),(495,495,"495"),(496,496,"496"),(497,497,"497"),(498,498,"498"),(499,499,"499"),(500,500,"500"); + +-- test: [MULTIVALUED] +CREATE TABLE test.pairs3(id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, name CHAR(10), custinfo JSON); +INSERT INTO test.pairs3 VALUES (1, 'pingcap', '{"zipcode": [1,2]}'); + +-- test: DROP operation +CREATE TABLE test.pairs4(x int auto_increment primary key, y int DEFAULT RAND(), z int DEFAULT RAND()); +INSERT INTO test.pairs4 VALUES (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(); + +-- test: DROP operation +CREATE TABLE test.pairs5(x int, y int, z varchar(20)); +INSERT INTO test.pairs5 VALUES (1,1,"1"),(2,2,"2"),(3,3,"3"),(4,4,"4"),(5,5,"5"),(6,6,"6"),(7,7,"7"),(8,8,"8"),(9,9,"9"),(10,10,"10"),(11,11,"11"),(12,12,"12"),(13,13,"13"),(14,14,"14"),(15,15,"15"),(16,16,"16"),(17,17,"17"),(18,18,"18"),(19,19,"19"),(20,20,"20"),(21,21,"21"),(22,22,"22"),(23,23,"23"),(24,24,"24"),(25,25,"25"),(26,26,"26"),(27,27,"27"),(28,28,"28"),(29,29,"29"),(30,30,"30"),(31,31,"31"),(32,32,"32"),(33,33,"33"),(34,34,"34"),(35,35,"35"),(36,36,"36"),(37,37,"37"),(38,38,"38"),(39,39,"39"),(40,40,"40"),(41,41,"41"),(42,42,"42"),(43,43,"43"),(44,44,"44"),(45,45,"45"),(46,46,"46"),(47,47,"47"),(48,48,"48"),(49,49,"49"),(50,50,"50"),(51,51,"51"),(52,52,"52"),(53,53,"53"),(54,54,"54"),(55,55,"55"),(56,56,"56"),(57,57,"57"),(58,58,"58"),(59,59,"59"),(60,60,"60"),(61,61,"61"),(62,62,"62"),(63,63,"63"),(64,64,"64"),(65,65,"65"),(66,66,"66"),(67,67,"67"),(68,68,"68"),(69,69,"69"),(70,70,"70"),(71,71,"71"),(72,72,"72"),(73,73,"73"),(74,74,"74"),(75,75,"75"),(76,76,"76"),(77,77,"77"),(78,78,"78"),(79,79,"79"),(80,80,"80"),(81,81,"81"),(82,82,"82"),(83,83,"83"),(84,84,"84"),(85,85,"85"),(86,86,"86"),(87,87,"87"),(88,88,"88"),(89,89,"89"),(90,90,"90"),(91,91,"91"),(92,92,"92"),(93,93,"93"),(94,94,"94"),(95,95,"95"),(96,96,"96"),(97,97,"97"),(98,98,"98"),(99,99,"99"),(100,100,"100"),(101,101,"101"),(102,102,"102"),(103,103,"103"),(104,104,"104"),(105,105,"105"),(106,106,"106"),(107,107,"107"),(108,108,"108"),(109,109,"109"),(110,110,"110"),(111,111,"111"),(112,112,"112"),(113,113,"113"),(114,114,"114"),(115,115,"115"),(116,116,"116"),(117,117,"117"),(118,118,"118"),(119,119,"119"),(120,120,"120"),(121,121,"121"),(122,122,"122"),(123,123,"123"),(124,124,"124"),(125,125,"125"),(126,126,"126"),(127,127,"127"),(128,128,"128"),(129,129,"129"),(130,130,"130"),(131,131,"131"),(132,132,"132"),(133,133,"133"),(134,134,"134"),(135,135,"135"),(136,136,"136"),(137,137,"137"),(138,138,"138"),(139,139,"139"),(140,140,"140"),(141,141,"141"),(142,142,"142"),(143,143,"143"),(144,144,"144"),(145,145,"145"),(146,146,"146"),(147,147,"147"),(148,148,"148"),(149,149,"149"),(150,150,"150"),(151,151,"151"),(152,152,"152"),(153,153,"153"),(154,154,"154"),(155,155,"155"),(156,156,"156"),(157,157,"157"),(158,158,"158"),(159,159,"159"),(160,160,"160"),(161,161,"161"),(162,162,"162"),(163,163,"163"),(164,164,"164"),(165,165,"165"),(166,166,"166"),(167,167,"167"),(168,168,"168"),(169,169,"169"),(170,170,"170"),(171,171,"171"),(172,172,"172"),(173,173,"173"),(174,174,"174"),(175,175,"175"),(176,176,"176"),(177,177,"177"),(178,178,"178"),(179,179,"179"),(180,180,"180"),(181,181,"181"),(182,182,"182"),(183,183,"183"),(184,184,"184"),(185,185,"185"),(186,186,"186"),(187,187,"187"),(188,188,"188"),(189,189,"189"),(190,190,"190"),(191,191,"191"),(192,192,"192"),(193,193,"193"),(194,194,"194"),(195,195,"195"),(196,196,"196"),(197,197,"197"),(198,198,"198"),(199,199,"199"),(200,200,"200"),(201,201,"201"),(202,202,"202"),(203,203,"203"),(204,204,"204"),(205,205,"205"),(206,206,"206"),(207,207,"207"),(208,208,"208"),(209,209,"209"),(210,210,"210"),(211,211,"211"),(212,212,"212"),(213,213,"213"),(214,214,"214"),(215,215,"215"),(216,216,"216"),(217,217,"217"),(218,218,"218"),(219,219,"219"),(220,220,"220"),(221,221,"221"),(222,222,"222"),(223,223,"223"),(224,224,"224"),(225,225,"225"),(226,226,"226"),(227,227,"227"),(228,228,"228"),(229,229,"229"),(230,230,"230"),(231,231,"231"),(232,232,"232"),(233,233,"233"),(234,234,"234"),(235,235,"235"),(236,236,"236"),(237,237,"237"),(238,238,"238"),(239,239,"239"),(240,240,"240"),(241,241,"241"),(242,242,"242"),(243,243,"243"),(244,244,"244"),(245,245,"245"),(246,246,"246"),(247,247,"247"),(248,248,"248"),(249,249,"249"),(250,250,"250"),(251,251,"251"),(252,252,"252"),(253,253,"253"),(254,254,"254"),(255,255,"255"),(256,256,"256"),(257,257,"257"),(258,258,"258"),(259,259,"259"),(260,260,"260"),(261,261,"261"),(262,262,"262"),(263,263,"263"),(264,264,"264"),(265,265,"265"),(266,266,"266"),(267,267,"267"),(268,268,"268"),(269,269,"269"),(270,270,"270"),(271,271,"271"),(272,272,"272"),(273,273,"273"),(274,274,"274"),(275,275,"275"),(276,276,"276"),(277,277,"277"),(278,278,"278"),(279,279,"279"),(280,280,"280"),(281,281,"281"),(282,282,"282"),(283,283,"283"),(284,284,"284"),(285,285,"285"),(286,286,"286"),(287,287,"287"),(288,288,"288"),(289,289,"289"),(290,290,"290"),(291,291,"291"),(292,292,"292"),(293,293,"293"),(294,294,"294"),(295,295,"295"),(296,296,"296"),(297,297,"297"),(298,298,"298"),(299,299,"299"),(300,300,"300"),(301,301,"301"),(302,302,"302"),(303,303,"303"),(304,304,"304"),(305,305,"305"),(306,306,"306"),(307,307,"307"),(308,308,"308"),(309,309,"309"),(310,310,"310"),(311,311,"311"),(312,312,"312"),(313,313,"313"),(314,314,"314"),(315,315,"315"),(316,316,"316"),(317,317,"317"),(318,318,"318"),(319,319,"319"),(320,320,"320"),(321,321,"321"),(322,322,"322"),(323,323,"323"),(324,324,"324"),(325,325,"325"),(326,326,"326"),(327,327,"327"),(328,328,"328"),(329,329,"329"),(330,330,"330"),(331,331,"331"),(332,332,"332"),(333,333,"333"),(334,334,"334"),(335,335,"335"),(336,336,"336"),(337,337,"337"),(338,338,"338"),(339,339,"339"),(340,340,"340"),(341,341,"341"),(342,342,"342"),(343,343,"343"),(344,344,"344"),(345,345,"345"),(346,346,"346"),(347,347,"347"),(348,348,"348"),(349,349,"349"),(350,350,"350"),(351,351,"351"),(352,352,"352"),(353,353,"353"),(354,354,"354"),(355,355,"355"),(356,356,"356"),(357,357,"357"),(358,358,"358"),(359,359,"359"),(360,360,"360"),(361,361,"361"),(362,362,"362"),(363,363,"363"),(364,364,"364"),(365,365,"365"),(366,366,"366"),(367,367,"367"),(368,368,"368"),(369,369,"369"),(370,370,"370"),(371,371,"371"),(372,372,"372"),(373,373,"373"),(374,374,"374"),(375,375,"375"),(376,376,"376"),(377,377,"377"),(378,378,"378"),(379,379,"379"),(380,380,"380"),(381,381,"381"),(382,382,"382"),(383,383,"383"),(384,384,"384"),(385,385,"385"),(386,386,"386"),(387,387,"387"),(388,388,"388"),(389,389,"389"),(390,390,"390"),(391,391,"391"),(392,392,"392"),(393,393,"393"),(394,394,"394"),(395,395,"395"),(396,396,"396"),(397,397,"397"),(398,398,"398"),(399,399,"399"),(400,400,"400"),(401,401,"401"),(402,402,"402"),(403,403,"403"),(404,404,"404"),(405,405,"405"),(406,406,"406"),(407,407,"407"),(408,408,"408"),(409,409,"409"),(410,410,"410"),(411,411,"411"),(412,412,"412"),(413,413,"413"),(414,414,"414"),(415,415,"415"),(416,416,"416"),(417,417,"417"),(418,418,"418"),(419,419,"419"),(420,420,"420"),(421,421,"421"),(422,422,"422"),(423,423,"423"),(424,424,"424"),(425,425,"425"),(426,426,"426"),(427,427,"427"),(428,428,"428"),(429,429,"429"),(430,430,"430"),(431,431,"431"),(432,432,"432"),(433,433,"433"),(434,434,"434"),(435,435,"435"),(436,436,"436"),(437,437,"437"),(438,438,"438"),(439,439,"439"),(440,440,"440"),(441,441,"441"),(442,442,"442"),(443,443,"443"),(444,444,"444"),(445,445,"445"),(446,446,"446"),(447,447,"447"),(448,448,"448"),(449,449,"449"),(450,450,"450"),(451,451,"451"),(452,452,"452"),(453,453,"453"),(454,454,"454"),(455,455,"455"),(456,456,"456"),(457,457,"457"),(458,458,"458"),(459,459,"459"),(460,460,"460"),(461,461,"461"),(462,462,"462"),(463,463,"463"),(464,464,"464"),(465,465,"465"),(466,466,"466"),(467,467,"467"),(468,468,"468"),(469,469,"469"),(470,470,"470"),(471,471,"471"),(472,472,"472"),(473,473,"473"),(474,474,"474"),(475,475,"475"),(476,476,"476"),(477,477,"477"),(478,478,"478"),(479,479,"479"),(480,480,"480"),(481,481,"481"),(482,482,"482"),(483,483,"483"),(484,484,"484"),(485,485,"485"),(486,486,"486"),(487,487,"487"),(488,488,"488"),(489,489,"489"),(490,490,"490"),(491,491,"491"),(492,492,"492"),(493,493,"493"),(494,494,"494"),(495,495,"495"),(496,496,"496"),(497,497,"497"),(498,498,"498"),(499,499,"499"),(500,500,"500"); + +-- test: [strange string in EXPRESSION], [rename operation] +CREATE TABLE test.pairs6(id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, `nam``;e` int, `cust``;info` JSON); +INSERT INTO test.pairs6 VALUES (1, 1, '{"zipcode": [1,2]}'); + +-- future test: [MODIFY COLUMN operation] +CREATE TABLE test.pairs8(x int, y int, z varchar(20)); +INSERT INTO test.pairs8 VALUES (1,1,"1"),(2,2,"2"),(3,3,"3"),(4,4,"4"),(5,5,"5"),(6,6,"6"),(7,7,"7"),(8,8,"8"),(9,9,"9"),(10,10,"10"),(11,11,"11"),(12,12,"12"),(13,13,"13"),(14,14,"14"),(15,15,"15"),(16,16,"16"),(17,17,"17"),(18,18,"18"),(19,19,"19"),(20,20,"20"),(21,21,"21"),(22,22,"22"),(23,23,"23"),(24,24,"24"),(25,25,"25"),(26,26,"26"),(27,27,"27"),(28,28,"28"),(29,29,"29"),(30,30,"30"),(31,31,"31"),(32,32,"32"),(33,33,"33"),(34,34,"34"),(35,35,"35"),(36,36,"36"),(37,37,"37"),(38,38,"38"),(39,39,"39"),(40,40,"40"),(41,41,"41"),(42,42,"42"),(43,43,"43"),(44,44,"44"),(45,45,"45"),(46,46,"46"),(47,47,"47"),(48,48,"48"),(49,49,"49"),(50,50,"50"),(51,51,"51"),(52,52,"52"),(53,53,"53"),(54,54,"54"),(55,55,"55"),(56,56,"56"),(57,57,"57"),(58,58,"58"),(59,59,"59"),(60,60,"60"),(61,61,"61"),(62,62,"62"),(63,63,"63"),(64,64,"64"),(65,65,"65"),(66,66,"66"),(67,67,"67"),(68,68,"68"),(69,69,"69"),(70,70,"70"),(71,71,"71"),(72,72,"72"),(73,73,"73"),(74,74,"74"),(75,75,"75"),(76,76,"76"),(77,77,"77"),(78,78,"78"),(79,79,"79"),(80,80,"80"),(81,81,"81"),(82,82,"82"),(83,83,"83"),(84,84,"84"),(85,85,"85"),(86,86,"86"),(87,87,"87"),(88,88,"88"),(89,89,"89"),(90,90,"90"),(91,91,"91"),(92,92,"92"),(93,93,"93"),(94,94,"94"),(95,95,"95"),(96,96,"96"),(97,97,"97"),(98,98,"98"),(99,99,"99"),(100,100,"100"),(101,101,"101"),(102,102,"102"),(103,103,"103"),(104,104,"104"),(105,105,"105"),(106,106,"106"),(107,107,"107"),(108,108,"108"),(109,109,"109"),(110,110,"110"),(111,111,"111"),(112,112,"112"),(113,113,"113"),(114,114,"114"),(115,115,"115"),(116,116,"116"),(117,117,"117"),(118,118,"118"),(119,119,"119"),(120,120,"120"),(121,121,"121"),(122,122,"122"),(123,123,"123"),(124,124,"124"),(125,125,"125"),(126,126,"126"),(127,127,"127"),(128,128,"128"),(129,129,"129"),(130,130,"130"),(131,131,"131"),(132,132,"132"),(133,133,"133"),(134,134,"134"),(135,135,"135"),(136,136,"136"),(137,137,"137"),(138,138,"138"),(139,139,"139"),(140,140,"140"),(141,141,"141"),(142,142,"142"),(143,143,"143"),(144,144,"144"),(145,145,"145"),(146,146,"146"),(147,147,"147"),(148,148,"148"),(149,149,"149"),(150,150,"150"),(151,151,"151"),(152,152,"152"),(153,153,"153"),(154,154,"154"),(155,155,"155"),(156,156,"156"),(157,157,"157"),(158,158,"158"),(159,159,"159"),(160,160,"160"),(161,161,"161"),(162,162,"162"),(163,163,"163"),(164,164,"164"),(165,165,"165"),(166,166,"166"),(167,167,"167"),(168,168,"168"),(169,169,"169"),(170,170,"170"),(171,171,"171"),(172,172,"172"),(173,173,"173"),(174,174,"174"),(175,175,"175"),(176,176,"176"),(177,177,"177"),(178,178,"178"),(179,179,"179"),(180,180,"180"),(181,181,"181"),(182,182,"182"),(183,183,"183"),(184,184,"184"),(185,185,"185"),(186,186,"186"),(187,187,"187"),(188,188,"188"),(189,189,"189"),(190,190,"190"),(191,191,"191"),(192,192,"192"),(193,193,"193"),(194,194,"194"),(195,195,"195"),(196,196,"196"),(197,197,"197"),(198,198,"198"),(199,199,"199"),(200,200,"200"),(201,201,"201"),(202,202,"202"),(203,203,"203"),(204,204,"204"),(205,205,"205"),(206,206,"206"),(207,207,"207"),(208,208,"208"),(209,209,"209"),(210,210,"210"),(211,211,"211"),(212,212,"212"),(213,213,"213"),(214,214,"214"),(215,215,"215"),(216,216,"216"),(217,217,"217"),(218,218,"218"),(219,219,"219"),(220,220,"220"),(221,221,"221"),(222,222,"222"),(223,223,"223"),(224,224,"224"),(225,225,"225"),(226,226,"226"),(227,227,"227"),(228,228,"228"),(229,229,"229"),(230,230,"230"),(231,231,"231"),(232,232,"232"),(233,233,"233"),(234,234,"234"),(235,235,"235"),(236,236,"236"),(237,237,"237"),(238,238,"238"),(239,239,"239"),(240,240,"240"),(241,241,"241"),(242,242,"242"),(243,243,"243"),(244,244,"244"),(245,245,"245"),(246,246,"246"),(247,247,"247"),(248,248,"248"),(249,249,"249"),(250,250,"250"),(251,251,"251"),(252,252,"252"),(253,253,"253"),(254,254,"254"),(255,255,"255"),(256,256,"256"),(257,257,"257"),(258,258,"258"),(259,259,"259"),(260,260,"260"),(261,261,"261"),(262,262,"262"),(263,263,"263"),(264,264,"264"),(265,265,"265"),(266,266,"266"),(267,267,"267"),(268,268,"268"),(269,269,"269"),(270,270,"270"),(271,271,"271"),(272,272,"272"),(273,273,"273"),(274,274,"274"),(275,275,"275"),(276,276,"276"),(277,277,"277"),(278,278,"278"),(279,279,"279"),(280,280,"280"),(281,281,"281"),(282,282,"282"),(283,283,"283"),(284,284,"284"),(285,285,"285"),(286,286,"286"),(287,287,"287"),(288,288,"288"),(289,289,"289"),(290,290,"290"),(291,291,"291"),(292,292,"292"),(293,293,"293"),(294,294,"294"),(295,295,"295"),(296,296,"296"),(297,297,"297"),(298,298,"298"),(299,299,"299"),(300,300,"300"),(301,301,"301"),(302,302,"302"),(303,303,"303"),(304,304,"304"),(305,305,"305"),(306,306,"306"),(307,307,"307"),(308,308,"308"),(309,309,"309"),(310,310,"310"),(311,311,"311"),(312,312,"312"),(313,313,"313"),(314,314,"314"),(315,315,"315"),(316,316,"316"),(317,317,"317"),(318,318,"318"),(319,319,"319"),(320,320,"320"),(321,321,"321"),(322,322,"322"),(323,323,"323"),(324,324,"324"),(325,325,"325"),(326,326,"326"),(327,327,"327"),(328,328,"328"),(329,329,"329"),(330,330,"330"),(331,331,"331"),(332,332,"332"),(333,333,"333"),(334,334,"334"),(335,335,"335"),(336,336,"336"),(337,337,"337"),(338,338,"338"),(339,339,"339"),(340,340,"340"),(341,341,"341"),(342,342,"342"),(343,343,"343"),(344,344,"344"),(345,345,"345"),(346,346,"346"),(347,347,"347"),(348,348,"348"),(349,349,"349"),(350,350,"350"),(351,351,"351"),(352,352,"352"),(353,353,"353"),(354,354,"354"),(355,355,"355"),(356,356,"356"),(357,357,"357"),(358,358,"358"),(359,359,"359"),(360,360,"360"),(361,361,"361"),(362,362,"362"),(363,363,"363"),(364,364,"364"),(365,365,"365"),(366,366,"366"),(367,367,"367"),(368,368,"368"),(369,369,"369"),(370,370,"370"),(371,371,"371"),(372,372,"372"),(373,373,"373"),(374,374,"374"),(375,375,"375"),(376,376,"376"),(377,377,"377"),(378,378,"378"),(379,379,"379"),(380,380,"380"),(381,381,"381"),(382,382,"382"),(383,383,"383"),(384,384,"384"),(385,385,"385"),(386,386,"386"),(387,387,"387"),(388,388,"388"),(389,389,"389"),(390,390,"390"),(391,391,"391"),(392,392,"392"),(393,393,"393"),(394,394,"394"),(395,395,"395"),(396,396,"396"),(397,397,"397"),(398,398,"398"),(399,399,"399"),(400,400,"400"),(401,401,"401"),(402,402,"402"),(403,403,"403"),(404,404,"404"),(405,405,"405"),(406,406,"406"),(407,407,"407"),(408,408,"408"),(409,409,"409"),(410,410,"410"),(411,411,"411"),(412,412,"412"),(413,413,"413"),(414,414,"414"),(415,415,"415"),(416,416,"416"),(417,417,"417"),(418,418,"418"),(419,419,"419"),(420,420,"420"),(421,421,"421"),(422,422,"422"),(423,423,"423"),(424,424,"424"),(425,425,"425"),(426,426,"426"),(427,427,"427"),(428,428,"428"),(429,429,"429"),(430,430,"430"),(431,431,"431"),(432,432,"432"),(433,433,"433"),(434,434,"434"),(435,435,"435"),(436,436,"436"),(437,437,"437"),(438,438,"438"),(439,439,"439"),(440,440,"440"),(441,441,"441"),(442,442,"442"),(443,443,"443"),(444,444,"444"),(445,445,"445"),(446,446,"446"),(447,447,"447"),(448,448,"448"),(449,449,"449"),(450,450,"450"),(451,451,"451"),(452,452,"452"),(453,453,"453"),(454,454,"454"),(455,455,"455"),(456,456,"456"),(457,457,"457"),(458,458,"458"),(459,459,"459"),(460,460,"460"),(461,461,"461"),(462,462,"462"),(463,463,"463"),(464,464,"464"),(465,465,"465"),(466,466,"466"),(467,467,"467"),(468,468,"468"),(469,469,"469"),(470,470,"470"),(471,471,"471"),(472,472,"472"),(473,473,"473"),(474,474,"474"),(475,475,"475"),(476,476,"476"),(477,477,"477"),(478,478,"478"),(479,479,"479"),(480,480,"480"),(481,481,"481"),(482,482,"482"),(483,483,"483"),(484,484,"484"),(485,485,"485"),(486,486,"486"),(487,487,"487"),(488,488,"488"),(489,489,"489"),(490,490,"490"),(491,491,"491"),(492,492,"492"),(493,493,"493"),(494,494,"494"),(495,495,"495"),(496,496,"496"),(497,497,"497"),(498,498,"498"),(499,499,"499"),(500,500,"500"); + +-- future test: [CHANGE COLUMN operation] +CREATE TABLE test.pairs9(x int, y int, z varchar(20)); +INSERT INTO test.pairs9 VALUES (1,1,"1"),(2,2,"2"),(3,3,"3"),(4,4,"4"),(5,5,"5"),(6,6,"6"),(7,7,"7"),(8,8,"8"),(9,9,"9"),(10,10,"10"),(11,11,"11"),(12,12,"12"),(13,13,"13"),(14,14,"14"),(15,15,"15"),(16,16,"16"),(17,17,"17"),(18,18,"18"),(19,19,"19"),(20,20,"20"),(21,21,"21"),(22,22,"22"),(23,23,"23"),(24,24,"24"),(25,25,"25"),(26,26,"26"),(27,27,"27"),(28,28,"28"),(29,29,"29"),(30,30,"30"),(31,31,"31"),(32,32,"32"),(33,33,"33"),(34,34,"34"),(35,35,"35"),(36,36,"36"),(37,37,"37"),(38,38,"38"),(39,39,"39"),(40,40,"40"),(41,41,"41"),(42,42,"42"),(43,43,"43"),(44,44,"44"),(45,45,"45"),(46,46,"46"),(47,47,"47"),(48,48,"48"),(49,49,"49"),(50,50,"50"),(51,51,"51"),(52,52,"52"),(53,53,"53"),(54,54,"54"),(55,55,"55"),(56,56,"56"),(57,57,"57"),(58,58,"58"),(59,59,"59"),(60,60,"60"),(61,61,"61"),(62,62,"62"),(63,63,"63"),(64,64,"64"),(65,65,"65"),(66,66,"66"),(67,67,"67"),(68,68,"68"),(69,69,"69"),(70,70,"70"),(71,71,"71"),(72,72,"72"),(73,73,"73"),(74,74,"74"),(75,75,"75"),(76,76,"76"),(77,77,"77"),(78,78,"78"),(79,79,"79"),(80,80,"80"),(81,81,"81"),(82,82,"82"),(83,83,"83"),(84,84,"84"),(85,85,"85"),(86,86,"86"),(87,87,"87"),(88,88,"88"),(89,89,"89"),(90,90,"90"),(91,91,"91"),(92,92,"92"),(93,93,"93"),(94,94,"94"),(95,95,"95"),(96,96,"96"),(97,97,"97"),(98,98,"98"),(99,99,"99"),(100,100,"100"),(101,101,"101"),(102,102,"102"),(103,103,"103"),(104,104,"104"),(105,105,"105"),(106,106,"106"),(107,107,"107"),(108,108,"108"),(109,109,"109"),(110,110,"110"),(111,111,"111"),(112,112,"112"),(113,113,"113"),(114,114,"114"),(115,115,"115"),(116,116,"116"),(117,117,"117"),(118,118,"118"),(119,119,"119"),(120,120,"120"),(121,121,"121"),(122,122,"122"),(123,123,"123"),(124,124,"124"),(125,125,"125"),(126,126,"126"),(127,127,"127"),(128,128,"128"),(129,129,"129"),(130,130,"130"),(131,131,"131"),(132,132,"132"),(133,133,"133"),(134,134,"134"),(135,135,"135"),(136,136,"136"),(137,137,"137"),(138,138,"138"),(139,139,"139"),(140,140,"140"),(141,141,"141"),(142,142,"142"),(143,143,"143"),(144,144,"144"),(145,145,"145"),(146,146,"146"),(147,147,"147"),(148,148,"148"),(149,149,"149"),(150,150,"150"),(151,151,"151"),(152,152,"152"),(153,153,"153"),(154,154,"154"),(155,155,"155"),(156,156,"156"),(157,157,"157"),(158,158,"158"),(159,159,"159"),(160,160,"160"),(161,161,"161"),(162,162,"162"),(163,163,"163"),(164,164,"164"),(165,165,"165"),(166,166,"166"),(167,167,"167"),(168,168,"168"),(169,169,"169"),(170,170,"170"),(171,171,"171"),(172,172,"172"),(173,173,"173"),(174,174,"174"),(175,175,"175"),(176,176,"176"),(177,177,"177"),(178,178,"178"),(179,179,"179"),(180,180,"180"),(181,181,"181"),(182,182,"182"),(183,183,"183"),(184,184,"184"),(185,185,"185"),(186,186,"186"),(187,187,"187"),(188,188,"188"),(189,189,"189"),(190,190,"190"),(191,191,"191"),(192,192,"192"),(193,193,"193"),(194,194,"194"),(195,195,"195"),(196,196,"196"),(197,197,"197"),(198,198,"198"),(199,199,"199"),(200,200,"200"),(201,201,"201"),(202,202,"202"),(203,203,"203"),(204,204,"204"),(205,205,"205"),(206,206,"206"),(207,207,"207"),(208,208,"208"),(209,209,"209"),(210,210,"210"),(211,211,"211"),(212,212,"212"),(213,213,"213"),(214,214,"214"),(215,215,"215"),(216,216,"216"),(217,217,"217"),(218,218,"218"),(219,219,"219"),(220,220,"220"),(221,221,"221"),(222,222,"222"),(223,223,"223"),(224,224,"224"),(225,225,"225"),(226,226,"226"),(227,227,"227"),(228,228,"228"),(229,229,"229"),(230,230,"230"),(231,231,"231"),(232,232,"232"),(233,233,"233"),(234,234,"234"),(235,235,"235"),(236,236,"236"),(237,237,"237"),(238,238,"238"),(239,239,"239"),(240,240,"240"),(241,241,"241"),(242,242,"242"),(243,243,"243"),(244,244,"244"),(245,245,"245"),(246,246,"246"),(247,247,"247"),(248,248,"248"),(249,249,"249"),(250,250,"250"),(251,251,"251"),(252,252,"252"),(253,253,"253"),(254,254,"254"),(255,255,"255"),(256,256,"256"),(257,257,"257"),(258,258,"258"),(259,259,"259"),(260,260,"260"),(261,261,"261"),(262,262,"262"),(263,263,"263"),(264,264,"264"),(265,265,"265"),(266,266,"266"),(267,267,"267"),(268,268,"268"),(269,269,"269"),(270,270,"270"),(271,271,"271"),(272,272,"272"),(273,273,"273"),(274,274,"274"),(275,275,"275"),(276,276,"276"),(277,277,"277"),(278,278,"278"),(279,279,"279"),(280,280,"280"),(281,281,"281"),(282,282,"282"),(283,283,"283"),(284,284,"284"),(285,285,"285"),(286,286,"286"),(287,287,"287"),(288,288,"288"),(289,289,"289"),(290,290,"290"),(291,291,"291"),(292,292,"292"),(293,293,"293"),(294,294,"294"),(295,295,"295"),(296,296,"296"),(297,297,"297"),(298,298,"298"),(299,299,"299"),(300,300,"300"),(301,301,"301"),(302,302,"302"),(303,303,"303"),(304,304,"304"),(305,305,"305"),(306,306,"306"),(307,307,"307"),(308,308,"308"),(309,309,"309"),(310,310,"310"),(311,311,"311"),(312,312,"312"),(313,313,"313"),(314,314,"314"),(315,315,"315"),(316,316,"316"),(317,317,"317"),(318,318,"318"),(319,319,"319"),(320,320,"320"),(321,321,"321"),(322,322,"322"),(323,323,"323"),(324,324,"324"),(325,325,"325"),(326,326,"326"),(327,327,"327"),(328,328,"328"),(329,329,"329"),(330,330,"330"),(331,331,"331"),(332,332,"332"),(333,333,"333"),(334,334,"334"),(335,335,"335"),(336,336,"336"),(337,337,"337"),(338,338,"338"),(339,339,"339"),(340,340,"340"),(341,341,"341"),(342,342,"342"),(343,343,"343"),(344,344,"344"),(345,345,"345"),(346,346,"346"),(347,347,"347"),(348,348,"348"),(349,349,"349"),(350,350,"350"),(351,351,"351"),(352,352,"352"),(353,353,"353"),(354,354,"354"),(355,355,"355"),(356,356,"356"),(357,357,"357"),(358,358,"358"),(359,359,"359"),(360,360,"360"),(361,361,"361"),(362,362,"362"),(363,363,"363"),(364,364,"364"),(365,365,"365"),(366,366,"366"),(367,367,"367"),(368,368,"368"),(369,369,"369"),(370,370,"370"),(371,371,"371"),(372,372,"372"),(373,373,"373"),(374,374,"374"),(375,375,"375"),(376,376,"376"),(377,377,"377"),(378,378,"378"),(379,379,"379"),(380,380,"380"),(381,381,"381"),(382,382,"382"),(383,383,"383"),(384,384,"384"),(385,385,"385"),(386,386,"386"),(387,387,"387"),(388,388,"388"),(389,389,"389"),(390,390,"390"),(391,391,"391"),(392,392,"392"),(393,393,"393"),(394,394,"394"),(395,395,"395"),(396,396,"396"),(397,397,"397"),(398,398,"398"),(399,399,"399"),(400,400,"400"),(401,401,"401"),(402,402,"402"),(403,403,"403"),(404,404,"404"),(405,405,"405"),(406,406,"406"),(407,407,"407"),(408,408,"408"),(409,409,"409"),(410,410,"410"),(411,411,"411"),(412,412,"412"),(413,413,"413"),(414,414,"414"),(415,415,"415"),(416,416,"416"),(417,417,"417"),(418,418,"418"),(419,419,"419"),(420,420,"420"),(421,421,"421"),(422,422,"422"),(423,423,"423"),(424,424,"424"),(425,425,"425"),(426,426,"426"),(427,427,"427"),(428,428,"428"),(429,429,"429"),(430,430,"430"),(431,431,"431"),(432,432,"432"),(433,433,"433"),(434,434,"434"),(435,435,"435"),(436,436,"436"),(437,437,"437"),(438,438,"438"),(439,439,"439"),(440,440,"440"),(441,441,"441"),(442,442,"442"),(443,443,"443"),(444,444,"444"),(445,445,"445"),(446,446,"446"),(447,447,"447"),(448,448,"448"),(449,449,"449"),(450,450,"450"),(451,451,"451"),(452,452,"452"),(453,453,"453"),(454,454,"454"),(455,455,"455"),(456,456,"456"),(457,457,"457"),(458,458,"458"),(459,459,"459"),(460,460,"460"),(461,461,"461"),(462,462,"462"),(463,463,"463"),(464,464,"464"),(465,465,"465"),(466,466,"466"),(467,467,"467"),(468,468,"468"),(469,469,"469"),(470,470,"470"),(471,471,"471"),(472,472,"472"),(473,473,"473"),(474,474,"474"),(475,475,"475"),(476,476,"476"),(477,477,"477"),(478,478,"478"),(479,479,"479"),(480,480,"480"),(481,481,"481"),(482,482,"482"),(483,483,"483"),(484,484,"484"),(485,485,"485"),(486,486,"486"),(487,487,"487"),(488,488,"488"),(489,489,"489"),(490,490,"490"),(491,491,"491"),(492,492,"492"),(493,493,"493"),(494,494,"494"),(495,495,"495"),(496,496,"496"),(497,497,"497"),(498,498,"498"),(499,499,"499"),(500,500,"500"); + +-- test partition +CREATE TABLE test.pairs10(x int, y int, z varchar(20)) +PARTITION BY RANGE (y) ( + PARTITION p0 VALUES LESS THAN (100), + PARTITION p1 VALUES LESS THAN (200), + PARTITION p2 VALUES LESS THAN MAXVALUE +); +INSERT INTO test.pairs10 VALUES (1,1,"1"),(2,2,"2"),(3,3,"3"),(4,4,"4"),(5,5,"5"),(6,6,"6"),(7,7,"7"),(8,8,"8"),(9,9,"9"),(10,10,"10"),(11,11,"11"),(12,12,"12"),(13,13,"13"),(14,14,"14"),(15,15,"15"),(16,16,"16"),(17,17,"17"),(18,18,"18"),(19,19,"19"),(20,20,"20"),(21,21,"21"),(22,22,"22"),(23,23,"23"),(24,24,"24"),(25,25,"25"),(26,26,"26"),(27,27,"27"),(28,28,"28"),(29,29,"29"),(30,30,"30"),(31,31,"31"),(32,32,"32"),(33,33,"33"),(34,34,"34"),(35,35,"35"),(36,36,"36"),(37,37,"37"),(38,38,"38"),(39,39,"39"),(40,40,"40"),(41,41,"41"),(42,42,"42"),(43,43,"43"),(44,44,"44"),(45,45,"45"),(46,46,"46"),(47,47,"47"),(48,48,"48"),(49,49,"49"),(50,50,"50"),(51,51,"51"),(52,52,"52"),(53,53,"53"),(54,54,"54"),(55,55,"55"),(56,56,"56"),(57,57,"57"),(58,58,"58"),(59,59,"59"),(60,60,"60"),(61,61,"61"),(62,62,"62"),(63,63,"63"),(64,64,"64"),(65,65,"65"),(66,66,"66"),(67,67,"67"),(68,68,"68"),(69,69,"69"),(70,70,"70"),(71,71,"71"),(72,72,"72"),(73,73,"73"),(74,74,"74"),(75,75,"75"),(76,76,"76"),(77,77,"77"),(78,78,"78"),(79,79,"79"),(80,80,"80"),(81,81,"81"),(82,82,"82"),(83,83,"83"),(84,84,"84"),(85,85,"85"),(86,86,"86"),(87,87,"87"),(88,88,"88"),(89,89,"89"),(90,90,"90"),(91,91,"91"),(92,92,"92"),(93,93,"93"),(94,94,"94"),(95,95,"95"),(96,96,"96"),(97,97,"97"),(98,98,"98"),(99,99,"99"),(100,100,"100"),(101,101,"101"),(102,102,"102"),(103,103,"103"),(104,104,"104"),(105,105,"105"),(106,106,"106"),(107,107,"107"),(108,108,"108"),(109,109,"109"),(110,110,"110"),(111,111,"111"),(112,112,"112"),(113,113,"113"),(114,114,"114"),(115,115,"115"),(116,116,"116"),(117,117,"117"),(118,118,"118"),(119,119,"119"),(120,120,"120"),(121,121,"121"),(122,122,"122"),(123,123,"123"),(124,124,"124"),(125,125,"125"),(126,126,"126"),(127,127,"127"),(128,128,"128"),(129,129,"129"),(130,130,"130"),(131,131,"131"),(132,132,"132"),(133,133,"133"),(134,134,"134"),(135,135,"135"),(136,136,"136"),(137,137,"137"),(138,138,"138"),(139,139,"139"),(140,140,"140"),(141,141,"141"),(142,142,"142"),(143,143,"143"),(144,144,"144"),(145,145,"145"),(146,146,"146"),(147,147,"147"),(148,148,"148"),(149,149,"149"),(150,150,"150"),(151,151,"151"),(152,152,"152"),(153,153,"153"),(154,154,"154"),(155,155,"155"),(156,156,"156"),(157,157,"157"),(158,158,"158"),(159,159,"159"),(160,160,"160"),(161,161,"161"),(162,162,"162"),(163,163,"163"),(164,164,"164"),(165,165,"165"),(166,166,"166"),(167,167,"167"),(168,168,"168"),(169,169,"169"),(170,170,"170"),(171,171,"171"),(172,172,"172"),(173,173,"173"),(174,174,"174"),(175,175,"175"),(176,176,"176"),(177,177,"177"),(178,178,"178"),(179,179,"179"),(180,180,"180"),(181,181,"181"),(182,182,"182"),(183,183,"183"),(184,184,"184"),(185,185,"185"),(186,186,"186"),(187,187,"187"),(188,188,"188"),(189,189,"189"),(190,190,"190"),(191,191,"191"),(192,192,"192"),(193,193,"193"),(194,194,"194"),(195,195,"195"),(196,196,"196"),(197,197,"197"),(198,198,"198"),(199,199,"199"),(200,200,"200"),(201,201,"201"),(202,202,"202"),(203,203,"203"),(204,204,"204"),(205,205,"205"),(206,206,"206"),(207,207,"207"),(208,208,"208"),(209,209,"209"),(210,210,"210"),(211,211,"211"),(212,212,"212"),(213,213,"213"),(214,214,"214"),(215,215,"215"),(216,216,"216"),(217,217,"217"),(218,218,"218"),(219,219,"219"),(220,220,"220"),(221,221,"221"),(222,222,"222"),(223,223,"223"),(224,224,"224"),(225,225,"225"),(226,226,"226"),(227,227,"227"),(228,228,"228"),(229,229,"229"),(230,230,"230"),(231,231,"231"),(232,232,"232"),(233,233,"233"),(234,234,"234"),(235,235,"235"),(236,236,"236"),(237,237,"237"),(238,238,"238"),(239,239,"239"),(240,240,"240"),(241,241,"241"),(242,242,"242"),(243,243,"243"),(244,244,"244"),(245,245,"245"),(246,246,"246"),(247,247,"247"),(248,248,"248"),(249,249,"249"),(250,250,"250"),(251,251,"251"),(252,252,"252"),(253,253,"253"),(254,254,"254"),(255,255,"255"),(256,256,"256"),(257,257,"257"),(258,258,"258"),(259,259,"259"),(260,260,"260"),(261,261,"261"),(262,262,"262"),(263,263,"263"),(264,264,"264"),(265,265,"265"),(266,266,"266"),(267,267,"267"),(268,268,"268"),(269,269,"269"),(270,270,"270"),(271,271,"271"),(272,272,"272"),(273,273,"273"),(274,274,"274"),(275,275,"275"),(276,276,"276"),(277,277,"277"),(278,278,"278"),(279,279,"279"),(280,280,"280"),(281,281,"281"),(282,282,"282"),(283,283,"283"),(284,284,"284"),(285,285,"285"),(286,286,"286"),(287,287,"287"),(288,288,"288"),(289,289,"289"),(290,290,"290"),(291,291,"291"),(292,292,"292"),(293,293,"293"),(294,294,"294"),(295,295,"295"),(296,296,"296"),(297,297,"297"),(298,298,"298"),(299,299,"299"),(300,300,"300"),(301,301,"301"),(302,302,"302"),(303,303,"303"),(304,304,"304"),(305,305,"305"),(306,306,"306"),(307,307,"307"),(308,308,"308"),(309,309,"309"),(310,310,"310"),(311,311,"311"),(312,312,"312"),(313,313,"313"),(314,314,"314"),(315,315,"315"),(316,316,"316"),(317,317,"317"),(318,318,"318"),(319,319,"319"),(320,320,"320"),(321,321,"321"),(322,322,"322"),(323,323,"323"),(324,324,"324"),(325,325,"325"),(326,326,"326"),(327,327,"327"),(328,328,"328"),(329,329,"329"),(330,330,"330"),(331,331,"331"),(332,332,"332"),(333,333,"333"),(334,334,"334"),(335,335,"335"),(336,336,"336"),(337,337,"337"),(338,338,"338"),(339,339,"339"),(340,340,"340"),(341,341,"341"),(342,342,"342"),(343,343,"343"),(344,344,"344"),(345,345,"345"),(346,346,"346"),(347,347,"347"),(348,348,"348"),(349,349,"349"),(350,350,"350"),(351,351,"351"),(352,352,"352"),(353,353,"353"),(354,354,"354"),(355,355,"355"),(356,356,"356"),(357,357,"357"),(358,358,"358"),(359,359,"359"),(360,360,"360"),(361,361,"361"),(362,362,"362"),(363,363,"363"),(364,364,"364"),(365,365,"365"),(366,366,"366"),(367,367,"367"),(368,368,"368"),(369,369,"369"),(370,370,"370"),(371,371,"371"),(372,372,"372"),(373,373,"373"),(374,374,"374"),(375,375,"375"),(376,376,"376"),(377,377,"377"),(378,378,"378"),(379,379,"379"),(380,380,"380"),(381,381,"381"),(382,382,"382"),(383,383,"383"),(384,384,"384"),(385,385,"385"),(386,386,"386"),(387,387,"387"),(388,388,"388"),(389,389,"389"),(390,390,"390"),(391,391,"391"),(392,392,"392"),(393,393,"393"),(394,394,"394"),(395,395,"395"),(396,396,"396"),(397,397,"397"),(398,398,"398"),(399,399,"399"),(400,400,"400"),(401,401,"401"),(402,402,"402"),(403,403,"403"),(404,404,"404"),(405,405,"405"),(406,406,"406"),(407,407,"407"),(408,408,"408"),(409,409,"409"),(410,410,"410"),(411,411,"411"),(412,412,"412"),(413,413,"413"),(414,414,"414"),(415,415,"415"),(416,416,"416"),(417,417,"417"),(418,418,"418"),(419,419,"419"),(420,420,"420"),(421,421,"421"),(422,422,"422"),(423,423,"423"),(424,424,"424"),(425,425,"425"),(426,426,"426"),(427,427,"427"),(428,428,"428"),(429,429,"429"),(430,430,"430"),(431,431,"431"),(432,432,"432"),(433,433,"433"),(434,434,"434"),(435,435,"435"),(436,436,"436"),(437,437,"437"),(438,438,"438"),(439,439,"439"),(440,440,"440"),(441,441,"441"),(442,442,"442"),(443,443,"443"),(444,444,"444"),(445,445,"445"),(446,446,"446"),(447,447,"447"),(448,448,"448"),(449,449,"449"),(450,450,"450"),(451,451,"451"),(452,452,"452"),(453,453,"453"),(454,454,"454"),(455,455,"455"),(456,456,"456"),(457,457,"457"),(458,458,"458"),(459,459,"459"),(460,460,"460"),(461,461,"461"),(462,462,"462"),(463,463,"463"),(464,464,"464"),(465,465,"465"),(466,466,"466"),(467,467,"467"),(468,468,"468"),(469,469,"469"),(470,470,"470"),(471,471,"471"),(472,472,"472"),(473,473,"473"),(474,474,"474"),(475,475,"475"),(476,476,"476"),(477,477,"477"),(478,478,"478"),(479,479,"479"),(480,480,"480"),(481,481,"481"),(482,482,"482"),(483,483,"483"),(484,484,"484"),(485,485,"485"),(486,486,"486"),(487,487,"487"),(488,488,"488"),(489,489,"489"),(490,490,"490"),(491,491,"491"),(492,492,"492"),(493,493,"493"),(494,494,"494"),(495,495,"495"),(496,496,"496"),(497,497,"497"),(498,498,"498"),(499,499,"499"),(500,500,"500"); + +-- test no need to repair +CREATE TABLE test.pairs11(x int auto_increment primary key, y int DEFAULT RAND(), z int DEFAULT RAND()); +INSERT INTO test.pairs11 VALUES (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(); +ALTER TABLE test.pairs11 ADD UNIQUE KEY u1(x, y); \ No newline at end of file diff --git a/br/tests/br_pitr/run.sh b/br/tests/br_pitr/run.sh index afe400820eb7e..7ab0142147749 100644 --- a/br/tests/br_pitr/run.sh +++ b/br/tests/br_pitr/run.sh @@ -29,6 +29,7 @@ restart_services # prepare the data echo "prepare the data" run_sql_file $CUR/prepare_data/delete_range.sql +run_sql_file $CUR/prepare_data/ingest_repair.sql # ... # check something after prepare the data @@ -46,6 +47,7 @@ run_br --pd $PD_ADDR backup full -s "local://$TEST_DIR/$PREFIX/full" # load the incremental data echo "load the incremental data" run_sql_file $CUR/incremental_data/delete_range.sql +run_sql_file $CUR/incremental_data/ingest_repair.sql # ... # check something after load the incremental data @@ -101,9 +103,12 @@ run_br --pd $PD_ADDR restore point -s "local://$TEST_DIR/$PREFIX/log" --full-bac # check something in downstream cluster echo "check br log" check_contains "restore log success summary" +## check feature history ddl delete range check_not_contains "rewrite delete range" echo "" > $res_file echo "check sql result" run_sql "select count(*) DELETE_RANGE_CNT from (select * from mysql.gc_delete_range union all select * from mysql.gc_delete_range_done) del_range group by ts order by DELETE_RANGE_CNT desc limit 1;" expect_delete_range=$(($incremental_delete_range_count-$prepare_delete_range_count)) check_contains "DELETE_RANGE_CNT: $expect_delete_range" +## check feature compatibility between PITR and accelerate indexing +bash $CUR/check/check_ingest_repair.sh diff --git a/br/tests/run_group_br_tests.sh b/br/tests/run_group_br_tests.sh new file mode 100755 index 0000000000000..f5c9068b1f584 --- /dev/null +++ b/br/tests/run_group_br_tests.sh @@ -0,0 +1,70 @@ +#!/usr/bin/env bash + +# This script split the integration tests into 9 groups to support parallel group tests execution. +# all the integration tests are located in br/tests directory. only the directories +# containing run.sh will be considered as valid br integration tests. the script will print the total case number + +set -eo pipefail + +# Step 1 +CUR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +group=$1 +export COV_DIR="/tmp/group_cover" +rm -rf $COV_DIR +mkdir -p $COV_DIR + +# Define groups +# Note: If new group is added, the group name must also be added to CI +# * https://github.com/PingCAP-QE/ci/blob/main/pipelines/pingcap/tidb/latest/pull_br_integration_test.groovy +# Each group of tests consumes as much time as possible, thus reducing CI waiting time. +# Putting multiple light tests together and heavy tests in a separate group. +declare -A groups +groups=( + ["G00"]="br_300_small_tables br_backup_empty br_backup_version br_cache_table br_case_sensitive br_charset_gbk br_check_new_collocation_enable" + ["G01"]="br_autoid br_crypter2 br_db br_db_online br_db_online_newkv br_db_skip br_debug_meta br_ebs br_foreign_key br_full br_table_partition" + ["G02"]="br_full_cluster_restore br_full_ddl br_full_index br_gcs br_history" + ["G03"]='br_incompatible_tidb_config br_incremental br_incremental_ddl br_incremental_index br_pitr' + ["G04"]='br_incremental_only_ddl br_incremental_same_table br_insert_after_restore br_key_locked br_log_test br_move_backup br_mv_index br_other br_partition_add_index br_tidb_placement_policy br_tiflash' + ["G05"]='br_range br_rawkv br_replica_read br_restore_TDE_enable br_restore_log_task_enable br_s3 br_shuffle_leader br_shuffle_region br_single_table' + ["G06"]='br_skip_checksum br_small_batch_size br_split_region_fail br_systables br_table_filter br_txn br_stats br_clustered_index br_crypter' + ["G07"]='br_tikv_outage' + ["G08"]='br_tikv_outage2 br_ttl br_views_and_sequences br_z_gc_safepoint br_autorandom' +) + +# Get other cases not in groups, to avoid missing any case +others=() +for script in "$CUR"/*/run.sh; do + test_name="$(basename "$(dirname "$script")")" + if [[ $test_name != br* ]]; then + continue + fi + # shellcheck disable=SC2076 + if [[ ! " ${groups[*]} " =~ " ${test_name} " ]]; then + others=("${others[@]} ${test_name}") + fi +done + +if [[ "$group" == "others" ]]; then + if [[ -z $others ]]; then + echo "All br integration test cases have been added to groups" + exit 0 + fi + echo "Error: "$others" is not added to any group in br/tests/run_group_br_tests.sh" + exit 1 +elif [[ " ${!groups[*]} " =~ " ${group} " ]]; then + test_names="${groups[${group}]}" + # Run test cases + if [[ -n $test_names ]]; then + echo "" + echo "Run cases: ${test_names}" + for case_name in $test_names; do + echo "Run cases: ${case_name}" + rm -rf /tmp/backup_restore_test + mkdir -p /tmp/backup_restore_test + TEST_NAME=${case_name} ${CUR}/run.sh + done + fi +else + echo "Error: invalid group name: ${group}" + exit 1 +fi From c52e6bdf35a73517f70843c09408349214c1d92d Mon Sep 17 00:00:00 2001 From: Jianjun Liao Date: Wed, 22 May 2024 10:10:31 +0800 Subject: [PATCH 2/3] resolve conflicts Signed-off-by: Jianjun Liao --- .../br_pitr/prepare_data/ingest_repair.sql | 2 +- br/tests/br_pitr/run.sh | 5 +- br/tests/run_group_br_tests.sh | 70 ------------------- 3 files changed, 4 insertions(+), 73 deletions(-) delete mode 100755 br/tests/run_group_br_tests.sh diff --git a/br/tests/br_pitr/prepare_data/ingest_repair.sql b/br/tests/br_pitr/prepare_data/ingest_repair.sql index fc81fa1ced06e..010a1ec446846 100644 --- a/br/tests/br_pitr/prepare_data/ingest_repair.sql +++ b/br/tests/br_pitr/prepare_data/ingest_repair.sql @@ -43,4 +43,4 @@ INSERT INTO test.pairs10 VALUES (1,1,"1"),(2,2,"2"),(3,3,"3"),(4,4,"4"),(5,5,"5" -- test no need to repair CREATE TABLE test.pairs11(x int auto_increment primary key, y int DEFAULT RAND(), z int DEFAULT RAND()); INSERT INTO test.pairs11 VALUES (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(); -ALTER TABLE test.pairs11 ADD UNIQUE KEY u1(x, y); \ No newline at end of file +ALTER TABLE test.pairs11 ADD UNIQUE KEY u1(x, y); diff --git a/br/tests/br_pitr/run.sh b/br/tests/br_pitr/run.sh index 7ab0142147749..b78b8778035df 100644 --- a/br/tests/br_pitr/run.sh +++ b/br/tests/br_pitr/run.sh @@ -107,8 +107,9 @@ check_contains "restore log success summary" check_not_contains "rewrite delete range" echo "" > $res_file echo "check sql result" -run_sql "select count(*) DELETE_RANGE_CNT from (select * from mysql.gc_delete_range union all select * from mysql.gc_delete_range_done) del_range group by ts order by DELETE_RANGE_CNT desc limit 1;" -expect_delete_range=$(($incremental_delete_range_count-$prepare_delete_range_count)) +run_sql "select * from mysql.gc_delete_range" +run_sql "select * from mysql.gc_delete_range_done" +run_sql "select count(*) DELETE_RANGE_CNT from (select distinct start_key, end_key, ts from (select * from mysql.gc_delete_range union all select * from mysql.gc_delete_range_done)) del_range group by ts order by DELETE_RANGE_CNT desc limit 1;"expect_delete_range=$(($incremental_delete_range_count-$prepare_delete_range_count)) check_contains "DELETE_RANGE_CNT: $expect_delete_range" ## check feature compatibility between PITR and accelerate indexing bash $CUR/check/check_ingest_repair.sh diff --git a/br/tests/run_group_br_tests.sh b/br/tests/run_group_br_tests.sh deleted file mode 100755 index f5c9068b1f584..0000000000000 --- a/br/tests/run_group_br_tests.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/env bash - -# This script split the integration tests into 9 groups to support parallel group tests execution. -# all the integration tests are located in br/tests directory. only the directories -# containing run.sh will be considered as valid br integration tests. the script will print the total case number - -set -eo pipefail - -# Step 1 -CUR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) -group=$1 -export COV_DIR="/tmp/group_cover" -rm -rf $COV_DIR -mkdir -p $COV_DIR - -# Define groups -# Note: If new group is added, the group name must also be added to CI -# * https://github.com/PingCAP-QE/ci/blob/main/pipelines/pingcap/tidb/latest/pull_br_integration_test.groovy -# Each group of tests consumes as much time as possible, thus reducing CI waiting time. -# Putting multiple light tests together and heavy tests in a separate group. -declare -A groups -groups=( - ["G00"]="br_300_small_tables br_backup_empty br_backup_version br_cache_table br_case_sensitive br_charset_gbk br_check_new_collocation_enable" - ["G01"]="br_autoid br_crypter2 br_db br_db_online br_db_online_newkv br_db_skip br_debug_meta br_ebs br_foreign_key br_full br_table_partition" - ["G02"]="br_full_cluster_restore br_full_ddl br_full_index br_gcs br_history" - ["G03"]='br_incompatible_tidb_config br_incremental br_incremental_ddl br_incremental_index br_pitr' - ["G04"]='br_incremental_only_ddl br_incremental_same_table br_insert_after_restore br_key_locked br_log_test br_move_backup br_mv_index br_other br_partition_add_index br_tidb_placement_policy br_tiflash' - ["G05"]='br_range br_rawkv br_replica_read br_restore_TDE_enable br_restore_log_task_enable br_s3 br_shuffle_leader br_shuffle_region br_single_table' - ["G06"]='br_skip_checksum br_small_batch_size br_split_region_fail br_systables br_table_filter br_txn br_stats br_clustered_index br_crypter' - ["G07"]='br_tikv_outage' - ["G08"]='br_tikv_outage2 br_ttl br_views_and_sequences br_z_gc_safepoint br_autorandom' -) - -# Get other cases not in groups, to avoid missing any case -others=() -for script in "$CUR"/*/run.sh; do - test_name="$(basename "$(dirname "$script")")" - if [[ $test_name != br* ]]; then - continue - fi - # shellcheck disable=SC2076 - if [[ ! " ${groups[*]} " =~ " ${test_name} " ]]; then - others=("${others[@]} ${test_name}") - fi -done - -if [[ "$group" == "others" ]]; then - if [[ -z $others ]]; then - echo "All br integration test cases have been added to groups" - exit 0 - fi - echo "Error: "$others" is not added to any group in br/tests/run_group_br_tests.sh" - exit 1 -elif [[ " ${!groups[*]} " =~ " ${group} " ]]; then - test_names="${groups[${group}]}" - # Run test cases - if [[ -n $test_names ]]; then - echo "" - echo "Run cases: ${test_names}" - for case_name in $test_names; do - echo "Run cases: ${case_name}" - rm -rf /tmp/backup_restore_test - mkdir -p /tmp/backup_restore_test - TEST_NAME=${case_name} ${CUR}/run.sh - done - fi -else - echo "Error: invalid group name: ${group}" - exit 1 -fi From dda6f0cedf2ef01d79811430ceb0bd0dded59f9b Mon Sep 17 00:00:00 2001 From: Jianjun Liao Date: Wed, 22 May 2024 10:11:36 +0800 Subject: [PATCH 3/3] resolve conflicts Signed-off-by: Jianjun Liao --- br/tests/br_pitr/run.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/br/tests/br_pitr/run.sh b/br/tests/br_pitr/run.sh index b78b8778035df..b9eb63f8eda4e 100644 --- a/br/tests/br_pitr/run.sh +++ b/br/tests/br_pitr/run.sh @@ -109,7 +109,8 @@ echo "" > $res_file echo "check sql result" run_sql "select * from mysql.gc_delete_range" run_sql "select * from mysql.gc_delete_range_done" -run_sql "select count(*) DELETE_RANGE_CNT from (select distinct start_key, end_key, ts from (select * from mysql.gc_delete_range union all select * from mysql.gc_delete_range_done)) del_range group by ts order by DELETE_RANGE_CNT desc limit 1;"expect_delete_range=$(($incremental_delete_range_count-$prepare_delete_range_count)) +run_sql "select count(*) DELETE_RANGE_CNT from (select distinct start_key, end_key, ts from (select * from mysql.gc_delete_range union all select * from mysql.gc_delete_range_done)) del_range group by ts order by DELETE_RANGE_CNT desc limit 1;" +expect_delete_range=$(($incremental_delete_range_count-$prepare_delete_range_count)) check_contains "DELETE_RANGE_CNT: $expect_delete_range" ## check feature compatibility between PITR and accelerate indexing bash $CUR/check/check_ingest_repair.sh