assert on SAVEPOINT without transaction
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Drizzle |
Fix Released
|
Critical
|
Jay Pipes |
Bug Description
During randgen, the follow assert is hit:
(gdb) bt
#0 0x00007f6859c494b5 in *__GI_raise (sig=<value optimized out>)
at ../nptl/
#1 0x00007f6859c4cf50 in *__GI_abort () at abort.c:92
#2 0x00007f6859c42481 in *__GI___assert_fail (
assertion=
line=2385,
function=
#3 0x000000000068ee0c in InnobaseEngine:
this=<value optimized out>, session=<value optimized out>,
named_
#4 0x000000000065a9f0 in drizzled:
at ./drizzled/
#5 drizzled:
session=
#6 0x000000000064092c in drizzled:
this=0x2ccc5f0) at drizzled/
#7 0x00000000006054c4 in mysql_execute_
at drizzled/
#8 0x0000000000606c45 in drizzled:
inBuf=0x2b239f8 "SAVEPOINT A", length=11) at drizzled/
#9 0x00000000006070cd in drizzled:
command=<value optimized out>, session=0x2b8b4c0,
packet=
at drizzled/
#10 0x00000000005da54f in drizzled:
at drizzled/
#11 0x00000000005dbe32 in drizzled:
at drizzled/
#12 0x00007f6847392352 in MultiThreadSche
arg=<value optimized out>) at ./plugin/
#13 session_thread (arg=<value optimized out>)
at plugin/
#14 0x00007f6859f8ba04 in start_thread (arg=<value optimized out>)
at pthread_
The query is simply "SAVEPOINT A", but innodb asserts because there is not an active transaction. The 'trx' structure does not seem to be corrupt:
(gdb) frame 3
#3 0x000000000068ee0c in InnobaseEngine:
this=<value optimized out>, session=<value optimized out>,
named_
2385 assert(
(gdb) print *trx
$5 = {magic_n = 91118598, op_info = 0x7de6a7 "", is_purge = 0,
is_recovered = 0, conc_state = 0, que_state = 0, isolation_level = 2,
check_foreigns = 1, check_unique_
flush_log_later = 0, must_flush_
duplicates = 0, has_search_latch = 0, declared_
handling_signals = 0, dict_operation_
id = {high = 0, low = 15140}, xid = {formatID = -1, gtrid_length = 0,
bqual_length = 0, data = '\000' <repeats 127 times>}, no = {high = 0,
low = 15141}, commit_lsn = 3664332, table_id = {high = 0, low = 0},
mysql_thd = 0x2b8b4c0, mysql_query_str = 0x0, mysql_log_file_name = 0x0,
mysql_log_offset = 0, mysql_thread_id = 140085757466896,
mysql_process_no = 3424, mysql_n_
search_
prev = 0x0, next = 0x2b55530}, mysql_trx_list = {prev = 0x0,
next = 0x2b55530}, error_state = 10, error_info = 0x2d21d80,
error_key_num = 0, sess = 0x29c44b0, graph = 0x0, n_active_thrs = 0,
graph_
receiver = 0x0, savept = {least_undo_no = {high = 0, low = 0}}, signals = {
prev = 0x0, next = 0x0}, reply_signals = {prev = 0x0, next = 0x0}},
signals = {count = 0, start = 0x0, end = 0x0}, reply_signals = {count = 0,
start = 0x0, end = 0x0}, wait_lock = 0x0,
was_chosen_
count = 0, start = 0x0, end = 0x0}, deadlock_mark = 1,
lock_heap = 0x7f6834052bc0, trx_locks = {count = 0, start = 0x0, end = 0x0},
global_
read_view = 0x0, trx_savepoints = {count = 0, start = 0x0, end = 0x0},
undo_mutex = {event = 0x7f6834053640, lock_word = 0 '\000', waiters = 0,
list = {prev = 0x0, next = 0x2b557b8},
cfile_name = 0x880c34 "plugin/
count_os_wait = 0}, undo_no = {high = 0, low = 0}, last_sql_stat_start = {
least_undo_no = {high = 0, low = 0}}, rseg = 0x0, insert_undo = 0x0,
update_undo = 0x0, roll_limit = {high = 0, low = 0}, pages_undone = 0,
undo_no_arr = 0x7f6834400a50, n_autoinc_rows = 0,
autoinc_locks = 0x7f6834054250,
detailed_error = "\000r\
Related branches
- Drizzle Developers: Pending requested
-
Diff: 195 lines (+132/-4)4 files modifieddrizzled/transaction_services.cc (+4/-1)
plugin/innobase/handler/ha_innodb.cc (+0/-3)
tests/r/savepoints.result (+46/-0)
tests/t/savepoints.test (+82/-0)
Changed in drizzle: | |
importance: | Undecided → Critical |
status: | New → Confirmed |
assignee: | nobody → Jay Pipes (jaypipes) |
milestone: | none → 2010-03-15 |
Changed in drizzle: | |
status: | Confirmed → In Progress |
Changed in drizzle: | |
status: | In Progress → Fix Committed |
Changed in drizzle: | |
status: | Fix Committed → Fix Released |
After much ado, Eric and I have narrowed this down to a reproduceable test case. Yeah! \o/. It turns out that AUTOCOMMIT=0 and LIMIT 0 together are the culprit, and the following test case will hit always assert:
SET AUTOCOMMIT = 0;
CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY);
COMMIT;
UPDATE t1 SET id = 2 WHERE id != 2 LIMIT 0;
SAVEPOINT A;