1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Fixed bug #16249: different results for a range with an without index

when a range condition use an invalid DATETIME constant.
Now we do not use invalid DATETIME constants to form end keys for
range intervals: range analysis just ignores predicates with such
constants.
This commit is contained in:
igor@rurik.mysql.com
2006-08-31 07:27:34 -07:00
parent d10d5b835d
commit c0389e7b0c
4 changed files with 88 additions and 1 deletions

View File

@ -4129,6 +4129,7 @@ get_mm_leaf(PARAM *param, COND *conf_func, Field *field, KEY_PART *key_part,
MEM_ROOT *alloc= param->mem_root;
char *str;
ulong orig_sql_mode;
int err;
DBUG_ENTER("get_mm_leaf");
/*
@ -4280,7 +4281,13 @@ get_mm_leaf(PARAM *param, COND *conf_func, Field *field, KEY_PART *key_part,
(field->type() == FIELD_TYPE_DATE ||
field->type() == FIELD_TYPE_DATETIME))
field->table->in_use->variables.sql_mode|= MODE_INVALID_DATES;
if (value->save_in_field_no_warnings(field, 1) < 0)
err= value->save_in_field_no_warnings(field, 1);
if (err > 0 && field->cmp_type() != value->result_type())
{
tree= 0;
goto end;
}
if (err < 0)
{
field->table->in_use->variables.sql_mode= orig_sql_mode;
/* This happens when we try to insert a NULL field in a not null column */