Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
11.8, 12.3
Description
The failing unit.conc_ps(test_vector) on big-endian highlights, a prepared statement protocol expecting to decode a SELECT from a VECTOR type column will end up with raw little endian.
MariaDB [test]> select * from my_vector;
|
Field 1: `a`
|
Org_field: `a`
|
Catalog: `def`
|
Database: `test`
|
Table: `my_vector`
|
Org_table: `my_vector`
|
Type: VAR_STRING
|
Collation: binary (63)
|
Length: 16
|
Max_length: 16
|
Decimals: 0
|
Flags: BINARY
|
|
|
|
|
+------------------+
|
| a |
|
+------------------+
|
| �?�̌?���?ff�? |
|
+------------------+
|
1 row in set (0.001 sec)
|
from: libmariadb/unittest/libmariadb/ps.c (test_vector)
float f1[4] = {1.0f, 1.1f, 1.2f, 1.3f};
|
float f2[4] = {0.0};
|
...
|
rc= mysql_stmt_prepare(stmt, SL("SELECT a FROM my_vector"));
|
check_stmt_rc(rc, stmt);
|
|
rc= mysql_stmt_execute(stmt);
|
check_stmt_rc(rc, stmt);
|
|
memset(&bind, 0, sizeof(MYSQL_BIND));
|
bind.buffer= &f2;
|
bind.buffer_length= sizeof(float) * 4;
|
rc= mysql_stmt_bind_result(stmt, &bind);
|
check_stmt_rc(rc, stmt);
|
|
rc= mysql_stmt_fetch(stmt);
|
check_stmt_rc(rc, stmt);
|
|
mysql_stmt_close(stmt);
|
|
if (memcmp(f1, f2, sizeof(float) * 4))
|
A client application can reasonable expect to get the same results back that it sent, as Georg's test does. Currently because of the protocol, there's no indication that the resulting vector type data is anything that needs special handling (like endian consideration), so its just copied a raw blob copied over the top of float arrays.
Recommendations:
- Add a extended metadata for vector so that C/C can endian unpack it
Attachments
Issue Links
- is caused by
-
MDEV-33410 VECTOR data type
-
- Closed
-
- relates to
-
MDEV-25848 Support for Multi-Valued Indexes
-
- Stalled
-
-
CONC-867 cannot insert/retreive vector data with prepared statements on big endian
-
- In Review
-