Software / code / prosody
Comparison
util/sql.lua @ 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 |
| parent | 10275:a247fa8df7df |
| child | 12872:a20923f7d5fd |
comparison
equal
deleted
inserted
replaced
| 10533:a6cc5b844d7b | 10534:8a42fd6702e6 |
|---|---|
| 333 | 333 |
| 334 if driver == "MySQL" then | 334 if driver == "MySQL" then |
| 335 local ok, actual_charset = self:transaction(function () | 335 local ok, actual_charset = self:transaction(function () |
| 336 return self:select"SHOW SESSION VARIABLES LIKE 'character_set_client'"; | 336 return self:select"SHOW SESSION VARIABLES LIKE 'character_set_client'"; |
| 337 end); | 337 end); |
| 338 if not ok then | |
| 339 return false, "Failed to detect connection encoding"; | |
| 340 end | |
| 338 local charset_ok = true; | 341 local charset_ok = true; |
| 339 for row in actual_charset do | 342 for row in actual_charset do |
| 340 if row[2] ~= charset then | 343 if row[2] ~= charset then |
| 341 log("error", "MySQL %s is actually %q (expected %q)", row[1], row[2], charset); | 344 log("error", "MySQL %s is actually %q (expected %q)", row[1], row[2], charset); |
| 342 charset_ok = false; | 345 charset_ok = false; |