diff options
author | unknown <monty@hundin.mysql.fi> | 2001-12-13 19:06:14 +0200 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2001-12-13 19:06:14 +0200 |
commit | c0de7ffcc83fb5192fda8ec1e47f20c417c5c374 (patch) | |
tree | 06519b8e0a8a16f795d98ca8a9c7861e6daaac04 /sql | |
parent | 2d1e16eb04a3e78830447400a55f7cd2291e566c (diff) | |
download | mariadb-git-c0de7ffcc83fb5192fda8ec1e47f20c417c5c374.tar.gz |
Fixed problem with default & InnoDB tables.
Docs/manual.texi:
ChangeLog
Diffstat (limited to 'sql')
-rw-r--r-- | sql/table.cc | 6 | ||||
-rw-r--r-- | sql/unireg.cc | 20 |
2 files changed, 17 insertions, 9 deletions
diff --git a/sql/table.cc b/sql/table.cc index eed4170c14a..1ab6c50add9 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -120,10 +120,8 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag, outparam->db_record_offset=1; if (db_create_options & HA_OPTION_LONG_BLOB_PTR) outparam->blob_ptr_size=portable_sizeof_char_ptr; - outparam->db_low_byte_first=test(outparam->db_type == DB_TYPE_MYISAM || - outparam->db_type == DB_TYPE_BERKELEY_DB || - outparam->db_type == DB_TYPE_HEAP); - + /* Set temporaryly a good value for db_low_byte_first */ + outparam->db_low_byte_first=test(outparam->db_type != DB_TYPE_ISAM); error=4; outparam->max_rows=uint4korr(head+18); outparam->min_rows=uint4korr(head+22); diff --git a/sql/unireg.cc b/sql/unireg.cc index c5bfbbbea88..0bfc462f01a 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 */ |