mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Fixed bug #18206.
The bug report revealed two problems related to min/max optimization: 1. If the length of a constant key used in a SARGable condition for for the MIN/MAX fields is greater than the length of the field an unwanted warning on key truncation is issued; 2. If MIN/MAX optimization is applied to a partial index, like INDEX(b(4)) than can lead to returning a wrong result set. mysql-test/r/func_group.result: Added test cases for bug #18206. mysql-test/t/func_group.test: Added test cases for bug #18206. sql/opt_sum.cc: Fixed bug #18206. Suppressed the warning about data truncation when store_val_in_field was used to store keys for the field used in MIN/MAX optimization. Blocked MIN/MAX optimization for partial keys, such as in INDEX(b(4)). sql/sql_select.cc: Fixed bug #18206. Added a parameter for the function store_val_in_field allowing to control setting warnings about data truncation in the function. sql/sql_select.h: Fixed bug #18206. Added a parameter for the function store_val_in_field allowing to control setting warnings about data truncation in the function.
This commit is contained in:
@@ -335,7 +335,7 @@ extern const char *join_type_str[];
|
||||
void TEST_join(JOIN *join);
|
||||
|
||||
/* Extern functions in sql_select.cc */
|
||||
bool store_val_in_field(Field *field,Item *val);
|
||||
bool store_val_in_field(Field *field, Item *val, enum_check_fields check_flag);
|
||||
TABLE *create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
|
||||
ORDER *group, bool distinct, bool save_sum_fields,
|
||||
ulong select_options, ha_rows rows_limit,
|
||||
|
||||
Reference in New Issue
Block a user