summaryrefslogtreecommitdiff
path: root/sql/item.cc
diff options
context:
space:
mode:
authorGleb Shchepa <gshchepa@mysql.com>2009-05-22 01:22:46 +0500
committerGleb Shchepa <gshchepa@mysql.com>2009-05-22 01:22:46 +0500
commit06142cd5452efc4ea0ac48d9340dd28f4a9e520b (patch)
treeb8b4fea0ac47fad5ef015c17a6e931a815ecbfa7 /sql/item.cc
parent42b3d8c74f6592d0b3492daa6fae7a0074217e07 (diff)
downloadmariadb-git-06142cd5452efc4ea0ac48d9340dd28f4a9e520b.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. mysql-test/r/variables.result: Added test case for bug #42778. mysql-test/suite/sys_vars/r/innodb_data_home_dir_basic.result: Updated test case for bug #42778: system variables were NOT NULL, now they are nullable. mysql-test/suite/sys_vars/r/innodb_flush_method_basic.result: Updated test case for bug #42778: system variables were NOT NULL, now they are nullable. mysql-test/suite/sys_vars/r/rpl_init_slave_func.result: Updated test case for bug #42778: system variables were NOT NULL, now they are nullable. mysql-test/suite/sys_vars/r/ssl_capath_basic.result: Updated test case for bug #42778: system variables were NOT NULL, now they are nullable. mysql-test/suite/sys_vars/r/ssl_cipher_basic.result: Updated test case for bug #42778: system variables were NOT NULL, now they are nullable. mysql-test/suite/sys_vars/t/innodb_data_home_dir_basic.test: Updated test case for bug #42778: system variables were NOT NULL, now they are nullable. mysql-test/suite/sys_vars/t/innodb_flush_method_basic.test: Updated test case for bug #42778: system variables were NOT NULL, now they are nullable. mysql-test/suite/sys_vars/t/ssl_capath_basic.test: Updated test case for bug #42778: system variables were NOT NULL, now they are nullable. mysql-test/suite/sys_vars/t/ssl_cipher_basic.test: Updated test case for bug #42778: system variables were NOT NULL, now they are nullable. mysql-test/t/variables.test: Added test case for bug #42778. sql/item.cc: Bug #42778: delete order by null global variable causes assertion .\filesort.cc, line 797 The longlong_from_string_with_check function has been modified to skip unwanted warnings: now it uses the THD::no_errors flag to suppress warnings. The Item_func_get_system_var::update_null_value method sets the no_error flag. sql/item_func.cc: Bug #42778: delete order by null global variable causes assertion .\filesort.cc, line 797 1. The Item_func_get_system_var::fix_length_and_dec method has been modified to make system variables truly nullable. 2. The Item_func_get_system_var::update_null_value method method has been overloaded with a simple wrapper (like Item_field::update_null_value) to suppress unwanted warnings from Item_func_get_system_var::val_int() calls on non-numeric variable values: the Item_func_get_system_var::update_null_value method sets and restores THD::no_errors flag for a nested call of the longlong_from_string_with_check function. sql/item_func.h: Bug #42778: delete order by null global variable causes assertion .\filesort.cc, line 797 The Item_func_get_system_var::update_null_value method method has been overloaded.
Diffstat (limited to 'sql/item.cc')
-rw-r--r--sql/item.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/item.cc b/sql/item.cc
index 62c8bfa3043..420efb2a4ee 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -2472,8 +2472,9 @@ longlong_from_string_with_check (CHARSET_INFO *cs, const char *cptr, char *end)
TODO: Give error if we wanted a signed integer and we got an unsigned
one
*/
- if (err > 0 ||
- (end != org_end && !check_if_only_end_space(cs, end, org_end)))
+ if (!current_thd->no_errors &&
+ (err > 0 ||
+ (end != org_end && !check_if_only_end_space(cs, end, org_end))))
{
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TRUNCATED_WRONG_VALUE,