-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Update sqlite3 wrapper for implement rust client #1849
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
Conversation
Change-Id: I25cf2b4a89001972ed56c756ba9d244e7e712780
|
We can hold on this PR for now, I'm working on other changes |
|
Thanks for the PR! Could you run |
Change-Id: Iaccde5758ed3c0aabe5fdfd18836124d71eabe3b
|
Hi @Mytherin , please help review the code. Please be noted that except for add some unsupported functions, I also update some of the logics. |
Mytherin
left a comment
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.
Thanks for the changes! Looks good. Some comments:
|
Hi @Mytherin Please help review the code |
Mytherin
left a comment
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.
Thanks for the changes! Some more comments:
| if (length < 0) { | ||
| length = 0; | ||
| } | ||
| return sqlite3_internal_bind_value(stmt, idx, Value::BLOB(string(length, '0'))); |
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.
This generates the ASCII character 0, not the byte 0 (\0). I imagine zeroblob should generate null bytes, not the character 0, no? Perhaps you could verify this behavior in SQLite itself?
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.
From SQLite doc:
The zeroblob(N) function returns a BLOB consisting of N bytes of 0x00. SQLite manages these zeroblobs very efficiently. Zeroblobs can be used to reserve space for a BLOB that is later written using incremental BLOB I/O. This SQL function is implemented using the sqlite3_result_zeroblob() routine from the C/C++ interface.
Currently our BLOB value always convert to string, so I mark the api as unsupported for now.
Change-Id: Ib0ee080d30c0e5654d3e33c6ffc7107a2a25e86e
Change-Id: I3c534c4f8056347756b8f1aeec0ad8849d9faa25
|
Thanks! Looks good now. |
Add missing method, otherwise there might be link error when using sqlite3 wrapper:
related #949