# HG changeset patch # User Kim Alvefur # Date 1659367540 -7200 # Node ID ccb030d988acfa05e4c237dfdb758b942a28af76 # Parent d6cdde74cd9b43cf30ceec2032e0f6ced5e6ef03 util.sqlite3: Skip prepared statements when no parameters are given Seems CREATE INDEX is unhappy as a prepared statement. Perhaps because the table has not been COMMIT-ed yet? diff -r d6cdde74cd9b -r ccb030d988ac util/sqlite3.lua --- a/util/sqlite3.lua Fri Oct 01 02:27:53 2021 +0200 +++ b/util/sqlite3.lua Mon Aug 01 17:25:40 2022 +0200 @@ -164,6 +164,16 @@ if not success then return success, err; end local prepared = self.prepared; + if select('#', ...) == 0 then + local ret = self.conn:exec(sql); + if ret ~= lsqlite3.OK then + local err = sqlite_errors.new(err); + err.text = self.conn:errmsg(); + return err; + end + return true; + end + local stmt = prepared[sql]; if not stmt then local err;