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
050280ce
Commit
050280ce
authored
Mar 15, 2019
by
sachinsetia1001@gmail.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-18922 Alter on long unique varchar column makes result null
Don't add long key into share->keys_for_keyread
parent
1ef50a34
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
1 deletion
+26
-1
mysql-test/main/long_unique_bugs.result
mysql-test/main/long_unique_bugs.result
+14
-0
mysql-test/main/long_unique_bugs.test
mysql-test/main/long_unique_bugs.test
+10
-0
sql/table.cc
sql/table.cc
+2
-1
No files found.
mysql-test/main/long_unique_bugs.result
View file @
050280ce
...
...
@@ -129,3 +129,17 @@ Comment
Index_comment
ALTER TABLE t1 ADD INDEX (pk);
DROP TABLE t1;
CREATE TABLE t1 (b int, a varchar(4000));
INSERT INTO t1 VALUES (1, 2),(2,3),(3,4);
ALTER TABLE t1 ADD UNIQUE INDEX (a);
SELECT * FROM t1;
b a
1 2
2 3
3 4
SELECT a FROM t1;
a
2
3
4
drop table t1;
mysql-test/main/long_unique_bugs.test
View file @
050280ce
...
...
@@ -150,3 +150,13 @@ CREATE TABLE t1 (pk INT, PRIMARY KEY USING HASH (pk)) ENGINE=InnoDB;
--
query_vertical
show
keys
from
t1
;
ALTER
TABLE
t1
ADD
INDEX
(
pk
);
DROP
TABLE
t1
;
#
# MDEV-18922 Alter on long unique varchar column makes result null
#
CREATE
TABLE
t1
(
b
int
,
a
varchar
(
4000
));
INSERT
INTO
t1
VALUES
(
1
,
2
),(
2
,
3
),(
3
,
4
);
ALTER
TABLE
t1
ADD
UNIQUE
INDEX
(
a
);
SELECT
*
FROM
t1
;
SELECT
a
FROM
t1
;
drop
table
t1
;
sql/table.cc
View file @
050280ce
...
...
@@ -2684,7 +2684,8 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
if
(
i
==
0
)
field
->
key_start
.
set_bit
(
key
);
if
(
field
->
key_length
()
==
key_part
->
length
&&
!
(
field
->
flags
&
BLOB_FLAG
))
!
(
field
->
flags
&
BLOB_FLAG
)
&&
key_info
->
algorithm
!=
HA_KEY_ALG_LONG_HASH
)
{
if
(
handler_file
->
index_flags
(
key
,
i
,
0
)
&
HA_KEYREAD_ONLY
)
{
...
...
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