#291 Add API for running a ProxySQL admin command in SQL

This is ran against the SQL admin port of the proxy.
pull/275/head
Andrei Ismail 11 years ago
parent 2d60a08b3d
commit 4edb0f9867

@ -0,0 +1,3 @@
set pagination off
target remote 0.0.0.0:2345
continue

@ -215,6 +215,28 @@ class ProxySQLBaseTest(TestCase):
if return_result:
return rows
def run_query_proxysql_admin(self, query, return_result=True):
"""Run a query against the ProxySQL admin.
Note: we do not need to specify a db for this query, as it's always
against the "main" database.
TODO(andrei): revisit db assumption once stats databases from ProxySQL
are accessible via the MySQL interface.
"""
return self.run_query_proxysql(
query,
# "main" database is hardcoded within the
# ProxySQL admin -- it contains the SQLite3
# tables with metadata about servers and users
"main",
return_result,
username=ProxySQLBaseTest.PROXYSQL_ADMIN_USERNAME,
password=ProxySQLBaseTest.PROXYSQL_ADMIN_PASSWORD,
port=ProxySQLBaseTest.PROXYSQL_ADMIN_PORT
)
def run_query_mysql(self, query, db, return_result=True, hostgroup=0,
username=None, password=None):
"""Run a query against the MySQL backend and optionally return its

Loading…
Cancel
Save