[MDEV-19705] Assertion `tmp >= 0' failed in best_access_path Created: 2019-06-06 Updated: 2019-08-27 Resolved: 2019-08-27 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Versioned Tables |
| Affects Version/s: | 10.4 |
| Fix Version/s: | 10.4.8, 10.5.0 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alice Sherepa | Assignee: | Varun Gupta (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
Reproducible on 10.4 with MyIsam, not with InnoDB
On 10.3: No visible problems on a non-debug build. |
| Comments |
| Comment by Varun Gupta (Inactive) [ 2019-06-12 ] | |||||||||||||||||
|
First lets just consider the case without SYSTEM VERSIONING, now i run the select and see in the optimizer_trace
so rows shos 1.1e14. The number of records in the table t2 is 7 actually, so this is some garbage data.
which returns estimates in rec_per_key, so rec_per_key estimates have some garbage value for the key f2
The issue is that for UNIQUE long keys for which we create a hash, rec_per_key is allocated for all the keyparts of the key though on the storage engine level we will have only 1 keypart. On the sql layer we have all the keyparts but we dont make use of rec_per_key for such keys. | |||||||||||||||||
| Comment by Varun Gupta (Inactive) [ 2019-06-12 ] | |||||||||||||||||
|
Patch | |||||||||||||||||
| Comment by Sergei Golubchik [ 2019-08-20 ] | |||||||||||||||||
|
How would work in the optimizer, when there are three key parts but onlt one rec_per_key[] element? | |||||||||||||||||
| Comment by Varun Gupta (Inactive) [ 2019-08-21 ] | |||||||||||||||||
|
serg for unique keys with hash the optimizer would only know that there is only one keypart and it will try to use the first one only. But the storage engine should set rec_per_key correctly else we would need to set them explicity for these keys somehow. |