diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-07-21 16:43:42 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-07-21 16:43:42 +0200 |
commit | d1fdb17bfb774e4e29c8a337b497128fd01a3473 (patch) | |
tree | 3965911387619c3b17e933bb3863651b4ad94990 | |
parent | b7b5f6f1ab49948b0e15b762266d4640b3d6b7fb (diff) | |
download | mariadb-git-d1fdb17bfb774e4e29c8a337b497128fd01a3473.tar.gz |
cosmetic fixes
-rw-r--r-- | sql/ha_partition.cc | 2 | ||||
-rw-r--r-- | sql/log_event.cc | 2 | ||||
-rw-r--r-- | sql/sp_head.cc | 4 | ||||
-rw-r--r-- | sql/sql_class.cc | 2 | ||||
-rw-r--r-- | sql/sql_insert.cc | 6 | ||||
-rw-r--r-- | sql/sql_parse.cc | 13 | ||||
-rw-r--r-- | sql/sql_prepare.cc | 2 | ||||
-rw-r--r-- | sql/sql_table.cc | 37 | ||||
-rw-r--r-- | sql/table.cc | 2 | ||||
-rw-r--r-- | storage/maria/ha_maria.cc | 2 | ||||
-rw-r--r-- | storage/myisam/ha_myisam.cc | 2 |
11 files changed, 36 insertions, 38 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index a5acd5759aa..4644863933b 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -678,7 +678,7 @@ int ha_partition::create(const char *name, TABLE *table_arg, DBUG_ASSERT(*fn_rext((char*)name) == '\0'); /* Not allowed to create temporary partitioned tables */ - if (create_info && create_info->options & HA_LEX_CREATE_TMP_TABLE) + if (create_info && create_info->tmp_table()) { my_error(ER_PARTITION_NO_TEMPORARY, MYF(0)); DBUG_RETURN(TRUE); diff --git a/sql/log_event.cc b/sql/log_event.cc index 01a5dd7f4e3..b1fe6a8cf64 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -3015,7 +3015,7 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg, case SQLCOM_CREATE_TABLE: trx_cache= (lex->select_lex.item_list.elements && thd->is_current_stmt_binlog_format_row()); - use_cache= ((lex->create_info.options & HA_LEX_CREATE_TMP_TABLE) && + use_cache= (lex->create_info.tmp_table() && thd->in_multi_stmt_transaction_mode()) || trx_cache; break; case SQLCOM_SET_OPTION: diff --git a/sql/sp_head.cc b/sql/sp_head.cc index cb689735925..510bce21093 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -260,7 +260,7 @@ sp_get_flags_for_command(LEX *lex) flags= sp_head::CONTAINS_DYNAMIC_SQL; break; case SQLCOM_CREATE_TABLE: - if (lex->create_info.options & HA_LEX_CREATE_TMP_TABLE) + if (lex->create_info.tmp_table()) flags= 0; else flags= sp_head::HAS_COMMIT_OR_ROLLBACK; @@ -4056,7 +4056,7 @@ sp_head::merge_table_list(THD *thd, TABLE_LIST *table, LEX *lex_for_tmp_check) return FALSE; if (lex_for_tmp_check->sql_command == SQLCOM_CREATE_TABLE && lex_for_tmp_check->query_tables == table && - lex_for_tmp_check->create_info.options & HA_LEX_CREATE_TMP_TABLE) + lex_for_tmp_check->create_info.tmp_table()) { tab->temp= TRUE; tab->qname.length= temp_table_key_length; diff --git a/sql/sql_class.cc b/sql/sql_class.cc index c9f07c4d036..c38beb8e122 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -5056,7 +5056,7 @@ int THD::decide_logging_format(TABLE_LIST *tables) if (lex->sql_command != SQLCOM_CREATE_TABLE || (lex->sql_command == SQLCOM_CREATE_TABLE && - (lex->create_info.options & HA_LEX_CREATE_TMP_TABLE))) + lex->create_info.tmp_table())) { my_bool trans= table->table->file->has_transactions(); diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index b5178f865d1..0be22d17557 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -3895,7 +3895,7 @@ static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info, { DEBUG_SYNC(thd,"create_table_select_before_open"); - if (!(create_info->options & HA_LEX_CREATE_TMP_TABLE)) + if (!create_info->tmp_table()) { Open_table_context ot_ctx(thd, MYSQL_OPEN_REOPEN); /* @@ -4040,7 +4040,7 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u) row-based replication for the statement. If we are creating a temporary table, we need to start a statement transaction. */ - if ((thd->lex->create_info.options & HA_LEX_CREATE_TMP_TABLE) == 0 && + if (!thd->lex->create_info.tmp_table() && thd->is_current_stmt_binlog_format_row() && mysql_bin_log.is_open()) { @@ -4061,7 +4061,7 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u) { DBUG_ASSERT(m_plock == NULL); - if (create_info->options & HA_LEX_CREATE_TMP_TABLE) + if (create_info->tmp_table()) m_plock= &m_lock; else m_plock= &thd->extra_lock; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 7d057f4e91a..0c51810d4d3 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -211,7 +211,7 @@ static bool stmt_causes_implicit_commit(THD *thd, uint mask) case SQLCOM_ALTER_TABLE: case SQLCOM_CREATE_TABLE: /* If CREATE TABLE of non-temporary table, do implicit commit */ - skip= (lex->create_info.options & HA_LEX_CREATE_TMP_TABLE); + skip= lex->create_info.tmp_table(); break; case SQLCOM_SET_OPTION: skip= lex->autocommit ? FALSE : TRUE; @@ -1029,7 +1029,7 @@ static my_bool deny_updates_if_read_only_option(THD *thd, const my_bool create_temp_tables= (lex->sql_command == SQLCOM_CREATE_TABLE) && - (lex->create_info.options & HA_LEX_CREATE_TMP_TABLE); + lex->create_info.tmp_table(); const my_bool drop_temp_tables= (lex->sql_command == SQLCOM_DROP_TABLE) && @@ -2927,7 +2927,7 @@ case SQLCOM_PREPARE: lex->unlink_first_table(&link_to_local); /* So that CREATE TEMPORARY TABLE gets to binlog at commit/rollback */ - if (create_info.options & HA_LEX_CREATE_TMP_TABLE) + if (create_info.tmp_table()) thd->variables.option_bits|= OPTION_KEEP_LOG; /* @@ -2956,7 +2956,7 @@ case SQLCOM_PREPARE: else { /* So that CREATE TEMPORARY TABLE gets to binlog at commit/rollback */ - if (create_info.options & HA_LEX_CREATE_TMP_TABLE) + if (create_info.tmp_table()) thd->variables.option_bits|= OPTION_KEEP_LOG; /* regular create */ if (create_info.options & HA_LEX_CREATE_TABLE_LIKE) @@ -7771,7 +7771,7 @@ void create_table_set_open_action_and_adjust_tables(LEX *lex) { TABLE_LIST *create_table= lex->query_tables; - if (lex->create_info.options & HA_LEX_CREATE_TMP_TABLE) + if (lex->create_info.tmp_table()) create_table->open_type= OT_TEMPORARY_ONLY; else create_table->open_type= OT_BASE_ONLY; @@ -7817,8 +7817,7 @@ bool create_table_precheck(THD *thd, TABLE_LIST *tables, CREATE TABLE ... SELECT, also require INSERT. */ - want_priv= (lex->create_info.options & HA_LEX_CREATE_TMP_TABLE) ? - CREATE_TMP_ACL : + want_priv= lex->create_info.tmp_table() ? CREATE_TMP_ACL : (CREATE_ACL | (select_lex->item_list.elements ? INSERT_ACL : 0)); if (check_access(thd, want_priv, create_table->db, diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 120cfc3e350..4465da6eeac 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1773,7 +1773,7 @@ static bool mysql_test_create_table(Prepared_statement *stmt) if (select_lex->item_list.elements) { /* Base table and temporary table are not in the same name space. */ - if (!(lex->create_info.options & HA_LEX_CREATE_TMP_TABLE)) + if (!lex->create_info.tmp_table()) create_table->open_type= OT_BASE_ONLY; if (open_normal_and_derived_tables(stmt->thd, lex->query_tables, diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 79c6d4cbaf9..ca5e71f6ea8 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -7834,9 +7834,11 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, handle_if_exists_options(thd, table, alter_info); - /* Look if we have to do anything at all. */ - /* Normally ALTER can become NOOP only after handling */ - /* the IF (NOT) EXISTS options. */ + /* + Look if we have to do anything at all. + Normally ALTER can become NOOP only after handling + the IF (NOT) EXISTS options. + */ if (alter_info->flags == 0) { my_snprintf(alter_ctx.tmp_name, sizeof(alter_ctx.tmp_name), @@ -8238,26 +8240,23 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, if (lock_tables(thd, table_list, alter_ctx.tables_opened, 0)) goto err_new_table_cleanup; - { - if (ha_create_table(thd, alter_ctx.get_tmp_path(), - alter_ctx.new_db, alter_ctx.tmp_name, - create_info, &frm)) - goto err_new_table_cleanup; + if (ha_create_table(thd, alter_ctx.get_tmp_path(), + alter_ctx.new_db, alter_ctx.tmp_name, + create_info, &frm)) + goto err_new_table_cleanup; - /* Mark that we have created table in storage engine. */ - no_ha_table= false; + /* Mark that we have created table in storage engine. */ + no_ha_table= false; - if (create_info->tmp_table()) - { - if (!open_table_uncached(thd, new_db_type, - alter_ctx.get_tmp_path(), - alter_ctx.new_db, alter_ctx.tmp_name, - true, true)) - goto err_new_table_cleanup; - } + if (create_info->tmp_table()) + { + if (!open_table_uncached(thd, new_db_type, + alter_ctx.get_tmp_path(), + alter_ctx.new_db, alter_ctx.tmp_name, + true, true)) + goto err_new_table_cleanup; } - /* Open the table since we need to copy the data. */ if (table->s->tmp_table != NO_TMP_TABLE) { diff --git a/sql/table.cc b/sql/table.cc index 266749d98a2..4aa09e87dc9 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2029,7 +2029,7 @@ static bool sql_unusable_for_discovery(THD *thd, const char *sql) if (lex->select_lex.item_list.elements) return 1; // ... temporary - if (create_info->options & HA_LEX_CREATE_TMP_TABLE) + if (create_info->tmp_table()) return 1; // ... if exists if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS) diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index 946051d8a2a..551dc8a2dde 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -3051,7 +3051,7 @@ int ha_maria::create(const char *name, register TABLE *table_arg, create_info.transactional= (row_type == BLOCK_RECORD && ha_create_info->transactional != HA_CHOICE_NO); - if (ha_create_info->options & HA_LEX_CREATE_TMP_TABLE) + if (ha_create_info->tmp_table()) { create_flags|= HA_CREATE_TMP_TABLE; create_info.transactional= 0; diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index 3c69bb65d53..9b3fcc8af11 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -2000,7 +2000,7 @@ int ha_myisam::create(const char *name, register TABLE *table_arg, create_info.index_file_name= ha_create_info->index_file_name; create_info.language= share->table_charset->number; - if (ha_create_info->options & HA_LEX_CREATE_TMP_TABLE) + if (ha_create_info->tmp_table()) create_flags|= HA_CREATE_TMP_TABLE; if (ha_create_info->options & HA_CREATE_KEEP_FILES) create_flags|= HA_CREATE_KEEP_FILES; |