diff options
author | dlenev@mysql.com <> | 2006-03-24 14:58:18 +0300 |
---|---|---|
committer | dlenev@mysql.com <> | 2006-03-24 14:58:18 +0300 |
commit | 891e9424f208b5b6a7464f84b399a8fc9def9472 (patch) | |
tree | 77e94372a9a9d94c408d2d5169ea1dd691186fcc /sql/sql_trigger.cc | |
parent | cab060d2e2fc6de1f64e331d4d9d53c64697beb0 (diff) | |
download | mariadb-git-891e9424f208b5b6a7464f84b399a8fc9def9472.tar.gz |
Fix for bug #18153 "ALTER/OPTIMIZE/REPAIR on transactional tables corrupt
triggers".
Applying ALTER/OPTIMIZE/REPAIR TABLE statements to transactional table or to
table of any type on Windows caused disappearance of its triggers.
Bug was introduced in 5.0.19 by my fix for bug #13525 "Rename table does not
keep info of triggers" (see comment for sql_table.cc for more info).
.
Diffstat (limited to 'sql/sql_trigger.cc')
-rw-r--r-- | sql/sql_trigger.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index b432961b7e6..41573324082 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -1373,6 +1373,7 @@ Table_triggers_list::change_table_name_in_trignames(const char *db_name, This method tries to leave trigger related files in consistent state, i.e. it either will complete successfully, or will fail leaving files in their initial state. + Also this method assumes that subject table is not renamed to itself. RETURN VALUE FALSE Success @@ -1394,6 +1395,9 @@ bool Table_triggers_list::change_table_name(THD *thd, const char *db, safe_mutex_assert_owner(&LOCK_open); + DBUG_ASSERT(my_strcasecmp(table_alias_charset, db, new_db) || + my_strcasecmp(table_alias_charset, old_table, new_table)); + if (Table_triggers_list::check_n_load(thd, db, old_table, &table, TRUE)) { result= 1; |