mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-6950 Bad results with joins comparing DATE/DATETIME and INT/DECIMAL/DOUBLE/ENUM/VARCHAR columns
MDEV-6971 Bad results with joins comparing TIME and DOUBLE/DECIMAL columns Disallow using indexes on non-temporal columns to optimize ref access, range access and table elimination when the counterpart's cmp_type is TIME_RESULT, e.g.: SELECT * FROM t1 WHERE indexed_int_column=time_expression; Only index on a temporal column can be used to optimize temporal comparison operations.
This commit is contained in:
@ -4440,6 +4440,10 @@ add_key_field(JOIN *join,
|
||||
if (!eq_func) // eq_func is NEVER true when num_values > 1
|
||||
return;
|
||||
|
||||
if ((*value)->cmp_type() == TIME_RESULT &&
|
||||
field->cmp_type() != TIME_RESULT)
|
||||
return;
|
||||
|
||||
/*
|
||||
We can't use indexes when comparing a string index to a
|
||||
number or two strings if the effective collation
|
||||
|
Reference in New Issue
Block a user