From 52f038c5c3a065d2c68197535d844f6ed00a09cc Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 12 Feb 2014 21:17:28 +0100 Subject: MDEV-5655 Server crashes on NAME_CONST containing AND/OR expressions fix the NAME_CONST check to only allow literals, negated literals, and literals with the explicit collation. --- mysql-test/r/func_misc.result | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'mysql-test/r/func_misc.result') diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result index 5910a45c839..56d27ff78be 100644 --- a/mysql-test/r/func_misc.result +++ b/mysql-test/r/func_misc.result @@ -265,3 +265,10 @@ SELECT '1' IN ('1', INET_NTOA(0)); '1' IN ('1', INET_NTOA(0)) 1 End of tests +SELECT NAME_CONST('a', -(1 OR 2)) OR 1; +ERROR HY000: Incorrect arguments to NAME_CONST +SELECT NAME_CONST('a', -(1 AND 2)) AND 1; +ERROR HY000: Incorrect arguments to NAME_CONST +SELECT NAME_CONST('a', -(1)) OR 1; +NAME_CONST('a', -(1)) OR 1 +1 -- cgit v1.2.1