Update 2019.10 Error

Questions around the Aimeos bundle for the Symfony framework
Forum rules
Always add your Symfony, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
rasch
Posts: 22
Joined: 02 Sep 2019, 11:51

Update 2019.10 Error

Post by rasch » 28 Oct 2019, 14:00

Hi,

When updating Aimeos Shop from 2019.07.x-dev to 2019.10.1 with composer update I get the following SQL error message.
Checking table "mshop_subscription":
In Simple.php line 94:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax
to use near 'SMALLINT DEFAULT 0 NOT NULL, CHANGE `interval` `interval` VARCHAR(32) NOT NULL' at line 1: ALTER TABLE mshop_subscription ADD productid VARCHAR(36) NOT NULL, ADD perio
d SMALLINT DEFAULT 0 NOT NULL, CHANGE `interval` `interval` VARCHAR(32) NOT NULL
What can I do?

Thank your for your help.
--
aimeos: 2019.07.x-dev
symfony: 4.3
php: 7.2
ubuntu: 18

User avatar
aimeos
Administrator
Posts: 8318
Joined: 01 Jan 1970, 00:00

Re: Update 2019.10 Error

Post by aimeos » 28 Oct 2019, 14:14

Seems like the "period" column name is treated as a reserved word. Do you use MariaDB <= 10.3.6 in Oracle mode?
https://mariadb.com/kb/en/library/reser ... racle-mode
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

rasch
Posts: 22
Joined: 02 Sep 2019, 11:51

Re: Update 2019.10 Error

Post by rasch » 29 Oct 2019, 13:41

Seems like the "period" column name is treated as a reserved word. Do you use MariaDB <= 10.3.6 in Oracle mode?
No, I use MariaDB 10.3.18 and the sql_mode is STRICT_TRANS_TABLES, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, NO_ENGINE_SUBSTITUTION.

But the cause of the failure is nevertheless the unmasked identifier period. When I first excecute in the mysql shell the command ALTER TABLE mshop_subscription ADD productid VARCHAR (36) NOT NULL, ADD `period` SMALLINT DEFAULT 0 NOT NULL, CHANGE` interval` `interval` VARCHAR (32) NOT NULL; then composer update runs without error.

Is it possible to change the source code?

User avatar
aimeos
Administrator
Posts: 8318
Joined: 01 Jan 1970, 00:00

Re: Update 2019.10 Error

Post by aimeos » 29 Oct 2019, 13:56

We can't change the code because the SQL is generated by Doctrine DBAL and the problem must be somewhere around here:
https://github.com/doctrine/dbal/blob/2 ... m.php#L553

Does this also happen if you set up 2019.10 from scratch?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

rasch
Posts: 22
Joined: 02 Sep 2019, 11:51

Re: Update 2019.10 Error

Post by rasch » 30 Oct 2019, 07:26

No.

The error does not occur with a new installation. It only occurs during an update.

Post Reply