1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-32627 Distinguish between absence of a keyword and empty value for the keyword

Distinguish them in two place:

when constructing connection key in create_conn_key and
spider_create_conn for both ordinary queries and spider_direct_sql

For spider_create_conn and spider_udf_direct_sql_create_conn, the
created conn gets assigned a field from the source object if and only
if source->field is non-null.

For spider_create_conn_keys and spider_udf_direct_sql_create_conn_key,
we update the encoding so that absence of keyword and keyword with an
empty value result in different keys. More specifically, if the i-th
keyword has a value, the corresponding part in the conn key begins
with the char \i, followed by the possibly empty value and ends with a
\0. If the i-th keyword is not specified, then it does not get a
mention in the conn key.

As part of this change, we also update table param / option parsing to
recognise a singleton empty string when creating an string list,
instead of writing it off as NULL.
This commit is contained in:
Yuchen Pei
2024-06-04 14:51:25 +10:00
parent 6f3baec4f5
commit 20d99f3f86
4 changed files with 169 additions and 323 deletions

View File

@@ -169,6 +169,8 @@ void spider_print_keys(
);
#endif
void spider_create_conn_key_add_one(int* counter, char** target, char* src);
int spider_create_conn_keys(
SPIDER_SHARE *share
);