{"action":"created","issue":{"url":"https://api.github.com/repos/DBD-SQLite/DBD-SQLite/issues/11","labels_url":"https://api.github.com/repos/DBD-SQLite/DBD-SQLite/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/DBD-SQLite/DBD-SQLite/issues/11/comments","events_url":"https://api.github.com/repos/DBD-SQLite/DBD-SQLite/issues/11/events","html_url":"https://github.com/DBD-SQLite/DBD-SQLite/issues/11","id":97737719,"number":11,"title":"Garbage in sqlite_unprepared_statements with sqlite_unicode and prepare_cached","user":{"login":"Grinnz","id":5769356,"avatar_url":"https://avatars.githubusercontent.com/u/5769356?v=3","gravatar_id":"","url":"https://api.github.com/users/Grinnz","html_url":"https://github.com/Grinnz","followers_url":"https://api.github.com/users/Grinnz/followers","following_url":"https://api.github.com/users/Grinnz/following{/other_user}","gists_url":"https://api.github.com/users/Grinnz/gists{/gist_id}","starred_url":"https://api.github.com/users/Grinnz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Grinnz/subscriptions","organizations_url":"https://api.github.com/users/Grinnz/orgs","repos_url":"https://api.github.com/users/Grinnz/repos","events_url":"https://api.github.com/users/Grinnz/events{/privacy}","received_events_url":"https://api.github.com/users/Grinnz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-28T15:39:21Z","updated_at":"2015-07-29T13:46:50Z","closed_at":null,"body":"I have run into an issue when trying to implement Mojo::SQLite::Migrations (I worked around it by using ->do for the migrations instead for now). The attached testcase demonstrates the issue; the second time the \"select exists...\" query is run, it leaves some garbage in sqlite_unprepared_statements which is usually not a valid query. It seems like an XS issue. If the query is prepared with prepare() instead of prepare_cached(), or sqlite_unicode is not set, the issue does not occur.\r\n\r\nhttps://gist.github.com/Grinnz/9d6284fe36ec7d40249c\r\n\r\nOutput:\r\n````\r\nok 1 - Table does not exist\r\nDBD::SQLite::db prepare_cached failed: near \"Íø\": syntax error at dbd-sqlite-test.pl line 11.\r\n````\r\n(syntax error is random)"},"comment":{"url":"https://api.github.com/repos/DBD-SQLite/DBD-SQLite/issues/comments/125957857","html_url":"https://github.com/DBD-SQLite/DBD-SQLite/issues/11#issuecomment-125957857","issue_url":"https://api.github.com/repos/DBD-SQLite/DBD-SQLite/issues/11","id":125957857,"user":{"login":"Grinnz","id":5769356,"avatar_url":"https://avatars.githubusercontent.com/u/5769356?v=3","gravatar_id":"","url":"https://api.github.com/users/Grinnz","html_url":"https://github.com/Grinnz","followers_url":"https://api.github.com/users/Grinnz/followers","following_url":"https://api.github.com/users/Grinnz/following{/other_user}","gists_url":"https://api.github.com/users/Grinnz/gists{/gist_id}","starred_url":"https://api.github.com/users/Grinnz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Grinnz/subscriptions","organizations_url":"https://api.github.com/users/Grinnz/orgs","repos_url":"https://api.github.com/users/Grinnz/repos","events_url":"https://api.github.com/users/Grinnz/events{/privacy}","received_events_url":"https://api.github.com/users/Grinnz/received_events","type":"User","site_admin":false},"created_at":"2015-07-29T13:46:50Z","updated_at":"2015-07-29T13:46:50Z","body":"I am using sqlite_allow_multiple_statements currently with do(), but that does not affect manual prepare/execute, it would be nice to be able to cache these statements as well but still allow multiple statements. I am not sure about the XS part but would it be possible to have allow_multiple_statements also affect making sure unprepared_statements is usable with prepare_cached? Thanks for your help."}}