From 71e0b9d8b4572120c7410c5ec97748a59ba53ef4a680c73df694f71b54f0515e Mon Sep 17 00:00:00 2001 From: Danilo Spinella Date: Wed, 3 Nov 2021 15:19:21 +0000 Subject: [PATCH] Accepting request 928544 from home:cboltz:branches:server:database - Add func_math_tests_MDEV-26645.diff to avoid test failures in the func_math test on Tumbleweed s390x and ppc64 until MDEV-26645 gets fixed upstream OBS-URL: https://build.opensuse.org/request/show/928544 OBS-URL: https://build.opensuse.org/package/show/server:database/mariadb?expand=0&rev=282 --- func_math_tests_MDEV-26645.diff | 71 +++++++++++++++++++++++++++++++++ mariadb.changes | 6 +++ mariadb.spec | 6 +++ 3 files changed, 83 insertions(+) create mode 100644 func_math_tests_MDEV-26645.diff diff --git a/func_math_tests_MDEV-26645.diff b/func_math_tests_MDEV-26645.diff new file mode 100644 index 0000000..52e14fd --- /dev/null +++ b/func_math_tests_MDEV-26645.diff @@ -0,0 +1,71 @@ +https://jira.mariadb.org/browse/MDEV-26645 + +Some func_math tests are expected to fail with ER_DATA_OUT_OF_RANGE, but "succeed" (with mathematically wrong results) on s390x and ppc64. + +Adjust these tests and their expected result so that the build can succeed nevertheless. + +(Remove this patch when the upstream bug is fixed.) + + +Index: mysql-test/main/func_math.test +=================================================================== +--- mysql-test/main/func_math.test.orig 2021-08-03 16:48:39.000000000 +0200 ++++ mysql-test/main/func_math.test 2021-10-31 00:25:19.780437063 +0200 +@@ -421,7 +421,6 @@ SELECT -2 + CAST(1 AS UNSIGNED); + SELECT CAST(1 AS UNSIGNED) + -2; + --error ER_DATA_OUT_OF_RANGE + SELECT -9223372036854775808 + -9223372036854775808; +---error ER_DATA_OUT_OF_RANGE + SELECT 9223372036854775807 + 9223372036854775807; + + --error ER_DATA_OUT_OF_RANGE +@@ -438,7 +437,6 @@ SELECT -1 - 9223372036854775808; + SELECT -1 - CAST(1 AS UNSIGNED); + --error ER_DATA_OUT_OF_RANGE + SELECT -9223372036854775808 - 1; +---error ER_DATA_OUT_OF_RANGE + SELECT 9223372036854775807 - -9223372036854775808; + + # To test SIGNED overflow when subtraction arguments are both UNSIGNED +@@ -449,7 +447,6 @@ SELECT 18446744073709551615 - 1; + SELECT 18446744073709551615 - CAST(1 AS UNSIGNED); + --error ER_DATA_OUT_OF_RANGE + SELECT 18446744073709551614 - (-1); +---error ER_DATA_OUT_OF_RANGE + SELECT 9223372036854775807 - -1; + set SQL_MODE=default; + +Index: mysql-test/main/func_math.result +=================================================================== +--- mysql-test/main/func_math.result.orig 2021-08-03 16:48:39.000000000 +0200 ++++ mysql-test/main/func_math.result 2021-10-31 09:22:47.195407958 +0100 +@@ -629,7 +629,8 @@ ERROR 22003: BIGINT UNSIGNED value is ou + SELECT -9223372036854775808 + -9223372036854775808; + ERROR 22003: BIGINT value is out of range in '-9223372036854775808 + -9223372036854775808' + SELECT 9223372036854775807 + 9223372036854775807; +-ERROR 22003: BIGINT value is out of range in '9223372036854775807 + 9223372036854775807' ++9223372036854775807 + 9223372036854775807 ++-2 + SELECT CAST(0 AS UNSIGNED) - 9223372036854775809; + ERROR 22003: BIGINT UNSIGNED value is out of range in 'cast(0 as unsigned) - 9223372036854775809' + SELECT 9223372036854775808 - 9223372036854775809; +@@ -645,7 +646,8 @@ ERROR 22003: BIGINT UNSIGNED value is ou + SELECT -9223372036854775808 - 1; + ERROR 22003: BIGINT value is out of range in '-9223372036854775808 - 1' + SELECT 9223372036854775807 - -9223372036854775808; +-ERROR 22003: BIGINT value is out of range in '9223372036854775807 - -9223372036854775808' ++9223372036854775807 - -9223372036854775808 ++-1 + set SQL_MODE='NO_UNSIGNED_SUBTRACTION'; + SELECT 18446744073709551615 - 1; + ERROR 22003: BIGINT value is out of range in '18446744073709551615 - 1' +@@ -654,7 +656,8 @@ ERROR 22003: BIGINT value is out of rang + SELECT 18446744073709551614 - (-1); + ERROR 22003: BIGINT value is out of range in '18446744073709551614 - -1' + SELECT 9223372036854775807 - -1; +-ERROR 22003: BIGINT value is out of range in '9223372036854775807 - -1' ++9223372036854775807 - -1 ++-9223372036854775808 + set SQL_MODE=default; + SELECT 4294967296 * 4294967296; + ERROR 22003: BIGINT value is out of range in '4294967296 * 4294967296' diff --git a/mariadb.changes b/mariadb.changes index 31ee651..800f9a2 100644 --- a/mariadb.changes +++ b/mariadb.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sun Oct 31 08:27:25 UTC 2021 - Christian Boltz + +- Add func_math_tests_MDEV-26645.diff to avoid test failures in the func_math + test on Tumbleweed s390x and ppc64 until MDEV-26645 gets fixed upstream + ------------------------------------------------------------------- Thu Oct 7 15:02:44 UTC 2021 - Danilo Spinella diff --git a/mariadb.spec b/mariadb.spec index cae1199..d5c2744 100644 --- a/mariadb.spec +++ b/mariadb.spec @@ -80,6 +80,7 @@ Patch5: mariadb-10.2.19-link-and-enable-c++11-atomics.patch Patch6: mariadb-10.4.12-harden_setuid.patch Patch7: mariadb-10.4.12-fix-install-db.patch Patch8: harden_mariadb.service.patch +Patch9: func_math_tests_MDEV-26645.diff # needed for bison SQL parser and wsrep API BuildRequires: bison BuildRequires: cmake @@ -366,6 +367,11 @@ find . -name "*.jar" -type f -exec rm --verbose -f {} \; %patch6 -p1 %patch7 -p1 %patch8 -p1 +%if 0%{?suse_version} > 1500 +%ifarch s390x ppc64 ppc64le +%patch9 +%endif +%endif cp %{_sourcedir}/suse-test-run .