-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maybe inconsistent handling of implicit timestamp<->bigint conversion #14319
Comments
The code that prepares expressions is often inconsistent in how it checks type compatibility - sometimes it's a direct type comparison, and sometimes Although this is selector code, so maybe the issue is somewhere there. |
I found another example of an implicit conversion that Scylla does and Cassandra does: Suprisingly, the opposite direction is rejected in Scylla not just in Cassandra - So I don't understand when Scylla allows, and when it doesn't, these implicit conversions of function arguments. |
Code in functions.cc creates the different TYPEasblob() and blobasTYPE() functions for all type names TYPE. The functions for the "counter" type were skipped, supposedly because "counters are not supported yet". But counters are supported, so let's add the missing functions. The code fix is trivial, the tests that verify that the result behaves like Cassandra took more work. After this patch, unimplemented::cause::COUNTERS is no longer used anywhere in the code. I wanted to remove it, but noticed that unimplemented::cause is a graveyard of unused causes, so decided not to remove this one either. We should clean it up in a separate patch. Fixes scylladb#14742 Also includes tests for tangently-related issues: Refs scylladb#12607 Refs scylladb#14319 Signed-off-by: Nadav Har'El <nyh@scylladb.com>
Code in functions.cc creates the different TYPEasblob() and blobasTYPE() functions for all type names TYPE. The functions for the "counter" type were skipped, supposedly because "counters are not supported yet". But counters are supported, so let's add the missing functions. The code fix is trivial, the tests that verify that the result behaves like Cassandra took more work. After this patch, unimplemented::cause::COUNTERS is no longer used anywhere in the code. I wanted to remove it, but noticed that unimplemented::cause is a graveyard of unused causes, so decided not to remove this one either. We should clean it up in a separate patch. Fixes scylladb#14742 Also includes tests for tangently-related issues: Refs scylladb#12607 Refs scylladb#14319 Signed-off-by: Nadav Har'El <nyh@scylladb.com>
Interestingly, the issue #5552 was about |
This is a spinoff of https://github.com/scylladb/scylla-dtest/pull/3247, where we noticed that
SELECT mintimeuuid(writetime(x))
works in Cassandra, but on Scylla it fails saying:It's actually nice that
mintimeuuid(writetime(x))
doesn't work - writetime(x) returns aUSING TIMESTAMP
value, typically in microseconds, while mintimeuuid() expects atimestamp
-type value, which is in milliseconds, and the two don't match, so it's good we don't accept it although Cassandra does. We can consider this a Cassandra bug, and so far so good.But something still worries me... If
g
is abigint
(64-bit) number, the following select does work on both Scylla and Cassandra:And yet, the following select does not work in Scylla (it does work on Cassandra):
How can this be? both
g
andwritetime(x)
have the same type - bigint. Either bigint can be implicitly converted to timestamp, or it can't. So how come this conversion works for the expressiong
but not forwritetime(x)
? Maybe we have a bug in the implicit conversion code?Again, I'm not too worried about this specific example, where I even like the fact that the implicit conversion didn't work. But I'm worried that it indicates a bug that we did something about implicit conversions inconsistently or wrongly, and it might bite us in the future in other scenarios.
CC @avikivity @cvybhu
The text was updated successfully, but these errors were encountered: