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: require enterprise license when creating UDF or SP with PL/pgSQL #115657

Merged
merged 1 commit into from
Dec 6, 2023

Conversation

yuzefovich
Copy link
Member

This commit introduces an enterprise license check when we attempt to create a function using PL/pgSQL language. Most of the changes in this commit are about moving existing logic tests from pkg/sql/logictest path into pkg/ccl/logictestccl - some files are moved fully while for a few only the necessary contents are moved.

Co-authored by @michae2.

Fixes: #114602.

Release note: None

@yuzefovich yuzefovich added the backport-23.2.x Flags PRs that need to be backported to 23.2. label Dec 5, 2023
@yuzefovich yuzefovich requested a review from michae2 December 5, 2023 23:01
@yuzefovich yuzefovich requested review from a team as code owners December 5, 2023 23:01
Copy link

blathers-crl bot commented Dec 5, 2023

Your pull request contains more than 1000 changes. It is strongly encouraged to split big PRs into smaller chunks.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@yuzefovich
Copy link
Member Author

For some reason I could no longer push to michae2/plpgsqlccl branch after closing #114260, so I created the PR from a branch in my fork.

Copy link
Collaborator

@rharding6373 rharding6373 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs a new test in pkg/sql/logictest/testdata/logic_test like https://github.com/cockroachdb/cockroach/blob/master/pkg/sql/logictest/testdata/logic_test/multi_region#L1, which verifies that using PL/pgSQL results in the expected CCL error.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @michae2)

@yuzefovich
Copy link
Member Author

Good point, done.

Copy link
Collaborator

@rharding6373 rharding6373 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: Nice work on the heavy lifting!

I think that Michael or another responsible party should also take a look before merging (I was just passing through...).

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @michae2 and @yuzefovich)


pkg/sql/logictest/testdata/logic_test/plpgsql_license line 4 at r2 (raw file):


statement error pgcode XXC01 pq: using PL/pgSQL requires a CCL binary
CREATE OR REPLACE FUNCTION f() RETURNS RECORD AS $$

Add another test for CREATE PROCEDURE ... LANGUAGE PLpgSQL, too.

This commit introduces an enterprise license check when we attempt to
create a function using PL/pgSQL language. Most of the changes in this
commit are about moving existing logic tests from `pkg/sql/logictest`
path into `pkg/ccl/logictestccl` - some files are moved fully while for
a few only the necessary contents are moved.

Co-authored by @michae2.

Release note: None
Copy link
Member Author

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @michae2 and @rharding6373)


pkg/sql/logictest/testdata/logic_test/plpgsql_license line 4 at r2 (raw file):

Previously, rharding6373 (Rachael Harding) wrote…

Add another test for CREATE PROCEDURE ... LANGUAGE PLpgSQL, too.

Done.

Copy link
Collaborator

@michae2 michae2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: Thank you for picking this up!

Reviewed 50 of 53 files at r1, 2 of 3 files at r2, 2 of 2 files at r3, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (and 1 stale) (waiting on @rharding6373)

@yuzefovich
Copy link
Member Author

TFTRs!

bors r+

@craig
Copy link
Contributor

craig bot commented Dec 6, 2023

Build succeeded:

@craig craig bot merged commit d535403 into cockroachdb:master Dec 6, 2023
9 checks passed
Copy link

blathers-crl bot commented Dec 6, 2023

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


error creating merge commit from 742b99b to blathers/backport-release-23.2-115657: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 23.2.x failed. See errors above.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@yuzefovich
Copy link
Member Author

blathers backport 23.2

Copy link

blathers-crl bot commented Dec 6, 2023

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


error creating merge commit from 742b99b to blathers/backport-release-23.2-115657: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 23.2 failed. See errors above.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-23.2.x Flags PRs that need to be backported to 23.2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sql: make PL/pgSQL and SP enterprise-only
4 participants