ClickHouse/tests/queries/0_stateless/00662_has_nullable.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
1.2 KiB
MySQL
Raw Normal View History

DROP TABLE IF EXISTS 00662_has_nullable;
2024-03-13 07:14:55 +00:00
SELECT 'Nullable(UInt64), non-null array';
CREATE TABLE 00662_has_nullable(a Nullable(UInt64)) ENGINE = Memory;
INSERT INTO 00662_has_nullable VALUES (1), (Null);
SELECT a, has([0, 1], a) FROM 00662_has_nullable;
DROP TABLE 00662_has_nullable;
2024-03-13 07:14:55 +00:00
--------------------------------------------------------------------------------
SELECT 'Non-nullable UInt64, nullable array';
CREATE TABLE 00662_has_nullable(a UInt64) ENGINE = Memory;
INSERT INTO 00662_has_nullable VALUES (0), (1), (2);
SELECT a, has([NULL, 1, 2], a) FROM 00662_has_nullable;
DROP TABLE 00662_has_nullable;
--------------------------------------------------------------------------------
SELECT 'Nullable(UInt64), nullable array';
CREATE TABLE 00662_has_nullable(a Nullable(UInt64)) ENGINE = Memory;
INSERT INTO 00662_has_nullable VALUES (0), (Null), (1);
SELECT a, has([NULL, 1, 2], a) FROM 00662_has_nullable;
DROP TABLE 00662_has_nullable;
--------------------------------------------------------------------------------
SELECT 'All NULLs';
CREATE TABLE 00662_has_nullable(a Nullable(UInt64)) ENGINE = Memory;
INSERT INTO 00662_has_nullable VALUES (0), (Null);
SELECT a, has([NULL, NULL], a) FROM 00662_has_nullable;
DROP TABLE 00662_has_nullable;