# Copyright Materialize, Inc. and contributors. All rights reserved. # # Use of this software is governed by the Business Source License # included in the LICENSE file at the root of this repository. # # As of the Change Date specified in that file, in accordance with # the Business Source License, use of this software will be governed # by the Apache License, Version 2.0. # # This file is derived from the logic test suite in CockroachDB. The # original file was retrieved on June 10, 2019 from: # # https://github.com/cockroachdb/cockroach/blob/d2f7fbf5dd1fc1a099bbad790a2e1f7c60a66cc3/pkg/sql/logictest/testdata/logic_test/json_builtins # # The original source code is subject to the terms of the Apache # 2.0 license, a copy of which can be found in the LICENSE file at the # root of this repository. # Fixes database-issues#5212 query T SELECT 'a'::character = 'a'::"char"; ---- true query error db error: ERROR: coalesce could not convert type char\(1\) to "char" SELECT pg_typeof(coalesce('1'::"char", '1'::char)); # Fixes database-issues#5191 query T SELECT 'a'::"char"::char; ---- a query T SELECT pg_typeof('a'::"char"::char); ---- character query T SELECT 'a'::"char"::varchar; ---- a query T SELECT pg_typeof('a'::"char"::varchar); ---- character query T SELECT 'a'::"char"::text; ---- a query T SELECT pg_typeof('a'::"char"::text); ---- text query T SELECT 'abc'::char::"char"; ---- a query T SELECT pg_typeof('abc'::char::"char"); ---- "char" query T SELECT 'abc'::varchar::"char"; ---- a query T SELECT pg_typeof('abc'::varchar::"char"); ---- "char" query T SELECT 'abc'::text::"char"; ---- a query T SELECT pg_typeof('abc'::text::"char"); ---- "char" # Fixes database-issues#5222 query error db error: ERROR: coalesce could not convert type "char" to char SELECT COALESCE('a'::char, 'a'::"char"); query error db error: ERROR: coalesce could not convert type "char" to varchar SELECT COALESCE('a'::varchar, 'a'::"char"); query error db error: ERROR: coalesce could not convert type char\(1\) to "char" SELECT COALESCE('a'::"char", 'a'::char); query error db error: ERROR: coalesce could not convert type varchar to "char" SELECT COALESCE('a'::"char", 'a'::varchar);