summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorAlexander Nozdrin <alik@sun.com>2010-08-27 12:39:01 +0400
committerAlexander Nozdrin <alik@sun.com>2010-08-27 12:39:01 +0400
commit4fcb173c41ea85655b78db7839af1a76503f5084 (patch)
tree682da117a39e7624ae2c69ad933cc0cf6c9349ac /sql/sql_base.cc
parent7f0386545b7c6da30c6e050ed80f33b89d14dd72 (diff)
downloadmariadb-git-4fcb173c41ea85655b78db7839af1a76503f5084.tar.gz
Bug#27480 (Extend CREATE TEMPORARY TABLES privilege
to allow temp table operations) -- prerequisite patch #1. Move a piece of code that initialiazes TABLE instance after it was successfully opened into a separate function. This function will be reused in the following patches.
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc36
1 files changed, 3 insertions, 33 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 01ab0b6dec5..c14f2f41809 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -3023,41 +3023,11 @@ retry_share:
table->reginfo.lock_type=TL_READ; /* Assume read */
reset:
- DBUG_ASSERT(table->s->ref_count > 0 || table->s->tmp_table != NO_TMP_TABLE);
-
- if (thd->lex->need_correct_ident())
- table->alias_name_used= my_strcasecmp(table_alias_charset,
- table->s->table_name.str, alias);
- /* Fix alias if table name changes */
- if (strcmp(table->alias, alias))
- {
- uint length=(uint) strlen(alias)+1;
- table->alias= (char*) my_realloc((char*) table->alias, length,
- MYF(MY_WME));
- memcpy((char*) table->alias, alias, length);
- }
- table->tablenr=thd->current_tablenr++;
- table->used_fields=0;
- table->const_table=0;
- table->null_row= table->maybe_null= 0;
- table->force_index= table->force_index_order= table->force_index_group= 0;
- table->status=STATUS_NO_RECORD;
- table->insert_values= 0;
- table->fulltext_searched= 0;
- table->file->ft_handler= 0;
- table->reginfo.impossible_range= 0;
- /* Catch wrong handling of the auto_increment_field_not_null. */
- DBUG_ASSERT(!table->auto_increment_field_not_null);
- table->auto_increment_field_not_null= FALSE;
- if (table->timestamp_field)
- table->timestamp_field_type= table->timestamp_field->get_auto_set_type();
- table->pos_in_table_list= table_list;
table_list->updatable= 1; // It is not derived table nor non-updatable VIEW
- table->clear_column_bitmaps();
table_list->table= table;
- DBUG_ASSERT(table->key_read == 0);
- /* Tables may be reused in a sub statement. */
- DBUG_ASSERT(! table->file->extra(HA_EXTRA_IS_ATTACHED_CHILDREN));
+
+ table->init(thd, table_list);
+
DBUG_RETURN(FALSE);
err_lock: