Commit c3fb485c authored by vasil's avatar vasil

branches/5.1:

Merge a change from MySQL:

  ------------------------------------------------------------
  revno: 2728.19.1
  committer: Alfranio Correia <alfranio.correia@sun.com>
  branch nick: mysql-5.1-bugteam
  timestamp: Tue 2009-02-03 11:36:46 +0000
  message:
    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.
  modified:
    storage/innobase/handler/ha_innodb.cc
parent e2cd6d35
...@@ -3591,7 +3591,8 @@ ha_innobase::write_row( ...@@ -3591,7 +3591,8 @@ ha_innobase::write_row(
/* out: error code */ /* out: error code */
uchar* record) /* in: a row in MySQL format */ uchar* record) /* in: a row in MySQL format */
{ {
int error = 0; ulint error = 0;
int error_result= 0;
ibool auto_inc_used= FALSE; ibool auto_inc_used= FALSE;
ulint sql_command; ulint sql_command;
trx_t* trx = thd_to_trx(user_thd); trx_t* trx = thd_to_trx(user_thd);
...@@ -3707,6 +3708,7 @@ ha_innobase::write_row( ...@@ -3707,6 +3708,7 @@ ha_innobase::write_row(
} }
/* MySQL errors are passed straight back. */ /* MySQL errors are passed straight back. */
error_result = (int) error;
goto func_exit; goto func_exit;
} }
...@@ -3800,7 +3802,7 @@ ha_innobase::write_row( ...@@ -3800,7 +3802,7 @@ ha_innobase::write_row(
err = innobase_set_max_autoinc(auto_inc); err = innobase_set_max_autoinc(auto_inc);
if (err != DB_SUCCESS) { if (err != DB_SUCCESS) {
error = (int) err; error = err;
} }
} }
break; break;
...@@ -3810,12 +3812,12 @@ ha_innobase::write_row( ...@@ -3810,12 +3812,12 @@ ha_innobase::write_row(
innodb_srv_conc_exit_innodb(prebuilt->trx); innodb_srv_conc_exit_innodb(prebuilt->trx);
report_error: report_error:
error = convert_error_code_to_mysql(error, user_thd); error_result = convert_error_code_to_mysql((int) error, user_thd);
func_exit: func_exit:
innobase_active_small(); innobase_active_small();
DBUG_RETURN(error); DBUG_RETURN(error_result);
} }
/************************************************************************** /**************************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment