summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <gni@dev3-221.dev.cn.tlan>2007-09-28 09:16:41 +0800
committerunknown <gni@dev3-221.dev.cn.tlan>2007-09-28 09:16:41 +0800
commitbafa5fe8aa6a79ab5f28a9275d71647049709863 (patch)
tree34155e4d2a22c0252d5e1b68ad2fee11659e3611 /mysql-test
parent1cfa76569d7800f74def8beb7cba42b5607663a3 (diff)
downloadmariadb-git-bafa5fe8aa6a79ab5f28a9275d71647049709863.tar.gz
BUG#29851 TRUNCATE causes error 4350 from cluster in INSERT... ON DUPLICATE KEY UPDATE
mysql-test/r/ndb_alter_table2.result: Add test case for BUG#29851 mysql-test/t/ndb_alter_table2.test: Add test case for BUG#29851 sql/ha_ndbcluster.cc: Indexes are dropped also when dropping table in GlobalDictCache
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/ndb_alter_table2.result19
-rw-r--r--mysql-test/t/ndb_alter_table2.test31
2 files changed, 50 insertions, 0 deletions
diff --git a/mysql-test/r/ndb_alter_table2.result b/mysql-test/r/ndb_alter_table2.result
index 399578dc97b..886c300d53d 100644
--- a/mysql-test/r/ndb_alter_table2.result
+++ b/mysql-test/r/ndb_alter_table2.result
@@ -40,3 +40,22 @@ a b c
select * from t1;
a b c
drop table t1;
+DROP TABLE IF EXISTS truncate_test;
+CREATE TABLE truncate_test (
+i INT PRIMARY KEY,
+a INT,
+b VARCHAR(11),
+UNIQUE KEY (a)
+) ENGINE = NDB;
+INSERT INTO truncate_test VALUES (1, 1, 'test') ON DUPLICATE KEY UPDATE b = 'new';
+INSERT INTO truncate_test VALUES (1, 1, 'test') ON DUPLICATE KEY UPDATE b = 'new';
+TRUNCATE truncate_test;
+INSERT INTO truncate_test VALUES (1, 1, 'test') ON DUPLICATE KEY UPDATE b = 'new';
+SELECT * FROM truncate_test;
+i a b
+1 1 test
+INSERT INTO truncate_test VALUES (1, 1, 'test') ON DUPLICATE KEY UPDATE b = 'new';
+SELECT * FROM truncate_test;
+i a b
+1 1 new
+DROP TABLE truncate_test;
diff --git a/mysql-test/t/ndb_alter_table2.test b/mysql-test/t/ndb_alter_table2.test
index 3861fcc6c9d..99c201f7370 100644
--- a/mysql-test/t/ndb_alter_table2.test
+++ b/mysql-test/t/ndb_alter_table2.test
@@ -81,3 +81,34 @@ select * from t1;
select * from t1;
drop table t1;
+
+#For BUG#29851 TRUNCATE causes error 4350 from cluster in INSERT... ON DUPLICATE KEY UPDATE
+
+connection con1;
+
+--disable_warnings
+DROP TABLE IF EXISTS truncate_test;
+--enable_warnings
+
+CREATE TABLE truncate_test (
+ i INT PRIMARY KEY,
+ a INT,
+ b VARCHAR(11),
+ UNIQUE KEY (a)
+) ENGINE = NDB;
+
+INSERT INTO truncate_test VALUES (1, 1, 'test') ON DUPLICATE KEY UPDATE b = 'new';
+INSERT INTO truncate_test VALUES (1, 1, 'test') ON DUPLICATE KEY UPDATE b = 'new';
+
+connection con2;
+TRUNCATE truncate_test;
+
+connection con1;
+INSERT INTO truncate_test VALUES (1, 1, 'test') ON DUPLICATE KEY UPDATE b = 'new';
+SELECT * FROM truncate_test;
+
+connection con2;
+INSERT INTO truncate_test VALUES (1, 1, 'test') ON DUPLICATE KEY UPDATE b = 'new';
+SELECT * FROM truncate_test;
+
+DROP TABLE truncate_test;