summaryrefslogtreecommitdiff
path: root/sql/unireg.cc
diff options
context:
space:
mode:
authorunknown <tulin@mysql.com>2005-05-25 17:54:36 +0200
committerunknown <tulin@mysql.com>2005-05-25 17:54:36 +0200
commit2286913e7fe7515713ee00b80640e2f798474567 (patch)
tree6a382aba3634a829af29ca93e4fdd4776c503212 /sql/unireg.cc
parentcfb54ed5141c1b6ba5989658180d7d87a87bf613 (diff)
downloadmariadb-git-2286913e7fe7515713ee00b80640e2f798474567.tar.gz
Bug #10838 CREATE TABLE produces strange DEFAULT value
Diffstat (limited to 'sql/unireg.cc')
-rw-r--r--sql/unireg.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/unireg.cc b/sql/unireg.cc
index da463885f85..a5c5da6ec26 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -755,8 +755,11 @@ static bool make_empty_rec(THD *thd, File file,enum db_type table_type,
}
DBUG_ASSERT(data_offset == ((null_count + 7) / 8));
- /* Fill not used startpos */
- if (null_count)
+ /*
+ We need to set the unused bits to 1. If the number of bits is a multiple
+ of 8 there are no unused bits.
+ */
+ if (null_count & 7)
*(null_pos + null_count / 8)|= ~(((uchar) 1 << (null_count & 7)) - 1);
error=(int) my_write(file,(byte*) buff, (uint) reclength,MYF_RW);