OleMussmann opened a new issue, #1100:
URL: https://github.com/apache/arrow-adbc/issues/1100
Certain string matchings fail in `c/driver/common/utils.c` when trying to
find a table by name. A loop iterates through all tables and tries to find a
match. The matching code is currently:
```
if (!strncmp(name.data, table_name, name.size_bytes) { return table; }
```
`name.data` is a contiguous buffer of table names, like
`adbc_pkey_testtest_canceladbc_fkey_test_baseadbc_fkey_testadbc_composite_pk[...]`.
The `table_name` (let's say `adbc_pkey_test`) is now compared to the first
`name.size_bytes` of this buffer, which usually works out. If a non-existing
`table_name` string is composed of an existing table name _plus_ starting
characters of another table, a match can be made where there is none. A
correctly matching example is:
```
adbc_pkey_test
adbc_pkey_testtest_canceladbc_fkey_test_baseadbc_fkey_testadbc_composite_pk[...]
^
(compared until here)
```
An example that matches erroneously is:
```
adbc_pkey_testtest
adbc_pkey_testtest_canceladbc_fkey_test_baseadbc_fkey_testadbc_composite_pk[...]
^
(compared until here)
```
N.B.: The tables are returned in nondeterministic order, so this might not
fail reliably.
Software version: current `main` branch
https://github.com/apache/arrow-adbc/commit/8a832d6f00d81f1cc2a39fc4367f4789e2cdafed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]