diff options
author | ramil@mysql.com <> | 2005-04-05 13:40:34 +0500 |
---|---|---|
committer | ramil@mysql.com <> | 2005-04-05 13:40:34 +0500 |
commit | f57c7d8b118aed323a74906b31fc6e013de96bb5 (patch) | |
tree | 3a0729ec5d7587f2567c8bdba31055d07bf07b84 /sql/unireg.cc | |
parent | 8197710349d1f090891adaf25d2a61006a804ce3 (diff) | |
download | mariadb-git-f57c7d8b118aed323a74906b31fc6e013de96bb5.tar.gz |
Fix for bug #9571: Primary key creation causes server crash.
Diffstat (limited to 'sql/unireg.cc')
-rw-r--r-- | sql/unireg.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sql/unireg.cc b/sql/unireg.cc index 57e2c1029f1..929ca5c672e 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -679,15 +679,14 @@ static bool make_empty_rec(THD *thd, File file,enum db_type table_type, null_count++; } bfill(buff,(null_length=(null_fields+7)/8),255); - null_pos=buff; + null_pos= buff + null_count / 8; List_iterator<create_field> it(create_fields); thd->count_cuted_fields= CHECK_FIELD_WARN; // To find wrong default values while ((field=it++)) { Field *regfield=make_field((char*) buff+field->offset,field->length, - field->flags & NOT_NULL_FLAG ? 0: - null_pos+null_count/8, + null_pos, null_count & 7, field->pack_flag, field->sql_type, |