Commit b4c61152 authored by unknown's avatar unknown

Fix for BUG#7377. This fix adds the same implementation for...

Fix for BUG#7377. This fix adds the same implementation for ha_myisammgr::index_type as in version 5.0.


mysql-test/r/merge.result:
  Added test result for BUG#7377.
mysql-test/t/merge.test:
  Added test for BUG#7377.
sql/ha_myisammrg.cc:
  Added implementation for handler::index_type.
sql/ha_myisammrg.h:
  Added implementation for handler::index_type.
parent 1548c6b7
...@@ -675,4 +675,9 @@ a b c ...@@ -675,4 +675,9 @@ a b c
1 2 0 1 2 0
1 1 1 1 1 1
1 1 0 1 1 0
show index from t3;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t3 1 a 1 a A NULL NULL NULL YES BTREE
t3 1 a 2 b A NULL NULL NULL YES BTREE
t3 1 a 3 c A NULL NULL NULL YES BTREE
drop table t1, t2, t3; drop table t1, t2, t3;
...@@ -301,5 +301,8 @@ select a,b,c from t3 force index (a) where a=1 order by a,b,c; ...@@ -301,5 +301,8 @@ select a,b,c from t3 force index (a) where a=1 order by a,b,c;
explain select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc; explain select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc;
select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc; select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc;
# BUG#7377 SHOW index on MERGE table crashes debug server
show index from t3;
drop table t1, t2, t3; drop table t1, t2, t3;
...@@ -35,6 +35,17 @@ ...@@ -35,6 +35,17 @@
const char **ha_myisammrg::bas_ext() const const char **ha_myisammrg::bas_ext() const
{ static const char *ext[]= { ".MRG", NullS }; return ext; } { static const char *ext[]= { ".MRG", NullS }; return ext; }
const char *ha_myisammrg::index_type(uint key_number)
{
return ((table->key_info[key_number].flags & HA_FULLTEXT) ?
"FULLTEXT" :
(table->key_info[key_number].flags & HA_SPATIAL) ?
"SPATIAL" :
(table->key_info[key_number].algorithm == HA_KEY_ALG_RTREE) ?
"RTREE" :
"BTREE");
}
int ha_myisammrg::open(const char *name, int mode, uint test_if_locked) int ha_myisammrg::open(const char *name, int mode, uint test_if_locked)
{ {
......
...@@ -32,6 +32,7 @@ class ha_myisammrg: public handler ...@@ -32,6 +32,7 @@ class ha_myisammrg: public handler
~ha_myisammrg() {} ~ha_myisammrg() {}
const char *table_type() const { return "MRG_MyISAM"; } const char *table_type() const { return "MRG_MyISAM"; }
const char **bas_ext() const; const char **bas_ext() const;
const char *index_type(uint key_number);
ulong table_flags() const ulong table_flags() const
{ {
return (HA_REC_NOT_IN_SEQ | HA_AUTO_PART_KEY | HA_READ_RND_SAME | return (HA_REC_NOT_IN_SEQ | HA_AUTO_PART_KEY | HA_READ_RND_SAME |
......
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