Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rupg gave
0A000for the input ofaclitem, so a literal such as'postgres=r/postgres'::aclitemfailed. This change ports the input function ofaclitemfromacl.c, and the functionsmakeaclitem,aclcontains,aclitemeq,hash_aclitem,hash_aclitem_extended,aclinsertandaclremove. The results come from PostgreSQL 19.Changes
aclitem_inreads an item asaclparsedoes. A role name can have double quotes, and""in quotes is a quote. The key wordgrouporusercan come before the grantee. An empty grantee is PUBLIC, and a*after a privilege is its grant option. A name of 64 bytes or more gives42622, a role that does not exist gives42704, and a bad item gives22P02with the message and the hint of PostgreSQL. All of these are soft errors, sopg_input_is_validandpg_input_error_inforeport them.0L000"defaulting grantor to user ID 10", as PostgreSQL does. A function can now send a warning through the new methodwarnofrupg_func::Session. The reader of a statement keeps the warnings, and the session sends them before the result or the error of the statement.input_atofEnv, so that a warning of the input function points at the literal. This applies to a simple query, toParseand toPREPARE.aclcontainsand the operator@>check that the array has one dimension and no null items, then look for an item with the same grantee and grantor and all the privileges and grant options of the item.aclexplodereads its items with the same parser, so an item with a role that does not exist gives the OID of the role.makeaclitemreads the names of the privileges of all kinds of objects, which includeTEMP,TEMPORARYandALTER SYSTEM.hash_aclitemgives the sum of the privileges, the grantee and the grantor in 32 bits.hash_aclitem_extendedgives the same sum for the seed 0. Another seed gives0A000, because the engine does not have the hash ofhashfn.cyet.aclinsertandaclremovegive0A000with the message of PostgreSQL.aclitemgive42883"no binary output function available for type aclitem", as PostgreSQL does for a type that has no send or receive function.CopyOutResponsebefore it runs the query ofCOPY ... TO STDOUT. rupg now sendsCopyOutResponsebefore an error of the run too, in a simple query and inExecute._, asputiddoes.Tests
aclinrupg-sessionruns 73 statements with the output of PostgreSQL 19 for the same script in a new database. It has the text forms, the errors, the warnings in a simple query and inParse, the soft errors,makeaclitem,aclcontains,aclexplode, the hash functions, the arrays, the text forms ofCOPYand the error of the binary form.xtaskchecks andcargo docpass on server1.