diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/errmsg.h | 5 | ||||
-rw-r--r-- | include/m_ctype.h | 54 | ||||
-rw-r--r-- | include/my_base.h | 3 | ||||
-rw-r--r-- | include/my_handler_errors.h | 3 | ||||
-rw-r--r-- | include/my_sys.h | 4 | ||||
-rw-r--r-- | include/mysql/plugin_auth.h | 3 | ||||
-rw-r--r-- | include/ssl_compat.h | 3 |
7 files changed, 68 insertions, 7 deletions
diff --git a/include/errmsg.h b/include/errmsg.h index c0c4cfc58be..bd086bba05b 100644 --- a/include/errmsg.h +++ b/include/errmsg.h @@ -36,8 +36,9 @@ extern const char *client_errors[]; /* Error messages */ #define CR_MIN_ERROR 2000 /* For easier client code */ #define CR_MAX_ERROR 2999 #if !defined(ER) -#define ER(X) (((X) >= CR_ERROR_FIRST && (X) <= CR_ERROR_LAST)? \ - client_errors[(X)-CR_ERROR_FIRST]: client_errors[CR_UNKNOWN_ERROR]) +#define ER(X) (((X) >= CR_ERROR_FIRST && (X) <= CR_ERROR_LAST) \ + ? client_errors[(X)-CR_ERROR_FIRST] \ + : client_errors[CR_UNKNOWN_ERROR-CR_ERROR_FIRST]) #endif #define CLIENT_ERRMAP 2 /* Errormap used by my_error() */ diff --git a/include/m_ctype.h b/include/m_ctype.h index 5fa8f28ff7a..32cede0baaf 100644 --- a/include/m_ctype.h +++ b/include/m_ctype.h @@ -349,6 +349,60 @@ struct my_collation_handler_st const uchar *, size_t, const uchar *, size_t, my_bool); int (*strnncollsp)(CHARSET_INFO *, const uchar *, size_t, const uchar *, size_t); + /* + strnncollsp_nchars() - similar to strnncollsp() but assumes that both + strings were originally CHAR(N) values with the + same N, then were optionally space-padded, + or optionally space-trimmed. + + In other words, this function compares in the way + if we insert both values into a CHAR(N) column + and then compare the two column values. + + It compares the same amount of characters from the two strings. + This is especially important for NOPAD collations. + + If CHAR_LENGTH of the two strings are different, + the shorter string is virtually padded with trailing spaces + up to CHAR_LENGTH of the longer string, to guarantee that the + same amount of characters are compared. + This is important if the two CHAR(N) strings are space-trimmed + (e.g. like in InnoDB compact format for CHAR). + + The function compares not more than "nchars" characters only. + This can be useful to compare CHAR(N) space-padded strings + (when the exact N is known) without having to truncate them before + the comparison. + + For example, Field_string stores a "CHAR(3) CHARACTER SET utf8mb4" value + of "aaa" as 12 bytes in a record buffer: + - 3 bytes of the actual data, followed by + - 9 bytes of spaces (just fillers, not real data) + The caller can pass nchars=3 to compare CHAR(3) record values. + In such case, the comparator won't go inside the 9 bytes of the fillers. + + If N is not known, the caller can pass max(len1,len2) as the "nchars" value + (i.e. the maximum of the OCTET_LENGTH of the two strings). + + Notes on complex collations. + + This function counts contraction parts as individual characters. + For example, the Czech letter 'ch' (in Czech collations) + is ordinarily counted by the "nchars" limit as TWO characters + (although it is only one letter). + This corresponds to what CHAR(N) does in INSERT. + + If the "nchars" limit tears apart a contraction, only the part fitting + into "nchars" characters is used. For example, in case of a Czech collation, + the string "ach" with nchars=2 is compared as 'ac': the contraction + 'ch' is torn apart and the letter 'c' acts as an individual character. + This emulates the same comparison result with the scenario when we insert + 'ach' into a CHAR(2) column and then compare it. + */ + int (*strnncollsp_nchars)(CHARSET_INFO *, + const uchar *str1, size_t len1, + const uchar *str2, size_t len2, + size_t nchars); size_t (*strnxfrm)(CHARSET_INFO *, uchar *dst, size_t dstlen, uint nweights, const uchar *src, size_t srclen, uint flags); diff --git a/include/my_base.h b/include/my_base.h index b4e7c1c7707..c29e9de6e0d 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -526,7 +526,8 @@ enum ha_base_keytype { #define HA_ERR_SEQUENCE_INVALID_DATA 195 #define HA_ERR_SEQUENCE_RUN_OUT 196 #define HA_ERR_COMMIT_ERROR 197 -#define HA_ERR_LAST 197 /* Copy of last error nr * */ +#define HA_ERR_PARTITION_LIST 198 +#define HA_ERR_LAST 198 /* Copy of last error nr * */ /* Number of different errors */ #define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1) diff --git a/include/my_handler_errors.h b/include/my_handler_errors.h index 69b1566557d..96632629775 100644 --- a/include/my_handler_errors.h +++ b/include/my_handler_errors.h @@ -108,7 +108,8 @@ static const char *handler_error_messages[]= "Tablespace is missing for a table", "Sequence has been run out", "Sequence values are conflicting", - "Error during commit" + "Error during commit", + "Cannot select partitions" }; #endif /* MYSYS_MY_HANDLER_ERRORS_INCLUDED */ diff --git a/include/my_sys.h b/include/my_sys.h index 1304dee0146..e2517736131 100644 --- a/include/my_sys.h +++ b/include/my_sys.h @@ -1,5 +1,5 @@ /* Copyright (c) 2000, 2013, Oracle and/or its affiliates. - Copyright (c) 2010, 2021, MariaDB Corporation. + Copyright (c) 2010, 2022, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -263,7 +263,7 @@ extern int my_umask_dir, my_recived_signals, /* Signals we have got */ my_safe_to_handle_signal, /* Set when allowed to SIGTSTP */ my_dont_interrupt; /* call remember_intr when set */ -extern my_bool my_use_symdir; +extern MYSQL_PLUGIN_IMPORT my_bool my_use_symdir; extern ulong my_default_record_cache_size; extern MYSQL_PLUGIN_IMPORT my_bool my_disable_locking; diff --git a/include/mysql/plugin_auth.h b/include/mysql/plugin_auth.h index ae9c9368f15..3827db33431 100644 --- a/include/mysql/plugin_auth.h +++ b/include/mysql/plugin_auth.h @@ -147,7 +147,8 @@ struct st_mysql_auth @return 0 for ok, 1 for error - Can be NULL. + Can be NULL, in this case one will not be able to use SET PASSWORD or + PASSWORD('...') in GRANT, CREATE USER, ALTER USER. */ int (*hash_password)(const char *password, size_t password_length, char *hash, size_t *hash_length); diff --git a/include/ssl_compat.h b/include/ssl_compat.h index 9f4b6be8d95..8dc1225407e 100644 --- a/include/ssl_compat.h +++ b/include/ssl_compat.h @@ -73,7 +73,10 @@ #define EVP_MD_CTX_SIZE sizeof(EVP_MD_CTX) #endif +#ifndef DH_set0_pqg #define DH_set0_pqg(D,P,Q,G) ((D)->p= (P), (D)->g= (G)) +#endif + #define EVP_CIPHER_CTX_buf_noconst(ctx) ((ctx)->buf) #define EVP_CIPHER_CTX_encrypting(ctx) ((ctx)->encrypt) #define EVP_CIPHER_CTX_SIZE sizeof(EVP_CIPHER_CTX) |