-
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/sem/tree: break dependencies on catalog, sessiondata, security #80687
sql/sem/tree: break dependencies on catalog, sessiondata, security #80687
Conversation
92cbcea
to
f4a77d3
Compare
iter := sp.Iter() | ||
for schema, ok := iter.Next(); ok; schema, ok = iter.Next() { | ||
if err := f(schema); err != nil { | ||
if iterutil.Done(err) { |
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.
this iter package is cool
pkg/sql/alter_database.go
Outdated
@@ -35,6 +35,7 @@ import ( | |||
"github.com/cockroachdb/cockroach/pkg/sql/sem/tree" | |||
"github.com/cockroachdb/cockroach/pkg/sql/sqlerrors" | |||
"github.com/cockroachdb/cockroach/pkg/sql/sqltelemetry" | |||
"github.com/cockroachdb/cockroach/pkg/sql/username" |
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.
this import confused me when i reviewed this commit but got lost somewhere. i don't know if you want to fix it.
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.
I fixed this.
// PublicSchemaID redefines keys.PublicSchemaID to avoid an import. It exists | ||
// to deal with time-travel queries from moments before the time when all | ||
// databases other than system were given a public schema. | ||
const PublicSchemaID = 29 |
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.
maybe it belongs to pkg/base
???
f4a77d3
to
86be457
Compare
Merge away if CI is green |
d23a7c9
to
d800029
Compare
d800029
to
863891e
Compare
863891e
to
06a1bd0
Compare
5fd0fc9
to
761e0b7
Compare
8991138
to
da24e5d
Compare
It was big and obscuring the rest of the logic. Release note: None
Release note: None
No reason to involve sessiondata down in tree. Note that this is all probably moot because we're removing these options, but I didn't want to be the one to do that right now. Release note: None
The security package depends on logging amongst other things. This is easy to break as the methods were really just about string conversions. Also we needed sessiondata here. Release note: None
Tree and protobuf packages like sessiondatapb imported security just for the SQLUsername symbol and its associated proto symbol. There's no need for that. This was a purely automated move. Release note: None
Release note: None
Before this if we disallowed a prefix for imports and the package was itself under that prefix, the test would fail. Now we remove the package itself. Release note: None
Release note: None
It should just be constants. Release note: None
This is just constants. We want tree to be free of catalog. Release note: None
Release note: None
da24e5d
to
a53fad6
Compare
TFTR! bors r+ |
Build succeeded: |
This pile of commits moves stuff and makes some minor changes to break more dependencies of tree. Most of the commits are totally mechanical. The ones which aren't relate to abstracting
SearchPath
a tad and moving cast options to a struct. This should be straightforward to review commit-by-commit.The end goal here will be to break the dependencies of the parser on
util/log
. There's still a few more things remaining here and there, but this felt like a reasonable stopping point.