diff options
author | unknown <marko@hundin.mysql.fi> | 2005-03-10 16:42:43 +0200 |
---|---|---|
committer | unknown <marko@hundin.mysql.fi> | 2005-03-10 16:42:43 +0200 |
commit | db32cb17100f707c53cfe50a411e1dcd9813a9a1 (patch) | |
tree | a785e6e36d1aa7b73ed0782a4c9afcfb95850e0b /innobase/dict/dict0load.c | |
parent | 380c64b1fcf3cdbd0e2c31232d6fe927289dff25 (diff) | |
download | mariadb-git-db32cb17100f707c53cfe50a411e1dcd9813a9a1.tar.gz |
InnoDB: Keep the "compact format" flag in SYS_TABLES.N_COLS
instead of SYS_TABLES.MIX_LEN, because the latter was not
initialized to zero in old MySQL 3.23 releases. This will break
existing MySQL/InnoDB 5.0.3-bk databases for which
SHOW TABLE STATUS displays Row_format=Compact.
innobase/dict/dict0crea.c:
Write the "compact format" flag to N_COLS instead of MIX_LEN.
Remove corruption analysis for MIX_LEN, as it has been tracked down
to MySQL 3.23.4x not initializing MIX_LEN.
innobase/dict/dict0load.c:
Read the "compact format" flag from N_COLS instead of MIX_LEN.
Diffstat (limited to 'innobase/dict/dict0load.c')
-rw-r--r-- | innobase/dict/dict0load.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/innobase/dict/dict0load.c b/innobase/dict/dict0load.c index b33111b1ff1..1622ffa5454 100644 --- a/innobase/dict/dict0load.c +++ b/innobase/dict/dict0load.c @@ -818,8 +818,10 @@ dict_load_table( field = rec_get_nth_field_old(rec, 4, &len); n_cols = mach_read_from_4(field); - /* table->comp will be initialized later, in this function */ - table = dict_mem_table_create(name, space, n_cols, FALSE); + /* The high-order bit of N_COLS is the "compact format" flag. */ + table = dict_mem_table_create(name, space, + n_cols & ~0x80000000UL, + !!(n_cols & 0x80000000UL)); table->ibd_file_missing = ibd_file_missing; @@ -844,14 +846,12 @@ dict_load_table( #endif } - /* The high-order bit of MIX_LEN is the "compact format" flag */ - field = rec_get_nth_field_old(rec, 7, &len); - table->comp = !!(mach_read_from_1(field) & 0x80); - if ((table->type == DICT_TABLE_CLUSTER) || (table->type == DICT_TABLE_CLUSTER_MEMBER)) { - table->mix_len = mach_read_from_4(field) & 0x7fffffff; + field = rec_get_nth_field_old(rec, 7, &len); + ut_a(len == 4); + table->mix_len = mach_read_from_4(field); } btr_pcur_close(&pcur); |