diff options
author | mikef@nslinux.bedford.progress.com <> | 2001-03-21 15:34:16 -0500 |
---|---|---|
committer | mikef@nslinux.bedford.progress.com <> | 2001-03-21 15:34:16 -0500 |
commit | d145a6b97e3306abf6ed36725748f255dcfa4ba5 (patch) | |
tree | 5306fccfc0c0c42aabf0e2dd6bf883cdecc3ed03 /sql/sql_rename.cc | |
parent | 3c48448042457edca9c7559d9a6bed24485ddc86 (diff) | |
download | mariadb-git-d145a6b97e3306abf6ed36725748f255dcfa4ba5.tar.gz |
Add support for Gemini table handler, Monty has checked and approved
Fix bug when read return error
Diffstat (limited to 'sql/sql_rename.cc')
-rw-r--r-- | sql/sql_rename.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc index c3acbac1bd2..0f6e2f9fbf3 100644 --- a/sql/sql_rename.cc +++ b/sql/sql_rename.cc @@ -31,7 +31,7 @@ static TABLE_LIST *rename_tables(THD *thd, TABLE_LIST *table_list, bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list) { - bool error=1,got_all_locks=1; + bool error=1,cerror,got_all_locks=1; TABLE_LIST *lock_table,*ren_table=0; DBUG_ENTER("mysql_rename_tables"); @@ -85,7 +85,14 @@ end: rename_tables(thd, table, 1); /* Note that lock_table == 0 here, so the unlock loop will work */ } - if (!error) + + /* Lets hope this doesn't fail as the result will be messy */ + if ((cerror=ha_commit_rename(thd))) + { + my_error(ER_GET_ERRNO,MYF(0),cerror); + error= 1; + } + else if (!error) { mysql_update_log.write(thd,thd->query,thd->query_length); if (mysql_bin_log.is_open()) @@ -95,6 +102,7 @@ end: } send_ok(&thd->net); } + for (TABLE_LIST *table=table_list ; table != lock_table ; table=table->next) unlock_table_name(thd,table); pthread_cond_broadcast(&COND_refresh); |