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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
532de702
Commit
532de702
authored
May 03, 2015
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more tests, moving code around
parent
2bb0e713
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
18 deletions
+26
-18
mysql-test/r/alter_table.result
mysql-test/r/alter_table.result
+2
-0
mysql-test/r/alter_table_online.result
mysql-test/r/alter_table_online.result
+3
-0
mysql-test/r/innodb_mysql_sync.result
mysql-test/r/innodb_mysql_sync.result
+1
-0
mysql-test/t/alter_table_online.test
mysql-test/t/alter_table_online.test
+3
-0
sql/sql_table.cc
sql/sql_table.cc
+17
-18
No files found.
mysql-test/r/alter_table.result
View file @
532de702
...
...
@@ -1693,8 +1693,10 @@ INSERT INTO tm1 VALUES (1,1,1), (2,2,2);
INSERT INTO tm2 VALUES (1,1,1), (2,2,2);
ALTER TABLE ti1;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
ALTER TABLE tm1;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
ALTER TABLE ti1 ADD COLUMN d VARCHAR(200);
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
...
...
mysql-test/r/alter_table_online.result
View file @
532de702
...
...
@@ -12,6 +12,9 @@ ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCL
alter online table t1 rename to t2;
ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
alter online table t1 algorithm=INPLACE, lock=NONE;
alter online table t1;
alter table t1 algorithm=INPLACE;
alter table t1 lock=NONE;
drop table t1;
create temporary table t1 (a int not null primary key, b int, c varchar(80), e enum('a','b'));
insert into t1 (a) values (1),(2),(3);
...
...
mysql-test/r/innodb_mysql_sync.result
View file @
532de702
...
...
@@ -528,6 +528,7 @@ SET DEBUG_SYNC= 'RESET';
# This should not do anything
ALTER TABLE t1;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL rebuild';
# Check that we rebuild the table
ALTER TABLE t1 engine=innodb;
...
...
mysql-test/t/alter_table_online.test
View file @
532de702
...
...
@@ -27,6 +27,9 @@ alter online table t1 rename to t2;
# No OPs
alter
online
table
t1
algorithm
=
INPLACE
,
lock
=
NONE
;
alter
online
table
t1
;
alter
table
t1
algorithm
=
INPLACE
;
alter
table
t1
lock
=
NONE
;
drop
table
t1
;
...
...
sql/sql_table.cc
View file @
532de702
...
...
@@ -8429,9 +8429,25 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
mysql_audit_alter_table
(
thd
,
table_list
);
THD_STAGE_INFO
(
thd
,
stage_setup
);
handle_if_exists_options
(
thd
,
table
,
alter_info
);
/*
Look if we have to do anything at all.
ALTER can become NOOP after handling
the IF (NOT) EXISTS options.
*/
if
(
alter_info
->
flags
==
0
)
{
my_snprintf
(
alter_ctx
.
tmp_name
,
sizeof
(
alter_ctx
.
tmp_name
),
ER
(
ER_INSERT_INFO
),
0L
,
0L
,
thd
->
get_stmt_da
()
->
current_statement_warn_count
());
my_ok
(
thd
,
0L
,
0L
,
alter_ctx
.
tmp_name
);
DBUG_RETURN
(
false
);
}
if
(
!
(
alter_info
->
flags
&
~
(
Alter_info
::
ALTER_RENAME
|
Alter_info
::
ALTER_KEYS_ONOFF
))
&&
alter_info
->
flags
!=
0
&&
alter_info
->
requested_algorithm
!=
Alter_info
::
ALTER_TABLE_ALGORITHM_COPY
&&
!
table
->
s
->
tmp_table
)
// no need to touch frm
...
...
@@ -8450,23 +8466,6 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
DBUG_RETURN
(
res
);
}
if
(
alter_info
->
flags
!=
0
)
handle_if_exists_options
(
thd
,
table
,
alter_info
);
/*
Look if we have to do anything at all.
Normally ALTER can become NOOP only after handling
the IF (NOT) EXISTS options.
*/
if
(
alter_info
->
flags
==
0
)
{
my_snprintf
(
alter_ctx
.
tmp_name
,
sizeof
(
alter_ctx
.
tmp_name
),
ER
(
ER_INSERT_INFO
),
0L
,
0L
,
thd
->
get_stmt_da
()
->
current_statement_warn_count
());
my_ok
(
thd
,
0L
,
0L
,
alter_ctx
.
tmp_name
);
DBUG_RETURN
(
false
);
}
/* We have to do full alter table. */
#ifdef WITH_PARTITION_STORAGE_ENGINE
...
...
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