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
362ad94b
Commit
362ad94b
authored
Sep 05, 2016
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup: don't copy-paste, don't current_thd
parent
747893a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
36 deletions
+23
-36
sql/handler.cc
sql/handler.cc
+23
-36
No files found.
sql/handler.cc
View file @
362ad94b
...
...
@@ -5875,6 +5875,26 @@ int handler::ha_reset()
}
static
int
check_wsrep_max_ws_rows
()
{
#ifdef WITH_WSREP
if
(
wsrep_max_ws_rows
)
{
THD
*
thd
=
current_thd
;
thd
->
wsrep_affected_rows
++
;
if
(
thd
->
wsrep_exec_mode
!=
REPL_RECV
&&
thd
->
wsrep_affected_rows
>
wsrep_max_ws_rows
)
{
trans_rollback_stmt
(
thd
)
||
trans_rollback
(
thd
);
my_message
(
ER_ERROR_DURING_COMMIT
,
"wsrep_max_ws_rows exceeded"
,
MYF
(
0
));
return
ER_ERROR_DURING_COMMIT
;
}
}
#endif
/* WITH_WSREP */
return
0
;
}
int
handler
::
ha_write_row
(
uchar
*
buf
)
{
int
error
;
...
...
@@ -5897,20 +5917,9 @@ int handler::ha_write_row(uchar *buf)
rows_changed
++
;
if
(
unlikely
(
error
=
binlog_log_row
(
table
,
0
,
buf
,
log_func
)))
DBUG_RETURN
(
error
);
/* purecov: inspected */
#ifdef WITH_WSREP
current_thd
->
wsrep_affected_rows
++
;
if
(
wsrep_max_ws_rows
&&
current_thd
->
wsrep_exec_mode
!=
REPL_RECV
&&
current_thd
->
wsrep_affected_rows
>
wsrep_max_ws_rows
)
{
trans_rollback_stmt
(
current_thd
)
||
trans_rollback
(
current_thd
);
my_message
(
ER_ERROR_DURING_COMMIT
,
"wsrep_max_ws_rows exceeded"
,
MYF
(
0
));
DBUG_RETURN
(
ER_ERROR_DURING_COMMIT
);
}
#endif
/* WITH_WSREP */
DEBUG_SYNC_C
(
"ha_write_row_end"
);
DBUG_RETURN
(
0
);
DBUG_RETURN
(
check_wsrep_max_ws_rows
()
);
}
...
...
@@ -5941,18 +5950,7 @@ int handler::ha_update_row(const uchar *old_data, uchar *new_data)
rows_changed
++
;
if
(
unlikely
(
error
=
binlog_log_row
(
table
,
old_data
,
new_data
,
log_func
)))
return
error
;
#ifdef WITH_WSREP
current_thd
->
wsrep_affected_rows
++
;
if
(
wsrep_max_ws_rows
&&
current_thd
->
wsrep_exec_mode
!=
REPL_RECV
&&
current_thd
->
wsrep_affected_rows
>
wsrep_max_ws_rows
)
{
trans_rollback_stmt
(
current_thd
)
||
trans_rollback
(
current_thd
);
my_message
(
ER_ERROR_DURING_COMMIT
,
"wsrep_max_ws_rows exceeded"
,
MYF
(
0
));
return
ER_ERROR_DURING_COMMIT
;
}
#endif
/* WITH_WSREP */
return
0
;
return
check_wsrep_max_ws_rows
();
}
int
handler
::
ha_delete_row
(
const
uchar
*
buf
)
...
...
@@ -5979,18 +5977,7 @@ int handler::ha_delete_row(const uchar *buf)
rows_changed
++
;
if
(
unlikely
(
error
=
binlog_log_row
(
table
,
buf
,
0
,
log_func
)))
return
error
;
#ifdef WITH_WSREP
current_thd
->
wsrep_affected_rows
++
;
if
(
wsrep_max_ws_rows
&&
current_thd
->
wsrep_exec_mode
!=
REPL_RECV
&&
current_thd
->
wsrep_affected_rows
>
wsrep_max_ws_rows
)
{
trans_rollback_stmt
(
current_thd
)
||
trans_rollback
(
current_thd
);
my_message
(
ER_ERROR_DURING_COMMIT
,
"wsrep_max_ws_rows exceeded"
,
MYF
(
0
));
return
ER_ERROR_DURING_COMMIT
;
}
#endif
/* WITH_WSREP */
return
0
;
return
check_wsrep_max_ws_rows
();
}
...
...
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