Comments - Generated (Virtual and Persistent/Stored) Columns

8 years, 7 months ago Jan Steinman

By the way, I don't understand why constant expressions could not be accepted.

They apparently work in 10.1.6:

ALTER TABLE `z_test` ADD `Const` INT(5)  AS (`ID` + 1) PERSISTENT AFTER `ID`;

MariaDB [EcoReality]> SELECT ID, Const from z_test;
+----+-------+
| ID | Const |
+----+-------+
|  1 |     2 |
|  2 |     3 |
|  3 |     4 |
|  4 |     5 |
+----+-------+
4 rows in set (0.00 sec)
 
8 years, 7 months ago Jan Steinman

(I don't understand why this forum doesn't allow a bit of prettifying HTML...)-:

 
8 years, 7 months ago Ian Gilfillan

The editing help page gives details on formatting. I've tidied up your post above - there's lots you can do, just not HTML :)

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.