mysql-test/suite/ndb/t/ndb_truncate.test
raw| 1 | -- source include/have_ndb.inc |
| 2 | |
| 3 | --disable_warnings |
| 4 | DROP TABLE IF EXISTS t1, t2; |
| 5 | --enable_warnings |
| 6 | |
| 7 | CREATE TABLE t1 ( |
| 8 | a bigint unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY, |
| 9 | b int unsigned not null, |
| 10 | c int unsigned |
| 11 | ) engine=ndbcluster; |
| 12 | |
| 13 | |
| 14 | # |
| 15 | # insert records into table |
| 16 | # |
| 17 | let $1=500; |
| 18 | disable_query_log; |
| 19 | while ($1) |
| 20 | { |
| 21 | eval insert into t1 values(NULL, $1+9, 5*$1), (NULL, $1+10, 7),(NULL, $1+10, 7*$1), (NULL, $1+10, 10+$1), (NULL, $1+10, 70*$1), (NULL, $1+10, 7), (NULL, $1+10, 9), (NULL, $1+299, 899), (NULL, $1+10, 12), (NULL, $1+10, 14*$1); |
| 22 | dec $1; |
| 23 | } |
| 24 | enable_query_log; |
| 25 | |
| 26 | select count(*) from t1; |
| 27 | |
| 28 | select * from t1 order by a limit 2; |
| 29 | |
| 30 | truncate table t1; |
| 31 | |
| 32 | select count(*) from t1; |
| 33 | |
| 34 | insert into t1 values(NULL,1,1),(NULL,2,2); |
| 35 | |
| 36 | select * from t1 order by a; |
| 37 | |
| 38 | drop table t1; |
| 39 | |
| 40 | # End of 4.1 tests |