summaryrefslogtreecommitdiff
path: root/mysql-test/r/func_misc.result
diff options
context:
space:
mode:
authorMagne Mahre <magne.mahre@oracle.com>2010-11-18 14:02:24 +0100
committerMagne Mahre <magne.mahre@oracle.com>2010-11-18 14:02:24 +0100
commit54d63578375b07500e9fe1ce7467b5ca48b46d8a (patch)
tree19cc50225bc9734b4dce0d9e8bf12dd9301a0f60 /mysql-test/r/func_misc.result
parent247a696d79f9cbc7dd2dbc43ce668e91f69dd8bf (diff)
downloadmariadb-git-54d63578375b07500e9fe1ce7467b5ca48b46d8a.tar.gz
Bug#58199 name_const in the having clause crashes
NAME_CONST(..) was used wrongly in a HAVING clause, and should have caused a user error. Instead, it caused a segmentation fault. During parsing, the value parameter to NAME_CONST was specified to be an uninitialized Item_ref object (it would be resolved later). During the semantic analysis, the object is tested, and since it was not initialied, the server seg.faulted. The fix is to check if the object is initialized before testing it. The same pattern has already been applied to most other methods in the Item_ref class. Bug was introduced by the optimization done as part of Bug#33546.
Diffstat (limited to 'mysql-test/r/func_misc.result')
-rw-r--r--mysql-test/r/func_misc.result8
1 files changed, 7 insertions, 1 deletions
diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result
index 85448a258e4..3c5dc0faa0c 100644
--- a/mysql-test/r/func_misc.result
+++ b/mysql-test/r/func_misc.result
@@ -375,4 +375,10 @@ GREATEST(a, (SELECT b FROM t1 LIMIT 1))
3
1
DROP TABLE t1;
-End of 5.1 tests
+#
+# Bug #58199: name_const in the having clause crashes
+#
+CREATE TABLE t1 (a INT);
+SELECT 1 from t1 HAVING NAME_CONST('', a);
+ERROR HY000: Incorrect arguments to NAME_CONST
+DROP TABLE t1;