-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
66599: sql: enable adding columns which are not written to the current primary index r=postamar a=postamar row,schemachanger: use StoreColumnIDs/Names in primary index In a recent commit, the StoreColumnIDs and StoreColumnNames slices in primary indexes were populated when previously they had simply been empty. We simply assumed that all non-virtual columns in a table would be stored in the primary index: primary key columns in the key, the rest in the value. This commit breaks that assumption by using the StoreColumnIDs slice to determine what goes into the primary index. This makes it possible for the new schema changer to add columns safely, preventing unwanted writes to the old primary index while the schema change is underway. Fixes #59149. Release note: None sql,tabledesc: add new IndexDescriptorVersion for primary indexes Previously, the IndexDescriptorVersion type was only used to describe the encoding of secondary indexes. This commit adds a new value for use in primary indexes, PrimaryIndexWithStoredColumnsVersion, to signify that the StoredColumnIDs and StoredColumnNames slices are populated correctly. Previously, these slices did not need to be populated at all. This is because the set of columns comprising the primary index of a table is assumed to be all non-virtual columns of that table. Our upcoming work on the new schema changer will require us to violate that assumption however. This commit is in preparation of that change. In our effort to make meaningful the concept of stored columns in primary indexes, this commit also changes the contents of the information_schema.statistics table. As a result, SHOW INDEXES and SHOW COLUMNS behave the same way regardless of whether an index is primary or secondary. Release note (sql change): The contents of the statistics table in the information schema have changed, therefore so have the results of SHOW INDEX and SHOW COLUMNS. A column which is not in the primary key will now be listed as belonging to the primary index as a stored column. Previously, it was simply not listed as belonging to the primary index. 66664: sql: First round of cleanup of schemachange/random-load r=ajwerner,otan a=ajstorm This issue addresses several issues uncovered in running the randomized schema changer. Specifically: - Makes several errors pgcodes, so that they can be properly added to the expected errors list in the randomized schema changer. - Detects cases where the region column (crdb_region) is used multiple times in an index definition. - Allows for column type changes, which must have the experimental flag enable_experimental_alter_column_type_general flag set. It also disables the testing of setColumnType (tracked with #66662) as well as making a column nullable/non-nullable due to a timing hole (tracked with #66663). Release note: None. Co-authored-by: Marius Posta <[email protected]> Co-authored-by: Adam Storm <[email protected]>
- Loading branch information
Showing
86 changed files
with
1,602 additions
and
986 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.