Skip to content

DOLT_QUERY_DIFF: Scope privilege checks to tables referenced in queries #10701

@elianddb

Description

@elianddb

DOLT_QUERY_DIFF currently requires SELECT privilege on all tables in the database (GRANT SELECT ON mydb.*) to execute. This is overly-broad, and our docs imply that only the tables in the queries are necessary. I've updated the docs and added some tests for #10695 which are implicitly related to this. Down below is a gist of what should happen.

Expected

mydb/main> GRANT SELECT ON mydb.t TO user@localhost;
mydb/main> SELECT * FROM dolt_query_diff('SELECT * FROM t AS OF main', 'SELECT * FROM t AS OF other');
+--------+------+-----------+
| from_i | to_i | diff_type |
+--------+------+-----------+
| 1      | 2    | modified  |
+--------+------+-----------+

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpermissionsAny branch permission- or SQL user/grant- related issues

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions