1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-36596 Assertion failure in TABLE_SHARE::init_from_sql_statement_string upon returning wrong type from function

WHERE clause evaluation can fail
This commit is contained in:
Sergei Golubchik
2025-04-15 00:18:23 +02:00
parent 1691b0cfac
commit b5d0e30923
3 changed files with 20 additions and 0 deletions

View File

@@ -36,3 +36,11 @@ index_name comment
a disabled a disabled
drop table t1; drop table t1;
# End of 10.5 tests # End of 10.5 tests
#
# MDEV-36596 Assertion failure in TABLE_SHARE::init_from_sql_statement_string upon returning wrong type from function
#
create function f() returns int return (1>2,1,2);
select * from information_schema.columns where f() is null;
ERROR HY000: Cannot cast 'row' as 'int' in assignment of `(null)`
drop function f;
# End of 11.8 tests

View File

@@ -28,3 +28,13 @@ select index_name, comment from information_schema.statistics where table_schema
drop table t1; drop table t1;
--echo # End of 10.5 tests --echo # End of 10.5 tests
--echo #
--echo # MDEV-36596 Assertion failure in TABLE_SHARE::init_from_sql_statement_string upon returning wrong type from function
--echo #
create function f() returns int return (1>2,1,2);
--error ER_ILLEGAL_PARAMETER_DATA_TYPES2_FOR_OPERATION
select * from information_schema.columns where f() is null;
drop function f;
--echo # End of 11.8 tests

View File

@@ -5622,6 +5622,8 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond)
if (!partial_cond || partial_cond->val_bool()) if (!partial_cond || partial_cond->val_bool())
{ {
if (thd->is_error())
goto err;
/* /*
If table is I_S.tables and open_table_method is 0 (eg SKIP_OPEN) If table is I_S.tables and open_table_method is 0 (eg SKIP_OPEN)
we can skip table opening and we don't have lookup value for we can skip table opening and we don't have lookup value for