summaryrefslogtreecommitdiff
path: root/sql/unireg.cc
diff options
context:
space:
mode:
authorramil@mysql.com <>2005-04-05 13:40:34 +0500
committerramil@mysql.com <>2005-04-05 13:40:34 +0500
commitf57c7d8b118aed323a74906b31fc6e013de96bb5 (patch)
tree3a0729ec5d7587f2567c8bdba31055d07bf07b84 /sql/unireg.cc
parent8197710349d1f090891adaf25d2a61006a804ce3 (diff)
downloadmariadb-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.cc5
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,