Below is the list of changes that have just been committed into a local
6.0 repository of davi. When davi does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2008-03-28 12:14:20-03:00, davi@stripped +21 -0
Bug#15192 "fatal errors" are caught by handlers in stored procedures
The problem is that fatal errors (e.g.: out of memory) were being
caught by stored procedure exception handlers which could cause
the execution to not be stopped due to a continue handler.
The solution is to not call any exception handler if the error is
fatal and send the fatal error to the client.
include/my_sys.h@stripped, 2008-03-28 12:14:13-03:00, davi@stripped +1 -0
Introduce ME_FATALERROR flag to signal that a error is fatal.
mysql-test/r/sp-error.result@stripped, 2008-03-28 12:14:14-03:00, davi@stripped +11 -0
Add test case result for Bug#15192
mysql-test/t/sp-error.test@stripped, 2008-03-28 12:14:14-03:00, davi@stripped +21 -0
Add test case for Bug#15192
sql/event_data_objects.cc@stripped, 2008-03-28 12:14:14-03:00, davi@stripped +1 -1
Use init_sql_alloc to initialize memory roots, which uses
the sql error handler to push errors.
sql/ha_partition.cc@stripped, 2008-03-28 12:14:14-03:00, davi@stripped +1 -2
Pass flag to signal fatal error instead of calling fatal_error.
sql/item_func.cc@stripped, 2008-03-28 12:14:14-03:00, davi@stripped +9 -14
Pass flag to signal fatal error instead of calling fatal_error.
sql/item_subselect.cc@stripped, 2008-03-28 12:14:14-03:00, davi@stripped +1 -6
Remove redundant fatal error, memory root already pushes error.
sql/mysqld.cc@stripped, 2008-03-28 12:14:14-03:00, davi@stripped +5 -2
Don't call stored procedure error handlers if the error
is fatal. The THD handler is allowed to catch the error
because it might be silencing any kind of error.
sql/opt_sum.cc@stripped, 2008-03-28 12:14:15-03:00, davi@stripped +2 -4
Pass flag to signal fatal error instead of calling fatal_error.
sql/sp_head.cc@stripped, 2008-03-28 12:14:15-03:00, davi@stripped +2 -1
Stop executing stored procedure if a fatal error was signaled.
sql/sql_class.h@stripped, 2008-03-28 12:14:15-03:00, davi@stripped +5 -1
A error must exist for it to be fatal. Pass flag to signal fatal
error instead of calling fatal_error.
sql/sql_insert.cc@stripped, 2008-03-28 12:14:15-03:00, davi@stripped +3 -9
Pass flag to signal fatal error instead of calling fatal_error.
sql/sql_list.h@stripped, 2008-03-28 12:14:15-03:00, davi@stripped +1 -1
Pass flag to signal fatal error instead of calling fatal_error.
sql/sql_parse.cc@stripped, 2008-03-28 12:14:15-03:00, davi@stripped +1 -2
Pass flag to signal fatal error instead of calling fatal_error.
sql/sql_partition.cc@stripped, 2008-03-28 12:14:15-03:00, davi@stripped +2 -6
Pass flag to signal fatal error instead of calling fatal_error.
sql/sql_select.cc@stripped, 2008-03-28 12:14:16-03:00, davi@stripped +2 -3
Pass flag to signal fatal error instead of calling fatal_error.
sql/sql_servers.cc@stripped, 2008-03-28 12:14:16-03:00, davi@stripped +2 -2
Use init_sql_alloc to initialize memory roots, which uses
the sql error handler to push errors.
sql/sql_show.cc@stripped, 2008-03-28 12:14:16-03:00, davi@stripped +1 -2
Pass flag to signal fatal error instead of calling fatal_error.
sql/sql_trigger.cc@stripped, 2008-03-28 12:14:16-03:00, davi@stripped +2 -2
Use init_sql_alloc to initialize memory roots, which uses
the sql error handler to push errors.
sql/sql_update.cc@stripped, 2008-03-28 12:14:16-03:00, davi@stripped +10 -8
Pass flag to signal fatal error instead of calling fatal_error.
sql/tztime.cc@stripped, 2008-03-28 12:14:16-03:00, davi@stripped +1 -1
Use init_sql_alloc to initialize memory roots, which uses
the sql error handler to push errors.
diff -Nrup a/include/my_sys.h b/include/my_sys.h
--- a/include/my_sys.h 2008-02-27 07:03:14 -03:00
+++ b/include/my_sys.h 2008-03-28 12:14:13 -03:00
@@ -89,6 +89,7 @@ extern int NEAR my_errno; /* Last error
#define ME_COLOUR1 ((1 << ME_HIGHBYTE)) /* Possibly error-colours */
#define ME_COLOUR2 ((2 << ME_HIGHBYTE))
#define ME_COLOUR3 ((3 << ME_HIGHBYTE))
+#define ME_FATALERROR 1024 /* Fatal statement error */
/* Bits in last argument to fn_format */
#define MY_REPLACE_DIR 1 /* replace dir in name with 'dir' */
diff -Nrup a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result
--- a/mysql-test/r/sp-error.result 2008-02-19 11:08:25 -03:00
+++ b/mysql-test/r/sp-error.result 2008-03-28 12:14:14 -03:00
@@ -1611,3 +1611,14 @@ end loop label1;
end loop;
end|
ERROR 42000: End-label label1 without match
+drop procedure if exists p1;
+set @old_recursion_depth = @@max_sp_recursion_depth;
+set @@max_sp_recursion_depth = 255;
+create procedure p1(a int)
+begin
+declare continue handler for sqlexception select 'exception';
+call p1(a+1);
+end|
+call p1(1);
+set @@max_sp_recursion_depth = @old_recursion_depth;
+drop procedure p1;
diff -Nrup a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test
--- a/mysql-test/t/sp-error.test 2008-02-19 11:08:36 -03:00
+++ b/mysql-test/t/sp-error.test 2008-03-28 12:14:14 -03:00
@@ -2372,6 +2372,27 @@ delimiter ;|
#drop procedure p1;
#
+# Bug#15192: "fatal errors" are caught by handlers in stored procedures
+#
+
+--disable_warnings
+drop procedure if exists p1;
+--enable_warnings
+set @old_recursion_depth = @@max_sp_recursion_depth;
+set @@max_sp_recursion_depth = 255;
+delimiter |;
+create procedure p1(a int)
+begin
+ declare continue handler for sqlexception select 'exception';
+ call p1(a+1);
+end|
+delimiter ;|
+--error 0,ER_STACK_OVERRUN_NEED_MORE
+call p1(1);
+set @@max_sp_recursion_depth = @old_recursion_depth;
+drop procedure p1;
+
+#
# BUG#NNNN: New bug synopsis
#
#--disable_warnings
diff -Nrup a/sql/event_data_objects.cc b/sql/event_data_objects.cc
--- a/sql/event_data_objects.cc 2007-12-07 22:27:36 -02:00
+++ b/sql/event_data_objects.cc 2008-03-28 12:14:14 -03:00
@@ -716,7 +716,7 @@ Event_basic::Event_basic()
{
DBUG_ENTER("Event_basic::Event_basic");
/* init memory root */
- init_alloc_root(&mem_root, 256, 512);
+ init_sql_alloc(&mem_root, 256, 512);
dbname.str= name.str= NULL;
dbname.length= name.length= 0;
time_zone= NULL;
diff -Nrup a/sql/ha_partition.cc b/sql/ha_partition.cc
--- a/sql/ha_partition.cc 2008-03-27 15:58:37 -03:00
+++ b/sql/ha_partition.cc 2008-03-28 12:14:14 -03:00
@@ -1807,8 +1807,7 @@ partition_element *ha_partition::find_pa
return part_elem;
}
DBUG_ASSERT(0);
- my_error(ER_OUT_OF_RESOURCES, MYF(0));
- current_thd->fatal_error(); // Abort
+ my_error(ER_OUT_OF_RESOURCES, MYF(ME_FATALERROR));
return NULL;
}
diff -Nrup a/sql/item_func.cc b/sql/item_func.cc
--- a/sql/item_func.cc 2008-03-28 09:37:11 -03:00
+++ b/sql/item_func.cc 2008-03-28 12:14:14 -03:00
@@ -3836,7 +3836,7 @@ static user_var_entry *get_variable(HASH
uint size=ALIGN_SIZE(sizeof(user_var_entry))+name.length+1+extra_size;
if (!hash_inited(hash))
return 0;
- if (!(entry = (user_var_entry*) my_malloc(size,MYF(MY_WME))))
+ if (!(entry = (user_var_entry*) my_malloc(size,MYF(MY_WME | ME_FATALERROR))))
return 0;
entry->name.str=(char*) entry+ ALIGN_SIZE(sizeof(user_var_entry))+
extra_size;
@@ -3952,6 +3952,8 @@ bool Item_func_set_user_var::register_fi
@param dv derivation for new value
@param unsigned_arg indiates if a value of type INT_RESULT is unsigned
+ @note Sets error and fatal error if allocation fails.
+
@retval
false success
@retval
@@ -3995,7 +3997,8 @@ update_hash(user_var_entry *entry, bool
if (entry->value == pos)
entry->value=0;
entry->value= (char*) my_realloc(entry->value, length,
- MYF(MY_ALLOW_ZERO_PTR | MY_WME));
+ MYF(MY_ALLOW_ZERO_PTR | MY_WME |
+ ME_FATALERROR));
if (!entry->value)
return 1;
}
@@ -4032,7 +4035,6 @@ Item_func_set_user_var::update_hash(void
if (::update_hash(entry, (null_value= args[0]->null_value),
ptr, length, res_type, cs, dv, unsigned_arg))
{
- current_thd->fatal_error(); // Probably end of memory
null_value= 1;
return 1;
}
@@ -4722,11 +4724,6 @@ void Item_func_get_user_var::fix_length_
m_cached_result_type= STRING_RESULT;
max_length= MAX_BLOB_WIDTH;
}
-
- if (error)
- thd->fatal_error();
-
- return;
}
@@ -4797,18 +4794,16 @@ bool Item_user_var_as_out_param::fix_fie
void Item_user_var_as_out_param::set_null_value(CHARSET_INFO* cs)
{
- if (::update_hash(entry, TRUE, 0, 0, STRING_RESULT, cs,
- DERIVATION_IMPLICIT, 0 /* unsigned_arg */))
- current_thd->fatal_error(); // Probably end of memory
+ ::update_hash(entry, TRUE, 0, 0, STRING_RESULT, cs,
+ DERIVATION_IMPLICIT, 0 /* unsigned_arg */);
}
void Item_user_var_as_out_param::set_value(const char *str, uint length,
CHARSET_INFO* cs)
{
- if (::update_hash(entry, FALSE, (void*)str, length, STRING_RESULT, cs,
- DERIVATION_IMPLICIT, 0 /* unsigned_arg */))
- current_thd->fatal_error(); // Probably end of memory
+ ::update_hash(entry, FALSE, (void*)str, length, STRING_RESULT, cs,
+ DERIVATION_IMPLICIT, 0 /* unsigned_arg */);
}
diff -Nrup a/sql/item_subselect.cc b/sql/item_subselect.cc
--- a/sql/item_subselect.cc 2008-03-12 05:25:22 -03:00
+++ b/sql/item_subselect.cc 2008-03-28 12:14:14 -03:00
@@ -2005,8 +2005,6 @@ subselect_union_engine::subselect_union_
:subselect_engine(item_arg, result_arg)
{
unit= u;
- if (!result_arg) //out of memory
- current_thd->fatal_error();
unit->item= item_arg;
}
@@ -2044,10 +2042,7 @@ int subselect_single_select_engine::prep
join= new JOIN(thd, select_lex->item_list,
select_lex->options | SELECT_NO_UNLOCK, result);
if (!join || !result)
- {
- thd->fatal_error(); //out of memory
- return 1;
- }
+ return 1; /* Fatal error is set already. */
prepared= 1;
SELECT_LEX *save_select= thd->lex->current_select;
thd->lex->current_select= select_lex;
diff -Nrup a/sql/mysqld.cc b/sql/mysqld.cc
--- a/sql/mysqld.cc 2008-03-27 15:58:38 -03:00
+++ b/sql/mysqld.cc 2008-03-28 12:14:14 -03:00
@@ -2919,6 +2919,9 @@ int my_message_sql(uint error, const cha
*/
if ((thd= current_thd))
{
+ if (MyFlags & ME_FATALERROR)
+ thd->is_fatal_error= 1;
+
mysql_audit_general(thd,MYSQL_AUDIT_GENERAL_ERROR,error,my_time(0),
0,0,str,str ? strlen(str) : 0,
thd->query,thd->query_length,
@@ -2966,7 +2969,7 @@ int my_message_sql(uint error, const cha
If a continue handler is found, the error message will be cleared
by the stored procedures code.
*/
- if (thd->spcont &&
+ if (!thd->is_fatal_error && thd->spcont &&
thd->spcont->handle_error(error, MYSQL_ERROR::WARN_LEVEL_ERROR, thd))
{
/*
@@ -2976,7 +2979,7 @@ int my_message_sql(uint error, const cha
DBUG_RETURN(0);
}
- if (!thd->no_warnings_for_error)
+ if (!thd->no_warnings_for_error && !thd->is_fatal_error)
{
/*
Suppress infinite recursion if there a memory allocation error
diff -Nrup a/sql/opt_sum.cc b/sql/opt_sum.cc
--- a/sql/opt_sum.cc 2007-12-21 17:27:44 -02:00
+++ b/sql/opt_sum.cc 2008-03-28 12:14:15 -03:00
@@ -174,8 +174,7 @@ int opt_sum_query(TABLE_LIST *tables, Li
error= tl->table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK);
if(error)
{
- tl->table->file->print_error(error, MYF(0));
- tl->table->in_use->fatal_error();
+ tl->table->file->print_error(error, MYF(ME_FATALERROR));
return error;
}
count*= tl->table->file->stats.records;
@@ -423,8 +422,7 @@ int opt_sum_query(TABLE_LIST *tables, Li
if (error == HA_ERR_KEY_NOT_FOUND || error == HA_ERR_END_OF_FILE)
return HA_ERR_KEY_NOT_FOUND; // No rows matching WHERE
/* HA_ERR_LOCK_DEADLOCK or some other error */
- table->file->print_error(error, MYF(0));
- table->in_use->fatal_error();
+ table->file->print_error(error, MYF(ME_FATALERROR));
return(error);
}
removed_tables|= table->map;
diff -Nrup a/sql/sp_head.cc b/sql/sp_head.cc
--- a/sql/sp_head.cc 2008-03-27 08:26:12 -03:00
+++ b/sql/sp_head.cc 2008-03-28 12:14:15 -03:00
@@ -1262,7 +1262,7 @@ sp_head::execute(THD *thd)
continue;
}
}
- } while (!err_status && !thd->killed);
+ } while (!err_status && !thd->killed && !thd->is_fatal_error);
#if defined(ENABLED_PROFILING)
thd->profiling.finish_current_query();
@@ -3943,6 +3943,7 @@ sp_add_to_query_tables(THD *thd, LEX *le
if (!(table= (TABLE_LIST *)thd->calloc(sizeof(TABLE_LIST))))
{
+ /* Out of memory error was set. */
thd->fatal_error();
return NULL;
}
diff -Nrup a/sql/sql_class.h b/sql/sql_class.h
--- a/sql/sql_class.h 2008-03-28 09:37:11 -03:00
+++ b/sql/sql_class.h 2008-03-28 12:14:15 -03:00
@@ -1983,6 +1983,7 @@ public:
*/
inline void fatal_error()
{
+ DBUG_ASSERT(main_da.is_error());
is_fatal_error= 1;
DBUG_PRINT("error",("Fatal error set"));
}
@@ -2140,7 +2141,10 @@ public:
else
{
x_free(db);
- db= new_db ? my_strndup(new_db, new_db_len, MYF(MY_WME)) : NULL;
+ if (new_db)
+ db= my_strndup(new_db, new_db_len, MYF(MY_WME | ME_FATALERROR));
+ else
+ db= NULL;
}
db_length= db ? new_db_len : 0;
return new_db && !db;
diff -Nrup a/sql/sql_insert.cc b/sql/sql_insert.cc
--- a/sql/sql_insert.cc 2008-03-27 15:58:39 -03:00
+++ b/sql/sql_insert.cc 2008-03-28 12:14:15 -03:00
@@ -1871,20 +1871,16 @@ bool delayed_get_table(THD *thd, TABLE_L
if (! (di= find_handler(thd, table_list)))
{
if (!(di= new Delayed_insert()))
- {
- thd->fatal_error();
goto end_create;
- }
pthread_mutex_lock(&LOCK_thread_count);
thread_count++;
pthread_mutex_unlock(&LOCK_thread_count);
di->thd.set_db(table_list->db, strlen(table_list->db));
- di->thd.query= my_strdup(table_list->table_name, MYF(MY_WME));
+ di->thd.query= my_strdup(table_list->table_name, MYF(MY_WME | ME_FATALERROR));
if (di->thd.db == NULL || di->thd.query == NULL)
{
/* The error is reported */
delete di;
- thd->fatal_error();
goto end_create;
}
di->table_list= *table_list; // Needed to open table
@@ -1902,8 +1898,7 @@ bool delayed_get_table(THD *thd, TABLE_L
pthread_mutex_unlock(&di->mutex);
di->unlock();
delete di;
- my_error(ER_CANT_CREATE_THREAD, MYF(0), error);
- thd->fatal_error();
+ my_error(ER_CANT_CREATE_THREAD, MYF(ME_FATALERROR), error);
goto end_create;
}
@@ -2302,8 +2297,7 @@ pthread_handler_t handle_delayed_insert(
}
if (!(di->table->file->ha_table_flags() & HA_CAN_INSERT_DELAYED))
{
- thd->fatal_error();
- my_error(ER_ILLEGAL_HA, MYF(0), di->table_list.table_name);
+ my_error(ER_ILLEGAL_HA, MYF(ME_FATALERROR), di->table_list.table_name);
goto err;
}
if (di->table->triggers)
diff -Nrup a/sql/sql_list.h b/sql/sql_list.h
--- a/sql/sql_list.h 2007-06-01 04:43:54 -03:00
+++ b/sql/sql_list.h 2008-03-28 12:14:15 -03:00
@@ -452,7 +452,7 @@ struct ilink
struct ilink **prev,*next;
static void *operator new(size_t size)
{
- return (void*)my_malloc((uint)size, MYF(MY_WME | MY_FAE));
+ return (void*)my_malloc((uint)size, MYF(MY_WME | MY_FAE | ME_FATALERROR));
}
static void operator delete(void* ptr_arg, size_t size)
{
diff -Nrup a/sql/sql_parse.cc b/sql/sql_parse.cc
--- a/sql/sql_parse.cc 2008-03-27 15:58:39 -03:00
+++ b/sql/sql_parse.cc 2008-03-28 12:14:15 -03:00
@@ -5409,8 +5409,7 @@ bool check_stack_overrun(THD *thd, long
{
sprintf(errbuff[0],ER(ER_STACK_OVERRUN_NEED_MORE),
stack_used,thread_stack,margin);
- my_message(ER_STACK_OVERRUN_NEED_MORE,errbuff[0],MYF(0));
- thd->fatal_error();
+ my_message(ER_STACK_OVERRUN_NEED_MORE,errbuff[0],MYF(ME_FATALERROR));
return 1;
}
#ifndef DBUG_OFF
diff -Nrup a/sql/sql_partition.cc b/sql/sql_partition.cc
--- a/sql/sql_partition.cc 2008-03-27 15:58:39 -03:00
+++ b/sql/sql_partition.cc 2008-03-28 12:14:15 -03:00
@@ -2070,8 +2070,7 @@ char *generate_partition_syntax(partitio
default:
DBUG_ASSERT(0);
/* We really shouldn't get here, no use in continuing from here */
- my_error(ER_OUT_OF_RESOURCES, MYF(0));
- current_thd->fatal_error();
+ my_error(ER_OUT_OF_RESOURCES, MYF(ME_FATALERROR));
DBUG_RETURN(NULL);
}
if (part_info->part_expr)
@@ -5049,10 +5048,7 @@ static bool mysql_change_partitions(ALTE
&lpt->deleted, lpt->pack_frm_data,
lpt->pack_frm_len)))
{
- if (error != ER_OUTOFMEMORY)
- file->print_error(error, MYF(0));
- else
- lpt->thd->fatal_error();
+ file->print_error(error, MYF(error != ER_OUTOFMEMORY ? 0 : ME_FATALERROR));
DBUG_RETURN(TRUE);
}
DBUG_RETURN(FALSE);
diff -Nrup a/sql/sql_select.cc b/sql/sql_select.cc
--- a/sql/sql_select.cc 2008-03-27 06:56:04 -03:00
+++ b/sql/sql_select.cc 2008-03-28 12:14:16 -03:00
@@ -11340,7 +11340,7 @@ Field *create_tmp_field(THD *thd, TABLE
Item_sum *item_sum=(Item_sum*) item;
result= item_sum->create_tmp_field(group, table, convert_blob_length);
if (!result)
- thd->fatal_error();
+ my_error(ER_OUT_OF_RESOURCES, MYF(ME_FATALERROR));
return result;
}
case Item::FIELD_ITEM:
@@ -17322,8 +17322,7 @@ calc_group_buffer(JOIN *join,ORDER *grou
default:
/* This case should never be choosen */
DBUG_ASSERT(0);
- my_error(ER_OUT_OF_RESOURCES, MYF(0));
- join->thd->fatal_error();
+ my_error(ER_OUT_OF_RESOURCES, MYF(ME_FATALERROR));
}
}
parts++;
diff -Nrup a/sql/sql_servers.cc b/sql/sql_servers.cc
--- a/sql/sql_servers.cc 2008-03-21 05:45:58 -03:00
+++ b/sql/sql_servers.cc 2008-03-28 12:14:16 -03:00
@@ -128,7 +128,7 @@ bool servers_init(bool dont_read_servers
}
/* Initialize the mem root for data */
- init_alloc_root(&mem, ACL_ALLOC_BLOCK_SIZE, 0);
+ init_sql_alloc(&mem, ACL_ALLOC_BLOCK_SIZE, 0);
if (dont_read_servers_table)
goto end;
@@ -180,7 +180,7 @@ static bool servers_load(THD *thd, TABLE
my_hash_reset(&servers_cache);
free_root(&mem, MYF(0));
- init_alloc_root(&mem, ACL_ALLOC_BLOCK_SIZE, 0);
+ init_sql_alloc(&mem, ACL_ALLOC_BLOCK_SIZE, 0);
init_read_record(&read_record_info,thd,table=tables[0].table,NULL,1,0);
while (!(read_record_info.read_record(&read_record_info)))
diff -Nrup a/sql/sql_show.cc b/sql/sql_show.cc
--- a/sql/sql_show.cc 2008-03-27 15:58:39 -03:00
+++ b/sql/sql_show.cc 2008-03-28 12:14:16 -03:00
@@ -5158,8 +5158,7 @@ static int get_schema_partitions_record(
break;
default:
DBUG_ASSERT(0);
- my_error(ER_OUT_OF_RESOURCES, MYF(0));
- current_thd->fatal_error();
+ my_error(ER_OUT_OF_RESOURCES, MYF(ME_FATALERROR));
DBUG_RETURN(1);
}
table->field[7]->set_notnull();
diff -Nrup a/sql/sql_trigger.cc b/sql/sql_trigger.cc
--- a/sql/sql_trigger.cc 2008-03-27 08:26:13 -03:00
+++ b/sql/sql_trigger.cc 2008-03-28 12:14:16 -03:00
@@ -1647,7 +1647,7 @@ bool Table_triggers_list::drop_all_trigg
DBUG_ENTER("drop_all_triggers");
bzero(&table, sizeof(table));
- init_alloc_root(&table.mem_root, 8192, 0);
+ init_sql_alloc(&table.mem_root, 8192, 0);
if (Table_triggers_list::check_n_load(thd, db, name, &table, 1))
{
@@ -1844,7 +1844,7 @@ bool Table_triggers_list::change_table_n
DBUG_ENTER("change_table_name");
bzero(&table, sizeof(table));
- init_alloc_root(&table.mem_root, 8192, 0);
+ init_sql_alloc(&table.mem_root, 8192, 0);
/*
This method interfaces the mysql server code protected by
diff -Nrup a/sql/sql_update.cc b/sql/sql_update.cc
--- a/sql/sql_update.cc 2008-03-27 15:58:39 -03:00
+++ b/sql/sql_update.cc 2008-03-28 12:14:16 -03:00
@@ -653,11 +653,13 @@ int mysql_update(THD *thd,
If (ignore && error is ignorable) we don't have to
do anything; otherwise...
*/
+ myf flags= 0;
+
if (table->file->is_fatal_error(error, HA_CHECK_DUP_KEY))
- thd->fatal_error(); /* Other handler errors are fatal */
+ flags|= ME_FATALERROR; /* Other handler errors are fatal */
prepare_record_for_error_message(error, table);
- table->file->print_error(error,MYF(0));
+ table->file->print_error(error,MYF(flags));
error= 1;
break;
}
@@ -748,9 +750,8 @@ int mysql_update(THD *thd,
*/
{
/* purecov: begin inspected */
- thd->fatal_error();
prepare_record_for_error_message(loc_error, table);
- table->file->print_error(loc_error,MYF(0));
+ table->file->print_error(loc_error,MYF(ME_FATALERROR));
error= 1;
/* purecov: end */
}
@@ -1628,11 +1629,13 @@ bool multi_update::send_data(List<Item>
If (ignore && error == is ignorable) we don't have to
do anything; otherwise...
*/
+ myf flags= 0;
+
if (table->file->is_fatal_error(error, HA_CHECK_DUP_KEY))
- thd->fatal_error(); /* Other handler errors are fatal */
+ flags|= ME_FATALERROR; /* Other handler errors are fatal */
prepare_record_for_error_message(error, table);
- table->file->print_error(error,MYF(0));
+ table->file->print_error(error,MYF(flags));
DBUG_RETURN(1);
}
}
@@ -1910,9 +1913,8 @@ int multi_update::do_updates()
err:
{
- thd->fatal_error();
prepare_record_for_error_message(local_error, table);
- table->file->print_error(local_error,MYF(0));
+ table->file->print_error(local_error,MYF(ME_FATALERROR));
}
err2:
diff -Nrup a/sql/tztime.cc b/sql/tztime.cc
--- a/sql/tztime.cc 2007-12-12 13:20:56 -02:00
+++ b/sql/tztime.cc 2008-03-28 12:14:16 -03:00
@@ -1591,7 +1591,7 @@ my_tz_init(THD *org_thd, const char *def
hash_free(&tz_names);
goto end;
}
- init_alloc_root(&tz_storage, 32 * 1024, 0);
+ init_sql_alloc(&tz_storage, 32 * 1024, 0);
VOID(pthread_mutex_init(&tz_LOCK, MY_MUTEX_INIT_FAST));
tz_inited= 1;