summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authormonty@hundin.mysql.fi <>2001-11-08 22:30:27 +0200
committermonty@hundin.mysql.fi <>2001-11-08 22:30:27 +0200
commit7a45e7f2667141e5dff5570299f8ed13fbc40b9d (patch)
treeb588a19366ea8358f0ee2974d009bbf6b14a3e20 /mysql-test
parent578ab3f1b155e0ab8dbd85855634b70b0fd7d6bb (diff)
downloadmariadb-git-7a45e7f2667141e5dff5570299f8ed13fbc40b9d.tar.gz
Fixed bug in UPDATE .. ORDER BY
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/update.result10
-rw-r--r--mysql-test/t/update.test11
2 files changed, 21 insertions, 0 deletions
diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result
index 4fa1f3513b2..436f837ab68 100644
--- a/mysql-test/r/update.result
+++ b/mysql-test/r/update.result
@@ -102,3 +102,13 @@ select status from t1;
status
1
drop table t1;
+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;
+a b
+1 4
+1 4
+1 2
+drop table t1;
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;