-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sql/schemachanger: add enum type values as an element #83802
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
other than the testdata file I don't think you meant to add
This was inadequate because
for multi-region support we need to be able to iterate over
the values for an enum.
We'll need this for adding and dropping enum values too.
Reviewed 24 of 25 files at r1, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @ajwerner and @fqazi)
pkg/sql/schemachanger/testdata/drop
line 1683 at r1 (raw file):
# end PostCommitPhase setup
does this need to be split into multiple files / is this adding back a deleted file?
Code quote:
setup
CREATE DATABASE db1;
CREATE SCHEMA db1.sc1;
CREATE SEQUENCE db1.public.sq1;
CREATE SEQUENCE db1.sc1.sq1;
CREATE TABLE db1.sc1.t1 (id INT PRIMARY KEY, name varchar(256), val int DEFAULT nextval('db1.sc1.sq1'));
CREATE TABLE db1.public.t1 (id INT PRIMARY KEY, name varchar(256), val int DEFAULT nextval('db1.public.sq1'));
CREATE TABLE db1.public.ttl (id INT PRIMARY KEY) WITH (ttl_expire_after = '10 minutes');
CREATE VIEW db1.sc1.v1 AS (SELECT name FROM db1.sc1.t1);
CREATE VIEW db1.sc1.v2 AS (SELECT name AS n1, name AS n2 FROM db1.sc1.v1);
CREATE VIEW db1.sc1.v3 AS (SELECT name, n1 FROM db1.sc1.v1, db1.sc1.v2);
CREATE VIEW db1.sc1.v4 AS (SELECT n2, n1 FROM db1.sc1.v2);
CREATE TYPE db1.sc1.typ AS ENUM('a');
CREATE VIEW db1.sc1.v5 AS (SELECT 'a'::db1.sc1.typ::string AS k, n2, n1 from db1.sc1.v4);
----
...
+database {0 0 db1} -> 111
+schema {111 0 public} -> 112
+schema {111 0 sc1} -> 113
+object {111 112 sq1} -> 114
+object {111 113 sq1} -> 115
+object {111 113 t1} -> 116
+object {111 112 t1} -> 117
+object {111 112 ttl} -> 118
+object {111 113 v1} -> 119
+object {111 113 v2} -> 120
+object {111 113 v3} -> 121
+object {111 113 v4} -> 122
+object {111 113 typ} -> 123
+object {111 113 _typ} -> 124
+object {111 113 v5} -> 125
test
DROP DATABASE db1 CASCADE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @ajwerner)
pkg/sql/schemachanger/testdata/drop
line 1683 at r1 (raw file):
Previously, ajwerner wrote…
does this need to be split into multiple files / is this adding back a deleted file?
This was accidentally re-added. Dropping it from here
Done.
Seems you need a rewrite |
Previously, our decomposition of enum types only included an element for the type itself. This was inadequate because for multi-region support we need to be able to iterate over the values for an enum. This patch adds further decomposition for enums. Release note: None
@ajwerner TFTR! bors r+ |
Build succeeded: |
Previously, our decomposition of enum types only included
an element for the type itself. This was inadequate because
for multi-region support we need to be able to iterate over
the values for an enum. This patch adds further decomposition
for enums.
Release note: None