From 73b53795d7ba00124668741258eb4df914eee5ac Mon Sep 17 00:00:00 2001 From: spicy-sauce Date: Thu, 18 Nov 2021 11:50:35 +0200 Subject: [PATCH] Fix query --- rgsync/Connectors/sql_connectors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rgsync/Connectors/sql_connectors.py b/rgsync/Connectors/sql_connectors.py index 739b92b..460cc00 100644 --- a/rgsync/Connectors/sql_connectors.py +++ b/rgsync/Connectors/sql_connectors.py @@ -210,7 +210,7 @@ def GetUpdateQuery(tableName, mappings, pk): values = [val for kk, val in mappings.items() if not kk.startswith('_')] values = [pk] + values values.sort() - query = '%s (%s) VALUES (%s) ON DUPLICATE KEY UPDATE %s' % (query, ','.join(values), ','.join([':%s' % a for a in values]), ','.join(['%s=:%s' % (a,a) for a in values])) + query = '%s (%s) VALUES (%s) ON DUPLICATE KEY UPDATE %s' % (query, ','.join(values), ','.join([':%s' % a for a in values]), ','.join(['%s=values(%s)' % (a,a) for a in values])) return query self.addQuery = GetUpdateQuery(self.tableName, mappings, self.pk)