The following Launchpad bugs are fixed in this change: Bug 1370749: Now using MAX_USERNAME_LEN instead of hardcoded value
Bug 1413760: CREATE TABLE LIKE was failing in some circumstances because SHOWDDL was including the BY clause. Ownership rules changes in CREATE TABLE changed when ANSI schemas was implemented, so the BY clause is no longer needed.
Bug 1392107: Privileges granted on a view are no longer lost if the view is replaced via CREATE OR REPLACE VIEW.
Bug 1370740: A potential memory corruption problem is now avoided by reworking the authorization name lookup functions.
Bug 1413767: Previously DROP SCHEMA CASCADE would fail to drop a table with an IDENTITY column.
Bug 1413758: Previously DROP TABLE CASCADE did not drop nested views.
Bug 1412891: Previously DROP TABLE CASCADE failed if a dependent object contained a delimited name.
Changes are present for 1392086, but the work is not yet completed. This problem is related to roles and security keys.
Code changes are also present for giving ownership of an object to another authorization ID, but these changes are not complete. A description of the changes is included.
The GIVE command transfers ownership of a SQL item from one authorization ID to another. Implemented in this delivery is GIVE SCHEMA and GIVE ALL.
GIVE ALL transfers all SQL items owned by an authorization ID to another authorization ID. Current or new owner can be a user or a role. The GIVE ALL command requires the ALTER privilege.
GIVE ALL FROM authID TO authID
GIVE SCHEMA behavior depends on the type of schema and whether RESTRICT or CASCADE is specified. For private schemas, all the objects in the schema are given, as well as the schema itself. For shared schemas, only the schema is given, unless the CASCADE option is specified. In that case, ownership of all the objects in the shared schema is given to the new owner. Use of the CASCADE option requires the ALTER_SCHEMA privilege. Otherwise, GIVE SCHEMA only requires the user to be the owner of the schema.
GIVE SCHEMA schema-name TO authID [RESTRICT|CASCADE]
NOTE: RESTRICT and CASCADE are not applicable to private schemas and are ignored.
GIVE OBJECT is added to the syntax but is not implemented and may not be implemented.
A more detailed blueprint will be provided prior to the final delivery of GIVE.
1392805 – DB_ROOT incorrectly gets “NOT AUTHORIZED” messages 1398546 – revoke priv from role fails when view is present 1401233 – USAGE privilege not checked when creating procedure (and revoking privileges) 1403995 – Update stats failures due to schema PUBLIC_ACCESS_SCHEMA 1401683 – (Partial) DDLoperations see error 8841 about transaction started by SQL
catman1/TEST135 & EXPECTED138 catman1/EXPECTED138 (fix in common/ComUser.cpp)
Changed create view code to allow DB__ROOT to create views. Some reorganization required to make sure create view sets the updatatable and insertable privilege correctly. This also fixed the problem where the incorrect privileges were set when created by DB__ROOT.
This is a critical case QA filed because the PUBLIC_ACCESS_SCHEMA does not exist for temporary sample tables during Update Statistics. If the PUBLIC_ACCESS_SCHEMA does not exist, the temporary sample table will be created in the same schema as the source table. Also fixed an issue for private schemas not owned by DB__ROOT to make the histogram table's owner the current user.
There are several 8841 issues being detected. This is a fix for one of them related to Update Statistics where an embedded "get" statement causes a transaction to be started in a child tdm_arkcmp process. The fix is to not automatically start a transaction for the get request.