Repository navigation
[SQL] Fix persistent ID collision - #7848
Conversation
Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
|
What I ran: bug (high), regression: the stricter literal missing (medium), tests:
Suggested runtime test (passes on this branch): @Test
public void intervalUnitsRuntime() {
var ccs = this.getCCS("""
CREATE TABLE t (ts TIMESTAMP NOT NULL, ts2 TIMESTAMP NOT NULL);
CREATE VIEW v AS SELECT (ts - ts2) MINUTE > INTERVAL 60 MINUTE AS a,
(ts - ts2) MINUTE > INTERVAL 1 HOUR AS b,
(ts - ts2) SECOND <= INTERVAL '0 01:00:30' DAY TO SECOND AS c,
ts2 + INTERVAL 1 HOUR = ts AS d
FROM t;""");
ccs.step("INSERT INTO t VALUES('2024-01-01 01:00:30', '2024-01-01 00:00:00'), ('2024-01-01 01:01:00', '2024-01-01 00:00:00');", """
a | b | c | d | weight
------------------------
false | false | true | false | 1
true | true | false | false | 1""");
}Commits: the bodies contain only |
…rval literals equivalent() of literals and of array, map, variant and geo point constructors also compares the types. An interval literal has a comment with its SQL type, e.g., /*INTERVAL MINUTE*/, unless its unit is the largest unit that divides the value. Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
Linked Issue
Fixes #7832
Collisions happen when internal representations that are not equivalent generate Rust code that is identical.
This PR fixes collisions for Some() expressions and literals by switching to a "canonical" representation.
Checklist