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
98db467e
Commit
98db467e
authored
Mar 12, 2020
by
Sachin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better Alter Query
parent
2d12d739
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
13 deletions
+20
-13
sql/sql_table.cc
sql/sql_table.cc
+6
-6
sql/sql_yacc.yy
sql/sql_yacc.yy
+14
-7
No files found.
sql/sql_table.cc
View file @
98db467e
...
...
@@ -9421,8 +9421,8 @@ static bool write_start_alter(THD *thd, bool* partial_alter, start_alter_info *i
{
char
*
send_query
=
(
char
*
)
thd
->
alloc
(
thd
->
query_length
()
+
20
);
thd
->
gtid_flags3
|=
Gtid_log_event
::
FL_START_ALTER_E1
;
sprintf
(
send_query
,
"/*!10
0001 %s, START %ld */"
,
thd
->
query
()
,
(
long
)
thd
->
thread_id
);
sprintf
(
send_query
,
"/*!10
5001 %s EXECUTE = UNTIL COMMIT %ld */"
,
thd
->
query
(),
(
long
)
thd
->
thread_id
);
if
(
write_bin_log
(
thd
,
FALSE
,
send_query
,
strlen
(
send_query
),
true
))
return
true
;
*
partial_alter
=
true
;
...
...
@@ -10238,7 +10238,7 @@ do_continue:;
if
(
opt_binlog_split_alter
)
{
thd
->
gtid_flags3
|=
Gtid_log_event
::
FL_ROLLBACK_ALTER_E1
;
sprintf
(
send_query
,
"/*!10
0001 %s,
ROLLBACK %ld */"
,
thd
->
query
(),
sprintf
(
send_query
,
"/*!10
5001 %s EXECUTE =
ROLLBACK %ld */"
,
thd
->
query
(),
(
long
)
thd
->
thread_id
);
if
(
write_bin_log
(
thd
,
false
,
send_query
,
strlen
(
send_query
),
true
,
true
))
DBUG_RETURN
(
true
);
...
...
@@ -10403,7 +10403,7 @@ do_continue:;
if
(
partial_alter
)
{
thd
->
gtid_flags3
|=
Gtid_log_event
::
FL_COMMIT_ALTER_E1
;
sprintf
(
send_query
,
"%s /*!10
0001,
COMMIT %ld */"
,
thd
->
query
(),
sprintf
(
send_query
,
"%s /*!10
5001 EXECUTE =
COMMIT %ld */"
,
thd
->
query
(),
(
long
)
thd
->
thread_id
);
if
(
write_bin_log
(
thd
,
false
,
send_query
,
strlen
(
send_query
)))
DBUG_RETURN
(
true
);
...
...
@@ -10612,7 +10612,7 @@ do_continue:;
if
(
partial_alter
)
{
thd
->
gtid_flags3
|=
Gtid_log_event
::
FL_COMMIT_ALTER_E1
;
sprintf
(
send_query
,
"%s /*!10
0001,
COMMIT %ld */"
,
thd
->
query
(),
sprintf
(
send_query
,
"%s /*!10
5001 EXECUTE =
COMMIT %ld */"
,
thd
->
query
(),
(
long
)
thd
->
thread_id
);
if
(
write_bin_log
(
thd
,
false
,
send_query
,
strlen
(
send_query
)))
DBUG_RETURN
(
true
);
...
...
@@ -10681,7 +10681,7 @@ do_continue:;
else
if
(
opt_binlog_split_alter
)
{
thd
->
gtid_flags3
|=
Gtid_log_event
::
FL_ROLLBACK_ALTER_E1
;
sprintf
(
send_query
,
"/*!10
0001 %s,
ROLLBACK %ld */"
,
thd
->
query
(),
sprintf
(
send_query
,
"/*!10
5001 %s EXECUTE =
ROLLBACK %ld */"
,
thd
->
query
(),
(
long
)
thd
->
thread_id
);
if
(
write_bin_log
(
thd
,
false
,
send_query
,
strlen
(
send_query
),
true
,
true
))
DBUG_RETURN
(
true
);
...
...
sql/sql_yacc.yy
View file @
98db467e
...
...
@@ -7303,6 +7303,9 @@ alter_commands:
remove_partitioning
| remove_partitioning
| partitioning
| alter_list
alter_state
| alter_state
/*
This part was added for release 5.1 by Mikael Ronstrm.
From here we insert a number of commands to manage the partitions of a
...
...
@@ -7676,7 +7679,6 @@ alter_list_item:
}
| alter_algorithm_option
| alter_lock_option
| alter_state
| ADD SYSTEM VERSIONING_SYM
{
Lex->alter_info.flags|= ALTER_ADD_SYSTEM_VERSIONING;
...
...
@@ -7735,20 +7737,25 @@ alter_lock_option:
}
;
alter_state:
START_SYM ulong_num
EXECUTE_SYM opt_equal DEFAULT
{
Lex->alter_info.alter_state= Alter_info::ALTER_TABLE_NORMAL;
Lex->alter_info.alter_identifier= 0;
}
| EXECUTE_SYM opt_equal UNTIL_SYM COMMIT_SYM ulong_num
{
Lex->alter_info.alter_state= Alter_info::ALTER_TABLE_START;
Lex->alter_info.alter_identifier= $
2
;
Lex->alter_info.alter_identifier= $
5
;
}
| COMMIT_SYM ulong_num
|
EXECUTE_SYM opt_equal
COMMIT_SYM ulong_num
{
Lex->alter_info.alter_state= Alter_info::ALTER_TABLE_COMMIT;
Lex->alter_info.alter_identifier= $
2
;
Lex->alter_info.alter_identifier= $
4
;
}
| ROLLBACK_SYM ulong_num
|
EXECUTE_SYM opt_equal
ROLLBACK_SYM ulong_num
{
Lex->alter_info.alter_state= Alter_info::ALTER_TABLE_ROLLBACK;
Lex->alter_info.alter_identifier= $
2
;
Lex->alter_info.alter_identifier= $
4
;
}
;
...
...
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