summaryrefslogtreecommitdiff
path: root/mysql-test/t/ndb_truncate.test
diff options
context:
space:
mode:
authorunknown <magnus@neptunus.(none)>2004-08-04 11:28:36 +0200
committerunknown <magnus@neptunus.(none)>2004-08-04 11:28:36 +0200
commit94a1e48232184a25837e49fc01120228e5ff7860 (patch)
tree39130a79f04ed16342a5921f116d38f1145628ed /mysql-test/t/ndb_truncate.test
parent92498f81dbc94cd9327b431f4456e17fc8dddb8f (diff)
downloadmariadb-git-94a1e48232184a25837e49fc01120228e5ff7860.tar.gz
BUG#4892 TRUNCATE TABLE returns error 156
Added NDBCLUSTER to table types which does not support generate. Added test case for truncate. sql/handler.h: Add NDBCLUSTER to table types that does not support generate.
Diffstat (limited to 'mysql-test/t/ndb_truncate.test')
-rw-r--r--mysql-test/t/ndb_truncate.test33
1 files changed, 33 insertions, 0 deletions
diff --git a/mysql-test/t/ndb_truncate.test b/mysql-test/t/ndb_truncate.test
new file mode 100644
index 00000000000..63bb8cbefb6
--- /dev/null
+++ b/mysql-test/t/ndb_truncate.test
@@ -0,0 +1,33 @@
+-- source include/have_ndb.inc
+
+--disable_warnings
+DROP TABLE IF EXISTS t2;
+--enable_warnings
+
+
+CREATE TABLE t2 (
+ a bigint unsigned NOT NULL PRIMARY KEY,
+ b int unsigned not null,
+ c int unsigned
+) engine=ndbcluster;
+
+
+#
+# insert records into table
+#
+let $1=500;
+disable_query_log;
+while ($1)
+{
+ eval insert into t2 values($1*10, $1+9, 5*$1), ($1*10+1, $1+10, 7),($1*10+2, $1+10, 7*$1), ($1*10+3, $1+10, 10+$1), ($1*10+4, $1+10, 70*$1), ($1*10+5, $1+10, 7), ($1*10+6, $1+10, 9), ($1*10+7, $1+299, 899), ($1*10+8, $1+10, 12), ($1*10+9, $1+10, 14*$1);
+ dec $1;
+}
+enable_query_log;
+
+select count(*) from t2;
+
+truncate table t2;
+
+select count(*) from t2;
+
+drop table t2;