summaryrefslogtreecommitdiff
path: root/sql/unireg.cc
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2001-12-13 20:54:20 +0200
committerunknown <monty@hundin.mysql.fi>2001-12-13 20:54:20 +0200
commit6e31c2ca7d7881d26c86c29e8abd0e1528d6613b (patch)
tree053b9c4d48bf88ba54d5cf728bfebadb38d1a548 /sql/unireg.cc
parent9385d3aba530562b1ddcecedeb6dd61cd3d63d96 (diff)
parentb554ef6b10db3d6640935cafe0d7ebaf8034ae13 (diff)
downloadmariadb-git-6e31c2ca7d7881d26c86c29e8abd0e1528d6613b.tar.gz
merge
innobase/btr/btr0cur.c: Auto merged innobase/dict/dict0dict.c: Auto merged innobase/sync/sync0arr.c: Auto merged sql/mysqld.cc: Auto merged sql/table.cc: Auto merged sql/unireg.cc: Auto merged Docs/manual.texi: Merge
Diffstat (limited to 'sql/unireg.cc')
-rw-r--r--sql/unireg.cc20
1 files changed, 15 insertions, 5 deletions
diff --git a/sql/unireg.cc b/sql/unireg.cc
index 9f34e9cc71b..8c72dfc2855 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -515,16 +515,23 @@ static bool make_empty_rec(File file,enum db_type table_type,
uchar *buff,*null_pos;
TABLE table;
create_field *field;
+ handler *handler;
DBUG_ENTER("make_empty_rec");
/* We need a table to generate columns for default values */
bzero((char*) &table,sizeof(table));
- table.db_low_byte_first=test(table_type == DB_TYPE_MYISAM ||
- table_type == DB_TYPE_HEAP);
- table.blob_ptr_size=portable_sizeof_char_ptr;
+ handler= get_new_handler((TABLE*) 0, table_type);
- if (!(buff=(uchar*) my_malloc((uint) reclength,MYF(MY_WME | MY_ZEROFILL))))
+ if (!handler ||
+ !(buff=(uchar*) my_malloc((uint) reclength,MYF(MY_WME | MY_ZEROFILL))))
+ {
+ delete handler;
DBUG_RETURN(1);
+ }
+
+ table.db_low_byte_first= handler->low_byte_first();
+ table.blob_ptr_size=portable_sizeof_char_ptr;
+
firstpos=reclength;
null_count=0;
if (!(table_options & HA_OPTION_PACK_RECORD))
@@ -574,8 +581,11 @@ static bool make_empty_rec(File file,enum db_type table_type,
regfield->reset();
delete regfield;
}
- bfill((byte*) buff+null_length,firstpos-null_length,255);/* Fill not used startpos */
+
+ /* Fill not used startpos */
+ bfill((byte*) buff+null_length,firstpos-null_length,255);
error=(int) my_write(file,(byte*) buff,(uint) reclength,MYF_RW);
my_free((gptr) buff,MYF(MY_FAE));
+ delete handler;
DBUG_RETURN(error);
} /* make_empty_rec */