Commit f82e2887 authored by unknown's avatar unknown
Browse files

Always report row type of 'Fixed' for MEMORY tables. (Bug #3094)


mysql-test/r/heap.result:
  Add new results
mysql-test/t/heap.test:
  Add new regression test
sql/ha_heap.h:
  Always report row type of Fixed for MEMORY tables
parent d17c9b06
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -701,3 +701,10 @@ insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd
insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz");
ERROR 23000: Duplicate entry 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl' for key 1
drop table t1;
create table t1 (c char(10)) engine=memory;
create table t2 (c varchar(10)) engine=memory;
show table status like 't_';
Name	Engine	Version	Row_format	Rows	Avg_row_length	Data_length	Max_data_length	Index_length	Data_free	Auto_increment	Create_time	Update_time	Check_time	Collation	Checksum	Create_options	Comment
t1	MEMORY	10	Fixed	0	11	0	720192	0	0	NULL	NULL	NULL	NULL	latin1_swedish_ci	NULL		
t2	MEMORY	10	Fixed	0	12	0	785664	0	0	NULL	NULL	NULL	NULL	latin1_swedish_ci	NULL		
drop table t1, t2;
+10 −0
Original line number Diff line number Diff line
@@ -437,3 +437,13 @@ insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd
drop table t1;

# End of 4.1 tests

#
# Bug #3094: Row format of memory tables should always be reported as Fixed
#
create table t1 (c char(10)) engine=memory;
create table t2 (c varchar(10)) engine=memory;
show table status like 't_';
drop table t1, t2;

# End of 5.0 tests
+2 −0
Original line number Diff line number Diff line
@@ -43,6 +43,8 @@ class ha_heap: public handler
    return ((table->key_info[inx].algorithm == HA_KEY_ALG_BTREE) ? "BTREE" :
	    "HASH");
  }
  /* Rows also use a fixed-size format */
  enum row_type get_row_type() const { return ROW_TYPE_FIXED; }
  const char **bas_ext() const;
  ulong table_flags() const
  {