Commit 3973a430 authored by sunny's avatar sunny

Suppress printing of deadlock errors while reading the autoinc value.

DB_DEADLOCK errors are part of normal processing and excessive printing
of these error messages could be disconcerting for users. 
parent 62e98cd0
...@@ -7147,8 +7147,8 @@ the value of the auto-inc counter. */ ...@@ -7147,8 +7147,8 @@ the value of the auto-inc counter. */
int int
ha_innobase::innobase_read_and_init_auto_inc( ha_innobase::innobase_read_and_init_auto_inc(
/*=========================================*/ /*=========================================*/
/* out: 0 or error code: /* out: 0 or generic MySQL
deadlock or lock wait timeout */ error code */
longlong* value) /* out: the autoinc value */ longlong* value) /* out: the autoinc value */
{ {
longlong auto_inc; longlong auto_inc;
...@@ -7205,9 +7205,9 @@ ha_innobase::innobase_read_and_init_auto_inc( ...@@ -7205,9 +7205,9 @@ ha_innobase::innobase_read_and_init_auto_inc(
++auto_inc; ++auto_inc;
dict_table_autoinc_initialize(innodb_table, auto_inc); dict_table_autoinc_initialize(innodb_table, auto_inc);
} else { } else {
fprintf(stderr, " InnoDB error: Couldn't read the " fprintf(stderr, " InnoDB error (%lu): Couldn't read "
"max AUTOINC value from index (%s).\n", "the max AUTOINC value from the index (%s).\n",
index->name); error, index->name);
mysql_error = 1; mysql_error = 1;
} }
...@@ -7291,7 +7291,16 @@ ha_innobase::innobase_get_auto_increment( ...@@ -7291,7 +7291,16 @@ ha_innobase::innobase_get_auto_increment(
} else { } else {
*value = (ulonglong) autoinc; *value = (ulonglong) autoinc;
} }
/* A deadlock error during normal processing is OK
and can be ignored. */
} else if (error != DB_DEADLOCK) {
ut_print_timestamp(stderr);
sql_print_error(" InnoDB Error %lu in "
"::innobase_get_auto_increment()",
error);
} }
} while (*value == 0 && error == DB_SUCCESS); } while (*value == 0 && error == DB_SUCCESS);
return(error); return(error);
...@@ -7324,13 +7333,6 @@ ha_innobase::get_auto_increment( ...@@ -7324,13 +7333,6 @@ ha_innobase::get_auto_increment(
error = innobase_get_auto_increment(&autoinc); error = innobase_get_auto_increment(&autoinc);
if (error != DB_SUCCESS) { if (error != DB_SUCCESS) {
/* This should never happen in the code > ver 5.0.6,
since we call this function only after the counter
has been initialized. */
ut_print_timestamp(stderr);
sql_print_error("Error %lu in ::get_auto_increment()", error);
*first_value = (~(ulonglong) 0); *first_value = (~(ulonglong) 0);
return; return;
} }
......
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