summaryrefslogtreecommitdiff
path: root/innobase
diff options
context:
space:
mode:
authormarko@hundin.mysql.fi <>2005-03-10 16:42:43 +0200
committermarko@hundin.mysql.fi <>2005-03-10 16:42:43 +0200
commit946e24713ce7e9c969d80fc6cd4ebf7cc99e77e1 (patch)
treea785e6e36d1aa7b73ed0782a4c9afcfb95850e0b /innobase
parent4d8233e5617e26e6bf6868c0f002b4d4623f8429 (diff)
downloadmariadb-git-946e24713ce7e9c969d80fc6cd4ebf7cc99e77e1.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.
Diffstat (limited to 'innobase')
-rw-r--r--innobase/dict/dict0crea.c17
-rw-r--r--innobase/dict/dict0load.c14
2 files changed, 10 insertions, 21 deletions
diff --git a/innobase/dict/dict0crea.c b/innobase/dict/dict0crea.c
index fda09feca6f..1f12386e413 100644
--- a/innobase/dict/dict0crea.c
+++ b/innobase/dict/dict0crea.c
@@ -63,8 +63,8 @@ dict_create_sys_tables_tuple(
dfield = dtuple_get_nth_field(entry, 2);
ptr = mem_heap_alloc(heap, 4);
- mach_write_to_4(ptr, table->n_def);
-
+ mach_write_to_4(ptr, table->n_def
+ | ((ulint) table->comp << 31));
dfield_set_data(dfield, ptr, 4);
/* 5: TYPE -----------------------------*/
dfield = dtuple_get_nth_field(entry, 3);
@@ -82,21 +82,10 @@ dict_create_sys_tables_tuple(
dfield_set_data(dfield, ptr, 8);
/* 7: MIX_LEN --------------------------*/
- /* Track corruption reported on mailing list Jan 14, 2005 */
- if (table->mix_len != 0 && table->mix_len != 0x80000000) {
- fprintf(stderr,
-"InnoDB: Error: mix_len is %lu in table %s\n", (ulong)table->mix_len,
- table->name);
- mem_analyze_corruption((byte*)&(table->mix_len));
-
- ut_error;
- }
-
dfield = dtuple_get_nth_field(entry, 5);
ptr = mem_heap_alloc(heap, 4);
- mach_write_to_4(ptr, (table->mix_len & 0x7fffffff) |
- ((ulint) table->comp << 31));
+ mach_write_to_4(ptr, table->mix_len);
dfield_set_data(dfield, ptr, 4);
/* 8: CLUSTER_NAME ---------------------*/
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);