Skip to content
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: support the USAGE permission for schemas #53342

Closed
rohany opened this issue Aug 24, 2020 · 0 comments · Fixed by #53358
Closed

sql: support the USAGE permission for schemas #53342

rohany opened this issue Aug 24, 2020 · 0 comments · Fixed by #53358
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)

Comments

@rohany
Copy link
Contributor

rohany commented Aug 24, 2020

Schemas in Postgres have the USAGE permission, which controls whether or not a user can even resolve objects within a schema.

@rohany rohany added the C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) label Aug 24, 2020
@rohany rohany added this to Triage in SQL Foundations via automation Aug 24, 2020
rohany added a commit to rohany/cockroach that referenced this issue Aug 24, 2020
Fixes cockroachdb#50879.

This commit adds support for the `GRANT ... ON SCHEMA ... TO ...`
command and adds the necessary permissions checks that were missing.
Note that the `USAGE` permission is not implemented and will be done as
a follow up (cockroachdb#53342).

Release note (sql change): Add support for the `GRANT ... ON SCHEMA
command`.
rohany added a commit to rohany/cockroach that referenced this issue Aug 24, 2020
Fixes cockroachdb#53342.

This commit adds the `USAGE` privilege to schemas. The `USAGE` privilege
allows a user to resolve objects under a schema.

Release note (sql change): Support the `USAGE` privelege on schemas.
rohany added a commit to rohany/cockroach that referenced this issue Aug 24, 2020
Fixes cockroachdb#50879.

This commit adds support for the `GRANT ... ON SCHEMA ... TO ...`
command and adds the necessary permissions checks that were missing.
Note that the `USAGE` permission is not implemented and will be done as
a follow up (cockroachdb#53342).

Release note (sql change): Add support for the `GRANT ... ON SCHEMA
command`.
rohany added a commit to rohany/cockroach that referenced this issue Aug 24, 2020
Fixes cockroachdb#50879.

This commit adds support for the `GRANT ... ON SCHEMA ... TO ...`
command and adds the necessary permissions checks that were missing.
Note that the `USAGE` permission is not implemented and will be done as
a follow up (cockroachdb#53342).

Release note (sql change): Add support for the `GRANT ... ON SCHEMA
command`.
rohany added a commit to rohany/cockroach that referenced this issue Aug 25, 2020
Fixes cockroachdb#50879.

This commit adds support for the `GRANT ... ON SCHEMA ... TO ...`
command and adds the necessary permissions checks that were missing.
Note that the `USAGE` permission is not implemented and will be done as
a follow up (cockroachdb#53342).

Release note (sql change): Add support for the `GRANT ... ON SCHEMA
command`.
@thoszhang thoszhang moved this from Triage to 20.2 stability period in SQL Foundations Aug 25, 2020
@thoszhang thoszhang moved this from 20.2 stability period to 20.2.e in SQL Foundations Aug 25, 2020
craig bot pushed a commit that referenced this issue Aug 25, 2020
53344: sql: support the `GRANT ON SCHEMA` command r=rohany a=rohany

Fixes #50879.

This commit adds support for the `GRANT ... ON SCHEMA ... TO ...`
command and adds the necessary permissions checks that were missing.
Note that the `USAGE` permission is not implemented and will be done as
a follow up (#53342).

Release note (sql change): Add support for the `GRANT ... ON SCHEMA
command`.

53349: geo: return 3D+ dimensions from GEOS r=sumeerbhola a=otan

Currently any dimension about 2 was omitted with GEOS returned. Fix this
by telling the EWKB reader to return 3 if there is a Z coordinate.

Note this does not work for EMPTY geometries -- but this should be fine
since we don't store 3D/4D objects at this time.

Release note: None

53356: backupccl: remove enterprise check in SHOW r=dt a=dt

Release note (enterprise change): As part of making basic BACKUP and RESTORE free to use without an enterpris license, SHOW BACKUP and SHOW BACKUPS IN no longer require a license.

53387: sql: lift descriptor State enum to to top level r=lucy-zhang a=lucy-zhang

This commit moves the `State` protobuf enum out of the `TableDescriptor`
namespace to the top level and renames it to `DescriptorState`, and
replaces all the existing `State` enums for the other descriptors with
`DescriptorState`. This is prompted by the fact that type, schema, and
database descriptors also share the dropped and offline states with
tables.

Note that this is a backward-incompatible protobuf change from earlier
20.2 alphas. Due to the existing ordering of enum values, non-table
descriptors on disk in the dropped state, on unmarshalling, will be in
the adding state, and will essentially act as unresolvable descriptors
that will never be properly dropped without intervention. Descriptors in
the public state will not undergo any changes. We expect the unwanted
dropped -> adding conversion to be a rare occurence; users would have to
upgrade to a beta right concurrently with dropping a non-table
descriptor.

Release note (backward-incompatible change): A change to the on-disk
representation for user-defined schemas, enums, and databases was made
that is backward-incompatible with 20.2 alpha releases. Only schemas,
enums, and databases in the middle of being dropped at the time of the
upgrade are affected, and the upgrade may result in the drop never
running to completion. It's advisable to avoid dropping schemas, enums
and databases if upgrading from a 20.2 alpha release to a 20.2 beta
release.

Co-authored-by: Rohan Yadav <rohany@alumni.cmu.edu>
Co-authored-by: Oliver Tan <otan@cockroachlabs.com>
Co-authored-by: David Taylor <tinystatemachine@gmail.com>
Co-authored-by: Lucy Zhang <lucy@cockroachlabs.com>
rohany added a commit to rohany/cockroach that referenced this issue Aug 25, 2020
Fixes cockroachdb#50879.

This commit adds support for the `GRANT ... ON SCHEMA ... TO ...`
command and adds the necessary permissions checks that were missing.
Note that the `USAGE` permission is not implemented and will be done as
a follow up (cockroachdb#53342).

Release note (sql change): Add support for the `GRANT ... ON SCHEMA
command`.
craig bot pushed a commit that referenced this issue Aug 25, 2020
52952: rowexec: joinReader optimizations for index joins r=sumeerbhola a=sumeerbhola

These small optimizations are for index joins with large
numbers of rows, which are common with geospatial queries.
- No longer uses the keyToInputRowIndices map which
  was consuming about 1.5% in cpu profiles
- Sorts the spans to use optimizations at the storage layer,
  like cockroachdb/pebble#860
- Avoids constructing the partial key string since it is
  not used

Release note: None

53296: builtins: Implement ST_FlipCoordinates on arguments {geometry} r=otan a=themistoklik

Should adopt PostGIS behavior. 

Release note (sql change): Implemented geometry builtin `ST_FlipCoordinates`
Closes #48932 

53307: implement ST_SharedPaths r=otan a=devenbhooshan

Implemented the geometry based builtin `ST_SharedPaths`

53343: sql: remove auto-parallelism of UNION ALL r=yuzefovich a=yuzefovich

Previously, `UNION ALL` construct was handled by simply merging the
streams which could be handled by unordered synchronizers which are the
source of concurrency in the engine. As a result, in some extreme cases
(like when we have many UNION ALL constructs in the same query) we could
have basically an unbounded parallelism that would stress the resources
too much and could lead to OOM crashes.

This issue is now fixed by using ordered synchronizers for the merging
of the streams (which runs all inputs in the same goroutine). This
approach is taken instead of implementing a separate UnionAll processor
or operator because it is least invasive and should be easily
backportable.

Fixes: #51548.

Release note (sql change): The concurrency of evaluation of UNION ALL
queries has been reduced. Previously, such queries could end up crashing
the server due to OOM in some extreme cases, and now that should be
fixed at the expense of possible minor reduction in performance.

53358: sql: support the `USAGE` privilege on schemas r=rohany a=rohany

Fixes #53342.

This commit adds the `USAGE` privilege to schemas. The `USAGE` privilege
allows a user to resolve objects under a schema.

Release note (sql change): Support the `USAGE` privelege on schemas.

53421: importccl: ignore ANALYZE in PGDUMP r=mjibson a=mjibson

Release note: None

Fixes #53419

Co-authored-by: sumeerbhola <sumeer@cockroachlabs.com>
Co-authored-by: Themis Papavasileiou <tpapavasileiou@bol.com>
Co-authored-by: Deven Bhooshan <devenbhooshan@gmail.com>
Co-authored-by: Yahor Yuzefovich <yahor@cockroachlabs.com>
Co-authored-by: Rohan Yadav <rohany@alumni.cmu.edu>
Co-authored-by: Matt Jibson <matt.jibson@gmail.com>
@craig craig bot closed this as completed in e2fce35 Aug 25, 2020
SQL Features (Deprecated - use SQL Experience board) automation moved this from 20.2 stability to Done Aug 25, 2020
SQL Foundations automation moved this from 20.2.e to Done Aug 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

1 participant