summaryrefslogtreecommitdiff
path: root/sql/table.h
diff options
context:
space:
mode:
authorgluh@mysql.com/eagle.(none) <>2007-02-12 16:06:14 +0400
committergluh@mysql.com/eagle.(none) <>2007-02-12 16:06:14 +0400
commit47e537b47c81eeda96633c4693a4befce7a43a9d (patch)
tree56268dc0683afe8350e827428cb1e5ed709d579b /sql/table.h
parent0583c7c524c0d9b0c63eb86b9767edf597805b5e (diff)
downloadmariadb-git-47e537b47c81eeda96633c4693a4befce7a43a9d.tar.gz
Bug#24630 Subselect query crashes mysqld
The crash happens because second filling of the same I_S table happens in case of subselect with order by. table->sort.io_cache previously allocated in create_sort_index() is deleted during second filling (function get_schema_tables_result). There are two places where I_S table can be filled: JOIN::exec and create_sort_index(). To fix the bug we should check if the table was already filled in one of these places and skip processing of the table in second.
Diffstat (limited to 'sql/table.h')
-rw-r--r--sql/table.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/table.h b/sql/table.h
index 70e64439af5..8f013f3de19 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -287,6 +287,12 @@ struct st_table {
void reset_item_list(List<Item> *item_list) const;
};
+enum enum_schema_table_state
+{
+ NOT_PROCESSED= 0,
+ PROCESSED_BY_CREATE_SORT_INDEX,
+ PROCESSED_BY_JOIN_EXEC
+};
typedef struct st_foreign_key_info
{
@@ -529,7 +535,6 @@ typedef struct st_table_list
st_select_lex_unit *derived; /* SELECT_LEX_UNIT of derived table */
ST_SCHEMA_TABLE *schema_table; /* Information_schema table */
st_select_lex *schema_select_lex;
- bool is_schema_table_processed;
/*
True when the view field translation table is used to convert
schema table fields for backwards compatibility with SHOW command.
@@ -638,6 +643,7 @@ typedef struct st_table_list
*/
bool prelocking_placeholder;
+ enum enum_schema_table_state schema_table_state;
void calc_md5(char *buffer);
void set_underlying_merge();
int view_check_option(THD *thd, bool ignore_failure);