diff options
author | Eric Herman <eric@freesa.org> | 2021-07-02 07:59:56 +0200 |
---|---|---|
committer | Vicențiu-Marian Ciorbaru <vicentiu@mariadb.org> | 2021-07-21 16:32:11 +0300 |
commit | 105e4148bfe863a1580ad0bd7442bc661a4e02fd (patch) | |
tree | 0ce02426d37d7828891ca8875891622070dab233 /include/json_lib.h | |
parent | 7b587fcbe74e46a5b902e096b6c86d0476560489 (diff) | |
download | mariadb-git-105e4148bfe863a1580ad0bd7442bc661a4e02fd.tar.gz |
Add json_normalize function to json_lib
This patch implements a library for normalizing json documents.
The algorithm is:
* Recursively sort json keys according to utf8mb4_bin collation.
* Normalize numbers to be of the form [-]<digit>.<frac>E<exponent>
* All unneeded whitespace and line endings are removed.
* Arrays are not sorted.
Co-authored-by: Vicențiu Ciorbaru <vicentiu@mariadb.org>
Diffstat (limited to 'include/json_lib.h')
-rw-r--r-- | include/json_lib.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/json_lib.h b/include/json_lib.h index 7ef53e63517..6d802860cff 100644 --- a/include/json_lib.h +++ b/include/json_lib.h @@ -1,6 +1,8 @@ #ifndef JSON_LIB_INCLUDED #define JSON_LIB_INCLUDED +#include <my_sys.h> + #ifdef __cplusplus extern "C" { #endif @@ -431,6 +433,9 @@ int json_locate_key(const char *js, const char *js_end, const char **key_start, const char **key_end, int *comma_pos); +int json_normalize(DYNAMIC_STRING *result, + const char *s, size_t size, CHARSET_INFO *cs); + #ifdef __cplusplus } #endif |