[MDEV-20718] Crash on insert with PARTITION clause after TRUNCATE Created: 2019-10-01 Updated: 2019-12-12 Resolved: 2019-10-02 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Server |
| Affects Version/s: | 10.4.8, 10.4.10 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Jacob Williams | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | crash | ||
| Environment: |
AWS Linux from mariadb yum repo |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
Mysqld receives segfault (signal 11) on an insert statement following a truncate partition. It only happens if the insert has a PARTITION clause. If there are any other operations on the table without a PARTITION clause between the truncate and the insert, the crash does not occur. I tested in 10.4.8-MariaDB-1:10.4.8+maria~bionic-log in docker container, as well as 10.4.8-MariaDB-log on an Amazon Linux server. The error did not occur in version 10.2 which I was running previously in the Amazon Linux server. I have attached a sql script which can reproduce the crash on my docker container running 10.4.8 (docker image tagged 10.4 hash 92495405fc36). When producing the reproduction script I found that the error only occurred when the table had an AUTO_INCREMENT column. Without the AUTO_INCREMENT, no crash occurred. |
| Comments |
| Comment by Jacob Williams [ 2019-10-01 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Adding the log output during the crash:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Alice Sherepa [ 2019-10-02 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thanks a lot!
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jacob Williams [ 2019-12-12 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The fix in 10.4.9 did solve the specific test case that I submitted. But I am still seeing an issue in my application. The difference was that in my application the INSERT statement was using SELECT instead of VALUES. In the case of an INSERT..SELECT FROM table statement I still get an unexpected error, although not a crash as happened before. If the INSERT..SELECT FROM table directly follows the TRUNCATE PARTITION statement, I get a range error on the auto_increment column, even though the value is nowhere near the limits for the INT datatype. As before, doing a non-partition-targeted SELECT on the table before doing the insert will fix everything up and the INSERT works fine and has correct values for the auto increment field. I included a revised test script that uses the INSERT..SELECT version. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jacob Williams [ 2019-12-12 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Since this issue is closed and the symptoms are slightly different, I went ahead and filed |