Conversation
…rong impure cache usage
|
Are comments supported for constants? I didn't see this in the documentation. Comments are simply supported for packaged procedures and functions. It would make sense to do the same for constants (and any package objects, for that matter). |
No, I didn't plan to implement comments, but I think it's possible. I will take a look |
I think the original question was about a situation where there are 4 systemp packages, 1 user packages and a new version adds a new system package. If you preserve the original ID when restoring, the following situation will occur But the IDs are regenerated, so we are safe. |
Yes, that's exactly what I was asking about. Thanks for clarifying. |
|
None of IDs are persistent in Firebird and there is no reason for package's one to be the first. |
This isn't true for relations. That's why I asked. |
I've added permission checking connect employee user R;
Database: employee, User: R
SQL> select TEST.C1 from rdb$database;
Statement failed, SQLSTATE = 28000
no permission for USAGE access to PACKAGE "PUBLIC"."TEST"
-Effective user is RTo grant permissions: |
|
|
||
| FOR (REQUEST_HANDLE req_handle1) | ||
| CONST IN RDB$CONSTANTS | ||
| WITH CONST.RDB$SCHEMA_NAME NE SYSTEM_SCHEMA |
There was a problem hiding this comment.
Is this check allowed or should I add the RDB$SYSTEM_FLAG field?
… grant/revoke for constants in README
Noremos
left a comment
There was a problem hiding this comment.
I think this PR is ready to rereviw @AlexPeshkoff @asfernandes @dyemanov
src/isql/show.epp
Outdated
|
|
||
| bool isPrivate = !CONST.RDB$PRIVATE_FLAG.NULL && CONST.RDB$PRIVATE_FLAG; | ||
|
|
||
| if (!CONST.RDB$PACKAGE_NAME.NULL) |
There was a problem hiding this comment.
I removed the checks for now
src/jrd/obj.h
Outdated
| case obj_schemas: | ||
| return "SQL$SCHEMAS"; | ||
| case obj_package_constant: | ||
| return "SQL$PACKAGE_CONSTANT"; |
There was a problem hiding this comment.
I removed it for now
| class SysFunction | ||
| { | ||
| public: | ||
| enum Flags : UCHAR |
Package Constants
This PR adds a new database object - Package Constant (#1036). It is a constant value located in a package header (public visibility) or a package body (private visibility). See README.packages.txt for more information.
SYNTAX
Creation:
<constant_expr>is an expression that remains unchanged after recompilation.ackage constants can be queried using the expression
<package_name>.<consatnt_name>outside the package (<consatnt_name> must be a public constant) and using the expression<consatnt_name>inside the package.To query a constant, the user/role must have USAGE permission on the package.
Other SQL extensions:
Usage examples:
System Constants
As an exmaple, 3 consatnts have been added to the RDB$BLOB_UTIL package
System metadata changes
New system table - RDB$CONSTANTS
A new field has been added to
RDB$PACKAGES-RDB$PACKAGE_IDNew indexes:
Implementation
Packages have been added to the metacaching system. Since it relies heavily on identifiers, a new ID field (
RDB$PACKAGE_ID) has been added to theRDB$PACKAGEStable. Constants are stored as an array in the package metacaching object, with a package_id-to-array_id and constant_name-to-array_id mappings.There are also two important points: