-
Notifications
You must be signed in to change notification settings - Fork 793
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
Bug: values inside backticks not recognized (was: Record id with backticks using "SET id =" instead of : returns random id instead of user-specified one) #3593
Comments
Logs when creating something:
Returns:
Logs:
And running a back tick query:
Returns:
Hmmm seems like it loses the field? In fact you can see the log line It also sounds like to me that perhaps the back ticks are making the parsing logic somehow lose the part of the SET statement? This is proven with this query here:
And the result is:
The log lines are:
Which you can see |
Good eye! I've changed the title accordingly, looks like this goes beyond just ids. |
Interestingly I did some further testing, it looks like this also works?
Which gets interpreted as: Log line is here:
Seems like there is some strange behaviour surrounding back ticks? EDIT: Or maybe back ticks are just stripped out before being handed over to the core? |
Some more interesting backtick behaviour:
|
This is intended but indeed somewhat confusing behaviour. Backticks are not an alternative way to create strings like with This is useful when your table contains a field with a name which would be confusing to parse in surrealql.
In your example
Is equivalent to
Your first example
is equivalent to
Which is why the id will be set to |
Describe the bug
When a record id is specified via the syntax
SET id = (some value inside backticks)
instead of recordname:somevalueinsidebackticks
, a random id is returned instead.Steps to reproduce
CREATE working as expected using : and backticks:
CREATE not working as expected when other syntax is used:
Similarly, using backticks for numbers and non-ascii characters works as expected in the former case but not in the latter:
Expected behaviour
Either the output below, or an error.
SurrealDB version
1.2.1 for windows on x86_64
Contact Details
Slack
Is there an existing issue for this?
Code of Conduct
The text was updated successfully, but these errors were encountered: