Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
0d5dc514
Commit
0d5dc514
authored
Dec 19, 2006
by
tsmith/tim@siva.hindu.god
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added innodb_rollback_on_timeout option to restore the 4.1
InnoDB timeout behavior (Bug #24200)
parent
3cc1a425
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
144 additions
and
2 deletions
+144
-2
innobase/include/row0mysql.h
innobase/include/row0mysql.h
+2
-0
innobase/row/row0mysql.c
innobase/row/row0mysql.c
+10
-1
mysql-test/include/innodb_rollback_on_timeout.inc
mysql-test/include/innodb_rollback_on_timeout.inc
+37
-0
mysql-test/r/innodb_mysql.result
mysql-test/r/innodb_mysql.result
+36
-0
mysql-test/r/innodb_timeout_rollback.result
mysql-test/r/innodb_timeout_rollback.result
+35
-0
mysql-test/t/innodb_mysql-master.opt
mysql-test/t/innodb_mysql-master.opt
+1
-0
mysql-test/t/innodb_mysql.test
mysql-test/t/innodb_mysql.test
+2
-0
mysql-test/t/innodb_timeout_rollback-master.opt
mysql-test/t/innodb_timeout_rollback-master.opt
+1
-0
mysql-test/t/innodb_timeout_rollback.test
mysql-test/t/innodb_timeout_rollback.test
+5
-0
sql/ha_innodb.cc
sql/ha_innodb.cc
+7
-0
sql/ha_innodb.h
sql/ha_innodb.h
+1
-0
sql/mysqld.cc
sql/mysqld.cc
+6
-1
sql/set_var.cc
sql/set_var.cc
+1
-0
No files found.
innobase/include/row0mysql.h
View file @
0d5dc514
...
@@ -19,6 +19,8 @@ Created 9/17/2000 Heikki Tuuri
...
@@ -19,6 +19,8 @@ Created 9/17/2000 Heikki Tuuri
#include "btr0pcur.h"
#include "btr0pcur.h"
#include "trx0types.h"
#include "trx0types.h"
extern
ibool
row_rollback_on_timeout
;
typedef
struct
row_prebuilt_struct
row_prebuilt_t
;
typedef
struct
row_prebuilt_struct
row_prebuilt_t
;
/***********************************************************************
/***********************************************************************
...
...
innobase/row/row0mysql.c
View file @
0d5dc514
...
@@ -35,6 +35,9 @@ Created 9/17/2000 Heikki Tuuri
...
@@ -35,6 +35,9 @@ Created 9/17/2000 Heikki Tuuri
/* A dummy variable used to fool the compiler */
/* A dummy variable used to fool the compiler */
ibool
row_mysql_identically_false
=
FALSE
;
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
/* 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
that the table handler can drop the table in background when there are no
queries to it any more. Protected by the kernel mutex. */
queries to it any more. Protected by the kernel mutex. */
...
@@ -514,7 +517,9 @@ row_mysql_handle_errors(
...
@@ -514,7 +517,9 @@ row_mysql_handle_errors(
return
(
TRUE
);
return
(
TRUE
);
}
else
if
(
err
==
DB_DEADLOCK
}
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
/* Roll back the whole transaction; this resolution was added
to version 3.23.43 */
to version 3.23.43 */
...
@@ -522,6 +527,10 @@ row_mysql_handle_errors(
...
@@ -522,6 +527,10 @@ row_mysql_handle_errors(
}
else
if
(
err
==
DB_OUT_OF_FILE_SPACE
}
else
if
(
err
==
DB_OUT_OF_FILE_SPACE
||
err
==
DB_LOCK_WAIT_TIMEOUT
)
{
||
err
==
DB_LOCK_WAIT_TIMEOUT
)
{
ut_ad
(
!
(
err
==
DB_LOCK_WAIT_TIMEOUT
&&
row_rollback_on_timeout
));
if
(
savept
)
{
if
(
savept
)
{
/* Roll back the latest, possibly incomplete
/* Roll back the latest, possibly incomplete
insertion or update */
insertion or update */
...
...
mysql-test/include/innodb_rollback_on_timeout.inc
0 → 100644
View file @
0d5dc514
#
# 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/innodb_mysql.result
View file @
0d5dc514
...
@@ -383,4 +383,40 @@ EXPLAIN SELECT SQL_BIG_RESULT b, SUM(c) FROM t1 GROUP BY b;
...
@@ -383,4 +383,40 @@ EXPLAIN SELECT SQL_BIG_RESULT b, SUM(c) FROM t1 GROUP BY b;
id select_type table type possible_keys key key_len ref rows Extra
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 128 Using filesort
1 SIMPLE t1 ALL NULL NULL NULL NULL 128 Using filesort
DROP TABLE t1;
DROP TABLE t1;
show variables like 'innodb_rollback_on_timeout';
Variable_name Value
innodb_rollback_on_timeout OFF
create table t1 (a int unsigned not null primary key) engine = innodb;
insert into t1 values (1);
commit;
begin work;
insert into t1 values (2);
select * from t1;
a
1
2
begin work;
insert into t1 values (5);
select * from t1;
a
1
5
insert into t1 values (2);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t1;
a
1
5
commit;
select * from t1;
a
1
2
commit;
select * from t1;
a
1
2
5
drop table t1;
End of 5.0 tests
End of 5.0 tests
mysql-test/r/innodb_timeout_rollback.result
0 → 100644
View file @
0d5dc514
show variables like 'innodb_rollback_on_timeout';
Variable_name Value
innodb_rollback_on_timeout ON
create table t1 (a int unsigned not null primary key) engine = innodb;
insert into t1 values (1);
commit;
begin work;
insert into t1 values (2);
select * from t1;
a
1
2
begin work;
insert into t1 values (5);
select * from t1;
a
1
5
insert into t1 values (2);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t1;
a
1
commit;
select * from t1;
a
1
2
commit;
select * from t1;
a
1
2
drop table t1;
End of 5.0 tests
mysql-test/t/innodb_mysql-master.opt
0 → 100644
View file @
0d5dc514
--innodb-lock-wait-timeout=2
mysql-test/t/innodb_mysql.test
View file @
0d5dc514
...
@@ -384,4 +384,6 @@ EXPLAIN SELECT SQL_BIG_RESULT b, SUM(c) FROM t1 GROUP BY b;
...
@@ -384,4 +384,6 @@ EXPLAIN SELECT SQL_BIG_RESULT b, SUM(c) FROM t1 GROUP BY b;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
--
source
include
/
innodb_rollback_on_timeout
.
inc
--
echo
End
of
5.0
tests
--
echo
End
of
5.0
tests
mysql-test/t/innodb_timeout_rollback-master.opt
0 → 100644
View file @
0d5dc514
--innodb_lock_wait_timeout=2 --innodb_rollback_on_timeout
mysql-test/t/innodb_timeout_rollback.test
0 → 100644
View file @
0d5dc514
--
source
include
/
have_innodb
.
inc
--
source
include
/
innodb_rollback_on_timeout
.
inc
--
echo
End
of
5.0
tests
sql/ha_innodb.cc
View file @
0d5dc514
...
@@ -173,6 +173,7 @@ my_bool innobase_use_large_pages = FALSE;
...
@@ -173,6 +173,7 @@ my_bool innobase_use_large_pages = FALSE;
my_bool
innobase_use_native_aio
=
FALSE
;
my_bool
innobase_use_native_aio
=
FALSE
;
my_bool
innobase_file_per_table
=
FALSE
;
my_bool
innobase_file_per_table
=
FALSE
;
my_bool
innobase_locks_unsafe_for_binlog
=
FALSE
;
my_bool
innobase_locks_unsafe_for_binlog
=
FALSE
;
my_bool
innobase_rollback_on_timeout
=
FALSE
;
my_bool
innobase_create_status_file
=
FALSE
;
my_bool
innobase_create_status_file
=
FALSE
;
static
char
*
internal_innobase_data_file_path
=
NULL
;
static
char
*
internal_innobase_data_file_path
=
NULL
;
...
@@ -467,6 +468,10 @@ convert_error_code_to_mysql(
...
@@ -467,6 +468,10 @@ convert_error_code_to_mysql(
latest SQL statement in a lock wait timeout. Previously, we
latest SQL statement in a lock wait timeout. Previously, we
rolled back the whole transaction. */
rolled back the whole transaction. */
if
(
thd
&&
row_rollback_on_timeout
)
{
ha_rollback
(
thd
);
}
return
(
HA_ERR_LOCK_WAIT_TIMEOUT
);
return
(
HA_ERR_LOCK_WAIT_TIMEOUT
);
}
else
if
(
error
==
(
int
)
DB_NO_REFERENCED_ROW
)
{
}
else
if
(
error
==
(
int
)
DB_NO_REFERENCED_ROW
)
{
...
@@ -1380,6 +1385,8 @@ innobase_init(void)
...
@@ -1380,6 +1385,8 @@ innobase_init(void)
os_use_large_pages
=
(
ibool
)
innobase_use_large_pages
;
os_use_large_pages
=
(
ibool
)
innobase_use_large_pages
;
os_large_page_size
=
(
ulint
)
innobase_large_page_size
;
os_large_page_size
=
(
ulint
)
innobase_large_page_size
;
row_rollback_on_timeout
=
(
ibool
)
innobase_rollback_on_timeout
;
srv_file_per_table
=
(
ibool
)
innobase_file_per_table
;
srv_file_per_table
=
(
ibool
)
innobase_file_per_table
;
srv_locks_unsafe_for_binlog
=
(
ibool
)
innobase_locks_unsafe_for_binlog
;
srv_locks_unsafe_for_binlog
=
(
ibool
)
innobase_locks_unsafe_for_binlog
;
...
...
sql/ha_innodb.h
View file @
0d5dc514
...
@@ -216,6 +216,7 @@ extern my_bool innobase_log_archive,
...
@@ -216,6 +216,7 @@ extern my_bool innobase_log_archive,
innobase_use_large_pages
,
innobase_use_large_pages
,
innobase_use_native_aio
,
innobase_use_native_aio
,
innobase_file_per_table
,
innobase_locks_unsafe_for_binlog
,
innobase_file_per_table
,
innobase_locks_unsafe_for_binlog
,
innobase_rollback_on_timeout
,
innobase_create_status_file
;
innobase_create_status_file
;
extern
my_bool
innobase_very_fast_shutdown
;
/* set this to 1 just before
extern
my_bool
innobase_very_fast_shutdown
;
/* set this to 1 just before
calling innobase_end() if you want
calling innobase_end() if you want
...
...
sql/mysqld.cc
View file @
0d5dc514
...
@@ -4692,7 +4692,8 @@ enum options_mysqld
...
@@ -4692,7 +4692,8 @@ enum options_mysqld
OPT_LOG_SLOW_ADMIN_STATEMENTS
,
OPT_LOG_SLOW_ADMIN_STATEMENTS
,
OPT_TABLE_LOCK_WAIT_TIMEOUT
,
OPT_TABLE_LOCK_WAIT_TIMEOUT
,
OPT_PORT_OPEN_TIMEOUT
,
OPT_PORT_OPEN_TIMEOUT
,
OPT_MERGE
OPT_MERGE
,
OPT_INNODB_ROLLBACK_ON_TIMEOUT
};
};
...
@@ -4968,6 +4969,10 @@ Disable with --skip-innodb-doublewrite.", (gptr*) &innobase_use_doublewrite,
...
@@ -4968,6 +4969,10 @@ Disable with --skip-innodb-doublewrite.", (gptr*) &innobase_use_doublewrite,
(
gptr
*
)
&
srv_max_purge_lag
,
(
gptr
*
)
&
srv_max_purge_lag
,
(
gptr
*
)
&
srv_max_purge_lag
,
0
,
GET_LONG
,
REQUIRED_ARG
,
0
,
0
,
~
0L
,
(
gptr
*
)
&
srv_max_purge_lag
,
0
,
GET_LONG
,
REQUIRED_ARG
,
0
,
0
,
~
0L
,
0
,
1L
,
0
},
0
,
1L
,
0
},
{
"innodb_rollback_on_timeout"
,
OPT_INNODB_ROLLBACK_ON_TIMEOUT
,
"Roll back the complete transaction on lock wait timeout, for 4.x compatibility (disabled by default)"
,
(
gptr
*
)
&
innobase_rollback_on_timeout
,
(
gptr
*
)
&
innobase_rollback_on_timeout
,
0
,
GET_BOOL
,
OPT_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"innodb_status_file"
,
OPT_INNODB_STATUS_FILE
,
{
"innodb_status_file"
,
OPT_INNODB_STATUS_FILE
,
"Enable SHOW INNODB STATUS output in the innodb_status.<pid> file"
,
"Enable SHOW INNODB STATUS output in the innodb_status.<pid> file"
,
(
gptr
*
)
&
innobase_create_status_file
,
(
gptr
*
)
&
innobase_create_status_file
,
(
gptr
*
)
&
innobase_create_status_file
,
(
gptr
*
)
&
innobase_create_status_file
,
...
...
sql/set_var.cc
View file @
0d5dc514
...
@@ -904,6 +904,7 @@ struct show_var_st init_vars[]= {
...
@@ -904,6 +904,7 @@ struct show_var_st init_vars[]= {
{
sys_innodb_max_purge_lag
.
name
,
(
char
*
)
&
sys_innodb_max_purge_lag
,
SHOW_SYS
},
{
sys_innodb_max_purge_lag
.
name
,
(
char
*
)
&
sys_innodb_max_purge_lag
,
SHOW_SYS
},
{
"innodb_mirrored_log_groups"
,
(
char
*
)
&
innobase_mirrored_log_groups
,
SHOW_LONG
},
{
"innodb_mirrored_log_groups"
,
(
char
*
)
&
innobase_mirrored_log_groups
,
SHOW_LONG
},
{
"innodb_open_files"
,
(
char
*
)
&
innobase_open_files
,
SHOW_LONG
},
{
"innodb_open_files"
,
(
char
*
)
&
innobase_open_files
,
SHOW_LONG
},
{
"innodb_rollback_on_timeout"
,
(
char
*
)
&
innobase_rollback_on_timeout
,
SHOW_MY_BOOL
},
{
sys_innodb_support_xa
.
name
,
(
char
*
)
&
sys_innodb_support_xa
,
SHOW_SYS
},
{
sys_innodb_support_xa
.
name
,
(
char
*
)
&
sys_innodb_support_xa
,
SHOW_SYS
},
{
sys_innodb_sync_spin_loops
.
name
,
(
char
*
)
&
sys_innodb_sync_spin_loops
,
SHOW_SYS
},
{
sys_innodb_sync_spin_loops
.
name
,
(
char
*
)
&
sys_innodb_sync_spin_loops
,
SHOW_SYS
},
{
sys_innodb_table_locks
.
name
,
(
char
*
)
&
sys_innodb_table_locks
,
SHOW_SYS
},
{
sys_innodb_table_locks
.
name
,
(
char
*
)
&
sys_innodb_table_locks
,
SHOW_SYS
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment