BlackbitDigitalCommerce / pimcore-data-director

Import Bundle for Pimcore
16 stars 3 forks source link

Cant use "set" as attribute because of SQL Syntax error #47

Closed AndreasEisenbergerDGTLS closed 2 years ago

AndreasEisenbergerDGTLS commented 2 years ago

This is the query which has an syntax error because "set" is a reserved word.

INSERT INTO object_store_Product (oo_id,set) VALUES (1,2) ON DUPLICATE KEY UPDATE oo_id=VALUES(oo_id),set=VALUES(set)

If the query would wrap the column names in backticks it should work, no more syntax error:

INSERT INTO object_store_Product (oo_id,set) VALUES (1,2) ON DUPLICATE KEY UPDATE oo_id=VALUES(oo_id),set=VALUES(set)

How to recreate:

  1. Create Pimcore class and add "set" as a checkbox (in our case)
  2. Create dataport and assign any value to "set"
  3. "Start import" will produce this SQL syntax error in the log

It would be great if you could look into this and create a fix for this.

Best regards Andreas

BlackbitDevs commented 2 years ago

Which DD version are you using? Just tested it with 3.1 and there the problem does not occur.

AndreasEisenbergerDGTLS commented 2 years ago

We are using 3.0.5

BlackbitDevs commented 2 years ago

Was fixed in 3.0.6 but I would recommend to update to latest stable.