File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -134,8 +134,10 @@ BEGIN;
134
134
INSERT INTO t SET a=2;
135
135
connection consistent;
136
136
START TRANSACTION WITH CONSISTENT SNAPSHOT;
137
+ SAVEPOINT sp1;
137
138
SELECT * FROM t FORCE INDEX (b) FOR UPDATE;
138
139
ERROR HY000: Record has changed since last read in table 't'
140
+ SAVEPOINT sp1;
139
141
connection con_weird;
140
142
START TRANSACTION WITH CONSISTENT SNAPSHOT;
141
143
SELECT * FROM t FORCE INDEX (b) FOR UPDATE;
155
157
disconnect consistent;
156
158
connection default;
157
159
DROP TABLE t;
160
+ # End of 10.6 tests
Original file line number Diff line number Diff line change @@ -152,10 +152,12 @@ BEGIN; INSERT INTO t SET a=2;
152
152
153
153
--connection consistent
154
154
START TRANSACTION WITH CONSISTENT SNAPSHOT;
155
+ SAVEPOINT sp1;
155
156
--disable_ps2_protocol
156
157
--error ER_CHECKREAD
157
158
SELECT * FROM t FORCE INDEX (b) FOR UPDATE;
158
159
--enable_ps2_protocol
160
+ SAVEPOINT sp1;
159
161
160
162
--connection con_weird
161
163
START TRANSACTION WITH CONSISTENT SNAPSHOT;
@@ -181,3 +183,5 @@ SELECT * FROM t FORCE INDEX (b) FOR UPDATE;
181
183
182
184
--connection default
183
185
DROP TABLE t;
186
+
187
+ --echo # End of 10.6 tests
Original file line number Diff line number Diff line change @@ -2234,6 +2234,7 @@ convert_error_code_to_mysql(
2234
2234
return(HA_ERR_NO_ACTIVE_RECORD);
2235
2235
2236
2236
case DB_DEADLOCK:
2237
+ case DB_RECORD_CHANGED:
2237
2238
/* Since we rolled back the whole transaction, we must
2238
2239
tell it also to MySQL so that MySQL knows to empty the
2239
2240
cached binlog for this transaction */
@@ -2242,10 +2243,8 @@ convert_error_code_to_mysql(
2242
2243
thd_mark_transaction_to_rollback(thd, 1);
2243
2244
}
2244
2245
2245
- return(HA_ERR_LOCK_DEADLOCK);
2246
-
2247
- case DB_RECORD_CHANGED:
2248
- return HA_ERR_RECORD_CHANGED;
2246
+ return error == DB_DEADLOCK
2247
+ ? HA_ERR_LOCK_DEADLOCK : HA_ERR_RECORD_CHANGED;
2249
2248
2250
2249
case DB_LOCK_WAIT_TIMEOUT:
2251
2250
/* Starting from 5.0.13, we let MySQL just roll back the
You can’t perform that action at this time.
0 commit comments