Bug #5630 innodb assertion failure (btr0btr.c) in 4.1.4
Submitted: 17 Sep 2004 17:23 Modified: 30 Dec 2004 15:55
Reporter: Bernd Heller Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S1 (Critical)
Version:4.1.4-gamma OS:MacOS (Mac OS X 10.3.5)
Assigned to: Assigned Account CPU Architecture:Any

[17 Sep 2004 17:23] Bernd Heller
Description:
I created a fresh InnoDB tablespace consisting of 2 fixed-size 1GB files and one autoextend file. 
Then I reimported my data that I had dumped with mysqldump before. All looked fine so far. I 
deleted all records from one table using "truncate" and then got the following error in my log 
whenever I try to access that table. I'm using the pre-built 4.1.4-gamma-max binary for OS X, 
downloaded from mysql.com.

040917 17:14:13  InnoDB: Page checksum 123086972, prior-to-4.0.14-form checksum 
825630342
InnoDB: stored checksum 134026859, prior-to-4.0.14-form stored checksum 2
InnoDB: Page lsn 2 2218241136, low 4 bytes of lsn at page end 2218241136
InnoDB: Page number (if stored to page already) 98337,
InnoDB: space id (if created with >= MySQL-4.1.1 and stored already) 0
InnoDB: Page may be an index page where index id is 0 361
InnoDB: (index `Country_State_Name` of table `partnerminedb/cities`)
InnoDB: Corruption of an index tree: table `partnerminedb/cities`, index 
`Country_State_Name`,
InnoDB: father ptr page no 65320, child page no 83418
PHYSICAL RECORD: n_fields 4; 1-byte offs TRUE; info bits 0
 0: len 2; hex 4247; asc BG;; 1: SQL NULL, size 0 ; 2: len 6; hex 41636868c481; asc Achh  ;; 3: 
len 8; hex 000000000002e340; asc        @;;
            n_owned: 0; heap_no: 6; next rec: 3807
PHYSICAL RECORD: n_fields 5; 1-byte offs TRUE; info bits 0
 0: len 2; hex 4246; asc BF;; 1: len 2; hex 4e55; asc NU;; 2: len 6; hex 416272616861; asc 
