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
7bea8607
Commit
7bea8607
authored
Jun 24, 2017
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-12923 MyISAM allows CHECK constraint violation in ALTER TABLE
use correct type for Alter_inplace_info flags.
parent
9edfc006
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
11 deletions
+18
-11
mysql-test/r/alter_table.result
mysql-test/r/alter_table.result
+2
-2
mysql-test/r/partition_alter.result
mysql-test/r/partition_alter.result
+3
-1
mysql-test/t/partition_alter.test
mysql-test/t/partition_alter.test
+3
-1
storage/myisam/ha_myisam.cc
storage/myisam/ha_myisam.cc
+10
-7
No files found.
mysql-test/r/alter_table.result
View file @
7bea8607
...
...
@@ -1925,8 +1925,8 @@ ALTER TABLE ti1 FORCE;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
ALTER TABLE tm1 FORCE;
affected rows:
0
info: Records:
0
Duplicates: 0 Warnings: 0
affected rows:
2
info: Records:
2
Duplicates: 0 Warnings: 0
ALTER TABLE ti1 AUTO_INCREMENT 3;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
...
...
mysql-test/r/partition_alter.result
View file @
7bea8607
...
...
@@ -83,6 +83,8 @@ partition p2 values less than ('2020-10-19'));
insert t1 values (0, '2000-01-02', 0);
insert t1 values (1, '2020-01-02', 10);
alter table t1 add check (b in (0, 1));
ERROR 23000: CONSTRAINT `CONSTRAINT_1` failed for `test`.`#sql-temporary`
alter table t1 add check (b in (0, 10));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
...
...
@@ -90,7 +92,7 @@ t1 CREATE TABLE `t1` (
`d` date NOT NULL,
`b` tinyint(1) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`,`d`),
CONSTRAINT `CONSTRAINT_1` CHECK (`b` in (0,1))
CONSTRAINT `CONSTRAINT_1` CHECK (`b` in (0,1
0
))
) ENGINE=MyISAM DEFAULT CHARSET=latin1
PARTITION BY RANGE COLUMNS(d)
(PARTITION p1 VALUES LESS THAN ('2016-10-18') ENGINE = MyISAM,
...
...
mysql-test/t/partition_alter.test
View file @
7bea8607
...
...
@@ -96,8 +96,10 @@ partition p1 values less than ('2016-10-18'),
partition
p2
values
less
than
(
'2020-10-19'
));
insert
t1
values
(
0
,
'2000-01-02'
,
0
);
insert
t1
values
(
1
,
'2020-01-02'
,
10
);
# FIXME: MDEV-12923 MyISAM allows CHECK constraint violation in ALTER TABLE
--
replace_regex
/
#sql-[0-9a-f_]*/#sql-temporary/
--
error
ER_CONSTRAINT_FAILED
alter
table
t1
add
check
(
b
in
(
0
,
1
));
alter
table
t1
add
check
(
b
in
(
0
,
10
));
show
create
table
t1
;
--
error
ER_CONSTRAINT_FAILED
insert
t1
values
(
2
,
'2020-01-03'
,
20
);
...
...
storage/myisam/ha_myisam.cc
View file @
7bea8607
...
...
@@ -2291,16 +2291,19 @@ ha_myisam::check_if_supported_inplace_alter(TABLE *new_table,
{
DBUG_ENTER
(
"ha_myisam::check_if_supported_inplace_alter"
);
const
uint
readd_index
=
Alter_inplace_info
::
ADD_INDEX
|
const
Alter_inplace_info
::
HA_ALTER_FLAGS
readd_index
=
Alter_inplace_info
::
ADD_INDEX
|
Alter_inplace_info
::
DROP_INDEX
;
const
uint
readd_unique
=
Alter_inplace_info
::
ADD_UNIQUE_INDEX
|
Alter_inplace_info
::
DROP_UNIQUE_INDEX
;
const
uint
readd_pk
=
Alter_inplace_info
::
ADD_PK_INDEX
|
Alter_inplace_info
::
DROP_PK_INDEX
;
const
Alter_inplace_info
::
HA_ALTER_FLAGS
readd_unique
=
Alter_inplace_info
::
ADD_UNIQUE_INDEX
|
Alter_inplace_info
::
DROP_UNIQUE_INDEX
;
const
Alter_inplace_info
::
HA_ALTER_FLAGS
readd_pk
=
Alter_inplace_info
::
ADD_PK_INDEX
|
Alter_inplace_info
::
DROP_PK_INDEX
;
const
uint
op
=
alter_info
->
handler_flags
;
const
Alter_inplace_info
::
HA_ALTER_FLAGS
op
=
alter_info
->
handler_flags
;
if
(
alter_info
->
handler_flags
&
Alter_inplace_info
::
ALTER_COLUMN_VCOL
)
if
(
op
&
Alter_inplace_info
::
ALTER_COLUMN_VCOL
)
DBUG_RETURN
(
HA_ALTER_INPLACE_NOT_SUPPORTED
);
/*
...
...
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