[MCOL-4757] Empty set in SELECT * INFORMATION_SCHEMA.COLUMNSTORE_TABLES WHERE TABLE_NAME='t1' Created: 2021-06-10 Updated: 2021-06-11 Resolved: 2021-06-11 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | MDB Plugin |
| Affects Version/s: | 5.6.1, 6.1.1 |
| Fix Version/s: | 6.1.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I create an MTR test file I_S.test with this content:
Now I run mtr either:
or
It produces the following outout:
Notice, the SELECT query returned no rows. Now I send the same script to "mariadb" client:
Notice, the SELECT query returned one record. The problem happens because of this code in is_columnstore_tables_fill() in is_columnstore_tables.cpp:
That looks wrong. String::ptr() returns a pointer to a buffer which is not necessary 0x00-terminated (String DOES NOT guarantee to provide a 0x00-terminated array). So the result of compare() depends on the random byte value beyond the valid buffer size. |
| Comments |
| Comment by Alexander Barkov [ 2021-06-10 ] | |||||||||
|
A related problem. This script:
crashes the server. This happens because in this code:
the buffer str_buf gets destroyed when the execution exists this code block, while val_str() can return a pointer to it to the caller. | |||||||||
| Comment by Alexander Barkov [ 2021-06-11 ] | |||||||||
|
A related problem. This script:
crashes the server.
we access fitem->arguments()[1] but we don't check that the function really has at least two arguments. |