[MDEV-23632] ALTER TABLE...ADD KEY creates corrupted index on virtual column Created: 2020-08-31 Updated: 2021-04-25 Resolved: 2021-01-05 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Virtual Columns |
| Affects Version/s: | 10.3, 10.4, 10.5 |
| Fix Version/s: | 10.3.28, 10.4.18, 10.5.9 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Marko Mäkelä | Assignee: | Nikita Malyavin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | MSAN, affects-tests, corruption, not-10.2, regression, valgrind | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Description |
|
Based on a trace that I analyzed in
This test will fail in 10.3 Valgrind as well as 10.5 MSAN:
If the ADD COLUMN is removed or ,FORCE is added to the statement, the test will not fail. Instant ADD COLUMN was introduced in |
| Comments |
| Comment by Elena Stepanova [ 2020-08-31 ] | ||||||||||||||
|
Looks like it could be related to | ||||||||||||||
| Comment by Marko Mäkelä [ 2020-09-03 ] | ||||||||||||||
|
The test case in the Description triggers the following errors after I merged the fixes of
Note: This is with GCC and WITH_VALGRIND=ON. If I compile with Clang, there will be many bogus warnings. You may have to avoid optimizations as well. In GCC 10.2.0, -Og does not seem to trigger too many bogus Valgrind warnings. | ||||||||||||||
| Comment by Nikita Malyavin [ 2020-12-21 ] | ||||||||||||||
|
Seems that mysql_col_offset is not updated (correctly) after new column added:
virtual fields are always added in the end, so the column should be 4th, and mysql_col_offset should be 1 + 4*3 = 13 | ||||||||||||||
| Comment by Nikita Malyavin [ 2020-12-24 ] | ||||||||||||||
|
marko Please review the bugfix and two other related commits on bb-10.3-vcol-instant branch | ||||||||||||||
| Comment by Marko Mäkelä [ 2021-01-04 ] | ||||||||||||||
|
Thank you! I provided some feedback on the first commit. It is OK to push after addressing those. |