Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.0.16-galera
-
None
-
RHEL6
-
5.5.54
Description
Try to add virtual column in to an existing table. The server is one of the node in a galera cluster, which is RBR.
It's a live table, and update/insert cannot be stopped. Alter table with add new virtual column by RSU without any issue. New row is coming in without problem. However, all PERSISTENT virtual column value will become null, VIRTUAL one is populated without issue.
It may be make sense for these columns become null if it is RBR? but how can I fix this null value after all server have the new table structure?
Are there any statement I can run to force the DB to re-calculate the PERSISTENT virtual column?
Attachments
Issue Links
- is blocked by
-
MDEV-11636 Extra persistent columns on slave always gets NULL in RBR
- Closed
If I understand the problem correctly, my suggestion would be to try to run ALTER TABLE ... MODIFY <initial virtual column definition>.
For example, the initial table was
create table t1 (a int)
Then you added
alter table t1 add vcol int as (a+5) persistent
Then it got populated with (1,NULL) through the replication
Then you run
alter table t1 modify vcol int as (a+5) persistent
It should become (1,6).
But I will assign the issue to Nirbhay, maybe he can think of a more elegant solution, from Galera cluster perspective (The problem is not specific to Galera cluster, it would be the same if lets say the table was altered on the slave in a normal replication; but when it's done people who introduce such differences between master and slave are supposed to take care about possible problems, while with Galera it should generally "just work").