From 2b7d080fd26095fd2bda748167dfc9c866f47acc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Wed, 28 Sep 2016 23:08:49 +0000 Subject: [PATCH] Workaround for bug #708 An almost empty `global_variables` is added on stats schema. This will allow to run queries against it, even if empty. --- lib/ProxySQL_Admin.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/ProxySQL_Admin.cpp b/lib/ProxySQL_Admin.cpp index 811d487b7..4f6d3e6a4 100644 --- a/lib/ProxySQL_Admin.cpp +++ b/lib/ProxySQL_Admin.cpp @@ -2539,6 +2539,7 @@ bool ProxySQL_Admin::init() { insert_into_tables_defs(tables_defs_stats,"stats_mysql_query_digest", STATS_SQLITE_TABLE_MYSQL_QUERY_DIGEST); insert_into_tables_defs(tables_defs_stats,"stats_mysql_query_digest_reset", STATS_SQLITE_TABLE_MYSQL_QUERY_DIGEST_RESET); insert_into_tables_defs(tables_defs_stats,"stats_mysql_global", STATS_SQLITE_TABLE_MYSQL_GLOBAL); + insert_into_tables_defs(tables_defs_stats,"global_variables", ADMIN_SQLITE_TABLE_GLOBAL_VARIABLES); // workaround for issue #708 // upgrade mysql_servers if needed (upgrade from previous version) disk_upgrade_mysql_servers(); @@ -2578,6 +2579,10 @@ bool ProxySQL_Admin::init() { __insert_or_replace_maintable_select_disktable(); flush_admin_variables___database_to_runtime(admindb,true); + + // workaround for issue #708 + statsdb->execute("INSERT OR IGNORE INTO global_variables VALUES('mysql-max_allowed_packet',4194304)"); + #ifdef DEBUG if (GloVars.global.gdbg==false && GloVars.__cmd_proxysql_gdbg) { proxy_debug(PROXY_DEBUG_ADMIN, 4, "Enabling GloVars.global.gdbg because GloVars.__cmd_proxysql_gdbg==%d\n", GloVars.__cmd_proxysql_gdbg);