diff --git a/mysql-test/r/heap.result b/mysql-test/r/heap.result index b905dae3aba..4725ff6b814 100644 --- a/mysql-test/r/heap.result +++ b/mysql-test/r/heap.result @@ -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; diff --git a/mysql-test/t/heap.test b/mysql-test/t/heap.test index 6a9ff5c8284..922bd4b9bf0 100644 --- a/mysql-test/t/heap.test +++ b/mysql-test/t/heap.test @@ -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 diff --git a/sql/ha_heap.h b/sql/ha_heap.h index f7368436456..7c4227e952c 100644 --- a/sql/ha_heap.h +++ b/sql/ha_heap.h @@ -43,6 +43,8 @@ public: 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 {