diff options
author | Sergei Golubchik <serg@mariadb.org> | 2015-10-08 00:32:07 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-10-08 10:01:43 +0200 |
commit | c8d511293aae155210089b6de4143d11569af18d (patch) | |
tree | 0278c7ff58e7cd08347310142bf6326e9d665a76 /sql/sql_show.cc | |
parent | 504802f333d3ba2a7385ca14f5b40a3facc72de8 (diff) | |
download | mariadb-git-c8d511293aae155210089b6de4143d11569af18d.tar.gz |
MDEV-8796 Delete with sub query with information_schema.TABLES deletes too many rows
make_cond_for_info_schema() does preserve outer fields
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r-- | sql/sql_show.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 1e27e654318..86fc11ca236 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -7730,13 +7730,14 @@ bool get_schema_tables_result(JOIN *join, TABLE_LIST *table_list= tab->table->pos_in_table_list; if (table_list->schema_table && thd->fill_information_schema_tables()) { -#if MYSQL_VERSION_ID > 100105 -#error I_S tables only need to be re-populated if make_cond_for_info_schema() will preserve outer fields - bool is_subselect= (&lex->unit != lex->current_select->master_unit() && - lex->current_select->master_unit()->item); -#else -#define is_subselect false -#endif + /* + I_S tables only need to be re-populated if make_cond_for_info_schema() + preserves outer fields + */ + bool is_subselect= &lex->unit != lex->current_select->master_unit() && + lex->current_select->master_unit()->item && + tab->select_cond && + tab->select_cond->used_tables() & OUTER_REF_TABLE_BIT; /* A value of 0 indicates a dummy implementation */ if (table_list->schema_table->fill_table == 0) |