Bug #74308 dict_index_node_ptr_max_size() returns wrong small value for SYS_TABLES
Submitted: 10 Oct 2014 4:32 Modified: 10 Oct 2014 19:46
Reporter: Yasufumi Kinoshita Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.7.5 OS:Any
Assigned to: CPU Architecture:Any

[10 Oct 2014 4:32] Yasufumi Kinoshita
Description:
dict_index_node_ptr_max_size() for SYS_TABLES returns wrong small value
and makes the block lock estimation at btr_cur_search_to_nth_level() wrong also.
It might cause deadlock at SYS_TABLES blocks by the wrong block latch order.

This is bug of WL#6326 and for mysql-5.7 only.

How to repeat:
Workload which includes CREATE/DROP TABLE seems to cause hangup (very) rarely.

Suggested fix:
dict_boot() should set exact maximum length of the columns which are used for index fields.
Currently, they are set 0 as length...

"SYS_TABLES"  : "NAME", "ID"
"SYS_COLUMNS" : "TABLE_ID"
"SYS_INDEXES" : "TABLE_ID", "ID"
"SYS_FIELDS"  : "INDEX_ID"
[10 Oct 2014 19:16] Daniel Price
Posted by developer:
 
revno: 9032
committer: Yasufumi Kinoshita <yasufumi.kinoshita@oracle.com>
branch nick: mysql-trunk
timestamp: Fri 2014-10-10 18:57:37 +0900
message:
  Bug#19791849 : DICT_INDEX_NODE_PTR_MAX_SIZE() RETURNS WRONG SMALL VALUE FOR SYS_TABLES
  
  dict_boot() should set exact maximum length of the columns which are used for index fields.
  ("SYS_TABLES", "SYS_COLUMNS", "SYS_INDEXES" and "SYS_FIELDS" intenal tables)
  Otherwise, dict_index_node_ptr_max_size() returns wrong small value.
[10 Oct 2014 19:46] Daniel Price
Posted by developer:
 
Fixed as of the upcoming 5.7.6 release, and here's the changelog entry:

The "dict_boot()" function did not set the maximum length of columns used
for index fields, resulting in "dict_index_node_ptr_max_size()" returning
incorrect values. 

Thank you for the bug report.