diff options
author | Gleb Shchepa <gshchepa@mysql.com> | 2008-12-31 15:55:04 +0400 |
---|---|---|
committer | Gleb Shchepa <gshchepa@mysql.com> | 2008-12-31 15:55:04 +0400 |
commit | 33cbf93cedf153f502f8bd2980c71d2cc0025eda (patch) | |
tree | b6c51b3059dee8e174d2794f6adacf0c0cb437dc /sql/field.h | |
parent | b6aaa28826ae9ea9e8c74c369f51bd3fc4995abb (diff) | |
download | mariadb-git-33cbf93cedf153f502f8bd2980c71d2cc0025eda.tar.gz |
Bug #41363: crash of mysqld on windows with aggregate in case
Execution of queries containing the CASE function of
aggregate function like in "SELECT ... CASE ARGV(...) WHEN ..."
crashed the server.
The CASE function caches pointers to concrete comparison
functions for an each pair of types of CASE-WHERE clause
parameters, i.e. for the "CASE INT_RESULT WHERE REAL_RESULT
THEN ... WHERE DECIMAL_RESULT ... END" function call it
caches comparisons for INT_RESULT with REAL_RESULT and
for INT_RESULT with DECIMAL_RESULT. Usually a result
type is known after a call to the fix_fields function,
however, the setup_copy_fields function call may
wrap aggregate items with Item_copy_string that has
STRING_RESULT result type, so setup_copy_fields may
change argument result types of the CASE function after
call to Item_func_case::fix_fields/fix_length_and_dec.
Then the Item_func_case::find_item function tries to
use comparison function for unexpected pair of the
STRING_RESULT and some other type - that caused
an assertion failure of server crash.
The Item_func_case::fix_length_and_dec function has
been modified to take into account possible STRING_RESULT
result type in the presence of aggregate arguments of
the CASE function.
Diffstat (limited to 'sql/field.h')
0 files changed, 0 insertions, 0 deletions