Loading cmd-line-utils/readline/histfile.c +2 −1 Original line number Diff line number Diff line Loading @@ -334,7 +334,8 @@ history_truncate_file (fname, lines) file_size = (size_t)finfo.st_size; /* check for overflow on very large files */ if (file_size != finfo.st_size || file_size + 1 < file_size) if ((long long) file_size != (long long) finfo.st_size || file_size + 1 < file_size) { close (file); #if defined (EFBIG) Loading innobase/include/row0mysql.h +2 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ Created 9/17/2000 Heikki Tuuri #include "btr0pcur.h" #include "trx0types.h" extern ibool row_rollback_on_timeout; typedef struct row_prebuilt_struct row_prebuilt_t; /*********************************************************************** Loading innobase/row/row0mysql.c +10 −1 Original line number Diff line number Diff line Loading @@ -35,6 +35,9 @@ Created 9/17/2000 Heikki Tuuri /* A dummy variable used to fool the compiler */ ibool row_mysql_identically_false = FALSE; /* Provide optional 4.x backwards compatibility for 5.0 and above */ ibool row_rollback_on_timeout = FALSE; /* List of tables we should drop in background. ALTER TABLE in MySQL requires that the table handler can drop the table in background when there are no queries to it any more. Protected by the kernel mutex. */ Loading Loading @@ -514,7 +517,9 @@ row_mysql_handle_errors( return(TRUE); } else if (err == DB_DEADLOCK || err == DB_LOCK_TABLE_FULL) { || err == DB_LOCK_TABLE_FULL || (err == DB_LOCK_WAIT_TIMEOUT && row_rollback_on_timeout)) { /* Roll back the whole transaction; this resolution was added to version 3.23.43 */ Loading @@ -522,6 +527,10 @@ row_mysql_handle_errors( } else if (err == DB_OUT_OF_FILE_SPACE || err == DB_LOCK_WAIT_TIMEOUT) { ut_ad(!(err == DB_LOCK_WAIT_TIMEOUT && row_rollback_on_timeout)); if (savept) { /* Roll back the latest, possibly incomplete insertion or update */ Loading mysql-test/include/innodb_rollback_on_timeout.inc 0 → 100644 +37 −0 Original line number Diff line number Diff line # # Bug #24200: Provide backwards compatibility mode for 4.x "rollback on # transaction timeout" # show variables like 'innodb_rollback_on_timeout'; create table t1 (a int unsigned not null primary key) engine = innodb; insert into t1 values (1); commit; connect (con1,localhost,root,,); connect (con2,localhost,root,,); connection con2; begin work; insert into t1 values (2); select * from t1; connection con1; begin work; insert into t1 values (5); select * from t1; # Lock wait timeout set to 2 seconds in <THIS TEST>-master.opt; this # statement will time out; in 5.0.13+, it will not roll back transaction. --error ER_LOCK_WAIT_TIMEOUT insert into t1 values (2); # On 5.0.13+, this should give ==> 1, 5 select * from t1; commit; connection con2; select * from t1; commit; connection default; select * from t1; drop table t1; disconnect con1; disconnect con2; mysql-test/r/func_str.result +12 −0 Original line number Diff line number Diff line Loading @@ -1916,4 +1916,16 @@ CHAR(0xff,0x8f USING utf8) IS NULL Warnings: Error 1300 Invalid utf8 character string: 'FF8F' SET SQL_MODE=@orig_sql_mode; select substring('abc', cast(2 as unsigned int)); substring('abc', cast(2 as unsigned int)) bc select repeat('a', cast(2 as unsigned int)); repeat('a', cast(2 as unsigned int)) aa select rpad('abc', cast(5 as unsigned integer), 'x'); rpad('abc', cast(5 as unsigned integer), 'x') abcxx select lpad('abc', cast(5 as unsigned integer), 'x'); lpad('abc', cast(5 as unsigned integer), 'x') xxabc End of 5.0 tests Loading
cmd-line-utils/readline/histfile.c +2 −1 Original line number Diff line number Diff line Loading @@ -334,7 +334,8 @@ history_truncate_file (fname, lines) file_size = (size_t)finfo.st_size; /* check for overflow on very large files */ if (file_size != finfo.st_size || file_size + 1 < file_size) if ((long long) file_size != (long long) finfo.st_size || file_size + 1 < file_size) { close (file); #if defined (EFBIG) Loading
innobase/include/row0mysql.h +2 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ Created 9/17/2000 Heikki Tuuri #include "btr0pcur.h" #include "trx0types.h" extern ibool row_rollback_on_timeout; typedef struct row_prebuilt_struct row_prebuilt_t; /*********************************************************************** Loading
innobase/row/row0mysql.c +10 −1 Original line number Diff line number Diff line Loading @@ -35,6 +35,9 @@ Created 9/17/2000 Heikki Tuuri /* A dummy variable used to fool the compiler */ ibool row_mysql_identically_false = FALSE; /* Provide optional 4.x backwards compatibility for 5.0 and above */ ibool row_rollback_on_timeout = FALSE; /* List of tables we should drop in background. ALTER TABLE in MySQL requires that the table handler can drop the table in background when there are no queries to it any more. Protected by the kernel mutex. */ Loading Loading @@ -514,7 +517,9 @@ row_mysql_handle_errors( return(TRUE); } else if (err == DB_DEADLOCK || err == DB_LOCK_TABLE_FULL) { || err == DB_LOCK_TABLE_FULL || (err == DB_LOCK_WAIT_TIMEOUT && row_rollback_on_timeout)) { /* Roll back the whole transaction; this resolution was added to version 3.23.43 */ Loading @@ -522,6 +527,10 @@ row_mysql_handle_errors( } else if (err == DB_OUT_OF_FILE_SPACE || err == DB_LOCK_WAIT_TIMEOUT) { ut_ad(!(err == DB_LOCK_WAIT_TIMEOUT && row_rollback_on_timeout)); if (savept) { /* Roll back the latest, possibly incomplete insertion or update */ Loading
mysql-test/include/innodb_rollback_on_timeout.inc 0 → 100644 +37 −0 Original line number Diff line number Diff line # # Bug #24200: Provide backwards compatibility mode for 4.x "rollback on # transaction timeout" # show variables like 'innodb_rollback_on_timeout'; create table t1 (a int unsigned not null primary key) engine = innodb; insert into t1 values (1); commit; connect (con1,localhost,root,,); connect (con2,localhost,root,,); connection con2; begin work; insert into t1 values (2); select * from t1; connection con1; begin work; insert into t1 values (5); select * from t1; # Lock wait timeout set to 2 seconds in <THIS TEST>-master.opt; this # statement will time out; in 5.0.13+, it will not roll back transaction. --error ER_LOCK_WAIT_TIMEOUT insert into t1 values (2); # On 5.0.13+, this should give ==> 1, 5 select * from t1; commit; connection con2; select * from t1; commit; connection default; select * from t1; drop table t1; disconnect con1; disconnect con2;
mysql-test/r/func_str.result +12 −0 Original line number Diff line number Diff line Loading @@ -1916,4 +1916,16 @@ CHAR(0xff,0x8f USING utf8) IS NULL Warnings: Error 1300 Invalid utf8 character string: 'FF8F' SET SQL_MODE=@orig_sql_mode; select substring('abc', cast(2 as unsigned int)); substring('abc', cast(2 as unsigned int)) bc select repeat('a', cast(2 as unsigned int)); repeat('a', cast(2 as unsigned int)) aa select rpad('abc', cast(5 as unsigned integer), 'x'); rpad('abc', cast(5 as unsigned integer), 'x') abcxx select lpad('abc', cast(5 as unsigned integer), 'x'); lpad('abc', cast(5 as unsigned integer), 'x') xxabc End of 5.0 tests