-
Notifications
You must be signed in to change notification settings - Fork 85
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
Disallow more non-deterministic queries in writes #2018
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll need to update WriteTest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved but I have a suggestion if you want to change it.
@@ -38,7 +39,8 @@ struct WriteTest : tpunit::TestFixture { | |||
for (int i = 0; i < 50; i++) { | |||
SData query("Query"); | |||
query["writeConsistency"] = "ASYNC"; | |||
query["query"] = "INSERT INTO foo VALUES ( RANDOM() );"; | |||
uint64_t rand = SRandom::rand64(); | |||
query["query"] = "INSERT INTO foo VALUES (" + to_string(rand) + ");"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SQ(SRandom::rand64())
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the column is defined as INTEGER so i left it unquoted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SQ does the right thing with integers (makes them strings)
Details
Disallows more non-deterministic functions in writes, and adds comments about how this feature works in general.
I didn't add tests for all of the functions, but happy to if useful.
Also fixes a typo,
sqlite3_version
is not a real function, itssqlite_version
.Fixed Issues
Related issues in https://github.com/Expensify/Expensify/issues/451388
Tests
Added automated tests
Internal Testing Reminder: when changing bedrock, please compile auth against your new changes