I blinked hard. I have not tried that! I had not seen any mention of that in the documentation. So I had to admit that I did not know and would have to try that.
The Test
mysql> CREATE TABLE gentest (a INT, b INT AS (a + 1) STORED, INDEX(b)); ... mysql> INSERT INTO gentest VALUES (1),(2),(3),(4); ...So now we have a table with data to test. So lets try to modify the value of one of the generated columns.
mysql> UPDATE gentest SET b = 9 WHERE a = 1;And what did the server do?
It returned an error and told me The value specified for generated column 'b' in table 'gentest' is not allowed.