summaryrefslogtreecommitdiff
path: root/mysql-test/r/group_by.result
diff options
context:
space:
mode:
authorunknown <gkodinov/kgeorge@macbook.gmz>2006-10-16 13:10:25 +0300
committerunknown <gkodinov/kgeorge@macbook.gmz>2006-10-16 13:10:25 +0300
commit750a2a0b862ba6a02c341a6120a96a081a83ac4f (patch)
tree1adb8d419ff754110873166f6615bfe61b89817a /mysql-test/r/group_by.result
parent9bf2ed95539220b6da3452eecbab56ae33af2126 (diff)
downloadmariadb-git-750a2a0b862ba6a02c341a6120a96a081a83ac4f.tar.gz
BUG#14019 : group by converts literal string to column name
When resolving unqualified name references MySQL was not checking what is the item type for the reference. Thus e.g a string literal item that has by convention a name equal to its string value will also work as a reference to a SELECT list item or a table field. Fixed by allowing only Item_ref or Item_field to referenced by (unqualified) name. mysql-test/r/func_gconcat.result: Bug #14019: group by converts literal string to column name - removed undeterministic testcase : order by a constant means no order. mysql-test/r/group_by.result: Bug #14019: group by converts literal string to column name - test case mysql-test/t/func_gconcat.test: Bug #14019: group by converts literal string to column name - removed undeterministic testcase : order by a constant means no order. mysql-test/t/group_by.test: Bug #14019: group by converts literal string to column name - test case sql/sql_base.cc: Bug #14019: group by converts literal string to column name - resolve unqualified by name refs only for real references
Diffstat (limited to 'mysql-test/r/group_by.result')
-rw-r--r--mysql-test/r/group_by.result45
1 files changed, 45 insertions, 0 deletions
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index 4ad28091164..61b73dc7005 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -773,3 +773,48 @@ select sql_buffer_result max(f1)+1 from t1;
max(f1)+1
3
drop table t1;
+CREATE TABLE t1(a INT);
+INSERT INTO t1 VALUES (1),(2);
+SELECT a FROM t1 GROUP BY 'a';
+a
+1
+SELECT a FROM t1 GROUP BY "a";
+a
+1
+SELECT a FROM t1 GROUP BY `a`;
+a
+1
+2
+set sql_mode=ANSI_QUOTES;
+SELECT a FROM t1 GROUP BY "a";
+a
+1
+2
+SELECT a FROM t1 GROUP BY 'a';
+a
+1
+SELECT a FROM t1 GROUP BY `a`;
+a
+1
+2
+set sql_mode='';
+SELECT a FROM t1 HAVING 'a' > 1;
+a
+SELECT a FROM t1 HAVING "a" > 1;
+a
+SELECT a FROM t1 HAVING `a` > 1;
+a
+2
+SELECT a FROM t1 ORDER BY 'a' DESC;
+a
+1
+2
+SELECT a FROM t1 ORDER BY "a" DESC;
+a
+1
+2
+SELECT a FROM t1 ORDER BY `a` DESC;
+a
+2
+1
+DROP TABLE t1;