Changeset

10534:8a42fd6702e6

util.sql: Handle failure to detect connection encoding Silences a luacheck warning about an unused variable
author Kim Alvefur <zash@zash.se>
date Mon, 23 Dec 2019 21:13:27 +0100
parents 10533:a6cc5b844d7b
children 10535:29c1a3bf1d29
files util/sql.lua
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/util/sql.lua	Mon Dec 23 21:09:38 2019 +0100
+++ b/util/sql.lua	Mon Dec 23 21:13:27 2019 +0100
@@ -335,6 +335,9 @@
 		local ok, actual_charset = self:transaction(function ()
 			return self:select"SHOW SESSION VARIABLES LIKE 'character_set_client'";
 		end);
+		if not ok then
+			return false, "Failed to detect connection encoding";
+		end
 		local charset_ok = true;
 		for row in actual_charset do
 			if row[2] ~= charset then