diff options
author | Gleb Shchepa <gshchepa@mysql.com> | 2009-05-22 01:22:46 +0500 |
---|---|---|
committer | Gleb Shchepa <gshchepa@mysql.com> | 2009-05-22 01:22:46 +0500 |
commit | 387a54fbbd54a416481d6c0b1e5236475a460357 (patch) | |
tree | b8b4fea0ac47fad5ef015c17a6e931a815ecbfa7 /mysql-test/t/variables.test | |
parent | 019e8a6c7186da0e989d7a1c0465b42f0d026ed5 (diff) | |
download | mariadb-git-387a54fbbd54a416481d6c0b1e5236475a460357.tar.gz |
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.
Diffstat (limited to 'mysql-test/t/variables.test')
-rw-r--r-- | mysql-test/t/variables.test | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 6da20409639..b404b5b07fb 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -1201,4 +1201,23 @@ SET GLOBAL server_id = -1; SELECT @@GLOBAL.server_id; SET GLOBAL server_id = @old_server_id; +# +# Bug #42778: delete order by null global variable causes +# assertion .\filesort.cc, line 797 +# + +SELECT @@GLOBAL.INIT_FILE, @@GLOBAL.INIT_FILE IS NULL; +SELECT @@GLOBAL.REPORT_HOST, @@GLOBAL.REPORT_HOST IS NULL; +SELECT @@GLOBAL.REPORT_PASSWORD, @@GLOBAL.REPORT_PASSWORD IS NULL; +SELECT @@GLOBAL.REPORT_USER, @@GLOBAL.REPORT_USER IS NULL; + +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (); +SET @bug42778= @@sql_safe_updates; +SET @@sql_safe_updates= 0; +DELETE FROM t1 ORDER BY (@@GLOBAL.INIT_FILE) ASC LIMIT 10; +SET @@sql_safe_updates= @bug42778; + +DROP TABLE t1; + --echo End of 5.1 tests |