Skip to content

Commit

Permalink
Changed JSON collation to utf8mb4_bin for case-sensitivity
Browse files Browse the repository at this point in the history
  • Loading branch information
pvetere committed Feb 27, 2024
1 parent 34babea commit 55ca3a8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
8 changes: 4 additions & 4 deletions create_loader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,31 +68,31 @@ emit_function_stmts()

cat <<EOF > "$OUTFILE"
CREATE $MAYBE_REPLACE FUNCTION json_flatten_json(
json JSON COLLATE utf8mb4_general_ci NOT NULL,
json JSON COLLATE utf8mb4_bin NOT NULL,
expr ARRAY(TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL))
RETURNS TABLE(
name TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
value LONGTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL)
AS WASM FROM $CONTENT_SRC;
CREATE $MAYBE_REPLACE FUNCTION json_flatten_bigint(
json JSON COLLATE utf8mb4_general_ci NOT NULL,
json JSON COLLATE utf8mb4_bin NOT NULL,
expr ARRAY(TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL))
RETURNS TABLE(
name TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
value BIGINT NOT NULL)
AS WASM FROM $CONTENT_SRC;
CREATE $MAYBE_REPLACE FUNCTION json_flatten_double(
json JSON COLLATE utf8mb4_general_ci NOT NULL,
json JSON COLLATE utf8mb4_bin NOT NULL,
expr ARRAY(TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL))
RETURNS TABLE(
name TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
value DOUBLE NOT NULL)
AS WASM FROM $CONTENT_SRC;
CREATE $MAYBE_REPLACE FUNCTION json_flatten_string(
json JSON COLLATE utf8mb4_general_ci NOT NULL,
json JSON COLLATE utf8mb4_bin NOT NULL,
expr ARRAY(TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL))
RETURNS TABLE(
name TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
Expand Down
8 changes: 4 additions & 4 deletions json_flatten.sql
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
CREATE FUNCTION json_flatten_json(
json JSON COLLATE utf8mb4_general_ci NOT NULL,
json JSON COLLATE utf8mb4_bin NOT NULL,
expr ARRAY(TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL))
RETURNS TABLE(
name TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
value LONGTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL)
AS WASM FROM LOCAL INFILE 'json_flatten.wasm';

CREATE FUNCTION json_flatten_bigint(
json JSON COLLATE utf8mb4_general_ci NOT NULL,
json JSON COLLATE utf8mb4_bin NOT NULL,
expr ARRAY(TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL))
RETURNS TABLE(
name TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
value BIGINT NOT NULL)
AS WASM FROM LOCAL INFILE 'json_flatten.wasm';

CREATE FUNCTION json_flatten_double(
json JSON COLLATE utf8mb4_general_ci NOT NULL,
json JSON COLLATE utf8mb4_bin NOT NULL,
expr ARRAY(TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL))
RETURNS TABLE(
name TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
value DOUBLE NOT NULL)
AS WASM FROM LOCAL INFILE 'json_flatten.wasm';

CREATE FUNCTION json_flatten_string(
json JSON COLLATE utf8mb4_general_ci NOT NULL,
json JSON COLLATE utf8mb4_bin NOT NULL,
expr ARRAY(TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL))
RETURNS TABLE(
name TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
Expand Down
2 changes: 2 additions & 0 deletions load_extension.sql

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions load_standalone.sql

Large diffs are not rendered by default.

0 comments on commit 55ca3a8

Please sign in to comment.