1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Bug #42778: delete order by null global variable causes

assertion .\filesort.cc, line 797

A query with the "ORDER BY @@some_system_variable" clause,
where @@some_system_variable is NULL, causes assertion
failure in the filesort procedures.

The reason of the failure is in the value of
Item_func_get_system_var::maybe_null: it was unconditionally
set to false even if the value of a variable was NULL.
This commit is contained in:
Gleb Shchepa
2009-05-22 01:22:46 +05:00
parent 019e8a6c71
commit 387a54fbbd
14 changed files with 115 additions and 65 deletions

View File

@ -29,7 +29,7 @@
# Displaying default value #
####################################################################
SELECT COUNT(@@GLOBAL.innodb_flush_method);
--echo 1 Expected
--echo 0 Expected
--echo '#---------------------BS_STVARS_029_02----------------------#'
@ -42,7 +42,7 @@ SET @@GLOBAL.innodb_flush_method=1;
--echo Expected error 'Read only variable'
SELECT COUNT(@@GLOBAL.innodb_flush_method);
--echo 1 Expected
--echo 0 Expected
@ -58,7 +58,7 @@ WHERE VARIABLE_NAME='innodb_flush_method';
--echo 1 Expected
SELECT COUNT(@@GLOBAL.innodb_flush_method);
--echo 1 Expected
--echo 0 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
@ -82,7 +82,7 @@ SELECT @@innodb_flush_method = @@GLOBAL.innodb_flush_method;
################################################################################
SELECT COUNT(@@innodb_flush_method);
--echo 1 Expected
--echo 0 Expected
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@local.innodb_flush_method);
@ -93,7 +93,7 @@ SELECT COUNT(@@SESSION.innodb_flush_method);
--echo Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.innodb_flush_method);
--echo 1 Expected
--echo 0 Expected
--Error ER_BAD_FIELD_ERROR
SELECT innodb_flush_method = @@SESSION.innodb_flush_method;