This is an automated email from the ASF dual-hosted git repository. amashenkov pushed a commit to branch ignite-19331 in repository https://gitbox.apache.org/repos/asf/ignite-3.git
commit b03bdb7a9258c23b11e30696ec28152fc11950e4 Author: amashenkov <andrey.mashen...@gmail.com> AuthorDate: Wed May 22 16:00:42 2024 +0300 wip --- .../sql/cast/test_boolean_cast.test | 81 +++++++---- .../sql/cast/test_boolean_cast.test_ignore | 160 --------------------- 2 files changed, 54 insertions(+), 187 deletions(-) diff --git a/modules/sql-engine/src/integrationTest/sql/cast/test_boolean_cast.test b/modules/sql-engine/src/integrationTest/sql/cast/test_boolean_cast.test index 05f24475c4..9a2fc2a0d5 100644 --- a/modules/sql-engine/src/integrationTest/sql/cast/test_boolean_cast.test +++ b/modules/sql-engine/src/integrationTest/sql/cast/test_boolean_cast.test @@ -1,7 +1,6 @@ # name: test/sql/cast/test_boolean_cast.test # description: Test boolean casts # group: [cast] -# Ignored with https://issues.apache.org/jira/browse/IGNITE-19331 statement ok PRAGMA enable_verification @@ -36,60 +35,88 @@ SELECT CAST('FALSE' AS BOOLEAN) ---- false -statement error -SELECT CAST('12345' AS BOOLEAN) +query T +SELECT CAST(NULL AS BOOLEAN) +---- +null + +query T +SELECT CAST(NULL AS BOOLEAN) +---- +null + +query T +SELECT CAST((1 = NULL) AS BOOLEAN) +---- +null -statement error -SELECT CAST(CAST('12345' AS INTEGER) AS BOOLEAN) +query T +SELECT CAST((1 = NULL) AS BOOLEAN) +---- +null -statement error -SELECT CAST(CAST('0' AS INTEGER) AS BOOLEAN) +statement error: Invalid character for cast: 1 +SELECT CAST('1' AS BOOLEAN) -statement error +statement error: Cast function cannot convert value of type TINYINT to type BOOLEAN SELECT CAST(CAST('1' AS tinyint) AS BOOLEAN) -statement error +statement error: Cast function cannot convert value of type TINYINT to type BOOLEAN SELECT CAST(CAST('0' AS tinyint) AS BOOLEAN) -statement error +statement error: Cast function cannot convert value of type SMALLINT to type BOOLEAN SELECT CAST(CAST('1' AS smallint) AS BOOLEAN) -statement error +statement error: Cast function cannot convert value of type SMALLINT to type BOOLEAN SELECT CAST(CAST('0' AS smallint) AS BOOLEAN) -statement error +statement error: Cast function cannot convert value of type INTEGER to type BOOLEAN SELECT CAST(CAST('1' AS integer) AS BOOLEAN) -statement error +statement error: Cast function cannot convert value of type INTEGER to type BOOLEAN SELECT CAST(CAST('0' AS integer) AS BOOLEAN) -statement error +statement error: Cast function cannot convert value of type BIGINT to type BOOLEAN SELECT CAST(CAST('1' AS bigint) AS BOOLEAN) -statement error +statement error: Cast function cannot convert value of type BIGINT to type BOOLEAN SELECT CAST(CAST('0' AS bigint) AS BOOLEAN) -statement error +statement error: Cast function cannot convert value of type DECIMAL(32767, 0) to type BOOLEAN SELECT CAST(CAST('1' AS decimal) AS BOOLEAN) -statement error +statement error: Cast function cannot convert value of type DECIMAL(32767, 0) to type BOOLEAN SELECT CAST(CAST('0' AS decimal) AS BOOLEAN) -statement error +statement error: Cast function cannot convert value of type DECIMAL(1, 0) to type BOOLEAN SELECT CAST(CAST('1' AS decimal(1,0)) AS BOOLEAN) -statement error +statement error: Cast function cannot convert value of type DECIMAL(1, 0) to type BOOLEAN SELECT CAST(CAST('0' AS decimal(1,0)) AS BOOLEAN) -statement error -SELECT CAST(CAST('1' AS decimal(9,0)) AS BOOLEAN) +statement error: Cast function cannot convert value of type FLOAT to type BOOLEAN +SELECT CAST(CAST('1' AS float) AS BOOLEAN) + +statement error: Cast function cannot convert value of type FLOAT to type BOOLEAN +SELECT CAST(CAST('0' AS float) AS BOOLEAN) + +statement error: Cast function cannot convert value of type DOUBLE to type BOOLEAN +SELECT CAST(CAST('1' AS double) AS BOOLEAN) + +statement error: Cast function cannot convert value of type DOUBLE to type BOOLEAN +SELECT CAST(CAST('0' AS double) AS BOOLEAN) + +statement error: Cast function cannot convert value of type DATE to type BOOLEAN +SELECT CAST(CAST('1970-1-1' AS date) AS BOOLEAN) -statement error -SELECT CAST(CAST('0' AS decimal(9,0)) AS BOOLEAN) +statement error: Cast function cannot convert value of type TIME(0) to type BOOLEAN +SELECT CAST(CAST('00:00:00' AS time) AS BOOLEAN) -statement error -SELECT CAST(CAST('1' AS decimal(38,0)) AS BOOLEAN) +statement error: Cast function cannot convert value of type TIME(9) to type BOOLEAN +SELECT CAST(CAST('00:00:00.000000000' AS time(9)) AS BOOLEAN) -statement error -SELECT CAST(CAST('0' AS decimal(38,0)) AS BOOLEAN) +statement error: Cast function cannot convert value of type TIMESTAMP(6) to type BOOLEAN +SELECT CAST(CAST('1970-1-1 00:00:00' AS timestamp) AS BOOLEAN) +statement error: Cast function cannot convert value of type TIMESTAMP(9) to type BOOLEAN +SELECT CAST(CAST('1970-1-1 00:00:00.000000000' AS timestamp(9)) AS BOOLEAN) \ No newline at end of file diff --git a/modules/sql-engine/src/integrationTest/sql/cast/test_boolean_cast.test_ignore b/modules/sql-engine/src/integrationTest/sql/cast/test_boolean_cast.test_ignore deleted file mode 100644 index 9a90c2a5cb..0000000000 --- a/modules/sql-engine/src/integrationTest/sql/cast/test_boolean_cast.test_ignore +++ /dev/null @@ -1,160 +0,0 @@ -# name: test/sql/cast/test_boolean_cast.test -# description: Test boolean casts -# group: [cast] -# Ignored with https://issues.apache.org/jira/browse/IGNITE-19331 - -statement ok -PRAGMA enable_verification - -query T -SELECT CAST(1=1 AS VARCHAR) ----- -TRUE - -query T -SELECT CAST(1=0 AS VARCHAR) ----- -FALSE - -query T -SELECT CAST('true' AS BOOLEAN) ----- -true - -query T -SELECT CAST('TRUE' AS BOOLEAN) ----- -true - -query T -SELECT CAST('false' AS BOOLEAN) ----- -false - -query T -SELECT CAST('FALSE' AS BOOLEAN) ----- -false - -statement error -SELECT CAST('12345' AS BOOLEAN) - -query T -SELECT CAST(CAST('12345' AS INTEGER) AS BOOLEAN) ----- -true - -query T -SELECT CAST(CAST('0' AS INTEGER) AS BOOLEAN) ----- -false - -query T -SELECT CAST(CAST('1' AS tinyint) AS BOOLEAN) ----- -true - -query T -SELECT CAST(CAST('0' AS tinyint) AS BOOLEAN) ----- -false - -query T -SELECT CAST(CAST('1' AS smallint) AS BOOLEAN) ----- -true - -query T -SELECT CAST(CAST('0' AS smallint) AS BOOLEAN) ----- -false - -query T -SELECT CAST(CAST('1' AS integer) AS BOOLEAN) ----- -true - -query T -SELECT CAST(CAST('0' AS integer) AS BOOLEAN) ----- -false - -query T -SELECT CAST(CAST('1' AS bigint) AS BOOLEAN) ----- -true - -query T -SELECT CAST(CAST('0' AS bigint) AS BOOLEAN) ----- -false - -query T -SELECT CAST(CAST('1' AS decimal) AS BOOLEAN) ----- -true - -query T -SELECT CAST(CAST('0' AS decimal) AS BOOLEAN) ----- -false - -query T -SELECT CAST(CAST('1' AS decimal(1,0)) AS BOOLEAN) ----- -true - -query T -SELECT CAST(CAST('0' AS decimal(1,0)) AS BOOLEAN) ----- -false - -query T -SELECT CAST(CAST('1' AS decimal(9,0)) AS BOOLEAN) ----- -true - -query T -SELECT CAST(CAST('0' AS decimal(9,0)) AS BOOLEAN) ----- -false - -query T -SELECT CAST(CAST('1' AS decimal(38,0)) AS BOOLEAN) ----- -true - -query T -SELECT CAST(CAST('0' AS decimal(38,0)) AS BOOLEAN) ----- -false - -query T -SELECT CAST(CAST('1' AS float) AS BOOLEAN) ----- -true - -query T -SELECT CAST(CAST('0' AS float) AS BOOLEAN) ----- -false - -query T -SELECT CAST(CAST('1' AS double) AS BOOLEAN) ----- -true - -query T -SELECT CAST(CAST('0' AS double) AS BOOLEAN) ----- -false - -query T -SELECT CAST(CAST('1' AS HUGEINT) AS BOOLEAN) ----- -true - -query T -SELECT CAST(CAST('0' AS HUGEINT) AS BOOLEAN) ----- -false