Commit ef309154 authored by unknown's avatar unknown

bugfix for 'ANALYZE for MERGE' and table-less MERGE table


mysql-test/r/merge.result:
  test added
mysql-test/t/merge.test:
  test added
parent cc014ceb
...@@ -258,7 +258,7 @@ t3 CREATE TABLE `t3` ( ...@@ -258,7 +258,7 @@ t3 CREATE TABLE `t3` (
`othr` int(11) NOT NULL default '0' `othr` int(11) NOT NULL default '0'
) TYPE=MRG_MyISAM UNION=(t1,t2) ) TYPE=MRG_MyISAM UNION=(t1,t2)
drop table t3,t2,t1; drop table t3,t2,t1;
create table t1 (a int not null) type=merge; create table t1 (a int not null, key(a)) type=merge;
select * from t1; select * from t1;
a a
drop table t1; drop table t1;
......
...@@ -105,7 +105,7 @@ drop table t3,t2,t1; ...@@ -105,7 +105,7 @@ drop table t3,t2,t1;
# #
# Test table without unions # Test table without unions
# #
create table t1 (a int not null) type=merge; create table t1 (a int not null, key(a)) type=merge;
select * from t1; select * from t1;
drop table t1; drop table t1;
......
...@@ -231,7 +231,7 @@ void ha_myisammrg::info(uint flag) ...@@ -231,7 +231,7 @@ void ha_myisammrg::info(uint flag)
#endif #endif
if (flag & HA_STATUS_CONST) if (flag & HA_STATUS_CONST)
{ {
if (table->key_parts) if (table->key_parts && info.rec_per_key)
memcpy((char*) table->key_info[0].rec_per_key, memcpy((char*) table->key_info[0].rec_per_key,
(char*) info.rec_per_key, (char*) info.rec_per_key,
sizeof(table->key_info[0].rec_per_key)*table->key_parts); sizeof(table->key_info[0].rec_per_key)*table->key_parts);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment