Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
80651: sql: change materialized view not to be created with fixed timestamp. r=ajwerner a=Xiang-Gu Previously, a materialized view was created with fixed time timestamp ( namely, its `CreateAsOfTime` is initialized to transaction's read time). If the transaction that created this materialized view is pushed forward then `CreateAsOfTime` will be before other descriptors created in the same transaction, causing the backfill job for create materialized view to fail because the other, needed descriptors are not visible at that early `CreatedAsOfTime`. We address this by removing the line that sets `CreateAsOfTime` field of the materalized view, and it instead will reply on the MVCC protocol to populate this field based on the MVCC timestamp of the row containing the needed descriptors when backfilling this materialized view. fixes: #79015 Release note (bug fix): This PR fixes a bug where if a transaction's commit time is pushed forward from its initial provisional time, a enclosing `CREATE MATERIALIZED VIEW AS ...` might fail to find other descriptors created in the same transaction during the view's backfill stage. The detailed description of this bug is summarized in issue #79015. Co-authored-by: Xiang Gu <xiang@cockroachlabs.com>
- Loading branch information