From c29994edb197c7698dc550aaab3e1debdfe50b33 Mon Sep 17 00:00:00 2001 From: Alfranio Correia Date: Tue, 3 Feb 2009 11:36:46 +0000 Subject: [PATCH] BUG#42445 Warning messages in innobase/handler/ha_innodb.cc There was a type casting problem in the storage/innobase/handler/ha_innodb.cc, (int ha_innobase::write_row(...)). Innobase uses has an internal error variable of type 'ulint' while mysql uses an 'int'. To fix the problem the function manipulates an error variable of type 'ulint' and only casts it into 'int' when needs to return the value. --- storage/innobase/handler/ha_innodb.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 5d895833f42..50c3917c43c 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -3577,7 +3577,8 @@ ha_innobase::write_row( /* out: error code */ uchar* record) /* in: a row in MySQL format */ { - int error = 0; + ulint error = 0; + int error_result= 0; ibool auto_inc_used= FALSE; ulint sql_command; trx_t* trx = thd_to_trx(user_thd); @@ -3693,6 +3694,7 @@ no_commit: } /* MySQL errors are passed straight back. */ + error_result = (int) error; goto func_exit; } @@ -3786,7 +3788,7 @@ set_max_autoinc: err = innobase_set_max_autoinc(auto_inc); if (err != DB_SUCCESS) { - error = (int) err; + error = err; } } break; @@ -3796,12 +3798,12 @@ set_max_autoinc: innodb_srv_conc_exit_innodb(prebuilt->trx); report_error: - error = convert_error_code_to_mysql(error, user_thd); + error_result = convert_error_code_to_mysql((int) error, user_thd); func_exit: innobase_active_small(); - DBUG_RETURN(error); + DBUG_RETURN(error_result); } /**************************************************************************