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
a6040851
Commit
a6040851
authored
Apr 17, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/psergey/mysql-4.1-bug9439
parents
b9474d86
e08b1b4c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
2 deletions
+34
-2
mysql-test/r/show_check.result
mysql-test/r/show_check.result
+21
-0
mysql-test/t/show_check.test
mysql-test/t/show_check.test
+11
-0
sql/sql_show.cc
sql/sql_show.cc
+2
-2
No files found.
mysql-test/r/show_check.result
View file @
a6040851
...
...
@@ -477,3 +477,24 @@ t1 CREATE TABLE `t1` (
KEY `i` TYPE BTREE (`i`)
) ENGINE=HEAP DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1(
field1 text NOT NULL,
PRIMARY KEY(field1(1000))
);
show index from t1;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def Table 253 64 2 N 129 31 63
def Non_unique 1 1 1 N 32929 0 63
def Key_name 253 64 7 N 129 31 63
def Seq_in_index 1 2 1 N 32929 0 63
def Column_name 253 64 6 N 129 31 63
def Collation 253 1 1 Y 128 31 63
def Cardinality 8 21 1 Y 32896 0 63
def Sub_part 2 3 4 Y 32928 0 63
def Packed 253 10 0 Y 128 31 63
def Null 253 3 0 N 129 31 63
def Index_type 253 16 5 N 129 31 63
def Comment 253 255 0 N 129 31 63
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 0 PRIMARY 1 field1 A 0 1000 NULL BTREE
drop table t1;
mysql-test/t/show_check.test
View file @
a6040851
...
...
@@ -357,3 +357,14 @@ SHOW CREATE TABLE t1;
ALTER
TABLE
t1
ENGINE
=
MEMORY
;
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
# Test for BUG#9439 "Reporting wrong datatype for sub_part on show index"
CREATE
TABLE
t1
(
field1
text
NOT
NULL
,
PRIMARY
KEY
(
field1
(
1000
))
);
--
enable_metadata
show
index
from
t1
;
--
disable_metadata
drop
table
t1
;
sql/sql_show.cc
View file @
a6040851
...
...
@@ -980,7 +980,7 @@ mysqld_show_keys(THD *thd, TABLE_LIST *table_list)
field_list
.
push_back
(
item
=
new
Item_int
(
"Cardinality"
,
0
,
21
));
item
->
maybe_null
=
1
;
field_list
.
push_back
(
item
=
new
Item_return_int
(
"Sub_part"
,
3
,
MYSQL_TYPE_
TINY
));
MYSQL_TYPE_
SHORT
));
item
->
maybe_null
=
1
;
field_list
.
push_back
(
item
=
new
Item_empty_string
(
"Packed"
,
10
));
item
->
maybe_null
=
1
;
...
...
@@ -1025,7 +1025,7 @@ mysqld_show_keys(THD *thd, TABLE_LIST *table_list)
/* Check if we have a key part that only uses part of the field */
if
(
!
(
key_info
->
flags
&
HA_FULLTEXT
)
&&
(
!
key_part
->
field
||
key_part
->
length
!=
table
->
field
[
key_part
->
fieldnr
-
1
]
->
key_length
()))
protocol
->
store_
tiny
((
longlong
)
key_part
->
length
/
protocol
->
store_
short
((
longlong
)
key_part
->
length
/
key_part
->
field
->
charset
()
->
mbmaxlen
);
else
protocol
->
store_null
();
...
...
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