From 1e4e47347d11fcc53a8405c24a7f88723e9646ac Mon Sep 17 00:00:00 2001 From: Georg Richter Date: Tue, 11 Feb 2025 19:38:55 +0100 Subject: [PATCH 1/6] test fix: use my_ulonglong instead of ulong Use 64-bit long instead of 32-bit value to avoid overflow --- unittest/libmariadb/connection.c | 2 ++ unittest/libmariadb/ps_bugs.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/unittest/libmariadb/connection.c b/unittest/libmariadb/connection.c index 8edf5dfb..adc27510 100644 --- a/unittest/libmariadb/connection.c +++ b/unittest/libmariadb/connection.c @@ -2339,6 +2339,7 @@ static int test_conc748(MYSQL *my __attribute__((unused))) MYSQL *mysql; int i; const char *ciphers[3]= {"TLS_AES_128_GCM_SHA256", "TLS_AES_256_GCM_SHA384", "TLS_CHACHA20_POLY1305_SHA256"}; + my_bool verify= 0; SKIP_MAXSCALE; @@ -2348,6 +2349,7 @@ static int test_conc748(MYSQL *my __attribute__((unused))) mysql= mysql_init(NULL); mysql_ssl_set(mysql, NULL, NULL, NULL, NULL, NULL); + mysql_optionsv(mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, &verify); mysql_optionsv(mysql, MYSQL_OPT_SSL_CIPHER, ciphers[i]); if (!my_test_connect(mysql, hostname, username, diff --git a/unittest/libmariadb/ps_bugs.c b/unittest/libmariadb/ps_bugs.c index 3109b141..f57b42a0 100644 --- a/unittest/libmariadb/ps_bugs.c +++ b/unittest/libmariadb/ps_bugs.c @@ -5001,7 +5001,7 @@ static int test_conc_fraction(MYSQL *mysql) for (i=0; i < 10; i++, frac=frac*10+i) { - unsigned long expected= 0; + my_ulonglong expected= 0; sprintf(query, "SELECT '2018-11-05 22:25:59.%ld'", frac); diag("%d: %s", i, query); @@ -5033,7 +5033,7 @@ static int test_conc_fraction(MYSQL *mysql) if (tm.second_part != expected) { - diag("Error: tm.second_part=%ld expected=%ld", tm.second_part, expected); + diag("Error: tm.second_part=%ld expected=%lld", tm.second_part, expected); mysql_stmt_close(stmt); return FAIL; } From a8f9a57aa51b1db112e65355ba13ce879334a0ed Mon Sep 17 00:00:00 2001 From: Daniel Bartholomew Date: Tue, 11 Feb 2025 15:01:15 -0500 Subject: [PATCH 2/6] bump the VERSION --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 31d7fd8e..c15e87d4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,7 +37,7 @@ SET(CC_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) SET(CPACK_PACKAGE_VERSION_MAJOR 3) SET(CPACK_PACKAGE_VERSION_MINOR 1) -SET(CPACK_PACKAGE_VERSION_PATCH 27) +SET(CPACK_PACKAGE_VERSION_PATCH 28) SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") MATH(EXPR MARIADB_PACKAGE_VERSION_ID "${CPACK_PACKAGE_VERSION_MAJOR} * 10000 + ${CPACK_PACKAGE_VERSION_MINOR} * 100 + From 4bbfa5040e0949a39915e3287153d258211f48a4 Mon Sep 17 00:00:00 2001 From: Daniel Bartholomew Date: Tue, 11 Feb 2025 15:03:48 -0500 Subject: [PATCH 3/6] bump the VERSION --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f4602de2..dbcd7bbe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,7 +52,7 @@ SET(CC_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) SET(CPACK_PACKAGE_VERSION_MAJOR 3) SET(CPACK_PACKAGE_VERSION_MINOR 3) -SET(CPACK_PACKAGE_VERSION_PATCH 14) +SET(CPACK_PACKAGE_VERSION_PATCH 15) SET(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") MATH(EXPR MARIADB_PACKAGE_VERSION_ID "${CPACK_PACKAGE_VERSION_MAJOR} * 10000 + ${CPACK_PACKAGE_VERSION_MINOR} * 100 + From 992c7f26ddb8e38d2aedc0b398cf125acf22b7ec Mon Sep 17 00:00:00 2001 From: Georg Richter Date: Wed, 12 Feb 2025 07:12:14 +0100 Subject: [PATCH 4/6] Travis fix: Skip maxscale for test_mdev35935 --- unittest/libmariadb/errors.c | 1 + unittest/libmariadb/ps_bugs.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/unittest/libmariadb/errors.c b/unittest/libmariadb/errors.c index 2f895c9d..bd4f05fb 100644 --- a/unittest/libmariadb/errors.c +++ b/unittest/libmariadb/errors.c @@ -287,6 +287,7 @@ static int test_mdev35935(MYSQL *mysql) MYSQL_BIND bind[2]; const char *data= "test"; + SKIP_MAXSCALE; SKIP_MYSQL(mysql); rc= mysql_select_db(mysql, schema); diff --git a/unittest/libmariadb/ps_bugs.c b/unittest/libmariadb/ps_bugs.c index f57b42a0..7072946b 100644 --- a/unittest/libmariadb/ps_bugs.c +++ b/unittest/libmariadb/ps_bugs.c @@ -5001,7 +5001,7 @@ static int test_conc_fraction(MYSQL *mysql) for (i=0; i < 10; i++, frac=frac*10+i) { - my_ulonglong expected= 0; + unsigned int expected= frac; sprintf(query, "SELECT '2018-11-05 22:25:59.%ld'", frac); diag("%d: %s", i, query); @@ -5027,7 +5027,8 @@ static int test_conc_fraction(MYSQL *mysql) diag("second_part: %ld", tm.second_part); - expected= frac * 100000; + while (expected && expected < 100000) + expected *= 10; while (expected >= 1000000) expected /= 10; From fe8f48c6c3cb85fb2fc8497a2b1035a3f23e90b6 Mon Sep 17 00:00:00 2001 From: Georg Richter Date: Wed, 12 Feb 2025 08:34:10 +0100 Subject: [PATCH 5/6] Build fix: fix warning in ps_bugs.c --- unittest/libmariadb/ps_bugs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unittest/libmariadb/ps_bugs.c b/unittest/libmariadb/ps_bugs.c index 7072946b..703aa34a 100644 --- a/unittest/libmariadb/ps_bugs.c +++ b/unittest/libmariadb/ps_bugs.c @@ -5034,7 +5034,7 @@ static int test_conc_fraction(MYSQL *mysql) if (tm.second_part != expected) { - diag("Error: tm.second_part=%ld expected=%lld", tm.second_part, expected); + diag("Error: tm.second_part=%ld expected=%d", tm.second_part, expected); mysql_stmt_close(stmt); return FAIL; } From d4eec05d00ce77d2bab3848ff49d04acf0ed2cc0 Mon Sep 17 00:00:00 2001 From: Georg Richter Date: Tue, 18 Feb 2025 16:19:50 +0100 Subject: [PATCH 6/6] Revert "CONC-710: Remove UDF declarations" Since UDF declarations are used e.g. by lib_mysqludf_sys, I'm reverting this commit. (See also CONC-757). This reverts commit 1a2ed3f67af698b394b2faed069b49d4f409a155. --- include/mariadb_com.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/include/mariadb_com.h b/include/mariadb_com.h index 195979af..4418bf8f 100644 --- a/include/mariadb_com.h +++ b/include/mariadb_com.h @@ -406,6 +406,30 @@ struct rand_struct { double max_value_dbl; }; + /* The following is for user defined functions */ + +enum Item_result {STRING_RESULT,REAL_RESULT,INT_RESULT,ROW_RESULT,DECIMAL_RESULT}; + +typedef struct st_udf_args +{ + unsigned int arg_count; /* Number of arguments */ + enum Item_result *arg_type; /* Pointer to item_results */ + char **args; /* Pointer to argument */ + unsigned long *lengths; /* Length of string arguments */ + char *maybe_null; /* Set to 1 for all maybe_null args */ +} UDF_ARGS; + + /* This holds information about the result */ + +typedef struct st_udf_init +{ + my_bool maybe_null; /* 1 if function can return NULL */ + unsigned int decimals; /* for real functions */ + unsigned int max_length; /* For string functions */ + char *ptr; /* free pointer for function data */ + my_bool const_item; /* 0 if result is independent of arguments */ +} UDF_INIT; + /* Connection types */ #define MARIADB_CONNECTION_UNIXSOCKET 0 #define MARIADB_CONNECTION_TCP 1