diff options
author | unknown <tulin@dl145b.mysql.com> | 2005-09-19 15:52:57 +0200 |
---|---|---|
committer | unknown <tulin@dl145b.mysql.com> | 2005-09-19 15:52:57 +0200 |
commit | f42ec4e0e28774803472e26fa4f216bbe3ae6585 (patch) | |
tree | 0ee29435d0e6022288c1c69f3c2e12486d6c266d /sql/table.cc | |
parent | 96dc3a3dfe7ae9427dfe7b6dd61543e6363fb5d3 (diff) | |
download | mariadb-git-f42ec4e0e28774803472e26fa4f216bbe3ae6585.tar.gz |
Corrected last fix for
Bug #13152 bit fields and fields that follow become corrupted when dumped from NDB tables
Diffstat (limited to 'sql/table.cc')
-rw-r--r-- | sql/table.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/table.cc b/sql/table.cc index 74ffe58e42e..67d4ebd713b 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -287,8 +287,6 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat, keynames=(char*) key_part; strpos+= (strmov(keynames, (char *) strpos) - keynames)+1; - share->null_bytes= null_pos - (uchar*) outparam->null_flags + (null_bit_pos + 7) / 8; - share->reclength = uint2korr((head+16)); if (*(head+26) == 1) share->system= 1; /* one-record-database */ @@ -459,6 +457,9 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat, { outparam->null_flags=null_pos=(uchar*) record+1; null_bit_pos= (db_create_options & HA_OPTION_PACK_RECORD) ? 0 : 1; + /* null_bytes below is only correct under the condition that + there are no bit fields. Correct values is set below after the + table struct is initialized */ share->null_bytes= (share->null_fields + null_bit_pos + 7) / 8; } else @@ -871,6 +872,9 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat, } } + /* the correct null_bytes can now be set, since bitfields have been taken into account */ + share->null_bytes= null_pos - (uchar*) outparam->null_flags + (null_bit_pos + 7) / 8; + /* The table struct is now initialized; Open the table */ error=2; if (db_stat) |