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
790a8274
Commit
790a8274
authored
Feb 22, 2017
by
sjaakola
Committed by
Jan Lindström
Aug 11, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refs: MW-360 * reverted WSREP_TO_ISOLATION macros back to original form
parent
04c6b03c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
31 deletions
+42
-31
sql/sql_parse.cc
sql/sql_parse.cc
+13
-1
sql/sql_parse.h
sql/sql_parse.h
+21
-4
sql/sql_partition_admin.cc
sql/sql_partition_admin.cc
+2
-2
sql/sql_truncate.cc
sql/sql_truncate.cc
+3
-3
sql/wsrep_mysqld.cc
sql/wsrep_mysqld.cc
+2
-2
sql/wsrep_mysqld.h
sql/wsrep_mysqld.h
+1
-19
No files found.
sql/sql_parse.cc
View file @
790a8274
...
...
@@ -4040,7 +4040,19 @@ case SQLCOM_PREPARE:
slave_ddl_exec_mode_options
==
SLAVE_EXEC_MODE_IDEMPOTENT
)
lex
->
check_exists
=
1
;
WSREP_TO_ISOLATION_BEGIN
(
NULL
,
NULL
,
all_tables
);
#ifdef WITH_WSREP
for
(
TABLE_LIST
*
table
=
all_tables
;
table
;
table
=
table
->
next_global
)
{
if
(
!
lex
->
drop_temporary
&&
(
!
thd
->
is_current_stmt_binlog_format_row
()
||
!
find_temporary_table
(
thd
,
table
)))
{
WSREP_TO_ISOLATION_BEGIN
(
NULL
,
NULL
,
all_tables
);
break
;
}
}
#endif
/* WITH_WSREP */
/* DDL and binlog write order are protected by metadata locks. */
res
=
mysql_rm_table
(
thd
,
first_table
,
lex
->
check_exists
,
lex
->
drop_temporary
);
...
...
sql/sql_parse.h
View file @
790a8274
...
...
@@ -209,12 +209,29 @@ inline bool is_supported_parser_charset(CHARSET_INFO *cs)
return
MY_TEST
(
cs
->
mbminlen
==
1
);
}
#ifndef WITH_WSREP
#ifdef WITH_WSREP
#define WSREP_MYSQL_DB (char *)"mysql"
#define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_) \
if (WSREP(thd) && wsrep_to_isolation_begin(thd, db_, table_, table_list_)) goto error;
#define WSREP_TO_ISOLATION_END \
if (WSREP(thd) || (thd && thd->wsrep_exec_mode==TOTAL_ORDER)) \
wsrep_to_isolation_end(thd);
/* Checks if lex->no_write_to_binlog is set for statements that use
LOCAL or NO_WRITE_TO_BINLOG
*/
#define WSREP_TO_ISOLATION_BEGIN_WRTCHK(db_, table_, table_list_) \
if (WSREP(thd) && !thd->lex->no_write_to_binlog \
&& wsrep_to_isolation_begin(thd, db_, table_, table_list_)) goto error;
#else
#define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_)
#define WSREP_TO_ISOLATION_BEGIN_QUERY(db_, query_, table_, table_list_)
#define WSREP_TO_ISOLATION_END
#define WSREP_TO_ISOLATION_BEGIN_WRTCHK(db_, query_, table_, table_list_)
#endif
/* !WITH_WSREP */
#define WSREP_TO_ISOLATION_BEGIN_WRTCHK(db_, table_, table_list_)
#endif
/* WITH_WSREP */
#endif
/* SQL_PARSE_INCLUDED */
sql/sql_partition_admin.cc
View file @
790a8274
...
...
@@ -537,7 +537,7 @@ bool Sql_cmd_alter_table_exchange_partition::
if
((
!
thd
->
is_current_stmt_binlog_format_row
()
||
/* TODO: Do we really need to check for temp tables in this case? */
!
find_temporary_table
(
thd
,
table_list
))
&&
wsrep_to_isolation_begin
(
thd
,
NULL
,
table_list
->
db
,
table_list
->
table_name
,
wsrep_to_isolation_begin
(
thd
,
table_list
->
db
,
table_list
->
table_name
,
NULL
))
{
WSREP_WARN
(
"ALTER TABLE EXCHANGE PARTITION isolation failure"
);
...
...
@@ -785,7 +785,7 @@ bool Sql_cmd_alter_table_truncate_partition::execute(THD *thd)
if
(
WSREP
(
thd
)
&&
(
!
thd
->
is_current_stmt_binlog_format_row
()
||
!
find_temporary_table
(
thd
,
first_table
))
&&
wsrep_to_isolation_begin
(
thd
,
NULL
,
first_table
->
db
,
first_table
->
table_name
,
NULL
)
thd
,
first_table
->
db
,
first_table
->
table_name
,
NULL
)
)
{
WSREP_WARN
(
"ALTER TABLE TRUNCATE PARTITION isolation failure"
);
...
...
sql/sql_truncate.cc
View file @
790a8274
...
...
@@ -487,9 +487,9 @@ bool Sql_cmd_truncate_table::truncate_table(THD *thd, TABLE_LIST *table_ref)
bool
hton_can_recreate
;
#ifdef WITH_WSREP
if
(
WSREP
(
thd
)
&&
wsrep_to_isolation_begin
(
thd
,
NULL
,
table_ref
->
db
,
table_ref
->
table_name
,
NULL
))
if
(
WSREP
(
thd
)
&&
wsrep_to_isolation_begin
(
thd
,
table_ref
->
db
,
table_ref
->
table_name
,
NULL
))
DBUG_RETURN
(
TRUE
);
#endif
/* WITH_WSREP */
if
(
lock_table
(
thd
,
table_ref
,
&
hton_can_recreate
))
...
...
sql/wsrep_mysqld.cc
View file @
790a8274
...
...
@@ -1523,7 +1523,7 @@ static void wsrep_RSU_end(THD *thd)
thd
->
variables
.
wsrep_on
=
1
;
}
int
wsrep_to_isolation_begin
(
THD
*
thd
,
c
onst
char
*
query
,
c
har
*
db_
,
char
*
table_
,
int
wsrep_to_isolation_begin
(
THD
*
thd
,
char
*
db_
,
char
*
table_
,
const
TABLE_LIST
*
table_list
)
{
...
...
@@ -1579,7 +1579,7 @@ int wsrep_to_isolation_begin(THD *thd, const char *query, char *db_, char *table
{
switch
(
thd
->
variables
.
wsrep_OSU_method
)
{
case
WSREP_OSU_TOI
:
ret
=
wsrep_TOI_begin
(
thd
,
query
,
db_
,
table_
,
table_list
);
ret
=
wsrep_TOI_begin
(
thd
,
thd
->
query
()
,
db_
,
table_
,
table_list
);
break
;
case
WSREP_OSU_RSU
:
ret
=
wsrep_RSU_begin
(
thd
,
db_
,
table_
);
...
...
sql/wsrep_mysqld.h
View file @
790a8274
...
...
@@ -320,7 +320,7 @@ extern PSI_mutex_key key_LOCK_wsrep_slave_threads;
extern
PSI_mutex_key
key_LOCK_wsrep_desync
;
#endif
/* HAVE_PSI_INTERFACE */
struct
TABLE_LIST
;
int
wsrep_to_isolation_begin
(
THD
*
thd
,
c
onst
char
*
query
,
c
har
*
db_
,
char
*
table_
,
int
wsrep_to_isolation_begin
(
THD
*
thd
,
char
*
db_
,
char
*
table_
,
const
TABLE_LIST
*
table_list
);
void
wsrep_to_isolation_end
(
THD
*
thd
);
void
wsrep_cleanup_transaction
(
THD
*
thd
);
...
...
@@ -338,22 +338,4 @@ void wsrep_init_sidno(const wsrep_uuid_t&);
bool
wsrep_node_is_donor
();
bool
wsrep_node_is_synced
();
#define WSREP_MYSQL_DB (char *)"mysql"
#define WSREP_TO_ISOLATION_BEGIN(db_, table_, table_list_) \
if (WSREP(thd) && wsrep_to_isolation_begin(thd, NULL, db_, table_, table_list_)) goto error;
#define WSREP_TO_ISOLATION_BEGIN_QUERY(query, db_, table_, table_list_) \
(WSREP(thd) && wsrep_to_isolation_begin(thd, query, db_, table_, table_list_))
#define WSREP_TO_ISOLATION_END \
if (WSREP(thd) || (thd && thd->wsrep_exec_mode==TOTAL_ORDER)) \
wsrep_to_isolation_end(thd);
/* Checks if lex->no_write_to_binlog is set for statements that use
LOCAL or NO_WRITE_TO_BINLOG
*/
#define WSREP_TO_ISOLATION_BEGIN_WRTCHK(db_, table_, table_list_) \
if (WSREP(thd) && !thd->lex->no_write_to_binlog \
&& wsrep_to_isolation_begin(thd, NULL, db_, table_, table_list_)) goto error;
#endif
/* WSREP_MYSQLD_H */
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