From f6eb868e77146babe2c5fdd8fe1012c3eadc2869 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sun, 19 Oct 2025 18:06:00 +0800 Subject: [PATCH] bugfix --- sqlor/mysqlor.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sqlor/mysqlor.py b/sqlor/mysqlor.py index 5e07240..9eb347b 100755 --- a/sqlor/mysqlor.py +++ b/sqlor/mysqlor.py @@ -76,7 +76,7 @@ class MySqlor(SQLor): limit $[from_line]$,$[rows]$""" def tablesSQL(self): - sqlcmd = """SELECT lower(TABLE_NAME) as name, lower(TABLE_COMMENT) as title FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '%s'""" % self.dbdesc.get('dbname','unknown') + sqlcmd = """SELECT lower(TABLE_NAME) as name, lower(TABLE_COMMENT) as title FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '%s'""" % self.dbname return sqlcmd def fieldsSQL(self,tablename=None): @@ -91,7 +91,7 @@ limit $[from_line]$,$[rows]$""" lower(is_nullable) as nullable, column_comment as title, lower(table_name) as table_name - from information_schema.columns where lower(TABLE_SCHEMA) = '%s' """ % self.dbdesc.get('dbname','unknown').lower() + from information_schema.columns where lower(TABLE_SCHEMA) = '%s' """ % self.dbname if tablename is not None: sqlcmd = sqlcmd + """and lower(table_name)='%s';""" % tablename.lower() return sqlcmd @@ -115,7 +115,7 @@ limit $[from_line]$,$[rows]$""" AND R.REFERENCED_TABLE_NAME = C.REFERENCED_TABLE_NAME WHERE C.REFERENCED_TABLE_NAME IS NOT NULL ; and C.TABLE_SCHEMA = '%s' -""" % self.dbdesc.get('dbname','unknown').lower() +""" % self.dbname if tablename is not None: sqlcmd = sqlcmd + " and C.REFERENCED_TABLE_NAME = '%s'" % tablename.lower() return sqlcmd @@ -136,7 +136,7 @@ limit $[from_line]$,$[rows]$""" FROM information_schema.statistics WHERE - table_schema = '%s'""" % self.dbdesc.get('dbname','unknown') + table_schema = '%s'""" % self.dbname if tablename is not None: sqlcmd = sqlcmd + """ AND table_name = '%s'""" % tablename.lower() return sqlcmd