diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-07-01 18:15:00 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-07-01 18:15:00 +0000 |
commit | a2a2e32c02643a0cec111511220227703fda1cd5 (patch) | |
tree | 69cc2b631234c2a8e026b9cd4d72676c61c594df /include/mysql/service_thd_alloc.h | |
parent | Releasing progress-linux version 1:10.11.8-1~progress7.99u1. (diff) | |
download | mariadb-a2a2e32c02643a0cec111511220227703fda1cd5.tar.xz mariadb-a2a2e32c02643a0cec111511220227703fda1cd5.zip |
Merging upstream version 1:11.4.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'include/mysql/service_thd_alloc.h')
-rw-r--r-- | include/mysql/service_thd_alloc.h | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/include/mysql/service_thd_alloc.h b/include/mysql/service_thd_alloc.h index 0be4687b..014277b5 100644 --- a/include/mysql/service_thd_alloc.h +++ b/include/mysql/service_thd_alloc.h @@ -35,27 +35,34 @@ extern "C" { #endif -struct st_mysql_lex_string +struct st_mysql_const_lex_string { - char *str; + const char *str; size_t length; }; -typedef struct st_mysql_lex_string MYSQL_LEX_STRING; +typedef struct st_mysql_const_lex_string MYSQL_CONST_LEX_STRING; -struct st_mysql_const_lex_string +struct st_mysql_lex_string { - const char *str; + char *str; size_t length; +#ifdef __cplusplus + // Allow automatic cast from LEX_STRING to LEX_CSTRING in c++. + operator struct st_mysql_const_lex_string() const + { + return {str, length}; + } +#endif }; -typedef struct st_mysql_const_lex_string MYSQL_CONST_LEX_STRING; +typedef struct st_mysql_lex_string MYSQL_LEX_STRING; extern struct thd_alloc_service_st { - void *(*thd_alloc_func)(MYSQL_THD, size_t); - void *(*thd_calloc_func)(MYSQL_THD, size_t); - char *(*thd_strdup_func)(MYSQL_THD, const char *); - char *(*thd_strmake_func)(MYSQL_THD, const char *, size_t); - void *(*thd_memdup_func)(MYSQL_THD, const void*, size_t); - MYSQL_CONST_LEX_STRING *(*thd_make_lex_string_func)(MYSQL_THD, + void *(*thd_alloc_func)(const MYSQL_THD, size_t); + void *(*thd_calloc_func)(const MYSQL_THD, size_t); + char *(*thd_strdup_func)(const MYSQL_THD, const char *); + char *(*thd_strmake_func)(const MYSQL_THD, const char *, size_t); + void *(*thd_memdup_func)(const MYSQL_THD, const void*, size_t); + MYSQL_CONST_LEX_STRING *(*thd_make_lex_string_func)(const MYSQL_THD, MYSQL_CONST_LEX_STRING *, const char *, size_t, int); } *thd_alloc_service; @@ -92,23 +99,23 @@ extern struct thd_alloc_service_st { @see alloc_root() */ -void *thd_alloc(MYSQL_THD thd, size_t size); +void *thd_alloc(const MYSQL_THD thd, size_t size); /** @see thd_alloc() */ -void *thd_calloc(MYSQL_THD thd, size_t size); +void *thd_calloc(const MYSQL_THD thd, size_t size); /** @see thd_alloc() */ -char *thd_strdup(MYSQL_THD thd, const char *str); +char *thd_strdup(const MYSQL_THD thd, const char *str); /** @see thd_alloc() */ -char *thd_strmake(MYSQL_THD thd, const char *str, size_t size); +char *thd_strmake(const MYSQL_THD thd, const char *str, size_t size); /** @see thd_alloc() */ -void *thd_memdup(MYSQL_THD thd, const void* str, size_t size); +void *thd_memdup(const MYSQL_THD thd, const void* str, size_t size); /** Create a LEX_STRING in this connection's local memory pool @@ -124,7 +131,7 @@ void *thd_memdup(MYSQL_THD thd, const void* str, size_t size); @see thd_alloc() */ MYSQL_CONST_LEX_STRING -*thd_make_lex_string(MYSQL_THD thd, MYSQL_CONST_LEX_STRING *lex_str, +*thd_make_lex_string(const MYSQL_THD thd, MYSQL_CONST_LEX_STRING *lex_str, const char *str, size_t size, int allocate_lex_string); |