subquery-opt.slt 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # Copyright 2015 - 2019 The Cockroach Authors. All rights reserved.
  2. # Copyright Materialize, Inc. and contributors. All rights reserved.
  3. #
  4. # Use of this software is governed by the Business Source License
  5. # included in the LICENSE file at the root of this repository.
  6. #
  7. # As of the Change Date specified in that file, in accordance with
  8. # the Business Source License, use of this software will be governed
  9. # by the Apache License, Version 2.0.
  10. #
  11. # This file is derived from the logic test suite in CockroachDB. The
  12. # original file was retrieved on June 10, 2019 from:
  13. #
  14. # https://github.com/cockroachdb/cockroach/blob/d2f7fbf5dd1fc1a099bbad790a2e1f7c60a66cc3/pkg/sql/logictest/testdata/logic_test/subquery-opt
  15. #
  16. # The original source code is subject to the terms of the Apache
  17. # 2.0 license, a copy of which can be found in the LICENSE file at the
  18. # root of this repository.
  19. mode cockroach
  20. # Regression test for cockroach#37263. This test is broken in the heuristic planner
  21. # because it does not correctly type check subqueries.
  22. query B
  23. SELECT 3::decimal IN (SELECT 1)
  24. ----
  25. false
  26. query error unsupported comparison operator
  27. SELECT 3::decimal IN (SELECT 1::int)
  28. query B
  29. SELECT 1 IN (SELECT '1');
  30. ----
  31. true
  32. # Regression test for database-issues#4155.
  33. query ITIIIII
  34. SELECT t.oid, t.typname, t.typsend, t.typreceive, t.typoutput, t.typinput, t.typelem
  35. FROM pg_type AS t
  36. WHERE t.oid NOT IN (
  37. SELECT (ARRAY[704,11676,10005,3912,11765,59410,11397])[i]
  38. FROM generate_series(1, 376) AS i
  39. )
  40. ----