You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Something goes wrong when trying to bind text to a prepared statement. I'm not sure if the binding is wrong or the language needs to patch something for it to work, but I couldn't get it working. I have confirmed that the arguments for the binding look right, they make sense according to documentation and examples I could find.
Reproduction:
Create a file with this code:
# Experimental!
Sqlite ~ "lib"
Sqlite~Open "test.db"
$ CREATE TABLE IF NOT EXISTS test (id INTEGER PRIMARY KEY, text TEXT);
Sqlite~Exec ⊙.
$ INSERT INTO test (text) VALUES (?);
Sqlite~Prepare ⊙.
Sqlite~BindText 1 "Hello world" . # yes, indexing into bindings starts at 1
Sqlite~ExecuteInsert
Sqlite~Close
Run the code. A file named "test.db" should be created without any errors.
Open the file in any sqlite viewer and view the "test" table. The one entry will have gibberish text. If you run the code multiple times, the table will have multiple rows with different gibberish text.
The same thing happens with blobs. I assume text eventually becomes a byte array and blobs are also just bytes, so the issue is probably the same. Consider this code:
# Experimental!
Sqlite ~ "lib"
Sqlite~Open "test.db"
$ CREATE TABLE IF NOT EXISTS test (id INTEGER PRIMARY KEY, blob BLOB);
Sqlite~Exec ⊙.
$ INSERT INTO test (blob) VALUES (?);
Sqlite~Prepare ⊙.
Sqlite~BindBlob 1 [1 2 3] .
Sqlite~ExecuteInsert
Sqlite~Close
Running this multiple times results in different bogus values getting inserted:
The text was updated successfully, but these errors were encountered:
Something goes wrong when trying to bind text to a prepared statement. I'm not sure if the binding is wrong or the language needs to patch something for it to work, but I couldn't get it working. I have confirmed that the arguments for the binding look right, they make sense according to documentation and examples I could find.
Reproduction:
The same thing happens with blobs. I assume text eventually becomes a byte array and blobs are also just bytes, so the issue is probably the same. Consider this code:
Running this multiple times results in different bogus values getting inserted:

The text was updated successfully, but these errors were encountered: