mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add quotes to schema name in ALTER DATABASE.
Fixes #48519 Driven by sql request error when schema contains dashes and some other special symbols.
This commit is contained in:
parent
f9fd1a889a
commit
da8336712e
1 changed files with 1 additions and 1 deletions
|
@ -959,7 +959,7 @@ def alter_db(name, character_set=None, collate=None, **connection_args):
|
|||
return []
|
||||
cur = dbc.cursor()
|
||||
existing = db_get(name, **connection_args)
|
||||
qry = 'ALTER DATABASE {0} CHARACTER SET {1} COLLATE {2};'.format(
|
||||
qry = 'ALTER DATABASE `{0}` CHARACTER SET {1} COLLATE {2};'.format(
|
||||
name.replace('%', r'\%').replace('_', r'\_'),
|
||||
character_set or existing.get('character_set'),
|
||||
collate or existing.get('collate'))
|
||||
|
|
Loading…
Add table
Reference in a new issue