db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r741118 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
Date Thu, 05 Feb 2009 14:58:10 GMT
Author: mamta
Date: Thu Feb  5 14:58:09 2009
New Revision: 741118

URL: http://svn.apache.org/viewvc?rev=741118&view=rev
The change here is getting committed for DERBY-4048

DERBY-269 provided a new stored procedure SYSCS_UTIL.SYSCS_UPDATE_STATISTICS to update the
statistics. The code to do the work was added in AlterTableConstantAction and the name of
new method in that class is updateStatistics(Activation activation). This code was copied
from an existing unused class execute/UpdateStatisticsConstantAction.java(that unused class
has been removed from Derby code). 

The copied code in AlterTableConstantAction:updateStatistics gets compile transaction to do
the work of updating the statistics. Instead, we should be using execute transaction because
we are not in the compile phase. The rest of the code in AlterTableConstantAction uses execute

I ran into this issue of getTransactionExecute vs getTransactionCompile while working on DERBY-3788
(provide a zero-admin way of updating the statistics). While trying to run the statistics
inline during the compile phase of a SELECT query, I ran into exception that statistics can't
be updated because we are in read-only mode. But if I change the AlterTableConstantAction
to use getTransactionExecute, then I do not run into the read-only mode exception.  


Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java?rev=741118&r1=741117&r2=741118&view=diff
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
Thu Feb  5 14:58:09 2009
@@ -638,7 +638,7 @@
 		LanguageConnectionContext lcc = activation.getLanguageConnectionContext();
 		DataDictionary dd = lcc.getDataDictionary();
-		TransactionController tc = lcc.getTransactionCompile();
+		TransactionController tc = lcc.getTransactionExecute();
 		ConglomerateDescriptor[] cds;
 		long[] conglomerateNumber;
 		ExecIndexRow[] indexRow;

View raw message