| 8104 | } |
| 8105 | |
| 8106 | static int wsrep_after_row(THD *thd) |
| 8107 | { |
| 8108 | DBUG_ENTER("wsrep_after_row"); |
| 8109 | #ifdef WITH_WSREP |
| 8110 | if (thd->internal_transaction()) |
| 8111 | DBUG_RETURN(0); |
| 8112 | |
| 8113 | /* enforce wsrep_max_ws_rows */ |
| 8114 | thd->wsrep_affected_rows++; |
| 8115 | if (wsrep_max_ws_rows && |
| 8116 | thd->wsrep_affected_rows > wsrep_max_ws_rows && |
| 8117 | wsrep_thd_is_local(thd)) |
| 8118 | { |
| 8119 | /* |
| 8120 | If we are inside stored function or trigger we should not commit or |
| 8121 | rollback current statement transaction. See comment in ha_commit_trans() |
| 8122 | call for more information. |
| 8123 | */ |
| 8124 | if (!thd->in_sub_stmt) |
| 8125 | trans_rollback_stmt(thd) || trans_rollback(thd); |
| 8126 | my_message(ER_ERROR_DURING_COMMIT, "wsrep_max_ws_rows exceeded", MYF(0)); |
| 8127 | DBUG_RETURN(ER_ERROR_DURING_COMMIT); |
| 8128 | } |
| 8129 | else if (wsrep_after_row_internal(thd)) |
| 8130 | { |
| 8131 | DBUG_RETURN(ER_LOCK_DEADLOCK); |
| 8132 | } |
| 8133 | #endif /* WITH_WSREP */ |
| 8134 | DBUG_RETURN(0); |
| 8135 | } |
| 8136 | |
| 8137 | |
| 8138 | static bool long_unique_fields_differ(KEY *keyinfo, const uchar *other) |
no test coverage detected