github-2327.slt 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. # Regression test for https://github.com/MaterializeInc/database-issues/issues/2327.
  10. statement ok
  11. CREATE TABLE t2 (f1 DOUBLE PRECISION, f2 DOUBLE PRECISION NOT NULL);
  12. statement ok
  13. INSERT INTO t2 VALUES (1, 1);
  14. statement ok
  15. INSERT INTO t2 VALUES (2, 2);
  16. query II
  17. SELECT * FROM (SELECT COUNT (*) AS f1 FROM t2) a1, (SELECT MAX (f1) AS f2 FROM t2) a2 WHERE 1 NOT IN (a1.f1 + a2.f2);
  18. ----
  19. 2
  20. 2
  21. query II
  22. SELECT AVG ( a1 .f2 ) , MIN ( a1 .f1 ) FROM ( SELECT COUNT ( TRUE ) f1 , AVG ( a2 .f2 ) AS f2 FROM t2 a2 ) a1 LEFT JOIN ( SELECT TRUE f1 , MAX ( a1 .f1 ) f2 FROM t2 a1, t2 ) a2 ON 1 NOT IN ( a1 .f1 + a2 .f2 , 2 ) ;
  23. ----
  24. 1
  25. 2