diff options
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/insert_select.test | 2 | ||||
-rw-r--r-- | mysql-test/t/update.test | 11 |
2 files changed, 13 insertions, 0 deletions
diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test index 30d3e31188c..42f65858d77 100644 --- a/mysql-test/t/insert_select.test +++ b/mysql-test/t/insert_select.test @@ -7,7 +7,9 @@ create table t1 (bandID MEDIUMINT UNSIGNED NOT NULL PRIMARY KEY, payoutID SMALLI insert into t1 (bandID,payoutID) VALUES (1,6),(2,6),(3,4),(4,9),(5,10),(6,1),(7,12),(8,12); create table t2 (payoutID SMALLINT UNSIGNED NOT NULL PRIMARY KEY); insert into t2 (payoutID) SELECT DISTINCT payoutID FROM t1; +--error 1062 insert into t2 (payoutID) SELECT payoutID+10 FROM t1; +insert ignore into t2 (payoutID) SELECT payoutID+10 FROM t1; select * from t2; drop table t1,t2; # diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test index 6f446a11521..5cbbd2a350e 100644 --- a/mysql-test/t/update.test +++ b/mysql-test/t/update.test @@ -76,3 +76,14 @@ alter table t1 change lfdnr lfdnr int(10) unsigned default 0 not null auto_incre update t1 set status=1 where type='Open'; select status from t1; drop table t1; + +# +# Test of ORDER BY +# + +create table t1 (a int not null, b int not null); +insert into t1 values (1,1),(1,2),(1,3); +update t1 set b=4 where a=1 order by b asc limit 1; +update t1 set b=4 where a=1 order by b desc limit 1; +select * from t1; +drop table t1; |