mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Bug#11766594 59736: SELECT DISTINCT.. INCORRECT RESULT WITH DETERMINISTIC FUNCTION IN WHERE C
There is an optimization of DISTINCT in JOIN::optimize() which depends on THD::used_tables value. Each SELECT statement inside SP resets used_tables value(see mysql_select()) and it leads to wrong result. The fix is to replace THD::used_tables with LEX::used_tables.
This commit is contained in:
@@ -649,7 +649,6 @@ THD::THD()
|
||||
is_slave_error= thread_specific_used= FALSE;
|
||||
hash_clear(&handler_tables_hash);
|
||||
tmp_table=0;
|
||||
used_tables=0;
|
||||
cuted_fields= sent_row_count= row_count= 0L;
|
||||
limit_found_rows= 0;
|
||||
row_count_func= -1;
|
||||
|
||||
Reference in New Issue
Block a user