teiid SVN: r4658 - branches/7.7.x/build/kits/jboss-container.
by teiid-commits@lists.jboss.org
Author: jolee
Date: 2014-09-16 16:27:59 -0400 (Tue, 16 Sep 2014)
New Revision: 4658
Modified:
branches/7.7.x/build/kits/jboss-container/teiid-releasenotes.html
Log:
BZ1108088: EDS_5.3.1_2_2014 + TEIID-2448: Oracle driver translation error (updated release notes)
Modified: branches/7.7.x/build/kits/jboss-container/teiid-releasenotes.html
===================================================================
--- branches/7.7.x/build/kits/jboss-container/teiid-releasenotes.html 2014-09-16 20:12:15 UTC (rev 4657)
+++ branches/7.7.x/build/kits/jboss-container/teiid-releasenotes.html 2014-09-16 20:27:59 UTC (rev 4658)
@@ -242,6 +242,8 @@
</h2>
<h4>From ${project.version}</h4>
<ul>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-2448'>TEIID-2448</a>] - Oracle driver translation error
+</li>
<li>[<a href='https://issues.jboss.org/browse/TEIID-2930'>TEIID-2930</a>] - SCROLL keyword for DECLARE CURSOR not being parsed correctly
</li>
<li>[<a href='https://issues.jboss.org/browse/TEIID-2985'>TEIID-2985/a>] - odbc script reader does not handle extra statement delimiters
10 years, 3 months
teiid SVN: r4657 - in branches/7.7.x: connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle and 3 other directories.
by teiid-commits@lists.jboss.org
Author: jolee
Date: 2014-09-16 16:12:15 -0400 (Tue, 16 Sep 2014)
New Revision: 4657
Modified:
branches/7.7.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/SQLConversionVisitor.java
branches/7.7.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java
branches/7.7.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestJDBCProcedureExecution.java
branches/7.7.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestSQLConversionVisitor.java
branches/7.7.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java
branches/7.7.x/engine/src/test/java/org/teiid/query/unittest/RealMetadataFactory.java
Log:
BZ1108088: EDS_5.3.1_2_2014 + TEIID-2448 correcting the oracle translation when no result or resultset is
present
Conflicts:
connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java
connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestSQLConversionVisitor.java
Modified: branches/7.7.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/SQLConversionVisitor.java
===================================================================
--- branches/7.7.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/SQLConversionVisitor.java 2014-08-27 16:18:03 UTC (rev 4656)
+++ branches/7.7.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/SQLConversionVisitor.java 2014-09-16 20:12:15 UTC (rev 4657)
@@ -328,20 +328,19 @@
*/
protected String generateSqlForStoredProcedure(Call exec) {
StringBuffer prepareCallBuffer = new StringBuffer();
- prepareCallBuffer.append("{ "); //$NON-NLS-1$
+ prepareCallBuffer.append(getSourceComment(exec));
+ prepareCallBuffer.append("{"); //$NON-NLS-1$
List<Argument> params = exec.getArguments();
//check whether a "?" is needed if there are returns
boolean needQuestionMark = exec.getReturnType() != null;
- prepareCallBuffer.append(getSourceComment(exec));
-
if(needQuestionMark){
- prepareCallBuffer.append("?="); //$NON-NLS-1$
+ prepareCallBuffer.append("?= "); //$NON-NLS-1$
}
- prepareCallBuffer.append(" call ");//$NON-NLS-1$
+ prepareCallBuffer.append("call ");//$NON-NLS-1$
prepareCallBuffer.append(exec.getMetadataObject() != null ? getName(exec.getMetadataObject()) : exec.getProcedureName());
prepareCallBuffer.append("("); //$NON-NLS-1$
Modified: branches/7.7.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java
===================================================================
--- branches/7.7.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java 2014-08-27 16:18:03 UTC (rev 4656)
+++ branches/7.7.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/oracle/OracleExecutionFactory.java 2014-09-16 20:12:15 UTC (rev 4657)
@@ -708,7 +708,7 @@
this.oracleSuppliedDriver = oracleNative;
}
- @TranslatorProperty(display="Oracle Native Driver", description="True if the driver is an Oracle supplied driver",advanced=true)
+ @TranslatorProperty(display="Oracle Supplied Driver", description="True if the driver is an Oracle supplied driver",advanced=true)
public boolean isOracleSuppliedDriver() {
return oracleSuppliedDriver;
}
@@ -717,7 +717,7 @@
public List<?> translate(LanguageObject obj, ExecutionContext context) {
if (oracleSuppliedDriver && obj instanceof Call) {
Call call = (Call)obj;
- if (call.getReturnType() == null && call.getMetadataObject() != null && call.getMetadataObject().getProperty(SQLConversionVisitor.TEIID_NATIVE_QUERY, false) == null) {
+ if (call.getReturnType() == null && call.getResultSetColumnTypes().length > 0 && call.getMetadataObject() != null && call.getMetadataObject().getProperty(SQLConversionVisitor.TEIID_NATIVE_QUERY, false) == null) {
//oracle returns the resultset as a parameter
call.setReturnType(RefCursorType.class);
}
Modified: branches/7.7.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestJDBCProcedureExecution.java
===================================================================
--- branches/7.7.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestJDBCProcedureExecution.java 2014-08-27 16:18:03 UTC (rev 4656)
+++ branches/7.7.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestJDBCProcedureExecution.java 2014-09-16 20:12:15 UTC (rev 4657)
@@ -22,7 +22,7 @@
package org.teiid.translator.jdbc;
-import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.*;
import java.sql.CallableStatement;
import java.sql.Connection;
@@ -42,7 +42,7 @@
CallableStatement cs = Mockito.mock(CallableStatement.class);
Mockito.stub(cs.getUpdateCount()).toReturn(-1);
Mockito.stub(cs.getInt(1)).toReturn(5);
- Mockito.stub(connection.prepareCall("{ call spTest8a(?)}")).toReturn(cs); //$NON-NLS-1$
+ Mockito.stub(connection.prepareCall("{call spTest8a(?)}")).toReturn(cs); //$NON-NLS-1$
JDBCExecutionFactory ef = new JDBCExecutionFactory();
JDBCProcedureExecution procedureExecution = new JDBCProcedureExecution(command, connection, Mockito.mock(ExecutionContext.class), ef);
@@ -56,7 +56,7 @@
CallableStatement cs = Mockito.mock(CallableStatement.class);
Mockito.stub(cs.getUpdateCount()).toReturn(-1);
Mockito.stub(cs.getInt(2)).toReturn(5);
- Mockito.stub(connection.prepareCall("{ call spTest8(?,?)}")).toReturn(cs); //$NON-NLS-1$
+ Mockito.stub(connection.prepareCall("{call spTest8(?,?)}")).toReturn(cs); //$NON-NLS-1$
JDBCExecutionFactory config = new JDBCExecutionFactory();
JDBCProcedureExecution procedureExecution = new JDBCProcedureExecution(command, connection, Mockito.mock(ExecutionContext.class), config);
Modified: branches/7.7.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestSQLConversionVisitor.java
===================================================================
--- branches/7.7.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestSQLConversionVisitor.java 2014-08-27 16:18:03 UTC (rev 4656)
+++ branches/7.7.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/TestSQLConversionVisitor.java 2014-09-16 20:12:15 UTC (rev 4657)
@@ -1,65 +1,65 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
package org.teiid.translator.jdbc;
-import static org.junit.Assert.*;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.teiid.dqp.internal.datamgr.ExecutionContextImpl;
-import org.teiid.dqp.internal.datamgr.TestDeleteImpl;
-import org.teiid.dqp.internal.datamgr.TestInsertImpl;
-import org.teiid.dqp.internal.datamgr.TestProcedureImpl;
-import org.teiid.dqp.internal.datamgr.TestQueryImpl;
-import org.teiid.dqp.internal.datamgr.TestUpdateImpl;
-import org.teiid.dqp.internal.datamgr.TstLanguageBridgeFactory;
-import org.teiid.language.LanguageObject;
-import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.ExecutionContext;
-import org.teiid.translator.TranslatorException;
-
+import static org.junit.Assert.*;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.teiid.dqp.internal.datamgr.ExecutionContextImpl;
+import org.teiid.dqp.internal.datamgr.TestDeleteImpl;
+import org.teiid.dqp.internal.datamgr.TestInsertImpl;
+import org.teiid.dqp.internal.datamgr.TestProcedureImpl;
+import org.teiid.dqp.internal.datamgr.TestQueryImpl;
+import org.teiid.dqp.internal.datamgr.TestUpdateImpl;
+import org.teiid.dqp.internal.datamgr.TstLanguageBridgeFactory;
+import org.teiid.language.LanguageObject;
+import org.teiid.metadata.RuntimeMetadata;
+import org.teiid.translator.ExecutionContext;
+import org.teiid.translator.TranslatorException;
+
/**
*/
public class TestSQLConversionVisitor {
public static final ExecutionContext context = new ExecutionContextImpl("VDB", //$NON-NLS-1$
- 1,
- "Payload", //$NON-NLS-1$
- "ConnectionID", //$NON-NLS-1$
- "Connector", //$NON-NLS-1$
- "RequestID", //$NON-NLS-1$
- "PartID", //$NON-NLS-1$
- "ExecCount"); //$NON-NLS-1$
-
- private static JDBCExecutionFactory TRANSLATOR;
-
- @BeforeClass public static void oneTimeSetup() throws TranslatorException {
- TRANSLATOR = new JDBCExecutionFactory();
- TRANSLATOR.setTrimStrings(true);
- TRANSLATOR.setUseBindVariables(false);
- TRANSLATOR.start();
- }
+ 1,
+ "Payload", //$NON-NLS-1$
+ "ConnectionID", //$NON-NLS-1$
+ "Connector", //$NON-NLS-1$
+ "RequestID", //$NON-NLS-1$
+ "PartID", //$NON-NLS-1$
+ "ExecCount"); //$NON-NLS-1$
+ private static JDBCExecutionFactory TRANSLATOR;
+
+ @BeforeClass public static void oneTimeSetup() throws TranslatorException {
+ TRANSLATOR = new JDBCExecutionFactory();
+ TRANSLATOR.setTrimStrings(true);
+ TRANSLATOR.setUseBindVariables(false);
+ TRANSLATOR.start();
+ }
+
public String getTestVDB() {
return TranslationHelper.PARTS_VDB;
}
@@ -68,29 +68,29 @@
helpTestVisitor(vdb, input, expectedOutput, false);
}
- public void helpTestVisitor(String vdb, String input, String expectedOutput, boolean usePreparedStatement) {
- JDBCExecutionFactory trans = new JDBCExecutionFactory();
- trans.setUseBindVariables(usePreparedStatement);
- try {
- trans.start();
- TranslationHelper.helpTestVisitor(vdb, input, expectedOutput, trans);
- } catch (TranslatorException e) {
- throw new RuntimeException(e);
- }
- }
+ public void helpTestVisitor(String vdb, String input, String expectedOutput, boolean usePreparedStatement) {
+ JDBCExecutionFactory trans = new JDBCExecutionFactory();
+ trans.setUseBindVariables(usePreparedStatement);
+ try {
+ trans.start();
+ TranslationHelper.helpTestVisitor(vdb, input, expectedOutput, trans);
+ } catch (TranslatorException e) {
+ throw new RuntimeException(e);
+ }
+ }
public static final RuntimeMetadata metadata = TstLanguageBridgeFactory.metadataFactory;
- private String getStringWithContext(LanguageObject obj) throws TranslatorException {
- JDBCExecutionFactory env = new JDBCExecutionFactory();
- env.setUseCommentsInSourceQuery(true);
- env.setUseBindVariables(false);
- env.start();
-
- SQLConversionVisitor visitor = env.getSQLConversionVisitor();
- visitor.setExecutionContext(context);
- visitor.append(obj);
- return visitor.toString();
+ private String getStringWithContext(LanguageObject obj) throws TranslatorException {
+ JDBCExecutionFactory env = new JDBCExecutionFactory();
+ env.setUseCommentsInSourceQuery(true);
+ env.setUseBindVariables(false);
+ env.start();
+
+ SQLConversionVisitor visitor = env.getSQLConversionVisitor();
+ visitor.setExecutionContext(context);
+ visitor.append(obj);
+ return visitor.toString();
}
@Test public void testSimple() {
@@ -389,57 +389,57 @@
}
@Test public void testVisitIProcedureWithComment() throws Exception {
- String expected = "{ /*teiid sessionid:ConnectionID, requestid:RequestID.PartID*/ call sq3(?,?)}"; //$NON-NLS-1$
+ String expected = "/*teiid sessionid:ConnectionID, requestid:RequestID.PartID*/ {call sq3(?,?)}"; //$NON-NLS-1$
assertEquals(expected, getStringWithContext(TestProcedureImpl.example()));
- }
-
- @Test public void testTrimStrings() throws Exception {
- TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB, "select stringkey from bqt1.smalla", "SELECT rtrim(SmallA.StringKey) FROM SmallA", TRANSLATOR); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- @Test public void testNestedSetQuery() throws Exception {
- String input = "select part_id id FROM parts UNION ALL (select part_name FROM parts UNION select part_id FROM parts)"; //$NON-NLS-1$
- String output = "SELECT rtrim(PARTS.PART_ID) AS id FROM PARTS UNION ALL (SELECT PARTS.PART_NAME FROM PARTS UNION SELECT rtrim(PARTS.PART_ID) FROM PARTS)"; //$NON-NLS-1$
-
- TranslationHelper.helpTestVisitor(TranslationHelper.PARTS_VDB,
- input,
- output, TRANSLATOR);
- }
-
- @Test public void testNestedSetQuery1() throws Exception {
- String input = "select part_id id FROM parts UNION (select part_name FROM parts EXCEPT select part_id FROM parts)"; //$NON-NLS-1$
- String output = "SELECT rtrim(PARTS.PART_ID) AS id FROM PARTS UNION (SELECT PARTS.PART_NAME FROM PARTS EXCEPT SELECT rtrim(PARTS.PART_ID) FROM PARTS)"; //$NON-NLS-1$
-
- TranslationHelper.helpTestVisitor(TranslationHelper.PARTS_VDB,
- input,
- output, TRANSLATOR);
- }
-
- @Test public void testNestedSetQuery2() throws Exception {
- String input = "select part_id id FROM parts UNION select part_name FROM parts EXCEPT select part_id FROM parts"; //$NON-NLS-1$
- String output = "SELECT rtrim(PARTS.PART_ID) AS id FROM PARTS UNION SELECT PARTS.PART_NAME FROM PARTS EXCEPT SELECT rtrim(PARTS.PART_ID) FROM PARTS"; //$NON-NLS-1$
-
- TranslationHelper.helpTestVisitor(TranslationHelper.PARTS_VDB,
- input,
- output, TRANSLATOR);
- }
-
- @Test public void testNestedSetQuery3() throws Exception {
- String input = "select part_id id FROM parts UNION (select part_name FROM parts Union ALL select part_id FROM parts)"; //$NON-NLS-1$
- String output = "SELECT rtrim(PARTS.PART_ID) AS id FROM PARTS UNION SELECT PARTS.PART_NAME FROM PARTS UNION SELECT rtrim(PARTS.PART_ID) FROM PARTS"; //$NON-NLS-1$
-
- TranslationHelper.helpTestVisitor(TranslationHelper.PARTS_VDB,
- input,
- output, TRANSLATOR);
- }
-
- @Test public void testOrderByUnrelated() throws Exception {
- String input = "select part_id id FROM parts order by part_name"; //$NON-NLS-1$
- String output = "SELECT rtrim(PARTS.PART_ID) AS id FROM PARTS ORDER BY PARTS.PART_NAME"; //$NON-NLS-1$
-
- TranslationHelper.helpTestVisitor(TranslationHelper.PARTS_VDB,
- input,
- output, TRANSLATOR);
- }
+ }
+
+ @Test public void testTrimStrings() throws Exception {
+ TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB, "select stringkey from bqt1.smalla", "SELECT rtrim(SmallA.StringKey) FROM SmallA", TRANSLATOR); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ @Test public void testNestedSetQuery() throws Exception {
+ String input = "select part_id id FROM parts UNION ALL (select part_name FROM parts UNION select part_id FROM parts)"; //$NON-NLS-1$
+ String output = "SELECT rtrim(PARTS.PART_ID) AS id FROM PARTS UNION ALL (SELECT PARTS.PART_NAME FROM PARTS UNION SELECT rtrim(PARTS.PART_ID) FROM PARTS)"; //$NON-NLS-1$
+
+ TranslationHelper.helpTestVisitor(TranslationHelper.PARTS_VDB,
+ input,
+ output, TRANSLATOR);
+ }
+
+ @Test public void testNestedSetQuery1() throws Exception {
+ String input = "select part_id id FROM parts UNION (select part_name FROM parts EXCEPT select part_id FROM parts)"; //$NON-NLS-1$
+ String output = "SELECT rtrim(PARTS.PART_ID) AS id FROM PARTS UNION (SELECT PARTS.PART_NAME FROM PARTS EXCEPT SELECT rtrim(PARTS.PART_ID) FROM PARTS)"; //$NON-NLS-1$
+
+ TranslationHelper.helpTestVisitor(TranslationHelper.PARTS_VDB,
+ input,
+ output, TRANSLATOR);
+ }
+
+ @Test public void testNestedSetQuery2() throws Exception {
+ String input = "select part_id id FROM parts UNION select part_name FROM parts EXCEPT select part_id FROM parts"; //$NON-NLS-1$
+ String output = "SELECT rtrim(PARTS.PART_ID) AS id FROM PARTS UNION SELECT PARTS.PART_NAME FROM PARTS EXCEPT SELECT rtrim(PARTS.PART_ID) FROM PARTS"; //$NON-NLS-1$
+
+ TranslationHelper.helpTestVisitor(TranslationHelper.PARTS_VDB,
+ input,
+ output, TRANSLATOR);
+ }
+
+ @Test public void testNestedSetQuery3() throws Exception {
+ String input = "select part_id id FROM parts UNION (select part_name FROM parts Union ALL select part_id FROM parts)"; //$NON-NLS-1$
+ String output = "SELECT rtrim(PARTS.PART_ID) AS id FROM PARTS UNION SELECT PARTS.PART_NAME FROM PARTS UNION SELECT rtrim(PARTS.PART_ID) FROM PARTS"; //$NON-NLS-1$
+
+ TranslationHelper.helpTestVisitor(TranslationHelper.PARTS_VDB,
+ input,
+ output, TRANSLATOR);
+ }
+
+ @Test public void testOrderByUnrelated() throws Exception {
+ String input = "select part_id id FROM parts order by part_name"; //$NON-NLS-1$
+ String output = "SELECT rtrim(PARTS.PART_ID) AS id FROM PARTS ORDER BY PARTS.PART_NAME"; //$NON-NLS-1$
+
+ TranslationHelper.helpTestVisitor(TranslationHelper.PARTS_VDB,
+ input,
+ output, TRANSLATOR);
+ }
}
Modified: branches/7.7.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java
===================================================================
--- branches/7.7.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java 2014-08-27 16:18:03 UTC (rev 4656)
+++ branches/7.7.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java 2014-09-16 20:12:15 UTC (rev 4657)
@@ -871,13 +871,22 @@
@Test public void testCallWithResultSet() throws Exception {
String input = "call spTest5(1)"; //$NON-NLS-1$
- String output = "{ ?= call spTest5(?)}"; //$NON-NLS-1$
+ String output = "{?= call spTest5(?)}"; //$NON-NLS-1$
TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB,
input, output,
TRANSLATOR);
}
+ @Test public void testCallWithoutResultSet() throws Exception {
+ String input = "call sp_noreturn()"; //$NON-NLS-1$
+ String output = "{call sp_noreturn()}"; //$NON-NLS-1$
+
+ TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB,
+ input, output,
+ TRANSLATOR);
+ }
+
@Test public void testProcedureExecution() throws Exception {
Command command = TranslationHelper.helpTranslate(TranslationHelper.BQT_VDB, "call spTest8(1)"); //$NON-NLS-1$
Connection connection = Mockito.mock(Connection.class);
@@ -886,7 +895,7 @@
ResultSet rs = Mockito.mock(ResultSet.class);
Mockito.stub(cs.getObject(1)).toReturn(rs);
Mockito.stub(cs.getInt(3)).toReturn(4);
- Mockito.stub(connection.prepareCall("{ ?= call spTest8(?,?)}")).toReturn(cs); //$NON-NLS-1$
+ Mockito.stub(connection.prepareCall("{?= call spTest8(?,?)}")).toReturn(cs); //$NON-NLS-1$
OracleExecutionFactory ef = new OracleExecutionFactory();
JDBCProcedureExecution procedureExecution = new JDBCProcedureExecution(command, connection, Mockito.mock(ExecutionContext.class), ef);
Modified: branches/7.7.x/engine/src/test/java/org/teiid/query/unittest/RealMetadataFactory.java
===================================================================
--- branches/7.7.x/engine/src/test/java/org/teiid/query/unittest/RealMetadataFactory.java 2014-08-27 16:18:03 UTC (rev 4656)
+++ branches/7.7.x/engine/src/test/java/org/teiid/query/unittest/RealMetadataFactory.java 2014-09-16 20:12:15 UTC (rev 4657)
@@ -27,6 +27,7 @@
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.Iterator;
import java.util.List;
@@ -308,6 +309,9 @@
Procedure vsp9 = createVirtualProcedure("TEIIDSP9", mmspTest1, Arrays.asList(vsp9p1, vsp9p2, vsp9p3), vspqn9); //$NON-NLS-1$
vsp9.setResultSet(vsprs9);
+ createStoredProcedure("sp_noreturn", pm4, Collections.EMPTY_LIST); //$NON-NLS-1$ //$NON-NLS-2$
+
+
// this is for the source added function
bqt1.addFunction(new FunctionMethod("reverse", "reverse", "misc", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
new FunctionParameter[] {new FunctionParameter("columnName", DataTypeManager.DefaultDataTypes.STRING, "")}, //$NON-NLS-1$ //$NON-NLS-2$
10 years, 3 months
[teiid/teiid] b8d991: TEIID-3130 preventing npes
by shawkins
Branch: refs/heads/8.7.x
Home: https://github.com/teiid/teiid
Commit: b8d991562711ed05e7608b314a3864df6bc64206
https://github.com/teiid/teiid/commit/b8d991562711ed05e7608b314a3864df6bc...
Author: shawkins <shawkins(a)redhat.com>
Date: 2014-09-16 (Tue, 16 Sep 2014)
Changed paths:
M api/src/main/java/org/teiid/translator/FileConnection.java
M api/src/main/resources/org/teiid/connector/i18n.properties
M connectors/translator-excel/src/main/java/org/teiid/translator/excel/ExcelExecution.java
M connectors/translator-excel/src/test/java/org/teiid/translator/excel/TestExcelExecution.java
M connectors/translator-file/src/main/java/org/teiid/translator/file/FileExecutionFactory.java
M connectors/translator-file/src/main/resources/org/teiid/translator/file/i18n.properties
Log Message:
-----------
TEIID-3130 preventing npes
10 years, 3 months
[teiid/teiid] 623161: TEIID-3130 preventing npes
by shawkins
Branch: refs/heads/master
Home: https://github.com/teiid/teiid
Commit: 6231614d2283a3f814f51ab91361ceed7fcfaebf
https://github.com/teiid/teiid/commit/6231614d2283a3f814f51ab91361ceed7fc...
Author: shawkins <shawkins(a)redhat.com>
Date: 2014-09-16 (Tue, 16 Sep 2014)
Changed paths:
M api/src/main/java/org/teiid/translator/FileConnection.java
M api/src/main/resources/org/teiid/connector/i18n.properties
M connectors/translator-excel/src/main/java/org/teiid/translator/excel/ExcelExecution.java
M connectors/translator-excel/src/test/java/org/teiid/translator/excel/TestExcelExecution.java
M connectors/translator-file/src/main/java/org/teiid/translator/file/FileExecutionFactory.java
M connectors/translator-file/src/main/resources/org/teiid/translator/file/i18n.properties
Log Message:
-----------
TEIID-3130 preventing npes
10 years, 3 months