[MDEV-17016] Assertion `!auto_increment_lock && !auto_increment_safe_stmt_log_lock' failed in ha_partition::external_lock Created: 2018-08-18 Updated: 2019-03-01 Resolved: 2019-02-20 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Partitioning |
| Affects Version/s: | 10.1, 10.2 |
| Fix Version/s: | 10.1.39, 10.3.14 |
| Type: | Bug | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Julius Goryavsky |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | regression | ||
| Issue Links: |
|
||||||||
| Description |
|
The problem was introduced by the latest commit:
|
| Comments |
| Comment by Julius Goryavsky [ 2018-08-19 ] |
|
Fixed regression, which led to assertion activation when compiling in DEBUG mode (only in it) when using partitons and keys outside the allowed range. A new test has been added, which tests this rare situation: https://github.com/MariaDB/server/pull/845 |
| Comment by Jan Lindström (Inactive) [ 2018-08-20 ] |
|
InnoDB code changes ok to push, I will assign rest to serg |
| Comment by Julius Goryavsky [ 2018-08-31 ] |
|
I added comments to the source - patch fixes the problems by setting the correct value of the insert_id_for_cur_row field (by preventing earlier return from the update_auto_increment() method). In several failed partitions-related tests the write_record() function (which located in the sql_insert.cc file) goes to the "before_trg_err" label (which located near the end of the function). In this case (and without this patch) the table->file->insert_id_for_cur_row field will be zero and, as a result, the restore_auto_increment() function call does not restore the value of next_isert_id field, which in the future results in an error in the release_auto_increment() method. |
| Comment by Sergei Golubchik [ 2018-08-31 ] |
|
My comment is still valid. The server behaves correctly according to the protocol. The handler ha_partition makes incorrect assumptions and violates its own assertion. Thus the bug is inside ha_partition and it must be fixed there. Unless you show that the protocol is incomplete, ha_partition does not have enough information and cannot possibly fix the bug properly. |
| Comment by Julius Goryavsky [ 2018-09-11 ] |
|
I re-published a completely redesigned patch for |
| Comment by Julius Goryavsky [ 2019-02-20 ] |
|
All fixes from here are transferred to the updated version of |