diff options
author | unknown <skozlov/ksm@mysql.com/virtop.localdomain> | 2006-12-17 23:08:04 +0300 |
---|---|---|
committer | unknown <skozlov/ksm@mysql.com/virtop.localdomain> | 2006-12-17 23:08:04 +0300 |
commit | 185997ceaf93b9c3453d8cf12a0e5b291d78120c (patch) | |
tree | 8070fc34631aab4ad6e47f2149a98253b06c451d /mysql-test/t/ndb_basic.test | |
parent | 32d0850823cdf5cebfdd14bc3bd81ee9d807cd83 (diff) | |
download | mariadb-git-185997ceaf93b9c3453d8cf12a0e5b291d78120c.tar.gz |
WL#2862
Diffstat (limited to 'mysql-test/t/ndb_basic.test')
-rw-r--r-- | mysql-test/t/ndb_basic.test | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/mysql-test/t/ndb_basic.test b/mysql-test/t/ndb_basic.test index 3348a94c044..8541c0ac0c5 100644 --- a/mysql-test/t/ndb_basic.test +++ b/mysql-test/t/ndb_basic.test @@ -747,4 +747,57 @@ select * from t1 order by a; select * from t2 order by a; drop table t1, t2; +# create table if not exists +--disable_warnings +create table t1 (a int not null primary key, b int not null default 0, c varchar(254)) engine=ndb; +create table if not exists t1 (a int not null primary key, b int not null default 0, c varchar(254)) engine=ndb; +--enable_warnings + +# create like +create table t2 like t1; + +# multi rename +rename table t1 to t10, t2 to t20; +drop table t10,t20; + +# delete +create table t1 (a int not null primary key, b int not null) engine=ndb; +create table t2 (a int not null primary key, b int not null) engine=ndb; +insert into t1 values (1,10), (2,20), (3,30); +insert into t2 values (1,10), (2,20), (3,30); +select * from t1 order by a; +delete from t1 where a > 0 order by a desc limit 1; +select * from t1 order by a; +delete from t1,t2 using t1,t2 where t1.a = t2.a; +select * from t2 order by a; +drop table t1,t2; + +# insert ignore +create table t1 (a int not null primary key, b int not null) engine=ndb; +insert into t1 values (1,10), (2,20), (3,30); +--error 1062 +insert into t1 set a=1, b=100; +insert ignore into t1 set a=1, b=100; +select * from t1 order by a; +insert into t1 set a=1, b=1000 on duplicate key update b=b+1; +select * from t1 order by a; +drop table t1; + +# update +create table t1 (a int not null primary key, b int not null) engine=ndb; +create table t2 (c int not null primary key, d int not null) engine=ndb; +insert into t1 values (1,10), (2,10), (3,30), (4, 30); +insert into t2 values (1,10), (2,10), (3,30), (4, 30); +--error 1062 +update t1 set a = 1 where a = 3; +select * from t1 order by a; +update t1 set b = 1 where a > 1 order by a desc limit 1; +select * from t1 order by a; +--error 1062 +update t1,t2 set a = 1, c = 1 where a = 3 and c = 3; +select * from t1 order by a; +update ignore t1,t2 set a = 1, c = 1 where a = 3 and c = 3; +select * from t1 order by a; +drop table t1,t2; + --echo End of 5.1 tests |