LuaSQLite3

Artifact Content
Login

Artifact 48ba0633c123b69c6d4faea054f6a82e8c6fba7d:

Ticket change [48ba0633c1] - New ticket [d54dc05633] INSERTING a blob (wav-file) can get it back the same.... by anonymous 2018-02-08 18:39:42.
D 2018-02-08T18:39:42.478
J foundin Don't\sknow,\spart\sof\sMushclient\s4.94
J icomment The\sfollowing\stable:\r\nlocalDB:exec(\s[[\r\n\s\s\s\s\s\s\s\sCREATE\sTABLE\sIF\sNOT\sEXISTS\ssoundcache\s(\r\n\s\s\s\s\s\s\s\sfilename\sTEXT\sPRIMARY\sKEY,\s\s--\saccess\spath\r\n\s\s\s\s\s\s\s\sISOtime\sTEXT,\s--\stime\sformat\sfor\sIf-Modified-Since\r\n\s\s\s\s\s\s\s\swav\sBLOB\s)\s\s\s\s--\sthe\scontent.\r\n\s\s\s\s\s\s\s\s]]\s)\r\nThe\sfollowing\sinsert:\r\nstat\s=\slocalDB:prepare(\r\n\s\s\s\s\s\s\s\s\s\s\s\s"INSERT\sOR\sREPLACE\sINTO\ssoundcache\s(filename,ISOtime,wav)\s"..\r\n\s\s\s\s\s\s\s\s\s\s\s\s"VALUES\s(?,?,?)")\r\n\s\s\s\s\s\s\s\sstat:bind(1,filename)\r\n\s\s\s\s\s\s\s\sstat:bind(2,isotime)\r\n\s\s\s\s\s\s\s\sNote("bind="..stat:bind_blob(3,body))\r\n\s\s\s\s\s\s\s\src\s=\sstat:step()\r\n\s\s\s\s\s\s\s\sif\src\s==\ssqlite3.DONE\sthen\r\n\s\s\s\s\s\s\s\s\s\s\s\sstat:finalize()\r\n\s\s\s\s\s\s\s\s\s\s\s\slocalDB:close()\s\s--\sclose\sit\r\n\s\s\s\s\s\s\s\s\s\s\s\s--\sother\soperations...\r\n\s\s\s\s\s\s\s\send\s--\sif\sand\sso\son.\r\n--\sretreival:\r\nstat\s=\slocalDB:prepare(\r\n\s\s\s\s\s\s\s\s\s\s\s\s"SELECT\swav\sFROM\ssoundcache\sWHERE\sfilename\s=\s?")\s\s-->\sreturns\s0\s(sqlite3.OK)\r\n\s\s\s\s\s\s\s\sstat:bind(1,filename)\r\n\s\s\s\s\s\s\s\sstat:step()\r\n\s\s\s\s\s\s\s\sbody\s=\sstat:get_value(0)\r\n\s\s\s\s\s\s\s\s\r\nI\sassume\sthe\serror\sis\shappening\swith\sthe\sbind_blob,\sas\sthe\sdifferent\sretreival\smethods\sare\sshowing\sa\sdifferent,\sshorter\sresult\sthen\sthe\soriginal\sinsert.
J login anonymous
J mimetype text/x-fossil-plain
J private_contact efb79e85e75602cfe5d12dcaa5f4c65fe7e26d8e
J severity Critical
J status Open
J title INSERTING\sa\sblob\s(wav-file)\scan\sget\sit\sback\sthe\ssame...
J type Code_Defect
K d54dc056330c7dd23f87226df67b17c22f29d23f
U anonymous
Z 948b40d64fadaf2213884cba7e6855c9