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
0c567648
Commit
0c567648
authored
Mar 22, 2019
by
Sachin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert (MDEV-18888)2b06de8064660c5c, fix it in different way And add test case for MDEV-18953
parent
ef33e26f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
9 deletions
+34
-9
mysql-test/main/disabled.def
mysql-test/main/disabled.def
+0
-2
mysql-test/main/long_unique_bugs.result
mysql-test/main/long_unique_bugs.result
+16
-0
mysql-test/main/long_unique_bugs.test
mysql-test/main/long_unique_bugs.test
+15
-0
sql/table.cc
sql/table.cc
+3
-7
No files found.
mysql-test/main/disabled.def
View file @
0c567648
...
...
@@ -22,5 +22,3 @@ partition_open_files_limit : open_files_limit check broken by MDEV-18360
mysqlcheck : special tables like proxy , host specific to a system are shown
flush_read_lock : special tables like proxy , host specific to a system are shown
join_cache : enable after MDEV-17752 is fixed
ctype_utf8mb4_myisam : enable after MDEV-18953 is fixed
ctype_utf8mb4_innodb : enable after MDEV-18953 is fixed
mysql-test/main/long_unique_bugs.result
View file @
0c567648
...
...
@@ -219,3 +219,19 @@ data
f
o
DROP TABLE t1;
create table t1 (
c char(10) character set utf8mb4,
unique key a using hash (c(1))
) engine=myisam;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c` char(10) CHARACTER SET utf8mb4 DEFAULT NULL,
UNIQUE KEY `a` (`c`(1)) USING HASH
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t1 values ('б');
insert into t1 values ('бб');
ERROR 23000: Duplicate entry '' for key 'a'
insert into t1 values ('ббб');
ERROR 23000: Duplicate entry '' for key 'a'
drop table t1;
mysql-test/main/long_unique_bugs.test
View file @
0c567648
...
...
@@ -250,3 +250,18 @@ SELECT * FROM t1;
DROP
TABLE
t1
;
--
let
$datadir
=
`select @@datadir`
--
remove_file
$datadir
/
test
/
load
.
data
#
# MDEV-18953 Hash index on partial char field not working
#
create
table
t1
(
c
char
(
10
)
character
set
utf8mb4
,
unique
key
a
using
hash
(
c
(
1
))
)
engine
=
myisam
;
show
create
table
t1
;
insert
into
t1
values
(
'б'
);
--
error
ER_DUP_ENTRY
insert
into
t1
values
(
'бб'
);
--
error
ER_DUP_ENTRY
insert
into
t1
values
(
'ббб'
);
drop
table
t1
;
sql/table.cc
View file @
0c567648
...
...
@@ -1204,6 +1204,8 @@ bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table,
new
(
mem_root
)
Item_field
(
thd
,
keypart
->
field
),
new
(
mem_root
)
Item_int
(
thd
,
length
));
list_item
->
fix_fields
(
thd
,
NULL
);
keypart
->
field
->
vcol_info
=
table
->
field
[
keypart
->
field
->
field_index
]
->
vcol_info
;
}
else
list_item
=
new
(
mem_root
)
Item_field
(
thd
,
keypart
->
field
);
...
...
@@ -3710,14 +3712,8 @@ enum open_frm_error open_table_from_share(THD *thd, TABLE_SHARE *share,
for
(
;
key_part
<
key_part_end
;
key_part
++
)
{
Field
*
field
=
key_part
->
field
=
outparam
->
field
[
key_part
->
fieldnr
-
1
];
/*
There's no need to create a prefix
Field for HA_KEY_ALG_LONG_HASH indexes, as they implement prefixing via
Iten_func_left anyway (see parse_vcol_defs())
*/
if
(
field
->
key_length
()
!=
key_part
->
length
&&
!
(
field
->
flags
&
BLOB_FLAG
)
&&
key_info
->
algorithm
!=
HA_KEY_ALG_LONG_HASH
)
!
(
field
->
flags
&
BLOB_FLAG
))
{
/*
We are using only a prefix of the column as a key:
...
...
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