Commit fae4abd7 authored by Timothy Smith's avatar Timothy Smith

Apply InnoDB snapshot innodb-5.1-ss2858, part 1. Fixes

Bug #35498: Cannot get table test/table1 auto-inccounter value in ::info


Detailed revison comments:

r2702 | sunny | 2008-09-30 11:41:56 +0300 (Tue, 30 Sep 2008) | 13 lines
branches/5.1: Since handler::get_auto_increment() doesn't allow us
to return the cause of failure we have to inform MySQL using the
sql_print_warning() function to return the cause for autoinc failure.
Previously we simply printed the error code, this patch prints the
text string representing the following two error codes:

DB_LOCK_WAIT_TIMEOUT
DB_DEADLOCK.

Bug#35498 Cannot get table test/table1 auto-inccounter value in ::info

Approved by Marko.
parent bb9ee6b6
...@@ -7456,13 +7456,23 @@ ha_innobase::innobase_get_auto_increment( ...@@ -7456,13 +7456,23 @@ ha_innobase::innobase_get_auto_increment(
} else { } else {
*value = autoinc; *value = autoinc;
} }
/* A deadlock error during normal processing is OK /* We need to print this message here because the
and can be ignored. */ handler::get_auto_increment() doesn't allow a way
} else if (error != DB_DEADLOCK) { to return the specific error for why it failed. */
} else if (error == DB_DEADLOCK) {
sql_print_warning(
"Deadlock in "
"innobase_get_auto_increment()");
} else if (error == DB_LOCK_WAIT_TIMEOUT) {
sql_print_warning(
"Lock wait timeout in "
"innobase_get_auto_increment()");
} else {
sql_print_error("InnoDB: Error: %lu in " sql_print_error(
"::innobase_get_auto_increment()", "InnoDB: Error: %lu in "
error); "innobase_get_auto_increment()",
error);
} }
} while (*value == 0 && error == DB_SUCCESS); } while (*value == 0 && error == DB_SUCCESS);
......
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