shopware5 / SwagMigration

Shopware 5 Migration (Import from third party systems)
http://store.shopware.com/en/swag00426/migrating-from-other-shop-systems-to-shopware-4.html
MIT License
17 stars 40 forks source link

IFNULL in SQL-Statements causes syntax errors #2

Closed t2oh4e closed 10 years ago

t2oh4e commented 10 years ago

Hi there,

in some mySQL versions the IFNULL-Functions in the SQL statements crash the order import.

"#1305 - FUNCTION dbname.IFNULL does not exist"

According to this blogpost the cause is the space between IFNULL and ( http://blog.152.org/2009/12/mysql-error-1305-function-xxx-does-not.html

Just tested this on mySQL 5.0.96 with the XtCommerce.php Profile, but there are some other files with this space. https://github.com/ShopwareAG/swagmigration/blob/master/Components/Migration/Profile/XtCommerce.php#L634 mySQL 5.0.96 Breaks with space, works without space. mySQL 5.5.28 works with and without space.

Kind regards

Timo

dnoegel commented 10 years ago

Hi,

I just removed the spaces - but actually we require MySQL > 5.1 for shopware, so you really shouldn't work with older MySQL versions. I cannot promise, that we won't break it again in the future.

t2oh4e commented 10 years ago

Shopware runs on newer MySQL Versions, but the shops that are migrated are not always using them so I think in this case it's reasonable to keep the statements that collect data from the old shop compatible with older version if possible.

Thanks for the response and the fix.

dnoegel commented 10 years ago

Ah, sure, you are right with that. Just as a hint for other users with similar problems: You can also e.g. dump your database on the old system and import on a mysql server with a more recent SQL version. The mitgration script will be able to import the images from the "original" system and every other data from the more recent database

Thanks for the hint with the ifnull compatibility, I hope it works now :)