Skip to content

Retrieving a BLOB from a SELECT query does not work #5

Open
@ekgame

Description

@ekgame

Yet again, I'm not sure if I'm doing something wrong or a byte array as return value from a function is not supported.

Reproduction:

  1. Find ColumnBlob in lib.ua, remove the assertion, uncomment the "Call" function line.
  2. Create a file with 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 (X'010203');
Sqlite~Exec ⊙.

$ SELECT blob FROM test;
Sqlite~Prepare ⊙.
◌Sqlite~StepRow .
◌?Sqlite~ColumnBlob 1

Sqlite~Close
  1. Run the code. A file named "test.db" will be created. You can inspect the database to confirm that bytes 1, 2, 3 were added.
  2. The code will crash with an FFI error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions