Debian Codegraph @

mysql-test/suite/ndb/t/ndb_bug22904640.test

raw
1 -- source include/have_ndb.inc
2 -- source suite/ndb/include/backup_restore_setup.inc
3
4 CREATE TABLE t1 (a int, b int, c int, PRIMARY KEY(a,b))
5 ENGINE = NDB
6 PARTITION BY KEY (a);
7
8 insert into t1 values
9 (1,1,3),(1,2,3),(1,3,3),(1,4,3),(1,5,3),(1,6,3),
10 (1,7,3),(1,8,3),(1,9,3),(1,10,3),(1,11,3),(1,12,3);
11
12 select * from t1 order by b;
13
14 disable_query_log ONCE;
15 let $max1=`SELECT max_rows from ndbinfo.dictionary_tables
16 WHERE table_name = "t1"`;
17 echo Checking MAX_ROWS is unchanged;
18 assert($max1 == 0);
19
20 --source include/ndb_backup.inc
21 drop table t1;
22 --exec $NDB_RESTORE -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUPS-$the_backup_id >> $NDB_TOOLS_OUTPUT
23 --exec $NDB_RESTORE -b $the_backup_id -n 2 -r --print --print_meta $NDB_BACKUPS-$the_backup_id >> $NDB_TOOLS_OUTPUT
24
25 disable_query_log ONCE;
26 let $max2=`SELECT max_rows from ndbinfo.dictionary_tables
27 WHERE table_name = "t1"`;
28 echo Checking MAX_ROWS is unchanged;
29 assert($max2 == 0);
30
31 select * from t1 order by b;
32
33 # Trigger assert from bug#22904640 with an alter table
34 # not actually doing any changes to partitioniong
35 ALTER TABLE t1 algorithm=inplace, REORGANIZE PARTITION;
36
37 DROP TABLE t1;
38 --source suite/ndb/include/backup_restore_cleanup.inc
39 --remove_file $NDB_TOOLS_OUTPUT