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
049811ec
Commit
049811ec
authored
3 years ago
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Plain Diff
Merge 10.2 into 10.3
parents
f130adbf
fdc4b7a6
Branches unavailable
Tags unavailable
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
92 additions
and
0 deletions
+92
-0
mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result
mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result
+33
-0
mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test
mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test
+43
-0
storage/innobase/handler/handler0alter.cc
storage/innobase/handler/handler0alter.cc
+16
-0
No files found.
mysql-test/suite/innodb_fts/r/innodb-fts-ddl.result
View file @
049811ec
...
...
@@ -232,6 +232,38 @@ CREATE TABLE t1 (FTS_DOC_ID BIGINT UNSIGNED PRIMARY KEY,
f1 VARCHAR(200),FULLTEXT fidx(f1))engine=innodb;
ALTER TABLE t1 DROP index fidx, ADD FULLTEXT INDEX(f1);
DROP TABLE t1;
#
# MDEV-21478 Inplace alter fails to report error when
# FTS_DOC_ID is added
SET NAMES utf8;
CREATE TABLE t1(f1 INT NOT NULL)ENGINE=InnoDB;
ALTER TABLE t1 ADD FTS_DOC_ıD BIGINT UNSIGNED NOT NULL, ALGORITHM=COPY;
ALTER TABLE t1 DROP COLUMN FTS_DOC_ıD;
ALTER TABLE t1 ADD FTS_DOC_ıD BIGINT UNSIGNED NOT NULL, ALGORITHM=INPLACE;
DROP TABLE t1;
CREATE TABLE t1 (f1 INT NOT NULL)ENGINE=InnoDB;
ALTER TABLE t1 ADD FTS_DOC_İD BIGINT UNSIGNED NOT NULL, ALGORITHM=INPLACE;
ERROR 42000: Incorrect column name 'FTS_DOC_İD'
ALTER TABLE t1 ADD FTS_DOC_İD BIGINT UNSIGNED NOT NULL, ALGORITHM=COPY;
ERROR 42000: Incorrect column name 'FTS_DOC_İD'
ALTER TABLE t1 ADD fts_doc_id INT, ALGORITHM=COPY;
ERROR 42000: Incorrect column name 'fts_doc_id'
ALTER TABLE t1 ADD fts_doc_id INT, ALGORITHM=INPLACE;
ERROR 42000: Incorrect column name 'fts_doc_id'
ALTER TABLE t1 ADD fts_doc_id BIGINT UNSIGNED NOT NULL, ALGORITHM=COPY;
ERROR 42000: Incorrect column name 'fts_doc_id'
ALTER TABLE t1 ADD fts_doc_id BIGINT UNSIGNED NOT NULL, ALGORITHM=INPLACE;
ERROR 42000: Incorrect column name 'fts_doc_id'
ALTER TABLE t1 ADD FTS_DOC_ID INT UNSIGNED NOT NULL, ALGORITHM=COPY;
ERROR 42000: Incorrect column name 'FTS_DOC_ID'
ALTER TABLE t1 ADD FTS_DOC_ID INT UNSIGNED NOT NULL, ALGORITHM=INPLACE;
ERROR 42000: Incorrect column name 'FTS_DOC_ID'
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(3)) ENGINE=InnoDB;
ALTER TABLE t1 ADD FULLTEXT KEY(a), ADD COLUMN b VARCHAR(3), ADD FULLTEXT KEY(b);
DROP TABLE t1;
...
...
@@ -244,3 +276,4 @@ CREATE TABLE t1
ENGINE=InnoDB;
ALTER TABLE t1 ADD c SERIAL;
DROP TABLE t1;
# End of 10.3 tests
This diff is collapsed.
Click to expand it.
mysql-test/suite/innodb_fts/t/innodb-fts-ddl.test
View file @
049811ec
...
...
@@ -278,6 +278,47 @@ CREATE TABLE t1 (FTS_DOC_ID BIGINT UNSIGNED PRIMARY KEY,
ALTER
TABLE
t1
DROP
index
fidx
,
ADD
FULLTEXT
INDEX
(
f1
);
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-21478 Inplace alter fails to report error when
--
echo
# FTS_DOC_ID is added
SET
NAMES
utf8
;
CREATE
TABLE
t1
(
f1
INT
NOT
NULL
)
ENGINE
=
InnoDB
;
ALTER
TABLE
t1
ADD
FTS_DOC_ıD
BIGINT
UNSIGNED
NOT
NULL
,
ALGORITHM
=
COPY
;
ALTER
TABLE
t1
DROP
COLUMN
FTS_DOC_ıD
;
ALTER
TABLE
t1
ADD
FTS_DOC_ıD
BIGINT
UNSIGNED
NOT
NULL
,
ALGORITHM
=
INPLACE
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
f1
INT
NOT
NULL
)
ENGINE
=
InnoDB
;
--
error
ER_WRONG_COLUMN_NAME
ALTER
TABLE
t1
ADD
FTS_DOC_İD
BIGINT
UNSIGNED
NOT
NULL
,
ALGORITHM
=
INPLACE
;
--
error
ER_WRONG_COLUMN_NAME
ALTER
TABLE
t1
ADD
FTS_DOC_İD
BIGINT
UNSIGNED
NOT
NULL
,
ALGORITHM
=
COPY
;
--
error
ER_WRONG_COLUMN_NAME
ALTER
TABLE
t1
ADD
fts_doc_id
INT
,
ALGORITHM
=
COPY
;
--
error
ER_WRONG_COLUMN_NAME
ALTER
TABLE
t1
ADD
fts_doc_id
INT
,
ALGORITHM
=
INPLACE
;
--
error
ER_WRONG_COLUMN_NAME
ALTER
TABLE
t1
ADD
fts_doc_id
BIGINT
UNSIGNED
NOT
NULL
,
ALGORITHM
=
COPY
;
--
error
ER_WRONG_COLUMN_NAME
ALTER
TABLE
t1
ADD
fts_doc_id
BIGINT
UNSIGNED
NOT
NULL
,
ALGORITHM
=
INPLACE
;
--
error
ER_WRONG_COLUMN_NAME
ALTER
TABLE
t1
ADD
FTS_DOC_ID
INT
UNSIGNED
NOT
NULL
,
ALGORITHM
=
COPY
;
--
error
ER_WRONG_COLUMN_NAME
ALTER
TABLE
t1
ADD
FTS_DOC_ID
INT
UNSIGNED
NOT
NULL
,
ALGORITHM
=
INPLACE
;
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
# Add more than one FTS index
CREATE
TABLE
t1
(
a
VARCHAR
(
3
))
ENGINE
=
InnoDB
;
ALTER
TABLE
t1
ADD
FULLTEXT
KEY
(
a
),
ADD
COLUMN
b
VARCHAR
(
3
),
ADD
FULLTEXT
KEY
(
b
);
...
...
@@ -294,3 +335,5 @@ CREATE TABLE t1
ENGINE
=
InnoDB
;
ALTER
TABLE
t1
ADD
c
SERIAL
;
DROP
TABLE
t1
;
--
echo
# End of 10.3 tests
This diff is collapsed.
Click to expand it.
storage/innobase/handler/handler0alter.cc
View file @
049811ec
...
...
@@ -5266,6 +5266,7 @@ prepare_inplace_alter_table_dict(
}
if
(
dict_col_name_is_reserved
(
field
->
field_name
.
str
))
{
wrong_column_name:
dict_mem_table_free
(
ctx
->
new_table
);
ctx
->
new_table
=
ctx
->
old_table
;
my_error
(
ER_WRONG_COLUMN_NAME
,
MYF
(
0
),
...
...
@@ -5273,6 +5274,21 @@ prepare_inplace_alter_table_dict(
goto
new_clustered_failed
;
}
/** Note the FTS_DOC_ID name is case sensitive due
to internal query parser.
FTS_DOC_ID column must be of BIGINT NOT NULL type
and it should be in all capitalized characters */
if
(
!
innobase_strcasecmp
(
field
->
field_name
.
str
,
FTS_DOC_ID_COL_NAME
))
{
if
(
col_type
!=
DATA_INT
||
field
->
real_maybe_null
()
||
col_len
!=
sizeof
(
doc_id_t
)
||
strcmp
(
field
->
field_name
.
str
,
FTS_DOC_ID_COL_NAME
))
{
goto
wrong_column_name
;
}
}
if
(
is_virtual
)
{
dict_mem_table_add_v_col
(
ctx
->
new_table
,
ctx
->
heap
,
...
...
This diff is collapsed.
Click to expand it.
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