summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <serg@serg.mysql.com>2003-01-16 13:23:33 +0100
committerunknown <serg@serg.mysql.com>2003-01-16 13:23:33 +0100
commitef3091541e34703138e1c9f2fa5037faefaf20ba (patch)
treeb5867f3af6a8d536708da1c8276d8d52ce5ca111
parentcc014ceba85513dbe745851df2f556713682320d (diff)
downloadmariadb-git-ef3091541e34703138e1c9f2fa5037faefaf20ba.tar.gz
bugfix for 'ANALYZE for MERGE' and table-less MERGE table
mysql-test/r/merge.result: test added mysql-test/t/merge.test: test added
-rw-r--r--mysql-test/r/merge.result2
-rw-r--r--mysql-test/t/merge.test2
-rw-r--r--sql/ha_myisammrg.cc2
3 files changed, 3 insertions, 3 deletions
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result
index f7e692d1c7b..86586d5950d 100644
--- a/mysql-test/r/merge.result
+++ b/mysql-test/r/merge.result
@@ -258,7 +258,7 @@ t3 CREATE TABLE `t3` (
`othr` int(11) NOT NULL default '0'
) TYPE=MRG_MyISAM UNION=(t1,t2)
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;
a
drop table t1;
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index 2199f50fb16..e2cd8b57b7e 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -105,7 +105,7 @@ drop table t3,t2,t1;
#
# 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;
drop table t1;
diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc
index b043c6fd942..a93d2e5ed43 100644
--- a/sql/ha_myisammrg.cc
+++ b/sql/ha_myisammrg.cc
@@ -231,7 +231,7 @@ void ha_myisammrg::info(uint flag)
#endif
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,
(char*) info.rec_per_key,
sizeof(table->key_info[0].rec_per_key)*table->key_parts);