Commit bce80207 authored by sunny's avatar sunny

branches/5.1: We need to send the messages to the client because

handler::get_auto_increment() doesn't allow a way to return the
specific error for why it failed.

rb://18
parent f3d2c882
...@@ -7477,16 +7477,24 @@ ha_innobase::innobase_get_auto_increment( ...@@ -7477,16 +7477,24 @@ ha_innobase::innobase_get_auto_increment(
} else { } else {
*value = autoinc; *value = autoinc;
} }
/* We need to print this message here because the /* We need to send the messages to the client because
handler::get_auto_increment() doesn't allow a way handler::get_auto_increment() doesn't allow a way
to return the specific error for why it failed. */ to return the specific error for why it failed. */
} else if (error == DB_DEADLOCK) { } else if (error == DB_DEADLOCK) {
sql_print_warning( THD* thd = ha_thd();
"Deadlock in "
push_warning(
thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
ER_LOCK_DEADLOCK,
"InnoDB: Deadlock in "
"innobase_get_auto_increment()"); "innobase_get_auto_increment()");
} else if (error == DB_LOCK_WAIT_TIMEOUT) { } else if (error == DB_LOCK_WAIT_TIMEOUT) {
sql_print_warning( THD* thd = ha_thd();
"Lock wait timeout in "
push_warning(
thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
ER_LOCK_WAIT_TIMEOUT,
"InnoDB: Lock wait timeout in "
"innobase_get_auto_increment()"); "innobase_get_auto_increment()");
} else { } else {
...@@ -7495,7 +7503,6 @@ ha_innobase::innobase_get_auto_increment( ...@@ -7495,7 +7503,6 @@ ha_innobase::innobase_get_auto_increment(
"innobase_get_auto_increment()", "innobase_get_auto_increment()",
error); error);
} }
} while (*value == 0 && error == DB_SUCCESS); } while (*value == 0 && error == DB_SUCCESS);
return(error); return(error);
......
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