From 9924466b3b9b3cdc590106e0036e6fb67d9aa4b0 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Mon, 16 Jan 2023 23:06:38 +0100 Subject: v5.5.4-stable --- extra/wolfssl/CMakeLists.txt | 2 ++ extra/wolfssl/wolfssl | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/extra/wolfssl/CMakeLists.txt b/extra/wolfssl/CMakeLists.txt index 35c3b735bdd..7bd5f1694ed 100644 --- a/extra/wolfssl/CMakeLists.txt +++ b/extra/wolfssl/CMakeLists.txt @@ -157,6 +157,8 @@ IF(WOLFSSL_X86_64_BUILD) ${WOLFCRYPT_SRCDIR}/sha512_asm.S ${WOLFCRYPT_SRCDIR}/sha256_asm.S) ADD_DEFINITIONS(-maes -msse4.2 -mpclmul) + # WolfSSL 5.5.4 bug - user_settings.h not included into aes_asm.S + SET_PROPERTY(SOURCE ${WOLFCRYPT_SRCDIR}/aes_asm.S APPEND PROPERTY COMPILE_OPTIONS "-DWOLFSSL_X86_64_BUILD") ENDIF() ENDIF() diff --git a/extra/wolfssl/wolfssl b/extra/wolfssl/wolfssl index f1e2165c591..4fbd4fd36a2 160000 --- a/extra/wolfssl/wolfssl +++ b/extra/wolfssl/wolfssl @@ -1 +1 @@ -Subproject commit f1e2165c591f074feb47872a8ff712713ec411e1 +Subproject commit 4fbd4fd36a21efd9d1a7e17aba390e91c78693b1 -- cgit v1.2.1 From ff72a9431a6559b691d3dcfb595e76546678313d Mon Sep 17 00:00:00 2001 From: Rucha Deodhar Date: Thu, 29 Dec 2022 22:46:53 +0530 Subject: MDEV-26392: Crash with json_get_path_next and 10.5.12 Analysis: When we skip level when path is found, it changes the state of the json engine. This breaks the sequence for json_get_path_next() which is called at the end to ensure json document is valid and leads to crash. Fix: Use json_scan_next() at the end to check if json document has correct syntax (is valid). --- mysql-test/main/func_json.result | 12 ++++++++++++ mysql-test/main/func_json.test | 12 ++++++++++++ sql/item_jsonfunc.cc | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/mysql-test/main/func_json.result b/mysql-test/main/func_json.result index b0a7cb4988c..2a293fc72c7 100644 --- a/mysql-test/main/func_json.result +++ b/mysql-test/main/func_json.result @@ -1611,5 +1611,17 @@ SELECT json_object('a', coalesce(json_object('b', 'c'))); json_object('a', coalesce(json_object('b', 'c'))) {"a": {"b": "c"}} # +# MDEV-26392: Crash with json_get_path_next and 10.5.12 +# +CREATE TABLE arrNestTest ( +id VARCHAR(80) AS (JSON_COMPACT(JSON_EXTRACT(doc, "$._id"))) UNIQUE KEY, +doc JSON, +CONSTRAINT id_not_null CHECK(id IS NOT NULL)); +INSERT INTO test.arrNestTest (doc) VALUES ('{ "_id" : { "$oid" : "611c0a463b150154132f6636" }, "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : 1.0 } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] }'); +SELECT * FROM arrNestTest; +id doc +{"$oid":"611c0a463b150154132f6636"} { "_id" : { "$oid" : "611c0a463b150154132f6636" }, "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : 1.0 } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } +DROP TABLE arrNestTest; +# # End of 10.5 tests # diff --git a/mysql-test/main/func_json.test b/mysql-test/main/func_json.test index 7e7b83c720d..35645bcb226 100644 --- a/mysql-test/main/func_json.test +++ b/mysql-test/main/func_json.test @@ -1054,6 +1054,18 @@ DROP TABLE t2; SELECT json_object('a', if(1, json_object('b', 'c'), json_object('e', 'f'))); SELECT json_object('a', coalesce(json_object('b', 'c'))); +--echo # +--echo # MDEV-26392: Crash with json_get_path_next and 10.5.12 +--echo # + +CREATE TABLE arrNestTest ( + id VARCHAR(80) AS (JSON_COMPACT(JSON_EXTRACT(doc, "$._id"))) UNIQUE KEY, + doc JSON, + CONSTRAINT id_not_null CHECK(id IS NOT NULL)); + +INSERT INTO test.arrNestTest (doc) VALUES ('{ "_id" : { "$oid" : "611c0a463b150154132f6636" }, "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : [ { "a" : 1.0 } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] } ] }'); +SELECT * FROM arrNestTest; +DROP TABLE arrNestTest; --echo # --echo # End of 10.5 tests diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc index e6507278381..9843b6d14b1 100644 --- a/sql/item_jsonfunc.cc +++ b/sql/item_jsonfunc.cc @@ -994,7 +994,7 @@ String *Item_func_json_extract::read_json(String *str, if (!possible_multiple_values) { /* Loop to the end of the JSON just to make sure it's valid. */ - while (json_get_path_next(&je, &p) == 0) {} + while (json_scan_next(&je) == 0) {} break; } } -- cgit v1.2.1 From da798c951182c7afdbf04948dccbc7d4705cc224 Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Mon, 16 Jan 2023 14:18:07 +0100 Subject: new PCRE2 10.42 --- cmake/pcre.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/pcre.cmake b/cmake/pcre.cmake index 0ac834f44a6..65dc2ae28f6 100644 --- a/cmake/pcre.cmake +++ b/cmake/pcre.cmake @@ -54,8 +54,8 @@ MACRO(BUNDLE_PCRE2) ExternalProject_Add( pcre2 PREFIX "${dir}" - URL "https://github.com/PhilipHazel/pcre2/releases/download/pcre2-10.40/pcre2-10.40.zip" - URL_MD5 798698846982ce171d881ed0d7535c2a + URL "https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.42/pcre2-10.42.zip" + URL_MD5 fe90992fbfb03f854bd9f344074f49eb INSTALL_COMMAND "" CMAKE_ARGS "-DCMAKE_WARN_DEPRECATED=FALSE" -- cgit v1.2.1