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'll try. I hope I can make as few changes as possible. |
|
I'm currently almost done refactoring the constants to use the
As far as I can see, the only open issue regarding global constants is name collision resolution. |
IHMO, global constants don't need to be implemented. As far as I know, no relational DBMS has implemented constants in this way. It seems to me that any non-standard extensions that can be used in DSQL should, if possible, be kept within packages. |
|
No code change in scl.epp? |
Hmm, I thought that since constants aren't independent objects, it would be enough if the user had permission to create a package. Should I add separate permissions for creating constants? |
I'm referring to the outside user of a constant, which should have permission to use the package. |
- Add package ID field - Add package metacache Package body create/drop handles like a newVersion of the cache object. The versioned part as a dictionary to search constants by name and by ID in the package Known issues: 1) Id for system packages is missing 2) Restore of old packages lead to lock leakage assert 3) Probably incorrect Package::scan result and Package::reload with Package::checkReload handle 4) Probably not needed `if (schema.isEmpty())` checks
Does this mean constants in system packages are impossible? I'd really like to see constants in system packages too. Some examples:
|
These issues are temporary and will be fixed. I don't think adding constants to system packages will be a problem |
Got it. I will add a the permission check |
Add the following constants: FROM_BEGIN = 0 FROM_CURRENT = 1 FROM_END = 2
|
Are the ID ranges for user packages and system packages somehow separated? I'm saying this because the number of system packages will expand over time. Couldn't the ID assigned to a user package be overwritten when restored by a new ID for a system package (in a new Firebird version)? |
This PR adds a new database object - Package Constant (#1036). See README.packages.txt for more information.
Usage examples:
The implementation has three key points: