diff options
author | unknown <guilhem@mysql.com> | 2004-08-19 10:01:01 +0200 |
---|---|---|
committer | unknown <guilhem@mysql.com> | 2004-08-19 10:01:01 +0200 |
commit | f758ada4bcfdf9b22b1603bc273b5e2a6436037b (patch) | |
tree | 26271fb112f14b2eb66e343b3d54754d8407c525 /sql/sql_table.cc | |
parent | ac866d9e948735f841b45faa3bf01df8796a4809 (diff) | |
download | mariadb-git-f758ada4bcfdf9b22b1603bc273b5e2a6436037b.tar.gz |
cosmetic change
sql/sql_class.h:
comment
sql/sql_table.cc:
smarter use of the Disable_binlog object (using a block so that when leaving it either way, the object gets
destroyed and so properties of the thread get reset).
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index c09892ac48b..96eebd98ac3 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1762,7 +1762,6 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, List_iterator<Key> key_it(keys); List_iterator<create_field> field_it(create_list); List<key_part_spec> key_parts; - Disable_binlog *disable_binlog; KEY *key_info=table->key_info; for (uint i=0 ; i < table->keys ; i++,key_info++) @@ -1925,16 +1924,17 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, } else create_info->data_file_name=create_info->index_file_name=0; - /* We don't log the statement, it will be logged later */ - disable_binlog= new Disable_binlog(thd); - if ((error=mysql_create_table(thd, new_db, tmp_name, - create_info, - create_list,key_list,1))) { - delete disable_binlog; - DBUG_RETURN(error); + /* + We don't log the statement, it will be logged later. Using a block so + that disable_binlog is deleted when we leave it in either way. + */ + Disable_binlog disable_binlog(thd); + if ((error=mysql_create_table(thd, new_db, tmp_name, + create_info, + create_list,key_list,1))) + DBUG_RETURN(error); } - delete disable_binlog; // reset binlogging properties for next code lines if (table->tmp_table) new_table=open_table(thd,new_db,tmp_name,tmp_name,0); else |