github-5774.td 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. #
  10. # Regression test for https://github.com/MaterializeInc/database-issues/issues/1780
  11. #
  12. # wrong result with inner join
  13. #
  14. $ set-sql-timeout duration=125ms
  15. > CREATE TABLE customer (c_custkey integer);
  16. > CREATE TABLE orders (o_orderkey integer, o_custkey integer NOT NULL);
  17. > CREATE INDEX pk_orders_orderkey ON orders (o_orderkey);
  18. > CREATE TABLE lineitem (l_orderkey integer NOT NULL);
  19. > CREATE INDEX fk_lineitem_orderkey ON lineitem (l_orderkey ASC);
  20. > INSERT INTO "lineitem" VALUES (1);
  21. > INSERT INTO "orders" VALUES (1, 4);
  22. > INSERT INTO "customer" VALUES (4);
  23. > SELECT COUNT(*) FROM lineitem, orders, customer WHERE l_orderkey = o_orderkey AND o_custkey = c_custkey;
  24. 1
  25. > SELECT COUNT(*) FROM lineitem, orders, customer WHERE l_orderkey = o_orderkey AND o_custkey = c_custkey;
  26. 1
  27. > SELECT COUNT(*) FROM lineitem, orders, customer WHERE l_orderkey = o_orderkey AND o_custkey = c_custkey;
  28. 1