|
@@ -101,8 +101,7 @@ def db_query(ctx, oformat, ostyle, query):
|
|
def db_connect(ctx):
|
|
def db_connect(ctx):
|
|
dbtype = ctx.gconfig.get("db", "type")
|
|
dbtype = ctx.gconfig.get("db", "type")
|
|
if dbtype.lower() == "mysql":
|
|
if dbtype.lower() == "mysql":
|
|
- CMD_BASE = "mysql -h {0} -u {1} -p{2} "
|
|
|
|
- scmd = (CMD_BASE + "{3}").format(
|
|
|
|
|
|
+ scmd = ("mysql -h {0} -u {1} -p{2} {3}").format(
|
|
ctx.gconfig.get("db", "host"),
|
|
ctx.gconfig.get("db", "host"),
|
|
ctx.gconfig.get("db", "rwuser"),
|
|
ctx.gconfig.get("db", "rwuser"),
|
|
ctx.gconfig.get("db", "rwpassword"),
|
|
ctx.gconfig.get("db", "rwpassword"),
|
|
@@ -127,8 +126,7 @@ def db_connect(ctx):
|
|
def db_clirun(ctx, query):
|
|
def db_clirun(ctx, query):
|
|
dbtype = ctx.gconfig.get("db", "type")
|
|
dbtype = ctx.gconfig.get("db", "type")
|
|
if dbtype == "mysql":
|
|
if dbtype == "mysql":
|
|
- CMD_BASE = "mysql -h {0} -u {1} -p{2} "
|
|
|
|
- scmd = (CMD_BASE + '-e "{3} ;" {4}').format(
|
|
|
|
|
|
+ scmd = ('mysql -h {0} -u {1} -p{2} -e "{3} ;" {4}').format(
|
|
ctx.gconfig.get("db", "host"),
|
|
ctx.gconfig.get("db", "host"),
|
|
ctx.gconfig.get("db", "rwuser"),
|
|
ctx.gconfig.get("db", "rwuser"),
|
|
ctx.gconfig.get("db", "rwpassword"),
|
|
ctx.gconfig.get("db", "rwpassword"),
|
|
@@ -155,8 +153,7 @@ def db_clirun(ctx, query):
|
|
def db_clishow(ctx, table):
|
|
def db_clishow(ctx, table):
|
|
dbtype = ctx.gconfig.get("db", "type")
|
|
dbtype = ctx.gconfig.get("db", "type")
|
|
if dbtype == "mysql":
|
|
if dbtype == "mysql":
|
|
- CMD_BASE = "mysql -h {0} -u {1} -p{2} "
|
|
|
|
- scmd = (CMD_BASE + '-e "select * from {3} ;" {4}').format(
|
|
|
|
|
|
+ scmd = ('mysql -h {0} -u {1} -p{2} -e "select * from {3} ;" {4}').format(
|
|
ctx.gconfig.get("db", "host"),
|
|
ctx.gconfig.get("db", "host"),
|
|
ctx.gconfig.get("db", "rwuser"),
|
|
ctx.gconfig.get("db", "rwuser"),
|
|
ctx.gconfig.get("db", "rwpassword"),
|
|
ctx.gconfig.get("db", "rwpassword"),
|
|
@@ -183,8 +180,7 @@ def db_clishow(ctx, table):
|
|
def db_clishowg(ctx, table):
|
|
def db_clishowg(ctx, table):
|
|
dbtype = ctx.gconfig.get("db", "type")
|
|
dbtype = ctx.gconfig.get("db", "type")
|
|
if dbtype == "mysql":
|
|
if dbtype == "mysql":
|
|
- CMD_BASE = "mysql -h {0} -u {1} -p{2} "
|
|
|
|
- scmd = (CMD_BASE + r'-e "select * from {3} \G" {4}').format(
|
|
|
|
|
|
+ scmd = (r'mysql -h {0} -u {1} -p{2} -e "select * from {3} \G" {4}').format(
|
|
ctx.gconfig.get("db", "host"),
|
|
ctx.gconfig.get("db", "host"),
|
|
ctx.gconfig.get("db", "rwuser"),
|
|
ctx.gconfig.get("db", "rwuser"),
|
|
ctx.gconfig.get("db", "rwpassword"),
|
|
ctx.gconfig.get("db", "rwpassword"),
|