github-5502.td 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 from database-issues#5502, where earlier errors were erroneously
  10. # discarded by TopK's error handling.
  11. > CREATE TABLE t0(c0 FLOAT);
  12. > CREATE TABLE t1(c0 CHAR(317) DEFAULT (CAST(0.37833587419206882174194106482900679111480712890625 AS VARCHAR(654))));
  13. > CREATE TABLE t2(c0 DECIMAL, c1 integer);
  14. > CREATE TABLE t3(c0 INT);
  15. > CREATE TABLE t4(c0 boolean);
  16. > INSERT INTO t4(c0) VALUES(TRUE);
  17. > INSERT INTO t1(c0) VALUES(''), ((('')||(((((((1677746101)&(1677746101)))<<(((1402123780)&(836896798)))))|(((((-1221621620)|(1402123780)))&(((-1485737887)>>(-1221621620)))))))));
  18. > INSERT INTO t2(c1, c0) VALUES(-251187149, 0.7499183096237433954200923835742287337779998779296875);
  19. > CREATE VIEW v0(c0) AS (SELECT DISTINCT t2.c1 FROM t0, t3, t1, t2, t4 WHERE t4.c0);
  20. > INSERT INTO t4(c0) VALUES(NOT ((NOT (((0.42697382035812925238360548974014818668365478515625)<=(0.78326640921410817242076518596149981021881103515625)))) IS UNKNOWN)), (TRUE), (FALSE);
  21. > UPDATE t0 SET c0=0.11376621 WHERE (0.11376621) BETWEEN (0.4413229) AND (0.04469857);
  22. > INSERT INTO t2(c0) VALUES(0.60333799444918667642667742256890051066875457763671875);
  23. > INSERT INTO t2(c0) VALUES(0.53391115661476107323579753938247449696063995361328125), (0.96599097445518788962459666436188854277133941650390625), (0.50874802079664827036964425133191980421543121337890625);
  24. > CREATE INDEX t2i0 ON t2(c1 DESC NULLS LAST);
  25. > INSERT INTO t3(c0) VALUES(-1221621620);
  26. > DELETE FROM t4;
  27. > INSERT INTO t2(c0, c1) VALUES(0.798383958841370588999097890336997807025909423828125, 1402123780), (0.60310610645862705592179509039851836860179901123046875, -886808703), (0.96925146076085255675280905052204616367816925048828125, -1006231220);
  28. > INSERT INTO t1(c0) VALUES('}~^KC0');
  29. > INSERT INTO t2(c1) VALUES(-1221621620), (-2008997878), (409134752);
  30. > INSERT INTO t0(c0) VALUES(0.11376621), (0.1963102), (-1.00623123E9), (0.3170005);
  31. > INSERT INTO t0(c0) VALUES(0.84266704), (0.29847664), (0.28999355);
  32. > INSERT INTO t2(c1) VALUES(NULL);
  33. > INSERT INTO t2(c0) VALUES(0.3973591531507036922477027474087662994861602783203125);
  34. > INSERT INTO t0(c0) VALUES(-1.22162163E9);
  35. > INSERT INTO t0(c0) VALUES(0.36171648);
  36. > INSERT INTO t4(c0) VALUES(TRUE);
  37. > INSERT INTO t0(c0) VALUES(0.05187392);
  38. > INSERT INTO t0(c0) VALUES(1677746101);
  39. # Returns the same result in Postgres and Materialize (v0.48.0 and v0.49.0).
  40. > SELECT
  41. SUM(count)
  42. FROM
  43. (
  44. SELECT
  45. (NOT (NOT (t4.c0)))::INT as count
  46. FROM
  47. t4
  48. RIGHT OUTER JOIN (SELECT - (t3.c0) FROM t1, t3) AS sub0 ON t4.c0
  49. RIGHT OUTER JOIN (SELECT (0.47583646) NOT IN (- (t3.c0)), CAST(t4.c0 AS VARCHAR(813))!~*t1.c0 FROM t3, t4, t2, v0, t1 WHERE NOT (((t4.c0)<(t4.c0)))) AS sub1 ON t4.c0
  50. ) as res;
  51. 936
  52. # insert a bad value!
  53. > INSERT INTO t1(c0) VALUES('Ja[LPB');
  54. # Different results in Postgres and Materialize; returns an error in
  55. # v0.48.0, swallows an error in v0.49.0 and erroneously returns 1248.
  56. #
  57. # This test was fixed by materialize#22560, indicating that the issue is not
  58. # affecting the equijoin-based outer join lowering strategy.
  59. # ! SELECT
  60. # SUM(count)
  61. # FROM
  62. # (
  63. # SELECT
  64. # (NOT (NOT (t4.c0)))::INT as count
  65. # FROM
  66. # t4
  67. # RIGHT OUTER JOIN (SELECT - (t3.c0) FROM t1, t3) AS sub0 ON t4.c0
  68. # RIGHT OUTER JOIN (SELECT (0.47583646) NOT IN (- (t3.c0)), CAST(t4.c0 AS VARCHAR(813))!~*t1.c0 FROM t3, t4, t2, v0, t1 WHERE NOT (((t4.c0)<(t4.c0))) LIMIT 5633455955921112428) AS sub1 ON t4.c0
  69. # ) as res;
  70. # contains: invalid regular expression