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
33f0270e
Commit
33f0270e
authored
Jul 04, 2022
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.4 into 10.5
parents
b546913b
9a0cbd31
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
248 additions
and
20 deletions
+248
-20
mysql-test/suite/innodb/r/change_column_collation.result
mysql-test/suite/innodb/r/change_column_collation.result
+19
-0
mysql-test/suite/innodb/r/instant_alter_charset,redundant.rdiff
...test/suite/innodb/r/instant_alter_charset,redundant.rdiff
+8
-5
mysql-test/suite/innodb/r/instant_alter_charset.result
mysql-test/suite/innodb/r/instant_alter_charset.result
+164
-14
mysql-test/suite/innodb/t/change_column_collation.test
mysql-test/suite/innodb/t/change_column_collation.test
+24
-0
mysql-test/suite/innodb/t/instant_alter_charset.test
mysql-test/suite/innodb/t/instant_alter_charset.test
+23
-0
storage/innobase/handler/handler0alter.cc
storage/innobase/handler/handler0alter.cc
+10
-1
No files found.
mysql-test/suite/innodb/r/change_column_collation.result
0 → 100644
View file @
33f0270e
#
# MDEV-26294 Duplicate entries in unique index not detected when
# changing collation with INPLACE algorithm
#
SET NAMES utf8;
CREATE TABLE t1 (
id INT PRIMARY KEY,
msg VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_swedish_ci UNIQUE
) ENGINE=INNODB;
INSERT INTO t1 VALUES (1, 'aaa');
INSERT INTO t1 VALUES (2, 'ååå');
ALTER TABLE t1
MODIFY msg VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci,
ALGORITHM=NOCOPY;
ERROR 0A000: ALGORITHM=NOCOPY is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY
ALTER TABLE t1 DROP INDEX msg,
MODIFY msg VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci,
ALGORITHM=NOCOPY;
DROP TABLE t1;
mysql-test/suite/innodb/r/instant_alter_charset,redundant.rdiff
View file @
33f0270e
--- instant_alter_charset.result 2019-06-17 14:36:02.311515062 +0300
+++ instant_alter_charset,redundant.result 2019-06-17 14:50:11.888705725 +0300
@@ -279,7 +279,6 @@
@@ -288,7 +288,6 @@
alter table boundary_255
modify a varchar(70) charset utf8mb4,
algorithm=instant;
...
...
@@ -8,7 +6,7 @@
drop table boundary_255;
create table t (
a char(10) collate utf8mb3_general_ci,
@@ -
297,32 +296
,21 @@
@@ -
306,35 +305
,21 @@
repeat('a', 10), repeat('a', 10)
);
alter table t modify a char(10) collate utf8mb4_general_ci, algorithm=instant;
...
...
@@ -27,16 +25,19 @@
-test.t check status OK
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table t modify aa char(10) collate utf8mb4_general_ci, algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table t modify bb char(70) collate utf8mb4_general_ci, algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table t modify cc char(100) collate utf8mb4_general_ci, algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Collation change on an indexed column. Try ALGORITHM=COPY
-check table t;
-Table Op Msg_type Msg_text
-test.t check status OK
...
...
@@ -44,8 +45,10 @@
alter table t modify d char(10) collate utf8mb4_spanish_ci, algorithm=instant;
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
alter table t modify dd char(10) collate utf8mb4_spanish_ci, algorithm=instant;
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason:
ADD INDEX. Try ALGORITHM=NO
COPY
-ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason:
Collation change on an indexed column. Try ALGORITHM=
COPY
+ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type. Try ALGORITHM=COPY
select * from t;
a b c aa bb cc d dd
aaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaa aaaaaaaaaa
mysqltest: Result length mismatch
mysql-test/suite/innodb/r/instant_alter_charset.result
View file @
33f0270e
This diff is collapsed.
Click to expand it.
mysql-test/suite/innodb/t/change_column_collation.test
0 → 100644
View file @
33f0270e
--
source
include
/
have_innodb
.
inc
--
echo
#
--
echo
# MDEV-26294 Duplicate entries in unique index not detected when
--
echo
# changing collation with INPLACE algorithm
--
echo
#
# Detect the duplicate entry after collation change of column
SET
NAMES
utf8
;
CREATE
TABLE
t1
(
id
INT
PRIMARY
KEY
,
msg
VARCHAR
(
100
)
CHARACTER
SET
utf8
COLLATE
utf8_swedish_ci
UNIQUE
)
ENGINE
=
INNODB
;
INSERT
INTO
t1
VALUES
(
1
,
'aaa'
);
INSERT
INTO
t1
VALUES
(
2
,
'ååå'
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
ALTER
TABLE
t1
MODIFY
msg
VARCHAR
(
100
)
CHARACTER
SET
utf8
COLLATE
utf8_unicode_ci
,
ALGORITHM
=
NOCOPY
;
ALTER
TABLE
t1
DROP
INDEX
msg
,
MODIFY
msg
VARCHAR
(
100
)
CHARACTER
SET
utf8
COLLATE
utf8_unicode_ci
,
ALGORITHM
=
NOCOPY
;
DROP
TABLE
t1
;
mysql-test/suite/innodb/t/instant_alter_charset.test
View file @
33f0270e
...
...
@@ -227,9 +227,18 @@ create table key_part_bug (
a
varchar
(
150
)
charset
utf8mb3
unique
key
)
engine
=
innodb
;
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
alter
table
key_part_bug
modify
a
varchar
(
150
)
charset
utf8mb4
,
algorithm
=
instant
;
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
alter
table
key_part_bug
modify
a
varchar
(
150
)
charset
utf8mb4
,
algorithm
=
nocopy
;
alter
table
key_part_bug
drop
index
a
,
modify
a
varchar
(
150
)
charset
utf8mb4
,
algorithm
=
nocopy
;
drop
table
key_part_bug
;
...
...
@@ -347,10 +356,13 @@ check table t;
alter
table
t
modify
c
char
(
100
)
collate
utf8mb4_general_ci
,
algorithm
=
instant
;
check
table
t
;
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
alter
table
t
modify
aa
char
(
10
)
collate
utf8mb4_general_ci
,
algorithm
=
instant
;
check
table
t
;
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
alter
table
t
modify
bb
char
(
70
)
collate
utf8mb4_general_ci
,
algorithm
=
instant
;
check
table
t
;
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
alter
table
t
modify
cc
char
(
100
)
collate
utf8mb4_general_ci
,
algorithm
=
instant
;
check
table
t
;
...
...
@@ -442,11 +454,16 @@ while ($counter <= $data_size) {
insert
into
tmp
values
(
'AAA'
,
'AAA'
),
(
'bbb'
,
'bbb'
);
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
eval
alter
table
tmp
change
a
a
varchar
(
50
)
charset
$to_charset
collate
$to_collate
,
modify
b
varchar
(
50
)
charset
$to_charset
collate
$to_collate
,
algorithm
=
instant
;
eval
alter
table
tmp
change
a
a
varchar
(
50
)
charset
$to_charset
collate
$to_collate
,
algorithm
=
instant
;
check
table
tmp
;
drop
table
tmp
;
...
...
@@ -685,7 +702,10 @@ alter table t modify a char(10) collate latin1_general_cs, algorithm=inplace;
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
alter
table
t
modify
b
char
(
10
)
collate
latin1_general_cs
,
algorithm
=
instant
;
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
alter
table
t
modify
b
char
(
10
)
collate
latin1_general_cs
,
algorithm
=
nocopy
;
alter
table
t
modify
b
char
(
10
)
collate
latin1_general_cs
,
drop
index
b_key
,
algorithm
=
nocopy
;
check
table
t
;
alter
table
t
modify
c
char
(
10
)
collate
latin1_general_cs
,
algorithm
=
instant
;
...
...
@@ -708,7 +728,10 @@ alter table t modify a varchar(10) collate latin1_general_cs, algorithm=inplace;
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
alter
table
t
modify
b
varchar
(
10
)
collate
latin1_general_cs
,
algorithm
=
instant
;
--
error
ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
alter
table
t
modify
b
varchar
(
10
)
collate
latin1_general_cs
,
algorithm
=
nocopy
;
alter
table
t
modify
b
varchar
(
10
)
collate
latin1_general_cs
,
drop
index
b_key
,
algorithm
=
nocopy
;
check
table
t
;
alter
table
t
modify
c
varchar
(
10
)
collate
latin1_general_cs
,
algorithm
=
instant
;
...
...
storage/innobase/handler/handler0alter.cc
View file @
33f0270e
...
...
@@ -2272,7 +2272,16 @@ ha_innobase::check_if_supported_inplace_alter(
if
(
new_field
->
field
)
{
/* This is an existing column. */
continue
;
if
(
new_field
->
field
->
charset
()
==
key_part
->
field
->
charset
())
{
continue
;
}
ha_alter_info
->
unsupported_reason
=
"Collation change on"
" an indexed column"
;
DBUG_RETURN
(
HA_ALTER_INPLACE_NOT_SUPPORTED
);
}
/* This is an added column. */
...
...
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