# HG changeset patch # User Matthew Wild # Date 1480711631 0 # Node ID 9d132153d78665c670f34d6d6f99a8fc9343b970 # Parent be08b65f28558eded60bba34e28597bff942aaff mod_log_messages: Add assert() to detect errors creating SQL table diff -r be08b65f2855 -r 9d132153d786 mod_log_messages_sql/mod_log_messages_sql.lua --- a/mod_log_messages_sql/mod_log_messages_sql.lua Fri Dec 02 19:06:37 2016 +0000 +++ b/mod_log_messages_sql/mod_log_messages_sql.lua Fri Dec 02 20:47:11 2016 +0000 @@ -169,7 +169,7 @@ -- In the telnet console, run: -- >hosts["this host"].modules.mam_sql.environment.create_sql() function create_sql() - local stm = getsql([[ + local stm = assert(getsql([[ CREATE TABLE `]]..table_name..[[` ( `host` TEXT, `user` TEXT, @@ -183,7 +183,7 @@ CREATE INDEX `hus` ON `]]..table_name..[[` (`host`, `user`, `store`); CREATE INDEX `with` ON `]]..table_name..[[` (`with`); CREATE INDEX `thetime` ON `]]..table_name..[[` (`when`); - ]]); + ]])); stm:execute(); sql.commit(); end