Hallo zusammen,
ich versuche eine vorhandene Tabelle mit einer virtuellen Spalte zu erweitern:
ALTER TABLE `terminal` ADD `list_dscms3` tinyint GENERATED ALWAYS AS IF(deleted is NULL and deployed <= curdate() and testing = 0, 1, 0) VIRTUAL;
Dabei bekomme ich jedoch folgenden Fehler:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GENERATED ALWAYS AS IF(deleted is NULL and deployed <= curdate() and testing = 0' at line 1
Ich habe auch bereits folgendes versucht:
ALTER TABLE `terminal` ADD `list_dscms3` tinyint AS IF(deleted is NULL and deployed <= curdate() and testing = 0, 1, 0) VIRTUAL;
Das funktioniert aber auch nicht:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS IF(deleted is NULL and deployed <= curdate() and testing = 0, 1, 0) VIRTUAL' at line 1
An folgenden HOWTOs habe ich mich orientiert:
https://mariadb.com/kb/en/mariadb/virtual-computed-columns/
https://www.percona.com/blog/2016/03/04/virtual-columns-in-mysql-and-mariadb/
MariaDB Version ist
mysql Ver 14.14 Distrib 5.5.50, for debian-linux-gnu (x86_64) using readline 6.3
Datenbankengine der Tabelle ist
InnoDB.
Ich hoffe, es ist ein MySQL Spezialist unter euch, der mir hier weiterhelfen kann.