Commit 6edf3ef1 authored by vasil's avatar vasil

branches/zip:

Bugfix1: Set innodb_locks.lock_index to NOT NULL.
If a column in INFORMATION_SCHEMA table has the flag
MY_I_S_MAYBE_NULL and it is not explicitly marked as NOT NULL
with the method ::set_notnull() then it is always rendered as
NULL by MySQL.

Bugfix2: Avoid crashes if lock_index is NULL. It is NULL for table
level locks.

Pointyhat to:	Marko
parent 30d19bf4
......@@ -566,12 +566,19 @@ fill_innodb_locks_from_cache(
system_charset_info));
/* lock_index */
bufend = innobase_convert_name(buf, sizeof(buf),
row->lock_index,
strlen(row->lock_index),
thd, FALSE);
OK(fields[IDX_LOCK_INDEX]->store(buf, bufend - buf,
system_charset_info));
if (row->lock_index != NULL) {
bufend = innobase_convert_name(buf, sizeof(buf),
row->lock_index,
strlen(row->lock_index),
thd, FALSE);
OK(fields[IDX_LOCK_INDEX]->store(buf, bufend - buf,
system_charset_info));
fields[IDX_LOCK_INDEX]->set_notnull();
} else {
fields[IDX_LOCK_INDEX]->set_null();
}
/* lock_space */
OK(field_store_ulint(fields[IDX_LOCK_SPACE],
......
lock_mode lock_type lock_table lock_index lock_rec lock_data
X RECORD `test`.```t'\"_str` NULL 2 '1', 'abc', '''abc', 'abc''', 'a''bc', 'a''bc''', '''abc'''''
X RECORD `test`.```t'\"_str` NULL 2 '1', 'abc', '''abc', 'abc''', 'a''bc', 'a''bc''', '''abc'''''
X RECORD `test`.```t'\"_str` NULL 3 '2', 'abc', '"abc', 'abc"', 'a"bc', 'a"bc"', '"abc""'
X RECORD `test`.```t'\"_str` NULL 3 '2', 'abc', '"abc', 'abc"', 'a"bc', 'a"bc"', '"abc""'
X RECORD `test`.```t'\"_str` NULL 4 '3', 'abc', '\\abc', 'abc\\', 'a\\bc', 'a\\bc\\', '\\abc\\\\'
X RECORD `test`.```t'\"_str` NULL 4 '3', 'abc', '\\abc', 'abc\\', 'a\\bc', 'a\\bc\\', '\\abc\\\\'
X RECORD `test`.```t'\"_str` NULL 5 '4', 'abc', '\0abc', 'abc\0', 'a\0bc', 'a\0bc\0', 'a\0bc\0\0'
X RECORD `test`.```t'\"_str` NULL 5 '4', 'abc', '\0abc', 'abc\0', 'a\0bc', 'a\0bc\0', 'a\0bc\0\0'
X RECORD `test`.`t_min` NULL 2 -128, 0, -32768, 0, -8388608, 0, -2147483648, 0, -9223372036854775808, 0
X RECORD `test`.`t_min` NULL 2 -128, 0, -32768, 0, -8388608, 0, -2147483648, 0, -9223372036854775808, 0
X RECORD `test`.`t_max` NULL 2 127, 255, 32767, 65535, 8388607, 16777215, 2147483647, 4294967295, 9223372036854775807, 18446744073709551615
X RECORD `test`.`t_max` NULL 2 127, 255, 32767, 65535, 8388607, 16777215, 2147483647, 4294967295, 9223372036854775807, 18446744073709551615
X RECORD `test`.```t'\"_str` NULL 1 supremum pseudo-record
X RECORD `test`.```t'\"_str` NULL 1 supremum pseudo-record
X RECORD `test`.```t'\"_str` `PRIMARY` 2 '1', 'abc', '''abc', 'abc''', 'a''bc', 'a''bc''', '''abc'''''
X RECORD `test`.```t'\"_str` `PRIMARY` 2 '1', 'abc', '''abc', 'abc''', 'a''bc', 'a''bc''', '''abc'''''
X RECORD `test`.```t'\"_str` `PRIMARY` 3 '2', 'abc', '"abc', 'abc"', 'a"bc', 'a"bc"', '"abc""'
X RECORD `test`.```t'\"_str` `PRIMARY` 3 '2', 'abc', '"abc', 'abc"', 'a"bc', 'a"bc"', '"abc""'
X RECORD `test`.```t'\"_str` `PRIMARY` 4 '3', 'abc', '\\abc', 'abc\\', 'a\\bc', 'a\\bc\\', '\\abc\\\\'
X RECORD `test`.```t'\"_str` `PRIMARY` 4 '3', 'abc', '\\abc', 'abc\\', 'a\\bc', 'a\\bc\\', '\\abc\\\\'
X RECORD `test`.```t'\"_str` `PRIMARY` 5 '4', 'abc', '\0abc', 'abc\0', 'a\0bc', 'a\0bc\0', 'a\0bc\0\0'
X RECORD `test`.```t'\"_str` `PRIMARY` 5 '4', 'abc', '\0abc', 'abc\0', 'a\0bc', 'a\0bc\0', 'a\0bc\0\0'
X RECORD `test`.`t_min` `PRIMARY` 2 -128, 0, -32768, 0, -8388608, 0, -2147483648, 0, -9223372036854775808, 0
X RECORD `test`.`t_min` `PRIMARY` 2 -128, 0, -32768, 0, -8388608, 0, -2147483648, 0, -9223372036854775808, 0
X RECORD `test`.`t_max` `PRIMARY` 2 127, 255, 32767, 65535, 8388607, 16777215, 2147483647, 4294967295, 9223372036854775807, 18446744073709551615
X RECORD `test`.`t_max` `PRIMARY` 2 127, 255, 32767, 65535, 8388607, 16777215, 2147483647, 4294967295, 9223372036854775807, 18446744073709551615
X RECORD `test`.```t'\"_str` `PRIMARY` 1 supremum pseudo-record
X RECORD `test`.```t'\"_str` `PRIMARY` 1 supremum pseudo-record
lock_table COUNT(*)
`test`.`t_max` 2
`test`.`t_min` 2
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment