Commit 34255325 authored by Satya B's avatar Satya B

Fix for BUG#18828 - If InnoDB runs out of undo slots,

                    it returns misleading 'table is full'

Innodb returns a misleading error message "table is full" 
when the number of active concurrent transactions is greater
than 1024.

Fixed by adding errorcode "ER_TOO_MANY_CONCURRENT_TRXS" to the
error codes. Innodb should return HA_TOO_MANY_CONCURRENT_TRXS
to mysql which is then mapped to ER_TOO_MANY_CONCURRENT_TRXS


Note: testcase is not written as this was reproducible only by
      changing innodb code.

extra/perror.c:
  Add error number and message for HA_ERR_TOO_MANY_CONCURRENT_TRXS
include/my_base.h:
  Add error number and message for HA_ERR_TOO_MANY_CONCURRENT_TRXS
sql/ha_innodb.cc:
  Return HA_ERR_TOO_MANY_CONCURRENT_TRXS to mysql server
sql/handler.cc:
  Add error number and message for HA_ERR_TOO_MANY_CONCURRENT_TRXS
sql/share/errmsg.txt:
  Add error message for ER_TOO_MANY_CONCURRENT_TRXS
parent 1a4bc9a1
...@@ -108,6 +108,7 @@ static HA_ERRORS ha_errlist[]= ...@@ -108,6 +108,7 @@ static HA_ERRORS ha_errlist[]=
{ 161,"The table is not writable"}, { 161,"The table is not writable"},
{ 162,"Failed to get the next autoinc value"}, { 162,"Failed to get the next autoinc value"},
{ 163,"Failed to set the row autoinc value"}, { 163,"Failed to set the row autoinc value"},
{ 164,"Too many active concurrent transactions"},
{ -30999, "DB_INCOMPLETE: Sync didn't finish"}, { -30999, "DB_INCOMPLETE: Sync didn't finish"},
{ -30998, "DB_KEYEMPTY: Key/data deleted or never created"}, { -30998, "DB_KEYEMPTY: Key/data deleted or never created"},
{ -30997, "DB_KEYEXIST: The key/data pair already exists"}, { -30997, "DB_KEYEXIST: The key/data pair already exists"},
......
...@@ -377,9 +377,10 @@ enum ha_base_keytype { ...@@ -377,9 +377,10 @@ enum ha_base_keytype {
#define HA_ERR_TABLE_READONLY 161 /* The table is not writable */ #define HA_ERR_TABLE_READONLY 161 /* The table is not writable */
#define HA_ERR_AUTOINC_READ_FAILED 162/* Failed to get the next autoinc value */ #define HA_ERR_AUTOINC_READ_FAILED 162/* Failed to get the next autoinc value */
#define HA_ERR_AUTOINC_ERANGE 163 /* Failed to set the row autoinc value */ #define HA_ERR_AUTOINC_ERANGE 163 /* Failed to set the row autoinc value */
#define HA_ERR_TOO_MANY_CONCURRENT_TRXS 164 /*Too many active concurrent transactions */
/* You must also add numbers and description to extra/perror.c ! */ /* You must also add numbers and description to extra/perror.c ! */
#define HA_ERR_LAST 163 /*Copy last error nr.*/ #define HA_ERR_LAST 164 /*Copy last error nr.*/
/* Add error numbers before HA_ERR_LAST and change it accordingly. */ /* Add error numbers before HA_ERR_LAST and change it accordingly. */
#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1) #define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1)
......
...@@ -526,17 +526,7 @@ convert_error_code_to_mysql( ...@@ -526,17 +526,7 @@ convert_error_code_to_mysql(
return(HA_ERR_LOCK_TABLE_FULL); return(HA_ERR_LOCK_TABLE_FULL);
} else if (error == DB_TOO_MANY_CONCURRENT_TRXS) { } else if (error == DB_TOO_MANY_CONCURRENT_TRXS) {
/* Once MySQL add the appropriate code to errmsg.txt then return(HA_ERR_TOO_MANY_CONCURRENT_TRXS);
we can get rid of this #ifdef. NOTE: The code checked by
the #ifdef is the suggested name for the error condition
and the actual error code name could very well be different.
This will require some monitoring, ie. the status
of this request on our part.*/
#ifdef ER_TOO_MANY_CONCURRENT_TRXS
return(ER_TOO_MANY_CONCURRENT_TRXS);
#else
return(HA_ERR_RECORD_FILE_FULL);
#endif
} else if (error == DB_UNSUPPORTED) { } else if (error == DB_UNSUPPORTED) {
......
...@@ -426,6 +426,7 @@ static int ha_init_errors(void) ...@@ -426,6 +426,7 @@ static int ha_init_errors(void)
SETMSG(HA_ERR_TABLE_READONLY, ER(ER_OPEN_AS_READONLY)); SETMSG(HA_ERR_TABLE_READONLY, ER(ER_OPEN_AS_READONLY));
SETMSG(HA_ERR_AUTOINC_READ_FAILED, ER(ER_AUTOINC_READ_FAILED)); SETMSG(HA_ERR_AUTOINC_READ_FAILED, ER(ER_AUTOINC_READ_FAILED));
SETMSG(HA_ERR_AUTOINC_ERANGE, ER(ER_WARN_DATA_OUT_OF_RANGE)); SETMSG(HA_ERR_AUTOINC_ERANGE, ER(ER_WARN_DATA_OUT_OF_RANGE));
SETMSG(HA_ERR_TOO_MANY_CONCURRENT_TRXS, ER(ER_TOO_MANY_CONCURRENT_TRXS));
/* Register the error messages for use with my_error(). */ /* Register the error messages for use with my_error(). */
return my_error_register(errmsgs, HA_ERR_FIRST, HA_ERR_LAST); return my_error_register(errmsgs, HA_ERR_FIRST, HA_ERR_LAST);
...@@ -1927,6 +1928,9 @@ void handler::print_error(int error, myf errflag) ...@@ -1927,6 +1928,9 @@ void handler::print_error(int error, myf errflag)
case HA_ERR_AUTOINC_ERANGE: case HA_ERR_AUTOINC_ERANGE:
textno= ER_WARN_DATA_OUT_OF_RANGE; textno= ER_WARN_DATA_OUT_OF_RANGE;
break; break;
case HA_ERR_TOO_MANY_CONCURRENT_TRXS:
textno= ER_TOO_MANY_CONCURRENT_TRXS;
break;
default: default:
{ {
/* The error was "unknown" to this function. /* The error was "unknown" to this function.
......
...@@ -5649,3 +5649,5 @@ ER_XA_RBTIMEOUT XA106 ...@@ -5649,3 +5649,5 @@ ER_XA_RBTIMEOUT XA106
eng "XA_RBTIMEOUT: Transaction branch was rolled back: took too long" eng "XA_RBTIMEOUT: Transaction branch was rolled back: took too long"
ER_XA_RBDEADLOCK XA102 ER_XA_RBDEADLOCK XA102
eng "XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detected" eng "XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detected"
ER_TOO_MANY_CONCURRENT_TRXS
eng "Too many active concurrent transactions"
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