Author: shawkins
Date: 2011-11-22 13:01:23 -0500 (Tue, 22 Nov 2011)
New Revision: 3689
Modified:
trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java
trunk/engine/src/main/java/org/teiid/query/sql/proc/CreateProcedureCommand.java
trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj
trunk/engine/src/test/java/org/teiid/query/parser/TestParser.java
trunk/engine/src/test/java/org/teiid/query/sql/proc/TestCreateUpdateProcedureCommand.java
Log:
TEIID-1842 completely removing the concept of an update procedure
Modified: trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java 2011-11-22
16:58:35 UTC (rev 3688)
+++ trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java 2011-11-22
18:01:23 UTC (rev 3689)
@@ -2652,7 +2652,6 @@
Block b = new Block();
b.addStatement(new CommandStatement(newUpdate));
CreateProcedureCommand cupc = new CreateProcedureCommand();
- cupc.setUpdateProcedure(false);
Block parent = new Block();
parent.setAtomic(true);
ElementSymbol rowsUpdated = new
ElementSymbol(ProcedureReservedWords.VARIABLES+ElementSymbol.SEPARATOR+"ROWS_UPDATED");
//$NON-NLS-1$
Modified: trunk/engine/src/main/java/org/teiid/query/sql/proc/CreateProcedureCommand.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/query/sql/proc/CreateProcedureCommand.java 2011-11-22
16:58:35 UTC (rev 3688)
+++
trunk/engine/src/main/java/org/teiid/query/sql/proc/CreateProcedureCommand.java 2011-11-22
18:01:23 UTC (rev 3689)
@@ -50,9 +50,6 @@
// the command the user submitted against the virtual group being updated
private Command userCommand;
- //whether it is update procedure or virtual stored procedure, default to update
procedure
- private boolean isUpdateProcedure = true;
-
private List projectedSymbols;
private GroupSymbol virtualGroup;
@@ -202,33 +199,22 @@
if(this.projectedSymbols != null){
return this.projectedSymbols;
}
- if(!isUpdateProcedure){
- if(this.resultsCommand == null){
- //user may have not entered any query yet
- return Collections.EMPTY_LIST;
- }
- List<? extends SingleElementSymbol> symbols =
this.resultsCommand.getProjectedSymbols();
- if (this.resultsCommand instanceof StoredProcedure) {
- StoredProcedure sp = (StoredProcedure)this.resultsCommand;
- if (sp.isCallableStatement()) {
- symbols = sp.getResultSetColumns();
- }
- }
- setProjectedSymbols(symbols);
- return this.projectedSymbols;
+ if(this.resultsCommand == null){
+ //user may have not entered any query yet
+ return Collections.EMPTY_LIST;
}
- this.projectedSymbols = Command.getUpdateCommandSymbol();
- return this.projectedSymbols;
+ List<? extends SingleElementSymbol> symbols =
this.resultsCommand.getProjectedSymbols();
+ if (this.resultsCommand instanceof StoredProcedure) {
+ StoredProcedure sp = (StoredProcedure)this.resultsCommand;
+ if (sp.isCallableStatement()) {
+ symbols = sp.getResultSetColumns();
+ }
+ }
+ setProjectedSymbols(symbols);
+ return this.projectedSymbols;
}
/**
- * @param isUpdateProcedure
- */
- public void setUpdateProcedure(boolean isUpdateProcedure) {
- this.isUpdateProcedure = isUpdateProcedure;
- }
-
- /**
* @param projSymbols
*/
public void setProjectedSymbols(List projSymbols) {
Modified: trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj
===================================================================
--- trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj 2011-11-22 16:58:35
UTC (rev 3688)
+++ trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj 2011-11-22 18:01:23
UTC (rev 3689)
@@ -551,7 +551,6 @@
| (<PROCEDURE> target = id() <AS> { comment = getToken(1).specialToken; }
stmt = statement(info))
{
CreateProcedureCommand cup = new CreateProcedureCommand(asBlock(stmt));
- cup.setUpdateProcedure(false);
if (comment != null) {
cup.setCacheHint(getQueryCacheOption(comment.image));
}
@@ -1069,8 +1068,8 @@
<CREATE> [<VIRTUAL>] <PROCEDURE>
stmt = statement(info)
{
- updateProcCmd.setBlock(asBlock(stmt));
- return updateProcCmd;
+ procCmd.setBlock(asBlock(stmt));
+ return procCmd;
}
}
Modified: trunk/engine/src/test/java/org/teiid/query/parser/TestParser.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/parser/TestParser.java 2011-11-22 16:58:35
UTC (rev 3688)
+++ trunk/engine/src/test/java/org/teiid/query/parser/TestParser.java 2011-11-22 18:01:23
UTC (rev 3689)
@@ -3890,7 +3890,6 @@
CreateProcedureCommand virtualProcedureCommand = new CreateProcedureCommand();
virtualProcedureCommand.setBlock(block);
- virtualProcedureCommand.setUpdateProcedure(false);
helpTest("CREATE VIRTUAL PROCEDURE BEGIN DECLARE integer x; LOOP ON (SELECT
c1, c2 FROM m.g) AS mycursor BEGIN x=mycursor.c1; IF(x > 5) BEGIN CONTINUE; END END
SELECT c1, c2 FROM m.g; END", //$NON-NLS-1$
"CREATE VIRTUAL PROCEDURE\nBEGIN\nDECLARE integer x;\n" //$NON-NLS-1$
Modified:
trunk/engine/src/test/java/org/teiid/query/sql/proc/TestCreateUpdateProcedureCommand.java
===================================================================
---
trunk/engine/src/test/java/org/teiid/query/sql/proc/TestCreateUpdateProcedureCommand.java 2011-11-22
16:58:35 UTC (rev 3688)
+++
trunk/engine/src/test/java/org/teiid/query/sql/proc/TestCreateUpdateProcedureCommand.java 2011-11-22
18:01:23 UTC (rev 3689)
@@ -101,7 +101,6 @@
public void testProjectedSymbols() {
CreateProcedureCommand cupc = new CreateProcedureCommand();
- cupc.setUpdateProcedure(false);
StoredProcedure sp = (StoredProcedure)TestResolver.helpResolve("call
TEIIDSP9(p1=>1, p2=>?)", RealMetadataFactory.exampleBQTCached());
sp.setCallableStatement(true);
cupc.setResultsCommand(sp);
Show replies by date