diff options
author | unknown <ramil/ram@mysql.com/ramil.myoffice.izhnet.ru> | 2007-11-27 09:36:43 +0400 |
---|---|---|
committer | unknown <ramil/ram@mysql.com/ramil.myoffice.izhnet.ru> | 2007-11-27 09:36:43 +0400 |
commit | ba974f83712e458275ac2a3d2a803c36871cf4f0 (patch) | |
tree | 7e952ab6822831bf606dee0c76147f95905f85f6 /mysql-test/t/func_misc.test | |
parent | 1f57bfb8d1ed7f4cbe4a3410752903106cc8d34c (diff) | |
download | mariadb-git-ba974f83712e458275ac2a3d2a803c36871cf4f0.tar.gz |
Fix for bug #32559: connection hangs on query with name_const
Problem: passing a non-constant name to the NAME_CONST function results in a crash.
Fix: check the NAME_CONST name argument; return fake item type if we got
non-constant argument(s).
mysql-test/r/func_misc.result:
Fix for bug #32559: connection hangs on query with name_const
- test result.
mysql-test/t/func_misc.test:
Fix for bug #32559: connection hangs on query with name_const
- test case.
sql/item.cc:
Fix for bug #32559: connection hangs on query with name_const
- Item_name_const::type() now returns NULL_ITEM if non-constant arguments
were used to create the item to avoid wrong type casting.
sql/item.h:
Fix for bug #32559: connection hangs on query with name_const
- NAME_CONST name argument checked for invariability.
Diffstat (limited to 'mysql-test/t/func_misc.test')
-rw-r--r-- | mysql-test/t/func_misc.test | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test index 2c34f77b1ff..4870379d69e 100644 --- a/mysql-test/t/func_misc.test +++ b/mysql-test/t/func_misc.test @@ -204,5 +204,15 @@ SELECT NAME_CONST('test', 1.0); SELECT NAME_CONST('test', -1.0); SELECT NAME_CONST('test', 'test'); ---echo End of 5.0 tests +# +# Bug #32559: connection hangs on query with name_const +# +CREATE TABLE t1(a INT); +INSERT INTO t1 VALUES (), (), (); +--error ER_WRONG_ARGUMENTS +SELECT NAME_CONST(a, '1') FROM t1; +--error ER_WRONG_ARGUMENTS +SET INSERT_ID= NAME_CONST(a, a); +DROP TABLE t1; +--echo End of 5.0 tests |