summaryrefslogtreecommitdiff
path: root/mysql-test/t/order_by.test
diff options
context:
space:
mode:
authorunknown <cmiller@calliope.local.cmiller/calliope.local>2007-02-14 11:27:37 -0500
committerunknown <cmiller@calliope.local.cmiller/calliope.local>2007-02-14 11:27:37 -0500
commit48be0a2ff17af54aab36b0b554175ae5756e3690 (patch)
tree7c9fd27030b35104266e24d59e4c21c5a445468b /mysql-test/t/order_by.test
parent9d66be72b0ee079cecc39e09d4f4c0f7e1849dbc (diff)
parent4c4f50623896f43873420d6c8d8e2a320653d57a (diff)
downloadmariadb-git-48be0a2ff17af54aab36b0b554175ae5756e3690.tar.gz
Merge calliope.local.cmiller:/Volumes/Source/src/mysql-4.1-maint--bug25126
into calliope.local.cmiller:/Volumes/Source/src/mysql-5.0-maint sql/item.cc: Auto merged mysql-test/r/order_by.result: Manual merge. mysql-test/t/order_by.test: Manual merge.
Diffstat (limited to 'mysql-test/t/order_by.test')
-rw-r--r--mysql-test/t/order_by.test31
1 files changed, 30 insertions, 1 deletions
diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test
index 012b38ff8b7..5533f273b0d 100644
--- a/mysql-test/t/order_by.test
+++ b/mysql-test/t/order_by.test
@@ -589,6 +589,36 @@ SELECT a.a + 1 AS num FROM t1 a JOIN t1 b ON num = b.a;
DROP TABLE t1;
#
+# Bug#25126: Reference to non-existant column in UPDATE...ORDER BY...
+# crashes server
+#
+CREATE TABLE bug25126 (
+ val int unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY
+);
+--error 1054
+UPDATE bug25126 SET MissingCol = MissingCol;
+--error 1054
+UPDATE bug25126 SET val = val ORDER BY MissingCol;
+UPDATE bug25126 SET val = val ORDER BY val;
+UPDATE bug25126 SET val = 1 ORDER BY val;
+--error 1054
+UPDATE bug25126 SET val = 1 ORDER BY MissingCol;
+--error 1054
+UPDATE bug25126 SET val = 1 ORDER BY val, MissingCol;
+--error 1054
+UPDATE bug25126 SET val = MissingCol ORDER BY MissingCol;
+--error 1054
+UPDATE bug25126 SET MissingCol = 1 ORDER BY val, MissingCol;
+--error 1054
+UPDATE bug25126 SET MissingCol = 1 ORDER BY MissingCol;
+--error 1054
+UPDATE bug25126 SET MissingCol = val ORDER BY MissingCol;
+--error 1054
+UPDATE bug25126 SET MissingCol = MissingCol ORDER BY MissingCol;
+DROP TABLE bug25126;
+
+
+#
# Bug #25427: crash when order by expression contains a name
# that cannot be resolved unambiguously
#
@@ -603,7 +633,6 @@ SELECT p.a AS val, q.a AS val FROM t1 p, t1 q ORDER BY val > 1;
DROP TABLE t1;
-# End of 4.1 tests
create table t1 (a int not null, b int not null, c int not null);
insert t1 values (1,1,1),(1,1,2),(1,2,1);
select a, b from t1 group by a, b order by sum(c);