mirror of
https://github.com/MariaDB/server.git
synced 2026-05-03 05:35:31 +02: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:
parent
807934d083
commit
e52b1637e0
15 changed files with 505 additions and 0 deletions
|
|
@ -1486,6 +1486,8 @@ void check_equality(Dep_analysis_context *ctx, Dep_module_expr **eq_mod,
|
|||
left->real_item()->type() == Item::FIELD_ITEM)
|
||||
{
|
||||
Field *field= ((Item_field*)left->real_item())->field;
|
||||
if (right->cmp_type() == TIME_RESULT && field->cmp_type() != TIME_RESULT)
|
||||
return;
|
||||
if (field->result_type() == STRING_RESULT)
|
||||
{
|
||||
if (right->result_type() != STRING_RESULT)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue