Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3c67ba0

Browse files
committed
Minor fix
1 parent 354aaea commit 3c67ba0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/core/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2939,7 +2939,7 @@ def safeSQLIdentificatorNaming(name, isTable=False):
29392939
if _:
29402940
retVal = re.sub(r"(?i)\A%s\." % DEFAULT_MSSQL_SCHEMA, "", retVal)
29412941

2942-
if retVal.upper() in kb.keywords or not re.match(r"\A[A-Za-z0-9_@%s\$]+\Z" % ("." if _ else ""), retVal): # MsSQL is the only DBMS where we automatically prepend schema to table name (dot is normal)
2942+
if retVal.upper() in kb.keywords or (retVal or " ")[0].isdigit() or not re.match(r"\A[A-Za-z0-9_@%s\$]+\Z" % ("." if _ else ""), retVal): # MsSQL is the only DBMS where we automatically prepend schema to table name (dot is normal)
29432943
if Backend.getIdentifiedDbms() in (DBMS.MYSQL, DBMS.ACCESS):
29442944
retVal = "`%s`" % retVal.strip("`")
29452945
elif Backend.getIdentifiedDbms() in (DBMS.PGSQL, DBMS.DB2):

0 commit comments

Comments
 (0)