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/delegate: row level security statements incorrectly stored in crdb_internal.create_statements #141932

Open
Dedej-Bergin opened this issue Feb 24, 2025 · 0 comments
Assignees
Labels
branch-master Failures and bugs on the master branch. C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@Dedej-Bergin
Copy link
Contributor

Dedej-Bergin commented Feb 24, 2025

Describe the problem

Row level security statements are currently being stored in crdb_internal.create_statements they should only be stored in the policy_statements and alter_statements columns.

Expected behavior
We want to not see row level security statements in crdb_internal.create_statements the fix for this should be to update the SQL in show_table.go similar to how it works for zone configs.

SELECT
%[3]s AS table_name,
concat(` + createField + `,
CASE
WHEN is_multi_region THEN
CASE
WHEN (SELECT mr FROM zone_configs) IS NULL THEN NULL
ELSE concat(e';\n', (SELECT mr FROM zone_configs))
END
WHEN (SELECT raw FROM zone_configs) IS NOT NULL THEN
concat(e';\n', (SELECT raw FROM zone_configs))
WHEN NOT has_partitions
THEN NULL
ELSE
e'\n-- Warning: Partitioned table with no zone configurations.\n'
END
) AS create_statement

Additional context
Slack thread with additional details
https://cockroachlabs.slack.com/archives/C083W9NK34H/p1740086103580329?thread_ts=1738354642.988319&cid=C083W9NK34H

Jira issue: CRDB-48083

@Dedej-Bergin Dedej-Bergin added branch-master Failures and bugs on the master branch. C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. labels Feb 24, 2025
@Dedej-Bergin Dedej-Bergin self-assigned this Feb 24, 2025
@exalate-issue-sync exalate-issue-sync bot added the T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) label Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch-master Failures and bugs on the master branch. C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
None yet
Development

No branches or pull requests

1 participant