From 867235e4902c91531095676e3a413d935181b0bd Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 20 Jan 2022 12:26:36 -0500 Subject: repair broken truediv test suite; memusage the truediv test suite didn't have __backend__ so wasn't running for every DB except in the main build. Repaired this as well as truediv support to preserve the right-hand side type when casting to numeric, if the right type is already a numeric type. also fixed a memusage test that relies on savepoints so was not running under gerrit runs. Change-Id: I3be223fdf697af9c1ed61b70d621f57cbbb7a92b --- test/sql/test_compiler.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/sql') diff --git a/test/sql/test_compiler.py b/test/sql/test_compiler.py index c273dbbf8..d20037e92 100644 --- a/test/sql/test_compiler.py +++ b/test/sql/test_compiler.py @@ -2244,7 +2244,7 @@ class SelectTest(fixtures.TestBase, AssertsCompiledSQL): (value_tbl.c.val2 - value_tbl.c.val1) / value_tbl.c.val1, ), "SELECT values.id, (values.val2 - values.val1) " - "/ CAST(values.val1 AS NUMERIC) AS anon_1 FROM values", + "/ CAST(values.val1 AS FLOAT) AS anon_1 FROM values", ) self.assert_compile( @@ -2253,7 +2253,7 @@ class SelectTest(fixtures.TestBase, AssertsCompiledSQL): ), "SELECT values.id FROM values WHERE " "(values.val2 - values.val1) / " - "CAST(values.val1 AS NUMERIC) > :param_1", + "CAST(values.val1 AS FLOAT) > :param_1", ) self.assert_compile( @@ -2264,8 +2264,8 @@ class SelectTest(fixtures.TestBase, AssertsCompiledSQL): > 2.0, ), "SELECT values.id FROM values WHERE " - "(values.val1 / CAST((values.val2 - values.val1) AS NUMERIC)) " - "/ CAST(values.val1 AS NUMERIC) > :param_1", + "(values.val1 / CAST((values.val2 - values.val1) AS FLOAT)) " + "/ CAST(values.val1 AS FLOAT) > :param_1", ) def test_percent_chars(self): -- cgit v1.2.1