Abraha;; 3: len 8; hex 000000000002d3aa; asc         ;; 4: len 4; hex 0000ff28; asc    (;;
            n_owned: 0; heap_no: 124; next rec: 4119
InnoDB: You should dump + drop + reimport the table to fix the
InnoDB: corruption. If the crash happens at the database startup, see
InnoDB: section 6.1 of http://www.innodb.com/ibman.php about forcing
InnoDB: recovery. Then dump + drop + reimport.
040917 17:14:13InnoDB: Assertion failure in thread 2684396012 in file btr0btr.c line 618
InnoDB: Failing assertion: btr_node_ptr_get_child_page_no(node_ptr) == 
buf_frame_get_page_no(page)
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. See section 6.1 of
InnoDB: http://www.innodb.com/ibman.php about forcing recovery.
mysqld got signal 10;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help diagnose
the problem, but since we have already crashed, something is definitely wrong
and this may fail.

key_buffer_size=0
read_buffer_size=1044480
max_used_connections=0
max_connections=100
threads_connected=0
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 204399 K
bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

040917 17:14:14  mysqld ended

How to repeat:
Not sure. Maybe it's of importance or maybe not, but the table in question used utf8 charset and 
many records made use of odd characters. I'm just trying the import again after deleting my 
innodb files and will see if it happens again.
[17 Sep 2004 18:04] Bernd Heller
I have done the same: deleted InnoDB files. Recreated them and the database. Reimported data. 
And when I truncate the table I get loads of errors like these in the log:

InnoDB: Submit a detailed bug report to http://bugs.mysql.com
InnoDB: error in sec index entry update in
InnoDB: index `Country_Name` of table `partnerminedb/cities`
InnoDB: tuple DATA TUPLE: 3 fields;
 0: len 2; hex 4952; asc IR;; 1: len 6; hex 426167686920; asc Baghi ;; 2: len 8; hex 
0000000000055f18; asc       _ ;;

InnoDB: record PHYSICAL RECORD: n_fields 3; 1-byte offs TRUE; info bits 0
 0: len 2; hex 4952; asc IR;; 1: len 6; hex 42616768c481; asc Bagh  ;; 2: len 8; hex 
0000000000055b7a; asc       [z;;

TRANSACTION 0 2309, ACTIVE 48 sec, OS thread id 8739840 updating or deleting, thread 
declared inside InnoDB 360
mysql tables in use 1, locked 1
1492 lock struct(s), heap size 126272, undo log entries 352023
MySQL thread id 10, query id 100 localhost root updating
TRUNCATE  TABLE  `cities`

InnoDB: Submit a detailed bug report to http://bugs.mysql.com
InnoDB: error in sec index entry update in
InnoDB: index `Country_Name` of table `partnerminedb/cities`
InnoDB: tuple DATA TUPLE: 3 fields;
 0: len 2; hex 4952; asc IR;; 1: len 6; hex 42c4816768c4; asc B  gh ;; 2: len 8; hex 
0000000000055f31; asc       _1;;

InnoDB: record PHYSICAL RECORD: n_fields 3; 1-byte offs TRUE; info bits 0
 0: len 2; hex 4952; asc IR;; 1: len 6; hex 42c481676875; asc B  ghu;; 2: len 8; hex 
0000000000056060; asc       ``;;

TRANSACTION 0 2309, ACTIVE 48 sec, OS thread id 8739840 updating or deleting, thread 
declared inside InnoDB 310
mysql tables in use 1, locked 1
1492 lock struct(s), heap size 126272, undo log entries 352048
MySQL thread id 10, query id 100 localhost root updating
TRUNCATE  TABLE  `cities`

InnoDB: Submit a detailed bug report to http://bugs.mysql.com
InnoDB: error in sec index entry update in
InnoDB: index `Country_State_Name` of table `partnerminedb/cities`
InnoDB: tuple DATA TUPLE: 4 fields;
 0: len 2; hex 4952; asc IR;; 1: len 2; hex 4e55; asc NU;; 2: len 6; hex 42c4816768c4; asc B  gh 
;; 3: len 8; hex 0000000000055f31; asc       _1;;

InnoDB: record PHYSICAL RECORD: n_fields 4; 1-byte offs TRUE; info bits 0
 0: len 2; hex 4952; asc IR;; 1: len 2; hex 4e55; asc NU;; 2: len 6; hex 42c481676875; asc B  
ghu;; 3: len 8; hex 0000000000056071; asc       `q;;

TRANSACTION 0 2309, ACTIVE 48 sec, OS thread id 8739840 updating or deleting, thread 
declared inside InnoDB 310
mysql tables in use 1, locked 1
1492 lock struct(s), heap size 126272, undo log entries 352048
MySQL thread id 10, query id 100 localhost root updating
TRUNCATE  TABLE  `cities`

InnoDB: Submit a detailed bug report to http://bugs.mysql.com
InnoDB: error in sec index entry update in
InnoDB: index `Country_Name` of table `partnerminedb/cities`
InnoDB: tuple DATA TUPLE: 3 fields;
 0: len 2; hex 4952; asc IR;; 1: len 6; hex 42c4816768c4; asc B  gh ;; 2: len 8; hex 
0000000000055f32; asc       _2;;

InnoDB: record PHYSICAL RECORD: n_fields 3; 1-byte offs TRUE; info bits 0
 0: len 2; hex 4952; asc IR;; 1: len 6; hex 42c481676875; asc B  ghu;; 2: len 8; hex 
0000000000056060; asc       ``;;

TRANSACTION 0 2309, ACTIVE 48 sec, OS thread id 8739840 updating or deleting, thread 
declared inside InnoDB 308
mysql tables in use 1, locked 1
1492 lock struct(s), heap size 126272, undo log entries 352049
MySQL thread id 10, query id 100 localhost root updating
TRUNCATE  TABLE  `cities`

InnoDB: Submit a detailed bug report to http://bugs.mysql.com

This time I killed the truncate process which at least prevented the worst. Still no idea how a
fresh InnoDB table space can become corrupted like this though.
[18 Sep 2004 9:57] Bernd Heller
I think I found the actual source of these problems in the combination of innodb, and a prefix-
index on a string column with utf8 characters. I filed this as bug #5640.
[20 Sep 2004 12:07] Heikki Tuuri
Hi!

Ok, when we fix #5640, let us also look at this report. Probably this is the same bug as #5640.

Thank you,

Heikki
[18 Oct 2004 16:36] Heikki Tuuri
Bernd,

please test with 4.1.6 if you still get this problem after you have rebuilt the tables.

Regards,

Heikki
[30 Nov 2004 15:55] Heikki Tuuri
Bernd,

have you had time to test with 4.1.6 or 4.1.7?

Regards,

Heikki
[14 Feb 2005 22:54] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".