Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
80c56602
Commit
80c56602
authored
Jan 13, 2005
by
jimw@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
ce1cd9f0
d63dc891
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
113 additions
and
7 deletions
+113
-7
mysql-test/r/ctype_utf8.result
mysql-test/r/ctype_utf8.result
+2
-2
mysql-test/r/show_check.result
mysql-test/r/show_check.result
+70
-0
mysql-test/t/show_check.test
mysql-test/t/show_check.test
+32
-0
sql/sql_show.cc
sql/sql_show.cc
+9
-5
No files found.
mysql-test/r/ctype_utf8.result
View file @
80c56602
...
@@ -412,7 +412,7 @@ show create table t1;
...
@@ -412,7 +412,7 @@ show create table t1;
Table Create Table
Table Create Table
t1 CREATE TABLE `t1` (
t1 CREATE TABLE `t1` (
`c` char(10) character set utf8 default NULL,
`c` char(10) character set utf8 default NULL,
UNIQUE KEY `a` (`c`(1))
UNIQUE KEY `a`
TYPE HASH
(`c`(1))
) ENGINE=HEAP DEFAULT CHARSET=latin1
) ENGINE=HEAP DEFAULT CHARSET=latin1
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
insert into t1 values ('aa');
insert into t1 values ('aa');
...
@@ -570,7 +570,7 @@ show create table t1;
...
@@ -570,7 +570,7 @@ show create table t1;
Table Create Table
Table Create Table
t1 CREATE TABLE `t1` (
t1 CREATE TABLE `t1` (
`c` char(10) character set utf8 collate utf8_bin default NULL,
`c` char(10) character set utf8 collate utf8_bin default NULL,
UNIQUE KEY `a` (`c`(1))
UNIQUE KEY `a`
TYPE HASH
(`c`(1))
) ENGINE=HEAP DEFAULT CHARSET=latin1
) ENGINE=HEAP DEFAULT CHARSET=latin1
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
insert into t1 values ('aa');
insert into t1 values ('aa');
...
...
mysql-test/r/show_check.result
View file @
80c56602
...
@@ -406,3 +406,73 @@ where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
...
@@ -406,3 +406,73 @@ where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
delete from mysql.db
delete from mysql.db
where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
flush privileges;
flush privileges;
CREATE TABLE t1 (i int, KEY (i)) ENGINE=MEMORY;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`i` int(11) default NULL,
KEY `i` (`i`)
) ENGINE=HEAP DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (i int, KEY USING HASH (i)) ENGINE=MEMORY;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`i` int(11) default NULL,
KEY `i` TYPE HASH (`i`)
) ENGINE=HEAP DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MEMORY;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`i` int(11) default NULL,
KEY `i` TYPE BTREE (`i`)
) ENGINE=HEAP DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (i int, KEY (i)) ENGINE=MyISAM;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`i` int(11) default NULL,
KEY `i` (`i`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`i` int(11) default NULL,
KEY `i` TYPE BTREE (`i`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (i int, KEY (i)) ENGINE=MyISAM;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`i` int(11) default NULL,
KEY `i` (`i`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE t1 ENGINE=MEMORY;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`i` int(11) default NULL,
KEY `i` (`i`)
) ENGINE=HEAP DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (i int, KEY USING BTREE (i)) ENGINE=MyISAM;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`i` int(11) default NULL,
KEY `i` TYPE BTREE (`i`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE t1 ENGINE=MEMORY;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`i` int(11) default NULL,
KEY `i` TYPE BTREE (`i`)
) ENGINE=HEAP DEFAULT CHARSET=latin1
DROP TABLE t1;
mysql-test/t/show_check.test
View file @
80c56602
...
@@ -329,3 +329,35 @@ flush privileges;
...
@@ -329,3 +329,35 @@ flush privileges;
#--replace_column 7 # 8 # 9 #
#--replace_column 7 # 8 # 9 #
#show table status from `` LIKE '';
#show table status from `` LIKE '';
#drop database ``;
#drop database ``;
# Test that USING <keytype> is always shown in SHOW CREATE TABLE when it was
# specified during table creation, but not otherwise. (Bug #7235)
CREATE
TABLE
t1
(
i
int
,
KEY
(
i
))
ENGINE
=
MEMORY
;
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
i
int
,
KEY
USING
HASH
(
i
))
ENGINE
=
MEMORY
;
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
i
int
,
KEY
USING
BTREE
(
i
))
ENGINE
=
MEMORY
;
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
i
int
,
KEY
(
i
))
ENGINE
=
MyISAM
;
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
i
int
,
KEY
USING
BTREE
(
i
))
ENGINE
=
MyISAM
;
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
# Test that when an index is created with the default key algorithm and
# altered to another storage engine, it gets the default key algorithm
# for that storage engine, but when it is specified, the specified type is
# preserved.
CREATE
TABLE
t1
(
i
int
,
KEY
(
i
))
ENGINE
=
MyISAM
;
SHOW
CREATE
TABLE
t1
;
ALTER
TABLE
t1
ENGINE
=
MEMORY
;
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
i
int
,
KEY
USING
BTREE
(
i
))
ENGINE
=
MyISAM
;
SHOW
CREATE
TABLE
t1
;
ALTER
TABLE
t1
ENGINE
=
MEMORY
;
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
sql/sql_show.cc
View file @
80c56602
...
@@ -887,14 +887,18 @@ store_create_info(THD *thd, TABLE_LIST *table_list, String *packet)
...
@@ -887,14 +887,18 @@ store_create_info(THD *thd, TABLE_LIST *table_list, String *packet)
if
(
!
(
thd
->
variables
.
sql_mode
&
MODE_NO_KEY_OPTIONS
)
&&
if
(
!
(
thd
->
variables
.
sql_mode
&
MODE_NO_KEY_OPTIONS
)
&&
!
limited_mysql_mode
&&
!
foreign_db_mode
)
!
limited_mysql_mode
&&
!
foreign_db_mode
)
{
{
if
(
share
->
db_type
==
DB_TYPE_HEAP
&&
if
(
key_info
->
algorithm
==
HA_KEY_ALG_BTREE
)
key_info
->
algorithm
==
HA_KEY_ALG_BTREE
)
packet
->
append
(
" USING BTREE"
,
12
);
packet
->
append
(
" USING BTREE"
,
12
);
if
(
key_info
->
algorithm
==
HA_KEY_ALG_HASH
)
packet
->
append
(
" USING HASH"
,
11
);
// +BAR: send USING only in non-default case: non-spatial rtree
// +BAR: send USING only in non-default case: non-spatial rtree
if
((
key_info
->
algorithm
==
HA_KEY_ALG_RTREE
)
&&
if
((
key_info
->
algorithm
==
HA_KEY_ALG_RTREE
)
&&
!
(
key_info
->
flags
&
HA_SPATIAL
))
!
(
key_info
->
flags
&
HA_SPATIAL
))
packet
->
append
(
" USING RTREE"
,
12
);
packet
->
append
(
" USING RTREE"
,
12
);
// No need to send USING FULLTEXT, it is sent as FULLTEXT KEY
}
}
packet
->
append
(
" ("
,
2
);
packet
->
append
(
" ("
,
2
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment