Issue Details (XML | Word | Printable)

Key: DERBY-1062
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Mamta A. Satoor
Reporter: Mike Matrigali
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

Change the internal implemetation of SYSCS_INPLACE_COMPRESS_TABLE to share existing alter table

Created: 28/Feb/06 07:24 AM   Updated: 29/Jun/09 01:13 PM
Return to search
Component/s: SQL, Store
Affects Version/s: 10.1.3.1
Fix Version/s: 10.5.1.1

Time Tracking:
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works d1062-escape.diff 2008-05-21 08:48 AM Knut Anders Hatlen 5 kB
File Licensed for inclusion in ASF works d1062-escape.diff 2008-05-20 07:10 PM Knut Anders Hatlen 2 kB
HTML File Licensed for inclusion in ASF works releaseNote.html 2009-04-06 05:03 AM Mamta A. Satoor 4 kB

Issue & fix info: Release Note Needed
Resolution Date: 22/Jul/08 03:01 PM


 Description  « Hide
 Change the internal implemetation of SYSCS_INPLACE_COMPRESS_TABLE to share existing alter table
code. One suggested approach is to use the same mechanism as SYSCS_COMPRESS_TABLE. Such
an implementation would involve:
o change the parser for alter table to accecpt some internal only syntax for SYSCS_INPLACE_COMPRESS_TABLE
o change the alter table constant action to get the required information for inplace compress
o move most of the inplace compress driving code to a routine in alter table execution, following the same
     coding pattern as existing alter table compress.

I believe doing this will have multiple benefits:
1) shares existing alter table code, so things like error checking, security management, ... is all done by one piece of code
2) by sharing the code I believe the following outstanding JIRA issues will be addressed: DERBY-719, DERBY-720 -
3) future changes addressing ddl like grant/revoke will automatically work.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #655980 Tue May 13 19:29:12 UTC 2008 mamta This commit is for DERBY-1062. Currently SYSCS_INPLACE_COMPRESS_TABLE is implemented on it's own in
OnlineCompress.java It will be nice for us to share the existing code for ALTER TABLE so we do all the
necessary checks that are already done in ALTER TABLE rather than repeat the code in OnlineCompress.
Another procedure similar to SYSCS_INPLACE_COMPRESS_TABLE is SYSCS_COMPRESS_TABLE and
SYSCS_COMPRESS_TABLE is written using the ALTER TABLE code. With this commit, I am getting rid of
OnlineCompress.java and moving the necessary code into ALTER TABLE related classes. One thing that
SYSCS_INPLACE_COMPRESS_TABLE allows is compressing tables in SYSTEM schemas. The compile code currently
throws an exception if the operation is being done on system schema for DDLs. I had to make changes
such that we allow SYSTEM schema handling in DDL.

This sharing of code also fixes the GRANT/REVOKE code for SYSCS_INPLACE_COMPRESS_TABLE. Earlier we didn't
look for permissions when letting a user issue SYSCS_INPLACE_COMPRESS_TABLE. But now since we use the
existing code in ALTER TABLE, it already handles the permission issues.
Files Changed
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GrantRevokeDDLTest.java
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/catalog/SystemProcedures.java
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/AlterTableNode.java
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/GenericConstantActionFactory.java
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SysDiagVTIMappingTest.java
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DDLStatementNode.java
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
DEL /db/derby/code/trunk/java/engine/org/apache/derby/iapi/db/OnlineCompress.java

Repository Revision Date User Message
ASF #655989 Tue May 13 19:50:15 UTC 2008 mamta Followup commit to revision 655980 for DERBY-1062. Some of the tests were doing import of
OnlineCompress.java which I had deleted in revision 655980. This should fix the build errors caused
by 655980.
Files Changed
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/oc_rec4.java
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/oc_rec3.java
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/oc_rec2.java
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/OnlineCompressTest.java
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/oc_rec1.java

Repository Revision Date User Message
ASF #655990 Tue May 13 19:55:15 UTC 2008 mamta Removing old comment from GrantRevokeDDLTest which does not apply anymore. Fix to DERBY-1062 will now
correctly throw an exception if a user tries to compress a table on which it does not have correct
privileges.
Files Changed
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/GrantRevokeDDLTest.java

Repository Revision Date User Message
ASF #656323 Wed May 14 15:55:56 UTC 2008 mamta Taking care of javadoc warnings caused by a checkin made for DERBY-1062
Files Changed
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java

Repository Revision Date User Message
ASF #656797 Thu May 15 19:21:30 UTC 2008 mamta DERBY-3674

Inplace compress test in store/TransactionTable.sql started failing after the checkin for DERBY-1062.
Prior to the fix for DERBY-1062, an inplace compress request on VTI would return with no exception
although the code just ignored the compress request on VTI. After DERBY-1062 fix, Derby started
throwing exception. With the changes going through this commit, I am restoring the behavior to no-op
on inplace compress on VTI. I am doing this by making the check for VTI in SystemProcedure and returning
from it if it is a VTI. All the other inplace compress request get fulfilled through internal
generation of ALTER TABLE sql.
Files Changed
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/catalog/SystemProcedures.java

Repository Revision Date User Message
ASF #657154 Fri May 16 18:28:17 UTC 2008 mamta Cleaning for sqlgrammar.jj a little bit by removing the code to pass the parameters which never will be
set during ALTER TABLE when we are doing a non-compress operation on the table. This is for DERBY-1062
Files Changed
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/AlterTableNode.java

Repository Revision Date User Message
ASF #658604 Wed May 21 08:48:10 UTC 2008 kahatlen DERBY-1062: Escape special characters in table name and schema name before passing them on to ALTER TABLE
Files Changed
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/catalog/SystemProcedures.java
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/_Suite.java
ADD /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/CompressTableTest.java