Re:Introducing Cosette – a SQL solver for checking semantic ...
by lukaseder on Thursday July 20, 2017 @08:06AM
(#14811708)
Another question: How do you plan on handling non-deterministic expressions, such as CURRENT_TIMESTAMP or ROWNUM, et al.?
[ Parent
| on HN ]
Re:Introducing Cosette – a SQL solver for checking semantic ...
by LaPrometheus on Thursday July 20, 2017 @12:33PM
(#14813945)
CURRENT_TIMESTAMP is truly random. One thing we can do is to over approximate. For example, let CURRENT_TIMESTAMP be a symbolic variable, which essentially can be any value. If we still can prove the equivalence, then the equivalence is sound. But there might be some false negative.
ROWNUM is interesting. You can actually declare ROWNUM as an extra attribute of the table and then assert it is a key (We will add support of key constraints very soon). Then many cases will be covered.
Re:Introducing Cosette – a SQL solver for checking semantic ...
by lukaseder on Friday July 21, 2017 @04:47AM
(#14819014)
ROWNUM is actually more tricky than an extra attribute of the table, as it is influenced by ORDER BY. I guess I wouldn't prioritise support for ROWNUM, though. There are more interesting, and more standard things. E.g. comparing a correlated subquery to a window function.