#At file:///localhome/jl208045/mysql/mysql-6.0-backup-38624/
2676 Jorgen Loland 2008-08-07
Bug#38624 - Two si_objects.cc functions return 'success'
error code when error occurs.
Pre-fix:
1. DatabaseObj::do_serialize returns 'success' if
check_db_dir_existence returns 'error'
2. TriggerObj::do_serialize returns 'success' if the table the trigger is associated
with cannot be opened.
Fix:
1. Return TRUE ('error') if check_db_dir_existence fails
2. Return TRUE ('error') if open_table fails
modified:
sql/si_objects.cc
per-file comments:
sql/si_objects.cc
DatabaseObj::do_serialize and TriggerObj::do_serialize no longer
incorrectly return FALSE ('success') when errors are encountered
=== modified file 'sql/si_objects.cc'
--- a/sql/si_objects.cc 2008-07-09 07:12:43 +0000
+++ b/sql/si_objects.cc 2008-08-07 09:06:06 +0000
@@ -1607,7 +1607,7 @@ bool DatabaseObj::do_serialize(THD *thd,
if (check_db_dir_existence(m_db_name.c_ptr()))
{
my_error(ER_BAD_DB_ERROR, MYF(0), m_db_name.c_ptr());
- DBUG_RETURN(FALSE);
+ DBUG_RETURN(TRUE);
}
load_db_opt_by_name(thd, m_db_name.c_ptr(), &create);
@@ -1939,7 +1939,7 @@ bool TriggerObj::do_serialize(THD *thd,
alloc_mdl_locks(lst, thd->mem_root);
if (open_tables(thd, &lst, &num_tables, 0))
- DBUG_RETURN(FALSE);
+ DBUG_RETURN(TRUE);
DBUG_ASSERT(num_tables == 1);
Table_triggers_list *triggers= lst->table->triggers;