[MDEV-20001] Potential dangerous regression: INSERT INTO >=100 rows fail for myisam table with HASH indexes Created: 2019-07-09 Updated: 2021-03-12 Resolved: 2020-02-03 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Manipulation - Insert |
| Affects Version/s: | 10.4.6, 10.4 |
| Fix Version/s: | 10.4.13 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Slawomir Pryczek | Assignee: | Sachin Setiya (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Fedora Core 30 ( 5.1.15-300.fc30.x86_64 ) |
||
| Issue Links: |
|
||||||||||||||||
| Description |
|
Hi everyone, it seems there's a very "weird" and dangerous regression in mysql 10.4.6... So basically for it to work you need myisam table with UNIQUE KEY ... USING HASH. I was reading in docs it doesn't make a difference, but when used in newest maria it'll make the table behave very strangely, so you can NOT do INSERT INTO with > 100 rows at once.
So this code will produce To make it work correctly again you can do just one of the following:
When you change the engine to aria it exhibits same behaviour as myisam, but it gives different error: It works totally fine in older versions eg. Maria 10.2.9, 10.1.22 etc. I was trying to find somethig related to this and found some report with same bug related to replication. I don't remember the URL and details, it wasn't resolved... so i think it could also be breaking statement based replication and it's probably hard to diagnose. Most strange thing is that HASH indexes shouldn't even be supported by myisam so it should work like default b-tree index, so in fact it should make no difference if USING HASH is there or not, right? Thanks for the help |
| Comments |
| Comment by Alice Sherepa [ 2019-07-09 ] | |||||||||||||||||||||
|
Thanks a lot for the report! I repeated as described on MariaDB 10.4:
| |||||||||||||||||||||
| Comment by Sachin Setiya (Inactive) [ 2019-07-28 ] | |||||||||||||||||||||
|
simpler test , 100 insert passes 99 insert fails , debugging | |||||||||||||||||||||
| Comment by Sachin Setiya (Inactive) [ 2019-07-29 ] | |||||||||||||||||||||
|
It fails on first insert itself, Even this also fails
| |||||||||||||||||||||
| Comment by Sachin Setiya (Inactive) [ 2019-07-29 ] | |||||||||||||||||||||
|
I think something is going on in myisam Case when insert is less then 100
Case when insert is >= 100
| |||||||||||||||||||||
| Comment by Sachin Setiya (Inactive) [ 2019-07-29 ] | |||||||||||||||||||||
|
It does not work in earlier version , before 10.4 we did not had hash index for innodb and myisam
| |||||||||||||||||||||
| Comment by Sachin Setiya (Inactive) [ 2019-07-29 ] | |||||||||||||||||||||
|
Reason for this is , myisam disables the index in bulk insert (>= 100)
| |||||||||||||||||||||
| Comment by Sachin Setiya (Inactive) [ 2019-07-29 ] | |||||||||||||||||||||
|
patch http://lists.askmonty.org/pipermail/commits/2019-July/013913.html |