From 5c497ef3a85c1b0ae3d6155656c6446aeb5b77a3 Mon Sep 17 00:00:00 2001
From: "jimw@mysql.com" <>
Date: Sat, 8 Jan 2005 07:31:13 +0100
Subject: [PATCH] Use 'USING <indextype>' in results of SHOW CREATE TABLE, it's
 the preferred syntax. (Bug #7233)

---
 mysql-test/r/ctype_utf8.result | 4 ++--
 mysql-test/r/show_check.result | 4 ++--
 mysql-test/r/sql_mode.result   | 6 +++---
 mysql-test/t/show_check.test   | 4 ++--
 sql/sql_show.cc                | 4 ++--
 5 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index 599d49208e..41e2c13a4b 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -448,7 +448,7 @@ show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
   `c` char(10) character set utf8 default NULL,
-  UNIQUE KEY `a` TYPE BTREE (`c`(1))
+  UNIQUE KEY `a` USING BTREE (`c`(1))
 ) ENGINE=HEAP DEFAULT CHARSET=latin1
 insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
 insert into t1 values ('aa');
@@ -606,7 +606,7 @@ show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
   `c` char(10) character set utf8 collate utf8_bin default NULL,
-  UNIQUE KEY `a` TYPE BTREE (`c`(1))
+  UNIQUE KEY `a` USING BTREE (`c`(1))
 ) ENGINE=HEAP DEFAULT CHARSET=latin1
 insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
 insert into t1 values ('aa');
diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
index 0afe45eb5e..7d214e2da0 100644
--- a/mysql-test/r/show_check.result
+++ b/mysql-test/r/show_check.result
@@ -297,7 +297,7 @@ select @@max_heap_table_size;
 1047552
 CREATE TABLE t1 (
 a int(11) default NULL,
-KEY a TYPE BTREE (a)
+KEY a USING BTREE (a)
 ) ENGINE=HEAP;
 CREATE TABLE t2 (
 b int(11) default NULL,
@@ -306,7 +306,7 @@ index(b)
 CREATE TABLE t3 (
 a int(11) default NULL,
 b int(11) default NULL,
-KEY a TYPE BTREE (a),
+KEY a USING BTREE (a),
 index(b)
 ) ENGINE=HEAP;
 insert into t1 values (1),(2);
diff --git a/mysql-test/r/sql_mode.result b/mysql-test/r/sql_mode.result
index c18be2df40..e0bbc0f214 100644
--- a/mysql-test/r/sql_mode.result
+++ b/mysql-test/r/sql_mode.result
@@ -17,7 +17,7 @@ t1	CREATE TABLE `t1` (
   `pseudo` varchar(35) character set latin2 NOT NULL default '',
   `email` varchar(60) character set latin2 NOT NULL default '',
   PRIMARY KEY  (`a`),
-  UNIQUE KEY `email` TYPE BTREE (`email`)
+  UNIQUE KEY `email` USING BTREE (`email`)
 ) ENGINE=HEAP DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
 set @@sql_mode="ansi_quotes";
 show variables like 'sql_mode';
@@ -30,7 +30,7 @@ t1	CREATE TABLE "t1" (
   "pseudo" varchar(35) character set latin2 NOT NULL default '',
   "email" varchar(60) character set latin2 NOT NULL default '',
   PRIMARY KEY  ("a"),
-  UNIQUE KEY "email" TYPE BTREE ("email")
+  UNIQUE KEY "email" USING BTREE ("email")
 ) ENGINE=HEAP DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC
 set @@sql_mode="no_table_options";
 show variables like 'sql_mode';
@@ -43,7 +43,7 @@ t1	CREATE TABLE `t1` (
   `pseudo` varchar(35) character set latin2 NOT NULL default '',
   `email` varchar(60) character set latin2 NOT NULL default '',
   PRIMARY KEY  (`a`),
-  UNIQUE KEY `email` TYPE BTREE (`email`)
+  UNIQUE KEY `email` USING BTREE (`email`)
 )
 set @@sql_mode="no_key_options";
 show variables like 'sql_mode';
diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
index 7788215dd2..3bbfe86236 100644
--- a/mysql-test/t/show_check.test
+++ b/mysql-test/t/show_check.test
@@ -210,7 +210,7 @@ select @@max_heap_table_size;
 
 CREATE TABLE t1 (
  a int(11) default NULL,
- KEY a TYPE BTREE (a)
+ KEY a USING BTREE (a)
 ) ENGINE=HEAP;
 
 CREATE TABLE t2 (
@@ -221,7 +221,7 @@ CREATE TABLE t2 (
 CREATE TABLE t3 (
  a int(11) default NULL,
  b int(11) default NULL,
- KEY a TYPE BTREE (a),
+ KEY a USING BTREE (a),
  index(b)
 ) ENGINE=HEAP;
 
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index ba13dd1ff0..142badeb85 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1408,12 +1408,12 @@ store_create_info(THD *thd, TABLE *table, String *packet)
     {
       if (table->db_type == DB_TYPE_HEAP &&
 	  key_info->algorithm == HA_KEY_ALG_BTREE)
-	packet->append(" TYPE BTREE", 11);
+	packet->append(" USING BTREE", 12);
       
       // +BAR: send USING only in non-default case: non-spatial rtree
       if ((key_info->algorithm == HA_KEY_ALG_RTREE) &&
 	  !(key_info->flags & HA_SPATIAL))
-	packet->append(" TYPE RTREE", 11);
+	packet->append(" USING RTREE", 12);
     }
     packet->append(" (", 2);
 
-- 
2.30.9