diff options
author | timour@mysql.com <> | 2005-12-06 18:04:26 +0200 |
---|---|---|
committer | timour@mysql.com <> | 2005-12-06 18:04:26 +0200 |
commit | 6d6b617a2ef9340df81819b80db7dd1fed311b1e (patch) | |
tree | b7f446c2b01791b8e340597e85c4cd62eaf92794 /sql/item.h | |
parent | c6fc5d35ccfbfe2319d962e20d51b4b1db4a92ea (diff) | |
parent | 687b66b8daffd110e36f487e504199cd9a6ffa29 (diff) | |
download | mariadb-git-6d6b617a2ef9340df81819b80db7dd1fed311b1e.tar.gz |
Merge mysql.com:/home/timka/mysql/src/5.0-virgin
into mysql.com:/home/timka/mysql/src/5.0-2486
Diffstat (limited to 'sql/item.h')
-rw-r--r-- | sql/item.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/sql/item.h b/sql/item.h index c562e30d23d..ab9c93e207d 100644 --- a/sql/item.h +++ b/sql/item.h @@ -326,6 +326,48 @@ struct Name_resolution_context: Sql_alloc }; +/* + Store and restore the current state of a name resolution context. +*/ + +class Name_resolution_context_state +{ +private: + TABLE_LIST *save_table_list; + TABLE_LIST *save_first_name_resolution_table; + TABLE_LIST *save_next_name_resolution_table; + bool save_resolve_in_select_list; + +public: + TABLE_LIST *save_next_local; + +public: + /* Save the state of a name resolution context. */ + void save_state(Name_resolution_context *context, TABLE_LIST *table_list) + { + save_table_list= context->table_list; + save_first_name_resolution_table= context->first_name_resolution_table; + save_next_name_resolution_table= (context->first_name_resolution_table) ? + context->first_name_resolution_table-> + next_name_resolution_table : + NULL; + save_resolve_in_select_list= context->resolve_in_select_list; + save_next_local= table_list->next_local; + } + + /* Restore a name resolution context from saved state. */ + void restore_state(Name_resolution_context *context, TABLE_LIST *table_list) + { + table_list->next_local= save_next_local; + context->table_list= save_table_list; + context->first_name_resolution_table= save_first_name_resolution_table; + if (context->first_name_resolution_table) + context->first_name_resolution_table-> + next_name_resolution_table= save_next_name_resolution_table; + context->resolve_in_select_list= save_resolve_in_select_list; + } +}; + /*************************************************************************/ typedef bool (Item::*Item_processor)(byte *arg); |