Changeset

9629:b7a23136f345

Merge 0.11->trunk
author Matthew Wild <mwild1@gmail.com>
date Thu, 15 Nov 2018 21:55:32 +0000
parents 9627:a1c956bf6872 (current diff) 9628:2fcf517b811e (diff)
children 9633:28be90eb774a
files
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_storage_sql.lua	Thu Nov 15 10:26:50 2018 +0000
+++ b/plugins/mod_storage_sql.lua	Thu Nov 15 21:55:32 2018 +0000
@@ -510,12 +510,12 @@
 	if params.driver == "MySQL" then
 		local success,err = engine:transaction(function()
 			do
-				local result = engine:execute("SHOW COLUMNS FROM \"prosody\" WHERE \"Field\"='value' and \"Type\"='text'");
+				local result = assert(engine:execute("SHOW COLUMNS FROM \"prosody\" WHERE \"Field\"='value' and \"Type\"='text'"));
 				if result:rowcount() > 0 then
 					changes = true;
 					if apply_changes then
 						module:log("info", "Upgrading database schema (value column size)...");
-						engine:execute("ALTER TABLE \"prosody\" MODIFY COLUMN \"value\" MEDIUMTEXT");
+						assert(engine:execute("ALTER TABLE \"prosody\" MODIFY COLUMN \"value\" MEDIUMTEXT"));
 						module:log("info", "Database table automatically upgraded");
 					end
 				end
@@ -528,9 +528,9 @@
 					changes = true;
 					if apply_changes then
 						module:log("info", "Upgrading database schema (prosodyarchive_index)...");
-						engine:execute[[ALTER TABLE "prosodyarchive" DROP INDEX prosodyarchive_index;]];
+						assert(engine:execute[[ALTER TABLE "prosodyarchive" DROP INDEX prosodyarchive_index;]]);
 						local new_index = sql.Index { table = "prosodyarchive", name="prosodyarchive_index", "host", "user", "store", "key" };
-						engine:_create_index(new_index);
+						assert(engine:_create_index(new_index));
 						module:log("info", "Database table automatically upgraded");
 					end
 				end