LuaSQLite3

Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 48ba0633c123b69c6d4faea054f6a82e8c6fba7d
Ticket: d54dc056330c7dd23f87226df67b17c22f29d23f
INSERTING a blob (wav-file) can get it back the same...
User & Date: anonymous 2018-02-08 18:39:42
Changes

  1. foundin changed to: "Don't know, part of Mushclient 4.94"
  2. icomment:
    The following table:
    localDB:exec( [[
            CREATE TABLE IF NOT EXISTS soundcache (
            filename TEXT PRIMARY KEY,  -- access path
            ISOtime TEXT, -- time format for If-Modified-Since
            wav BLOB )    -- the content.
            ]] )
    The following insert:
    stat = localDB:prepare(
                "INSERT OR REPLACE INTO soundcache (filename,ISOtime,wav) "..
                "VALUES (?,?,?)")
            stat:bind(1,filename)
            stat:bind(2,isotime)
            Note("bind="..stat:bind_blob(3,body))
            rc = stat:step()
            if rc == sqlite3.DONE then
                stat:finalize()
                localDB:close()  -- close it
                -- other operations...
            end -- if and so on.
    -- retreival:
    stat = localDB:prepare(
                "SELECT wav FROM soundcache WHERE filename = ?")  --> returns 0 (sqlite3.OK)
            stat:bind(1,filename)
            stat:step()
            body = stat:get_value(0)
            
    I assume the error is happening with the bind_blob, as the different retreival methods are showing a different, shorter result then the original insert.
    
  3. login: "anonymous"
  4. mimetype: "text/x-fossil-plain"
  5. private_contact changed to: "efb79e85e75602cfe5d12dcaa5f4c65fe7e26d8e"
  6. severity changed to: "Critical"
  7. status changed to: "Open"
  8. title changed to:
    INSERTING a blob (wav-file) can get it back the same...
    
  9. type changed to: "Code_Defect"