ALTER TABLE
will refresh previous snapshot values for absent cells
#17121
Labels
type/bug
Something isn't working
There's a field named
snapshot_value
inDefaultColumnDesc
, which is the evaluation result of the default expression at the time when it's created or added withALTER TABLE
. This is introduced in #12678 to support impure default expressions likeDEFAULT NOW()
.If we then call
ALTER TABLE
again, the table will be replanned and the snapshot values will be evaluated once more. The new values could be different from the previous one if the expression is impure, leading to inconsistent select results for pre-existing rows prior to the very firstADD COLUMN .. DEFAULT NOW()
.To reproduce:
In Postgres, since the table will be rewritten to fill the default values for pre-existing rows, there's no such issue. We should be consistent with that behavior.
The text was updated successfully, but these errors were encountered: