File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,14 @@ void trans_reset_one_shot_chistics(THD *thd)
60
60
thd->tx_read_only = thd->variables .tx_read_only ;
61
61
}
62
62
63
- /* Conditions under which the transaction state must not change. */
63
+
64
+ /*
65
+ Conditions under which the transaction state must not change
66
+
67
+ @result TRUE Transaction can not commit
68
+ @result FALSE Transaction can commit
69
+ */
70
+
64
71
static bool trans_check (THD *thd)
65
72
{
66
73
DBUG_ENTER (" trans_check" );
@@ -72,8 +79,11 @@ static bool trans_check(THD *thd)
72
79
DBUG_ASSERT (thd->transaction ->stmt .is_empty ());
73
80
74
81
if (unlikely (thd->in_sub_stmt ))
82
+ {
75
83
my_error (ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG, MYF (0 ));
76
- if (!thd->transaction ->xid_state .is_explicit_XA ())
84
+ DBUG_RETURN (TRUE );
85
+ }
86
+ if (likely (!thd->transaction ->xid_state .is_explicit_XA ()))
77
87
DBUG_RETURN (FALSE );
78
88
79
89
thd->transaction ->xid_state .er_xaer_rmfail ();
You can’t perform that action at this time.
0 commit comments