From b0361006e16aa8d861e85aea5a4ab3bc163dc229 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Mon, 23 Dec 2019 21:13:27 +0100 Subject: util.sql: Handle failure to detect connection encoding Silences a luacheck warning about an unused variable --- util/sql.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/sql.lua b/util/sql.lua index 86740b1c..9d1c86ca 100644 --- a/util/sql.lua +++ b/util/sql.lua @@ -335,6 +335,9 @@ function engine:set_encoding() -- to UTF-8 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 -- cgit v1.2.3