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
4bcf5244
Commit
4bcf5244
authored
Oct 01, 2019
by
Alexander Barkov
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/5.5' into 10.1
parents
9b80f930
d481f69a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
8 deletions
+50
-8
mysql-test/r/myisam.result
mysql-test/r/myisam.result
+23
-0
mysql-test/t/myisam.test
mysql-test/t/myisam.test
+19
-0
sql/sql_table.cc
sql/sql_table.cc
+8
-8
No files found.
mysql-test/r/myisam.result
View file @
4bcf5244
...
...
@@ -2560,3 +2560,26 @@ myisam_block_size 1024
select @@
global.myisam_block_size;
@@global.myisam_block_size
1024
#
# MDEV-20704 An index on a double column erroneously uses prefix compression
#
CREATE TABLE t1 (
id INT NOT NULL PRIMARY KEY,
d DOUBLE,
KEY (d)
)
ENGINE=MyISAM;
MyISAM file: MYSQLD_DATADIR/test/t1
Record format: Fixed length
Character set: latin1_swedish_ci (8)
Data records: 0 Deleted blocks: 0
Recordlength: 13
table description:
Key Start Len Index Type
1 2 4 unique long
2 6 8 multip. double NULL
DROP TABLE t1;
#
# End of 5.5 tests
#
mysql-test/t/myisam.test
View file @
4bcf5244
...
...
@@ -1781,3 +1781,22 @@ drop table t1;
#
show variables like '
myisam_block_size
'
;
select
@@
global
.
myisam_block_size
;
--
echo
#
--
echo
# MDEV-20704 An index on a double column erroneously uses prefix compression
--
echo
#
CREATE
TABLE
t1
(
id
INT
NOT
NULL
PRIMARY
KEY
,
d
DOUBLE
,
KEY
(
d
)
)
ENGINE
=
MyISAM
;
let
$MYSQLD_DATADIR
=
`select @@datadir`
;
--
replace_result
$MYSQLD_DATADIR
MYSQLD_DATADIR
--
exec
$MYISAMCHK
-
d
$MYSQLD_DATADIR
/
test
/
t1
DROP
TABLE
t1
;
--
echo
#
--
echo
# End of 5.5 tests
--
echo
#
sql/sql_table.cc
View file @
4bcf5244
...
...
@@ -4059,16 +4059,16 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
/* Use packed keys for long strings on the first column */
if
(
!
((
*
db_options
)
&
HA_OPTION_NO_PACK_KEYS
)
&&
!
((
create_info
->
table_options
&
HA_OPTION_NO_PACK_KEYS
))
&&
(
key_part_length
>=
KEY_DEFAULT_PACK_LENGTH
&&
(
sql_field
->
sql_type
==
MYSQL_TYPE_STRING
||
sql_field
->
sql_type
==
MYSQL_TYPE_VARCHAR
||
sql_field
->
pack_flag
&
FIELDFLAG_BLOB
)))
(
key_part_length
>=
KEY_DEFAULT_PACK_LENGTH
&&
(
sql_field
->
sql_type
==
MYSQL_TYPE_STRING
||
sql_field
->
sql_type
==
MYSQL_TYPE_VARCHAR
||
f_is_blob
(
sql_field
->
pack_flag
)
)))
{
if
((
column_nr
==
0
&&
(
sql_field
->
pack_flag
&
FIELDFLAG_BLOB
))
||
if
((
column_nr
==
0
&&
f_is_blob
(
sql_field
->
pack_flag
))
||
sql_field
->
sql_type
==
MYSQL_TYPE_VARCHAR
)
key_info
->
flags
|=
HA_BINARY_PACK_KEY
|
HA_VAR_LENGTH_KEY
;
else
key_info
->
flags
|=
HA_PACK_KEY
;
key_info
->
flags
|=
HA_BINARY_PACK_KEY
|
HA_VAR_LENGTH_KEY
;
else
key_info
->
flags
|=
HA_PACK_KEY
;
}
/* Check if the key segment is partial, set the key flag accordingly */
if
(
key_part_length
!=
sql_field
->
key_length
)
...
...
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