Commit b4c61152 authored by unknown's avatar unknown
Browse files

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
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -675,4 +675,9 @@ a b c
1	2	0
1	1	1
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;
+3 −0
Original line number Diff line number Diff line
@@ -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;
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;
+11 −0
Original line number Diff line number Diff line
@@ -35,6 +35,17 @@
const char **ha_myisammrg::bas_ext() const
{ 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)
{
+1 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ class ha_myisammrg: public handler
  ~ha_myisammrg() {}
  const char *table_type() const { return "MRG_MyISAM"; }
  const char **bas_ext() const;
  const char *index_type(uint key_number);
  ulong table_flags() const
  {
    return (HA_REC_NOT_IN_SEQ | HA_AUTO_PART_KEY | HA_READ_RND_SAME |