From ecd5a235239fd9bae635c883dd564b94abbc10b5 Mon Sep 17 00:00:00 2001
From: Sebastian Pongratz <s.pongratz@adito.de>
Date: Tue, 16 Feb 2021 16:14:04 +0000
Subject: [PATCH] #1073266-LeadimportSQLSysntaxerror

---
 process/Leadimport_lib/process.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/process/Leadimport_lib/process.js b/process/Leadimport_lib/process.js
index 160ec05e7f..6d254c35c1 100644
--- a/process/Leadimport_lib/process.js
+++ b/process/Leadimport_lib/process.js
@@ -698,7 +698,12 @@ LeadImportUtils.insertTable = function(pDataFields, pDataTypes, pValues, pTable,
         TableValues[i] = pValues[Fields[i]];
     }
     
-    db.insertData(pTable, Fields, Types, TableValues);     
+    if (db.getDatabaseType(vars.getString("$sys.dbalias")) == db.DBTYPE_MARIADB10)
+    {
+        pTable = "`" + pTable + "`";
+    }
+    
+    db.insertData(pTable, Fields, Types, TableValues);
     
     return pValues[TableID];
 }
-- 
GitLab