summaryrefslogtreecommitdiff
path: root/odoo/service
diff options
context:
space:
mode:
authorXavier Morel <xmo@odoo.com>2020-08-20 09:02:48 +0000
committerXavier Morel <xmo@odoo.com>2020-08-20 09:02:48 +0000
commit4688b2dd9d5ffdb929f4f36fddea1dab1e5a233f (patch)
tree08354fbdc254b76837fa4393ecc6c9afe3ad83ba /odoo/service
parent98f33631138e0d3de83381bb54a9aa9a110acfc0 (diff)
[FIX] core: mis-updated SQL queries
odoo/odoo#53938 improved the SQL linter and used psycopg2.sql to silence the linter where that still made sense. However I forgot to mark table names (pretty much exclusively) as `sql.Identifier` in a few somewhat rare callsites, which consequently break when invoked as a simple string is not a Composable and psycopg2 therefore rejects it when composing the query. odoo/odoo#54556 fixed a few mis-updated ones, but apparently I still managed to miss one here. closes odoo/odoo#56191 Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Diffstat (limited to 'odoo/service')
-rw-r--r--odoo/service/db.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/odoo/service/db.py b/odoo/service/db.py
index ccb1ce41644..ea21a36d546 100644
--- a/odoo/service/db.py
+++ b/odoo/service/db.py
@@ -183,7 +183,7 @@ def exp_drop(db_name):
_drop_conn(cr, db_name)
try:
- cr.execute(sql.SQL('DROP DATABASE {}').format(db_name))
+ cr.execute(sql.SQL('DROP DATABASE {}').format(sql.Identifier(db_name)))
except Exception as e:
_logger.info('DROP DB: %s failed:\n%s', db_name, e)
raise Exception("Couldn't drop database %s: %s" % (db_name, e))