diff options
author | unknown <cmiller@calliope.local.cmiller/calliope.local> | 2007-02-14 12:24:11 -0500 |
---|---|---|
committer | unknown <cmiller@calliope.local.cmiller/calliope.local> | 2007-02-14 12:24:11 -0500 |
commit | 5097c6fc06887a3b8a6fbb9721026250bc60e3a3 (patch) | |
tree | cca848df4237003d6d9051d3f0fa5a173b3b636b /mysql-test | |
parent | af1f49b77eed1039e3116d91b70f102894db941b (diff) | |
parent | 4c4f50623896f43873420d6c8d8e2a320653d57a (diff) | |
download | mariadb-git-5097c6fc06887a3b8a6fbb9721026250bc60e3a3.tar.gz |
Merge calliope.local.cmiller:/Volumes/Source/src/mysql-4.1-maint--bug25126
into calliope.local.cmiller:/Volumes/Source/src/mysql-4.1-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')
-rw-r--r-- | mysql-test/r/order_by.result | 24 | ||||
-rw-r--r-- | mysql-test/t/order_by.test | 29 |
2 files changed, 53 insertions, 0 deletions
diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result index ec6032be882..f5601ba0e43 100644 --- a/mysql-test/r/order_by.result +++ b/mysql-test/r/order_by.result @@ -847,6 +847,30 @@ num (select num + 2 FROM t1 LIMIT 1) SELECT a.a + 1 AS num FROM t1 a JOIN t1 b ON num = b.a; ERROR 42S22: Unknown column 'num' in 'on clause' DROP TABLE t1; +CREATE TABLE bug25126 ( +val int unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY +); +UPDATE bug25126 SET MissingCol = MissingCol; +ERROR 42S22: Unknown column 'MissingCol' in 'field list' +UPDATE bug25126 SET val = val ORDER BY MissingCol; +ERROR 42S22: Unknown column 'MissingCol' in 'order clause' +UPDATE bug25126 SET val = val ORDER BY val; +UPDATE bug25126 SET val = 1 ORDER BY val; +UPDATE bug25126 SET val = 1 ORDER BY MissingCol; +ERROR 42S22: Unknown column 'MissingCol' in 'order clause' +UPDATE bug25126 SET val = 1 ORDER BY val, MissingCol; +ERROR 42S22: Unknown column 'MissingCol' in 'order clause' +UPDATE bug25126 SET val = MissingCol ORDER BY MissingCol; +ERROR 42S22: Unknown column 'MissingCol' in 'order clause' +UPDATE bug25126 SET MissingCol = 1 ORDER BY val, MissingCol; +ERROR 42S22: Unknown column 'MissingCol' in 'order clause' +UPDATE bug25126 SET MissingCol = 1 ORDER BY MissingCol; +ERROR 42S22: Unknown column 'MissingCol' in 'order clause' +UPDATE bug25126 SET MissingCol = val ORDER BY MissingCol; +ERROR 42S22: Unknown column 'MissingCol' in 'order clause' +UPDATE bug25126 SET MissingCol = MissingCol ORDER BY MissingCol; +ERROR 42S22: Unknown column 'MissingCol' in 'order clause' +DROP TABLE bug25126; CREATE TABLE t1 (a int); SELECT p.a AS val, q.a AS val1 FROM t1 p, t1 q ORDER BY val > 1; val val1 diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test index 3c23ea76d99..d781bd6c6ba 100644 --- a/mysql-test/t/order_by.test +++ b/mysql-test/t/order_by.test @@ -576,6 +576,35 @@ 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 # |