diff options
Diffstat (limited to 'include/mysql')
-rw-r--r-- | include/mysql/plugin_audit.h.pp | 19 | ||||
-rw-r--r-- | include/mysql/plugin_auth.h | 2 | ||||
-rw-r--r-- | include/mysql/plugin_auth.h.pp | 21 | ||||
-rw-r--r-- | include/mysql/plugin_encryption.h.pp | 19 | ||||
-rw-r--r-- | include/mysql/plugin_ftparser.h.pp | 19 | ||||
-rw-r--r-- | include/mysql/plugin_password_validation.h | 4 | ||||
-rw-r--r-- | include/mysql/plugin_password_validation.h.pp | 23 | ||||
-rw-r--r-- | include/mysql/service_my_snprintf.h | 15 | ||||
-rw-r--r-- | include/mysql/service_thd_alloc.h | 17 |
9 files changed, 103 insertions, 36 deletions
diff --git a/include/mysql/plugin_audit.h.pp b/include/mysql/plugin_audit.h.pp index 2adde48dc22..1772c0f6b87 100644 --- a/include/mysql/plugin_audit.h.pp +++ b/include/mysql/plugin_audit.h.pp @@ -141,7 +141,8 @@ extern struct my_snprintf_service_st { size_t (*my_snprintf_type)(char*, size_t, const char*, ...); size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list); } *my_snprintf_service; -size_t my_snprintf(char* to, size_t n, const char* fmt, ...); +size_t my_snprintf(char* to, size_t n, const char* fmt, ...) + ; size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap); extern struct progress_report_service_st { void (*thd_progress_init_func)(void* thd, unsigned int max_stage); @@ -233,13 +234,20 @@ struct st_mysql_lex_string size_t length; }; typedef struct st_mysql_lex_string MYSQL_LEX_STRING; +struct st_mysql_const_lex_string +{ + const char *str; + size_t length; +}; +typedef struct st_mysql_const_lex_string MYSQL_CONST_LEX_STRING; extern struct thd_alloc_service_st { void *(*thd_alloc_func)(void*, unsigned int); void *(*thd_calloc_func)(void*, unsigned int); char *(*thd_strdup_func)(void*, const char *); char *(*thd_strmake_func)(void*, const char *, unsigned int); void *(*thd_memdup_func)(void*, const void*, unsigned int); - MYSQL_LEX_STRING *(*thd_make_lex_string_func)(void*, MYSQL_LEX_STRING *, + MYSQL_CONST_LEX_STRING *(*thd_make_lex_string_func)(void*, + MYSQL_CONST_LEX_STRING *, const char *, unsigned int, int); } *thd_alloc_service; void *thd_alloc(void* thd, unsigned int size); @@ -247,9 +255,10 @@ void *thd_calloc(void* thd, unsigned int size); char *thd_strdup(void* thd, const char *str); char *thd_strmake(void* thd, const char *str, unsigned int size); void *thd_memdup(void* thd, const void* str, unsigned int size); -MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str, - const char *str, unsigned int size, - int allocate_lex_string); +MYSQL_CONST_LEX_STRING +*thd_make_lex_string(void* thd, MYSQL_CONST_LEX_STRING *lex_str, + const char *str, unsigned int size, + int allocate_lex_string); extern struct thd_autoinc_service_st { void (*thd_get_autoinc_func)(const void* thd, unsigned long* off, unsigned long* inc); diff --git a/include/mysql/plugin_auth.h b/include/mysql/plugin_auth.h index 807bfd4e652..638d9b57fd9 100644 --- a/include/mysql/plugin_auth.h +++ b/include/mysql/plugin_auth.h @@ -51,7 +51,7 @@ typedef struct st_mysql_server_auth_info User name as sent by the client and shown in USER(). NULL if the client packet with the user name was not received yet. */ - char *user_name; + const char *user_name; /** Length of user_name diff --git a/include/mysql/plugin_auth.h.pp b/include/mysql/plugin_auth.h.pp index a9cb8044c4f..bc873626fab 100644 --- a/include/mysql/plugin_auth.h.pp +++ b/include/mysql/plugin_auth.h.pp @@ -141,7 +141,8 @@ extern struct my_snprintf_service_st { size_t (*my_snprintf_type)(char*, size_t, const char*, ...); size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list); } *my_snprintf_service; -size_t my_snprintf(char* to, size_t n, const char* fmt, ...); +size_t my_snprintf(char* to, size_t n, const char* fmt, ...) + ; size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap); extern struct progress_report_service_st { void (*thd_progress_init_func)(void* thd, unsigned int max_stage); @@ -233,13 +234,20 @@ struct st_mysql_lex_string size_t length; }; typedef struct st_mysql_lex_string MYSQL_LEX_STRING; +struct st_mysql_const_lex_string +{ + const char *str; + size_t length; +}; +typedef struct st_mysql_const_lex_string MYSQL_CONST_LEX_STRING; extern struct thd_alloc_service_st { void *(*thd_alloc_func)(void*, unsigned int); void *(*thd_calloc_func)(void*, unsigned int); char *(*thd_strdup_func)(void*, const char *); char *(*thd_strmake_func)(void*, const char *, unsigned int); void *(*thd_memdup_func)(void*, const void*, unsigned int); - MYSQL_LEX_STRING *(*thd_make_lex_string_func)(void*, MYSQL_LEX_STRING *, + MYSQL_CONST_LEX_STRING *(*thd_make_lex_string_func)(void*, + MYSQL_CONST_LEX_STRING *, const char *, unsigned int, int); } *thd_alloc_service; void *thd_alloc(void* thd, unsigned int size); @@ -247,9 +255,10 @@ void *thd_calloc(void* thd, unsigned int size); char *thd_strdup(void* thd, const char *str); char *thd_strmake(void* thd, const char *str, unsigned int size); void *thd_memdup(void* thd, const void* str, unsigned int size); -MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str, - const char *str, unsigned int size, - int allocate_lex_string); +MYSQL_CONST_LEX_STRING +*thd_make_lex_string(void* thd, MYSQL_CONST_LEX_STRING *lex_str, + const char *str, unsigned int size, + int allocate_lex_string); extern struct thd_autoinc_service_st { void (*thd_get_autoinc_func)(const void* thd, unsigned long* off, unsigned long* inc); @@ -501,7 +510,7 @@ typedef struct st_plugin_vio } MYSQL_PLUGIN_VIO; typedef struct st_mysql_server_auth_info { - char *user_name; + const char *user_name; unsigned int user_name_length; const char *auth_string; unsigned long auth_string_length; diff --git a/include/mysql/plugin_encryption.h.pp b/include/mysql/plugin_encryption.h.pp index 4675f0cf6ec..4113e6d24a9 100644 --- a/include/mysql/plugin_encryption.h.pp +++ b/include/mysql/plugin_encryption.h.pp @@ -141,7 +141,8 @@ extern struct my_snprintf_service_st { size_t (*my_snprintf_type)(char*, size_t, const char*, ...); size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list); } *my_snprintf_service; -size_t my_snprintf(char* to, size_t n, const char* fmt, ...); +size_t my_snprintf(char* to, size_t n, const char* fmt, ...) + ; size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap); extern struct progress_report_service_st { void (*thd_progress_init_func)(void* thd, unsigned int max_stage); @@ -233,13 +234,20 @@ struct st_mysql_lex_string size_t length; }; typedef struct st_mysql_lex_string MYSQL_LEX_STRING; +struct st_mysql_const_lex_string +{ + const char *str; + size_t length; +}; +typedef struct st_mysql_const_lex_string MYSQL_CONST_LEX_STRING; extern struct thd_alloc_service_st { void *(*thd_alloc_func)(void*, unsigned int); void *(*thd_calloc_func)(void*, unsigned int); char *(*thd_strdup_func)(void*, const char *); char *(*thd_strmake_func)(void*, const char *, unsigned int); void *(*thd_memdup_func)(void*, const void*, unsigned int); - MYSQL_LEX_STRING *(*thd_make_lex_string_func)(void*, MYSQL_LEX_STRING *, + MYSQL_CONST_LEX_STRING *(*thd_make_lex_string_func)(void*, + MYSQL_CONST_LEX_STRING *, const char *, unsigned int, int); } *thd_alloc_service; void *thd_alloc(void* thd, unsigned int size); @@ -247,9 +255,10 @@ void *thd_calloc(void* thd, unsigned int size); char *thd_strdup(void* thd, const char *str); char *thd_strmake(void* thd, const char *str, unsigned int size); void *thd_memdup(void* thd, const void* str, unsigned int size); -MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str, - const char *str, unsigned int size, - int allocate_lex_string); +MYSQL_CONST_LEX_STRING +*thd_make_lex_string(void* thd, MYSQL_CONST_LEX_STRING *lex_str, + const char *str, unsigned int size, + int allocate_lex_string); extern struct thd_autoinc_service_st { void (*thd_get_autoinc_func)(const void* thd, unsigned long* off, unsigned long* inc); diff --git a/include/mysql/plugin_ftparser.h.pp b/include/mysql/plugin_ftparser.h.pp index 34d968b60ab..8147d793801 100644 --- a/include/mysql/plugin_ftparser.h.pp +++ b/include/mysql/plugin_ftparser.h.pp @@ -141,7 +141,8 @@ extern struct my_snprintf_service_st { size_t (*my_snprintf_type)(char*, size_t, const char*, ...); size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list); } *my_snprintf_service; -size_t my_snprintf(char* to, size_t n, const char* fmt, ...); +size_t my_snprintf(char* to, size_t n, const char* fmt, ...) + ; size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap); extern struct progress_report_service_st { void (*thd_progress_init_func)(void* thd, unsigned int max_stage); @@ -233,13 +234,20 @@ struct st_mysql_lex_string size_t length; }; typedef struct st_mysql_lex_string MYSQL_LEX_STRING; +struct st_mysql_const_lex_string +{ + const char *str; + size_t length; +}; +typedef struct st_mysql_const_lex_string MYSQL_CONST_LEX_STRING; extern struct thd_alloc_service_st { void *(*thd_alloc_func)(void*, unsigned int); void *(*thd_calloc_func)(void*, unsigned int); char *(*thd_strdup_func)(void*, const char *); char *(*thd_strmake_func)(void*, const char *, unsigned int); void *(*thd_memdup_func)(void*, const void*, unsigned int); - MYSQL_LEX_STRING *(*thd_make_lex_string_func)(void*, MYSQL_LEX_STRING *, + MYSQL_CONST_LEX_STRING *(*thd_make_lex_string_func)(void*, + MYSQL_CONST_LEX_STRING *, const char *, unsigned int, int); } *thd_alloc_service; void *thd_alloc(void* thd, unsigned int size); @@ -247,9 +255,10 @@ void *thd_calloc(void* thd, unsigned int size); char *thd_strdup(void* thd, const char *str); char *thd_strmake(void* thd, const char *str, unsigned int size); void *thd_memdup(void* thd, const void* str, unsigned int size); -MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str, - const char *str, unsigned int size, - int allocate_lex_string); +MYSQL_CONST_LEX_STRING +*thd_make_lex_string(void* thd, MYSQL_CONST_LEX_STRING *lex_str, + const char *str, unsigned int size, + int allocate_lex_string); extern struct thd_autoinc_service_st { void (*thd_get_autoinc_func)(const void* thd, unsigned long* off, unsigned long* inc); diff --git a/include/mysql/plugin_password_validation.h b/include/mysql/plugin_password_validation.h index 18c643e877b..e2763483db6 100644 --- a/include/mysql/plugin_password_validation.h +++ b/include/mysql/plugin_password_validation.h @@ -42,8 +42,8 @@ struct st_mariadb_password_validation Function provided by the plugin which should perform password validation and return 0 if the password has passed the validation. */ - int (*validate_password)(MYSQL_LEX_STRING *username, - MYSQL_LEX_STRING *password); + int (*validate_password)(MYSQL_CONST_LEX_STRING *username, + MYSQL_CONST_LEX_STRING *password); }; #ifdef __cplusplus diff --git a/include/mysql/plugin_password_validation.h.pp b/include/mysql/plugin_password_validation.h.pp index 5a642a55d08..929b3307f9e 100644 --- a/include/mysql/plugin_password_validation.h.pp +++ b/include/mysql/plugin_password_validation.h.pp @@ -141,7 +141,8 @@ extern struct my_snprintf_service_st { size_t (*my_snprintf_type)(char*, size_t, const char*, ...); size_t (*my_vsnprintf_type)(char *, size_t, const char*, va_list); } *my_snprintf_service; -size_t my_snprintf(char* to, size_t n, const char* fmt, ...); +size_t my_snprintf(char* to, size_t n, const char* fmt, ...) + ; size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap); extern struct progress_report_service_st { void (*thd_progress_init_func)(void* thd, unsigned int max_stage); @@ -233,13 +234,20 @@ struct st_mysql_lex_string size_t length; }; typedef struct st_mysql_lex_string MYSQL_LEX_STRING; +struct st_mysql_const_lex_string +{ + const char *str; + size_t length; +}; +typedef struct st_mysql_const_lex_string MYSQL_CONST_LEX_STRING; extern struct thd_alloc_service_st { void *(*thd_alloc_func)(void*, unsigned int); void *(*thd_calloc_func)(void*, unsigned int); char *(*thd_strdup_func)(void*, const char *); char *(*thd_strmake_func)(void*, const char *, unsigned int); void *(*thd_memdup_func)(void*, const void*, unsigned int); - MYSQL_LEX_STRING *(*thd_make_lex_string_func)(void*, MYSQL_LEX_STRING *, + MYSQL_CONST_LEX_STRING *(*thd_make_lex_string_func)(void*, + MYSQL_CONST_LEX_STRING *, const char *, unsigned int, int); } *thd_alloc_service; void *thd_alloc(void* thd, unsigned int size); @@ -247,9 +255,10 @@ void *thd_calloc(void* thd, unsigned int size); char *thd_strdup(void* thd, const char *str); char *thd_strmake(void* thd, const char *str, unsigned int size); void *thd_memdup(void* thd, const void* str, unsigned int size); -MYSQL_LEX_STRING *thd_make_lex_string(void* thd, MYSQL_LEX_STRING *lex_str, - const char *str, unsigned int size, - int allocate_lex_string); +MYSQL_CONST_LEX_STRING +*thd_make_lex_string(void* thd, MYSQL_CONST_LEX_STRING *lex_str, + const char *str, unsigned int size, + int allocate_lex_string); extern struct thd_autoinc_service_st { void (*thd_get_autoinc_func)(const void* thd, unsigned long* off, unsigned long* inc); @@ -487,6 +496,6 @@ void thd_wakeup_subsequent_commits(void* thd, int wakeup_error); struct st_mariadb_password_validation { int interface_version; - int (*validate_password)(MYSQL_LEX_STRING *username, - MYSQL_LEX_STRING *password); + int (*validate_password)(MYSQL_CONST_LEX_STRING *username, + MYSQL_CONST_LEX_STRING *password); }; diff --git a/include/mysql/service_my_snprintf.h b/include/mysql/service_my_snprintf.h index 4a99561dd00..586a539d48c 100644 --- a/include/mysql/service_my_snprintf.h +++ b/include/mysql/service_my_snprintf.h @@ -92,9 +92,22 @@ extern struct my_snprintf_service_st { #else -size_t my_snprintf(char* to, size_t n, const char* fmt, ...); +#ifndef ATTRIBUTE_FORMAT +#define ATTRIBUTE_FORMAT_DEFINED +#define ATTRIBUTE_FORMAT(A,B,C) +#endif +#ifdef MYSQL_ABI_CHECK +#undef ATTRIBUTE_FORMAT +#define ATTRIBUTE_FORMAT(A,B,C) +#endif +size_t my_snprintf(char* to, size_t n, const char* fmt, ...) + ATTRIBUTE_FORMAT(printf, 3, 4); size_t my_vsnprintf(char *to, size_t n, const char* fmt, va_list ap); +#ifdef ATTRIBUTE_FORMAT_DEFINED +#undef ATTRIBUTE_FORMAT_DEFINED +#undef ATTRIBUTE_FORMAT +#endif #endif #ifdef __cplusplus diff --git a/include/mysql/service_thd_alloc.h b/include/mysql/service_thd_alloc.h index e92f81b52c3..8d6ed8e4190 100644 --- a/include/mysql/service_thd_alloc.h +++ b/include/mysql/service_thd_alloc.h @@ -42,13 +42,21 @@ struct st_mysql_lex_string }; typedef struct st_mysql_lex_string MYSQL_LEX_STRING; +struct st_mysql_const_lex_string +{ + const char *str; + size_t length; +}; +typedef struct st_mysql_const_lex_string MYSQL_CONST_LEX_STRING; + extern struct thd_alloc_service_st { void *(*thd_alloc_func)(MYSQL_THD, unsigned int); void *(*thd_calloc_func)(MYSQL_THD, unsigned int); char *(*thd_strdup_func)(MYSQL_THD, const char *); char *(*thd_strmake_func)(MYSQL_THD, const char *, unsigned int); void *(*thd_memdup_func)(MYSQL_THD, const void*, unsigned int); - MYSQL_LEX_STRING *(*thd_make_lex_string_func)(MYSQL_THD, MYSQL_LEX_STRING *, + MYSQL_CONST_LEX_STRING *(*thd_make_lex_string_func)(MYSQL_THD, + MYSQL_CONST_LEX_STRING *, const char *, unsigned int, int); } *thd_alloc_service; @@ -115,9 +123,10 @@ void *thd_memdup(MYSQL_THD thd, const void* str, unsigned int size); @see thd_alloc() */ -MYSQL_LEX_STRING *thd_make_lex_string(MYSQL_THD thd, MYSQL_LEX_STRING *lex_str, - const char *str, unsigned int size, - int allocate_lex_string); +MYSQL_CONST_LEX_STRING +*thd_make_lex_string(MYSQL_THD thd, MYSQL_CONST_LEX_STRING *lex_str, + const char *str, unsigned int size, + int allocate_lex_string); #endif |