teiid SVN: r3374 - in trunk: build/kits/jboss-container and 15 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-08-10 16:39:40 -0400 (Wed, 10 Aug 2011)
New Revision: 3374
Added:
trunk/connectors/connector-file/src/test/java/org/
trunk/connectors/connector-file/src/test/java/org/teiid/
trunk/connectors/connector-file/src/test/java/org/teiid/resource/
trunk/connectors/connector-file/src/test/java/org/teiid/resource/adapter/
trunk/connectors/connector-file/src/test/java/org/teiid/resource/adapter/file/
trunk/connectors/connector-file/src/test/java/org/teiid/resource/adapter/file/TestFileConnection.java
Modified:
trunk/api/src/main/java/org/teiid/translator/FileConnection.java
trunk/build/kits/jboss-container/teiid-examples/jca/file-ds.xml
trunk/build/kits/jboss-container/teiid-releasenotes.html
trunk/common-core/src/main/java/org/teiid/core/util/StringUtil.java
trunk/connectors/connector-file/src/main/java/org/teiid/resource/adapter/file/FileConnectionImpl.java
trunk/connectors/connector-file/src/main/java/org/teiid/resource/adapter/file/FileManagedConnectionFactory.java
trunk/connectors/connector-file/src/main/rar/META-INF/ra.xml
trunk/connectors/connector-file/src/main/resources/org/teiid/resource/adapter/file/i18n.properties
trunk/connectors/translator-file/src/main/java/org/teiid/translator/file/FileExecutionFactory.java
trunk/connectors/translator-file/src/main/resources/org/teiid/translator/file/i18n.properties
trunk/documentation/admin-guide/src/main/docbook/en-US/content/vdb-deployment.xml
trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml
Log:
TEIID-1634 TEIID-1702 adding enhancements to file logic.
Modified: trunk/api/src/main/java/org/teiid/translator/FileConnection.java
===================================================================
--- trunk/api/src/main/java/org/teiid/translator/FileConnection.java 2011-08-10 20:35:57 UTC (rev 3373)
+++ trunk/api/src/main/java/org/teiid/translator/FileConnection.java 2011-08-10 20:39:40 UTC (rev 3374)
@@ -23,6 +23,7 @@
import java.io.File;
+import javax.resource.ResourceException;
import javax.resource.cci.Connection;
import org.teiid.core.util.FileUtils;
@@ -37,7 +38,7 @@
* @param path
* @return
*/
- File getFile(String path);
+ File getFile(String path) throws ResourceException;
public static class Util {
@@ -48,7 +49,7 @@
* @param path
* @return
*/
- public static File[] getFiles(String location, FileConnection fc) {
+ public static File[] getFiles(String location, FileConnection fc) throws ResourceException {
File datafile = fc.getFile(location);
if (datafile.isDirectory()) {
Modified: trunk/build/kits/jboss-container/teiid-examples/jca/file-ds.xml
===================================================================
--- trunk/build/kits/jboss-container/teiid-examples/jca/file-ds.xml 2011-08-10 20:35:57 UTC (rev 3373)
+++ trunk/build/kits/jboss-container/teiid-examples/jca/file-ds.xml 2011-08-10 20:39:40 UTC (rev 3374)
@@ -13,6 +13,17 @@
<!-- Directory where the data files are stored -->
<config-property name="ParentDirectory" type="java.lang.String">directory</config-property>
+
+ <!-- Optional properties -->
+
+ <!-- Set FileMapping to redirect specific relative paths (case sensitive) to alternative locations.
+ The string value specifies a map in the format key=value(,key=value)*
+ -->
+ <!-- <config-property name="FileMapping" type="java.lang.String">file1.txt=fileX.txt,file2.txt=fileY.txt</config-property> -->
+
+ <!-- Set AllowParentPaths to false to disallow .. in paths.
+ This prevent requesting files that are not contained in the parent directory -->
+ <config-property name="AllowParentPaths" type="java.lang.Boolean">true</config-property>
<max-pool-size>20</max-pool-size>
Modified: trunk/build/kits/jboss-container/teiid-releasenotes.html
===================================================================
--- trunk/build/kits/jboss-container/teiid-releasenotes.html 2011-08-10 20:35:57 UTC (rev 3373)
+++ trunk/build/kits/jboss-container/teiid-releasenotes.html 2011-08-10 20:39:40 UTC (rev 3374)
@@ -27,6 +27,7 @@
<H2><A NAME="Highlights"></A>Highlights</H2>
<UL>
<LI><B>Procedure language features</B> - Added support for compound/block statements, BEGIN [[NOT] ATOMIC], loop/block labels, and the leave statement. See the reference for more.
+ <LI><B>File Enhancements</B> - the file translator can now optionally (via the ExceptionIfFileNotFound property) throw an exception if the path refers to a file that doesn't exist. The file resource adapter can be configured to map file names and can prevent parent path .. references. See the Admin Guide or the file-ds.xml template for more.
</UL>
<h2><a name="Compatibility">Compatibility Issues</a></h2>
@@ -189,6 +190,7 @@
<h4>From 7.4</h4>
<ul>
+ <li>Saxon was upgraded to 9.2.1.5
<li>nux 1.6, and xom 1.2 were added.
</ul>
<h4>From 7.1</h4>
Modified: trunk/common-core/src/main/java/org/teiid/core/util/StringUtil.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/util/StringUtil.java 2011-08-10 20:35:57 UTC (rev 3373)
+++ trunk/common-core/src/main/java/org/teiid/core/util/StringUtil.java 2011-08-10 20:39:40 UTC (rev 3374)
@@ -947,7 +947,9 @@
*/
@SuppressWarnings("unchecked")
public static <T> T valueOf(String value, Class type){
-
+ if (value == null) {
+ return null;
+ }
if(type == String.class) {
return (T) value;
}
Modified: trunk/connectors/connector-file/src/main/java/org/teiid/resource/adapter/file/FileConnectionImpl.java
===================================================================
--- trunk/connectors/connector-file/src/main/java/org/teiid/resource/adapter/file/FileConnectionImpl.java 2011-08-10 20:35:57 UTC (rev 3373)
+++ trunk/connectors/connector-file/src/main/java/org/teiid/resource/adapter/file/FileConnectionImpl.java 2011-08-10 20:39:40 UTC (rev 3374)
@@ -23,6 +23,9 @@
package org.teiid.resource.adapter.file;
import java.io.File;
+import java.util.Collections;
+import java.util.Map;
+import java.util.regex.Pattern;
import javax.resource.ResourceException;
@@ -36,17 +39,32 @@
public class FileConnectionImpl extends BasicConnection implements FileConnection {
private File parentDirectory;
+ private Map<String, String> fileMapping;
+ private boolean allowParentPaths;
+ private static final Pattern parentRef = Pattern.compile("(^\\.\\.(\\\\{2}|/)?.*)|((\\\\{2}|/)\\.\\.)"); //$NON-NLS-1$
- public FileConnectionImpl(String parentDirectory) {
+ public FileConnectionImpl(String parentDirectory, Map<String, String> fileMapping, boolean allowParentPaths) {
this.parentDirectory = new File(parentDirectory);
+ if (fileMapping == null) {
+ fileMapping = Collections.emptyMap();
+ }
+ this.fileMapping = fileMapping;
+ this.allowParentPaths = allowParentPaths;
}
@Override
- public File getFile(String path) {
+ public File getFile(String path) throws ResourceException {
if (path == null) {
return this.parentDirectory;
}
- return new File(parentDirectory, path);
+ String altPath = fileMapping.get(path);
+ if (altPath != null) {
+ path = altPath;
+ }
+ if (!allowParentPaths && parentRef.matcher(path).matches()) {
+ throw new ResourceException(FileManagedConnectionFactory.UTIL.getString("parentpath_not_allowed", path)); //$NON-NLS-1$
+ }
+ return new File(parentDirectory, path);
}
@Override
Modified: trunk/connectors/connector-file/src/main/java/org/teiid/resource/adapter/file/FileManagedConnectionFactory.java
===================================================================
--- trunk/connectors/connector-file/src/main/java/org/teiid/resource/adapter/file/FileManagedConnectionFactory.java 2011-08-10 20:35:57 UTC (rev 3373)
+++ trunk/connectors/connector-file/src/main/java/org/teiid/resource/adapter/file/FileManagedConnectionFactory.java 2011-08-10 20:39:40 UTC (rev 3374)
@@ -21,10 +21,13 @@
*/
package org.teiid.resource.adapter.file;
+import java.util.Map;
+
import javax.resource.ResourceException;
import javax.resource.spi.InvalidPropertyException;
import org.teiid.core.BundleUtil;
+import org.teiid.core.util.StringUtil;
import org.teiid.resource.spi.BasicConnection;
import org.teiid.resource.spi.BasicConnectionFactory;
import org.teiid.resource.spi.BasicManagedConnectionFactory;
@@ -35,17 +38,20 @@
public static final BundleUtil UTIL = BundleUtil.getBundleUtil(FileManagedConnectionFactory.class);
private String parentDirectory;
+ private String fileMapping;
+ private boolean allowParentPaths = true;
@Override
public BasicConnectionFactory createConnectionFactory() throws ResourceException {
if (this.parentDirectory == null) {
throw new InvalidPropertyException(UTIL.getString("parentdirectory_not_set")); //$NON-NLS-1$
}
+ final Map<String, String> map = StringUtil.valueOf(this.fileMapping, Map.class);
return new BasicConnectionFactory() {
@Override
public BasicConnection getConnection() throws ResourceException {
- return new FileConnectionImpl(parentDirectory);
+ return new FileConnectionImpl(parentDirectory, map, allowParentPaths);
}
};
}
@@ -58,4 +64,20 @@
this.parentDirectory = parentDirectory;
}
+ public String getFileMapping() {
+ return fileMapping;
+ }
+
+ public void setFileMapping(String fileMapping) {
+ this.fileMapping = fileMapping;
+ }
+
+ public boolean isAllowParentPaths() {
+ return allowParentPaths;
+ }
+
+ public void setAllowParentPaths(boolean allowParentPaths) {
+ this.allowParentPaths = allowParentPaths;
+ }
+
}
Modified: trunk/connectors/connector-file/src/main/rar/META-INF/ra.xml
===================================================================
--- trunk/connectors/connector-file/src/main/rar/META-INF/ra.xml 2011-08-10 20:35:57 UTC (rev 3373)
+++ trunk/connectors/connector-file/src/main/rar/META-INF/ra.xml 2011-08-10 20:39:40 UTC (rev 3374)
@@ -46,6 +46,19 @@
<config-property-type>java.lang.String</config-property-type>
</config-property>
+ <config-property>
+ <description>{$display:"File Mapping"}</description>
+ <config-property-name>FileMapping</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ </config-property>
+
+ <config-property>
+ <description>{$display:"Allow Parent Paths"}</description>
+ <config-property-name>AllowParentPaths</config-property-name>
+ <config-property-type>java.lang.Boolean</config-property-type>
+ <config-property-value>true</config-property-value>
+ </config-property>
+
<connectionfactory-interface>javax.resource.cci.ConnectionFactory</connectionfactory-interface>
<connectionfactory-impl-class>org.teiid.resource.spi.WrappedConnectionFactory</connectionfactory-impl-class>
<connection-interface>javax.resource.cci.Connection</connection-interface>
Modified: trunk/connectors/connector-file/src/main/resources/org/teiid/resource/adapter/file/i18n.properties
===================================================================
--- trunk/connectors/connector-file/src/main/resources/org/teiid/resource/adapter/file/i18n.properties 2011-08-10 20:35:57 UTC (rev 3373)
+++ trunk/connectors/connector-file/src/main/resources/org/teiid/resource/adapter/file/i18n.properties 2011-08-10 20:39:40 UTC (rev 3374)
@@ -20,4 +20,5 @@
# 02110-1301 USA.
#
-parentdirectory_not_set=ParentDirectory is not set
\ No newline at end of file
+parentdirectory_not_set=ParentDirectory is not set
+parentpath_not_allowed=Parent path .. not allowed in file path {0}
\ No newline at end of file
Added: trunk/connectors/connector-file/src/test/java/org/teiid/resource/adapter/file/TestFileConnection.java
===================================================================
--- trunk/connectors/connector-file/src/test/java/org/teiid/resource/adapter/file/TestFileConnection.java (rev 0)
+++ trunk/connectors/connector-file/src/test/java/org/teiid/resource/adapter/file/TestFileConnection.java 2011-08-10 20:39:40 UTC (rev 3374)
@@ -0,0 +1,68 @@
+/*
+ * 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.resource.adapter.file;
+
+import static org.junit.Assert.*;
+
+import java.io.File;
+
+import javax.resource.ResourceException;
+
+import org.junit.Test;
+import org.teiid.resource.spi.BasicConnectionFactory;
+import org.teiid.translator.FileConnection;
+
+@SuppressWarnings("nls")
+public class TestFileConnection {
+
+ @Test public void testFileMapping() throws Exception {
+ FileManagedConnectionFactory fmcf = new FileManagedConnectionFactory();
+ fmcf.setParentDirectory("foo");
+ fmcf.setFileMapping("x=y,z=a");
+ BasicConnectionFactory bcf = fmcf.createConnectionFactory();
+ FileConnection fc = (FileConnection)bcf.getConnection();
+ File f = fc.getFile("x");
+ assertEquals("foo/y", f.getPath());
+ f = fc.getFile("n");
+ assertEquals("foo/n", f.getPath());
+ }
+
+ @Test(expected=ResourceException.class) public void testParentPaths() throws Exception {
+ FileManagedConnectionFactory fmcf = new FileManagedConnectionFactory();
+ fmcf.setParentDirectory("foo");
+ fmcf.setAllowParentPaths(false);
+ BasicConnectionFactory bcf = fmcf.createConnectionFactory();
+ FileConnection fc = (FileConnection)bcf.getConnection();
+ fc.getFile("../x");
+ }
+
+ @Test public void testParentPaths1() throws Exception {
+ FileManagedConnectionFactory fmcf = new FileManagedConnectionFactory();
+ fmcf.setParentDirectory("foo");
+ fmcf.setAllowParentPaths(true);
+ BasicConnectionFactory bcf = fmcf.createConnectionFactory();
+ FileConnection fc = (FileConnection)bcf.getConnection();
+ fc.getFile("../x");
+ }
+
+}
Property changes on: trunk/connectors/connector-file/src/test/java/org/teiid/resource/adapter/file/TestFileConnection.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/connectors/translator-file/src/main/java/org/teiid/translator/file/FileExecutionFactory.java
===================================================================
--- trunk/connectors/translator-file/src/main/java/org/teiid/translator/file/FileExecutionFactory.java 2011-08-10 20:35:57 UTC (rev 3373)
+++ trunk/connectors/translator-file/src/main/java/org/teiid/translator/file/FileExecutionFactory.java 2011-08-10 20:39:40 UTC (rev 3374)
@@ -34,6 +34,7 @@
import java.util.Collections;
import java.util.List;
+import javax.resource.ResourceException;
import javax.resource.cci.ConnectionFactory;
import org.teiid.core.BundleUtil;
@@ -80,7 +81,15 @@
@Override
public void execute() throws TranslatorException {
- files = FileConnection.Util.getFiles((String)command.getArguments().get(0).getArgumentValue().getValue(), fc);
+ String path = (String)command.getArguments().get(0).getArgumentValue().getValue();
+ try {
+ files = FileConnection.Util.getFiles(path, fc);
+ } catch (ResourceException e) {
+ throw new TranslatorException(e);
+ }
+ if (files == null && exceptionIfFileNotFound) {
+ throw new TranslatorException(UTIL.getString("file_not_found", path)); //$NON-NLS-1$
+ }
LogManager.logDetail(LogConstants.CTX_CONNECTOR, "Getting", files != null ? files.length : 0, "file(s)"); //$NON-NLS-1$ //$NON-NLS-2$
String name = command.getProcedureName();
if (name.equalsIgnoreCase(GETTEXTFILES)) {
@@ -136,6 +145,7 @@
public static final String SAVEFILE = "saveFile"; //$NON-NLS-1$
private Charset encoding = Charset.defaultCharset();
+ private boolean exceptionIfFileNotFound;
@TranslatorProperty(display="File Encoding",advanced=true)
public String getEncoding() {
@@ -146,6 +156,15 @@
this.encoding = Charset.forName(encoding);
}
+ @TranslatorProperty(display="Exception if file not found",advanced=true)
+ public boolean isExceptionIfFileNotFound() {
+ return exceptionIfFileNotFound;
+ }
+
+ public void setExceptionIfFileNotFound(boolean exceptionIfFileNotFound) {
+ this.exceptionIfFileNotFound = exceptionIfFileNotFound;
+ }
+
//@Override
public ProcedureExecution createProcedureExecution(final Call command,
final ExecutionContext executionContext, final RuntimeMetadata metadata,
@@ -178,6 +197,8 @@
throw new TranslatorException(e, UTIL.getString("error_writing")); //$NON-NLS-1$
} catch (SQLException e) {
throw new TranslatorException(e, UTIL.getString("error_writing")); //$NON-NLS-1$
+ } catch (ResourceException e) {
+ throw new TranslatorException(e, UTIL.getString("error_writing")); //$NON-NLS-1$
}
}
Modified: trunk/connectors/translator-file/src/main/resources/org/teiid/translator/file/i18n.properties
===================================================================
--- trunk/connectors/translator-file/src/main/resources/org/teiid/translator/file/i18n.properties 2011-08-10 20:35:57 UTC (rev 3373)
+++ trunk/connectors/translator-file/src/main/resources/org/teiid/translator/file/i18n.properties 2011-08-10 20:39:40 UTC (rev 3374)
@@ -22,4 +22,5 @@
non_null=Expected non-null values for filePath and file
unknown_type=Unknown type for file, was expecting an XML, CLOB, or BLOB value
-error_writing=Error writing file
\ No newline at end of file
+error_writing=Error writing file
+file_not_found=File not found {0}
\ No newline at end of file
Modified: trunk/documentation/admin-guide/src/main/docbook/en-US/content/vdb-deployment.xml
===================================================================
--- trunk/documentation/admin-guide/src/main/docbook/en-US/content/vdb-deployment.xml 2011-08-10 20:35:57 UTC (rev 3373)
+++ trunk/documentation/admin-guide/src/main/docbook/en-US/content/vdb-deployment.xml 2011-08-10 20:39:40 UTC (rev 3374)
@@ -134,6 +134,17 @@
<rar-name>teiid-connector-file.rar</rar-name>
<connection-definition>javax.resource.cci.ConnectionFactory</connection-definition>
<config-property name="ParentDirectory">path-to-the-directory-of-data-file</config-property>
+
+ <!-- Optional properties -->
+
+ <!-- Set FileMapping to redirect specific relative paths (case sensitive) to alternative locations.
+ The string value specifies a map in the format key=value(,key=value)*
+ -->
+ <!-- <config-property name="FileMapping" type="java.lang.String">file1.txt=fileX.txt,file2.txt=fileY.txt</config-property> -->
+
+ <!-- Set AllowParentPaths to false to disallow .. in paths.
+ This prevent requesting files that are not contained in the parent directory -->
+ <config-property name="AllowParentPaths" type="java.lang.Boolean">true</config-property>
</no-tx-connection-factory>
</connection-factories>]]></programlisting></example>
</section>
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml 2011-08-10 20:35:57 UTC (rev 3373)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml 2011-08-10 20:39:40 UTC (rev 3374)
@@ -162,6 +162,11 @@
<entry>The encoding that should be used for CLOBs returned by the getTextFiles procedure</entry>
<entry>The system default encoding</entry>
</row>
+ <row>
+ <entry>ExceptionIfFileNotFound</entry>
+ <entry>Throw an exception in getFiles or getTextFiles if the specified file/directory does not exist.</entry>
+ <entry>false</entry>
+ </row>
</tbody>
</tgroup>
</table>
@@ -178,7 +183,7 @@
If the extension path is specified, then it will filter all of the file in the directory referenced by the base path.
If the extension pattern is not specified and the path is a directory,
then all files in the directory will be returned. Otherwise the single file referenced will be returned. If the path
- doesn't exist, then no results will be returned.
+ doesn't exist, then no results will be returned if ExceptionIfFileNotFound is false, otherwise an exception will be raised.
</para>
<para>
14 years, 8 months
teiid SVN: r3373 - branches/7.4.x/build/kits/jboss-container.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-08-10 16:35:57 -0400 (Wed, 10 Aug 2011)
New Revision: 3373
Modified:
branches/7.4.x/build/kits/jboss-container/teiid-releasenotes.html
Log:
SOA-3162 adding a release note
Modified: branches/7.4.x/build/kits/jboss-container/teiid-releasenotes.html
===================================================================
--- branches/7.4.x/build/kits/jboss-container/teiid-releasenotes.html 2011-08-10 20:06:04 UTC (rev 3372)
+++ branches/7.4.x/build/kits/jboss-container/teiid-releasenotes.html 2011-08-10 20:35:57 UTC (rev 3373)
@@ -226,6 +226,7 @@
<h4>From 7.4</h4>
<ul>
+ <li>Saxon was upgraded to 9.2.1.5
<li>nux 1.6, and xom 1.2 were added.
</ul>
<h4>From 7.1</h4>
14 years, 8 months
teiid SVN: r3372 - in trunk: build/kits/jboss-container and 25 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-08-10 16:06:04 -0400 (Wed, 10 Aug 2011)
New Revision: 3372
Added:
trunk/engine/src/main/java/org/teiid/query/processor/proc/BranchingInstruction.java
trunk/engine/src/main/java/org/teiid/query/sql/proc/BranchingStatement.java
Removed:
trunk/engine/src/main/java/org/teiid/query/processor/proc/BreakInstruction.java
trunk/engine/src/main/java/org/teiid/query/processor/proc/ContinueInstruction.java
trunk/engine/src/main/java/org/teiid/query/sql/proc/BreakStatement.java
trunk/engine/src/main/java/org/teiid/query/sql/proc/ContinueStatement.java
trunk/engine/src/test/java/org/teiid/query/sql/proc/TestContinueStatement.java
Modified:
trunk/api/src/main/java/org/teiid/language/SQLConstants.java
trunk/build/kits/jboss-container/teiid-releasenotes.html
trunk/client/src/test/java/org/teiid/jdbc/TestStatement.java
trunk/common-core/src/main/java/org/teiid/core/util/StringUtil.java
trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesForceExecutionFactory.java
trunk/documentation/reference/src/main/docbook/en-US/content/grammar.xml
trunk/documentation/reference/src/main/docbook/en-US/content/procedures.xml
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/CapabilitiesConverter.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java
trunk/engine/src/main/java/org/teiid/query/optimizer/ProcedurePlanner.java
trunk/engine/src/main/java/org/teiid/query/parser/SQLParserUtil.java
trunk/engine/src/main/java/org/teiid/query/processor/proc/ExecDynamicSqlInstruction.java
trunk/engine/src/main/java/org/teiid/query/processor/proc/LoopInstruction.java
trunk/engine/src/main/java/org/teiid/query/processor/proc/ProcedurePlan.java
trunk/engine/src/main/java/org/teiid/query/processor/proc/Program.java
trunk/engine/src/main/java/org/teiid/query/processor/proc/RepeatedInstruction.java
trunk/engine/src/main/java/org/teiid/query/processor/proc/WhileInstruction.java
trunk/engine/src/main/java/org/teiid/query/resolver/command/UpdateProcedureResolver.java
trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java
trunk/engine/src/main/java/org/teiid/query/sql/LanguageVisitor.java
trunk/engine/src/main/java/org/teiid/query/sql/navigator/PreOrPostOrderNavigator.java
trunk/engine/src/main/java/org/teiid/query/sql/proc/Block.java
trunk/engine/src/main/java/org/teiid/query/sql/proc/IfStatement.java
trunk/engine/src/main/java/org/teiid/query/sql/proc/LoopStatement.java
trunk/engine/src/main/java/org/teiid/query/sql/proc/Statement.java
trunk/engine/src/main/java/org/teiid/query/sql/proc/TriggerAction.java
trunk/engine/src/main/java/org/teiid/query/sql/proc/WhileStatement.java
trunk/engine/src/main/java/org/teiid/query/sql/visitor/SQLStringVisitor.java
trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableStore.java
trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java
trunk/engine/src/main/java/org/teiid/query/validator/AbstractValidationVisitor.java
trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java
trunk/engine/src/main/java/org/teiid/query/validator/Validator.java
trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj
trunk/engine/src/main/resources/org/teiid/query/i18n.properties
trunk/engine/src/test/java/org/teiid/query/parser/TestParseAlter.java
trunk/engine/src/test/java/org/teiid/query/parser/TestParser.java
trunk/engine/src/test/java/org/teiid/query/processor/proc/TestProcedureProcessor.java
trunk/engine/src/test/java/org/teiid/query/resolver/TestAlterResolving.java
trunk/engine/src/test/java/org/teiid/query/sql/proc/TestBreakStatement.java
trunk/engine/src/test/java/org/teiid/query/validator/TestAlterValidation.java
trunk/engine/src/test/java/org/teiid/query/validator/TestValidator.java
Log:
TEIID-1701 adding procedure enhancements
Modified: trunk/api/src/main/java/org/teiid/language/SQLConstants.java
===================================================================
--- trunk/api/src/main/java/org/teiid/language/SQLConstants.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/api/src/main/java/org/teiid/language/SQLConstants.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -46,6 +46,7 @@
public static final String GE = ">="; //$NON-NLS-1$
public static final String LPAREN = "("; //$NON-NLS-1$
public static final String RPAREN = ")"; //$NON-NLS-1$
+ public static final String COLON = ":"; //$NON-NLS-1$
}
public interface NonReserved {
@@ -249,6 +250,7 @@
public static final String LARGE = "LARGE"; //$NON-NLS-1$
public static final String LATERAL = "LATERAL"; //$NON-NLS-1$
public static final String LEADING = "LEADING"; //$NON-NLS-1$
+ public static final String LEAVE = "LEAVE"; //$NON-NLS-1$
public static final String LEFT = "LEFT"; //$NON-NLS-1$
public static final String LIKE = "LIKE"; //$NON-NLS-1$
public static final String LIKE_REGEX = "LIKE_REGEX"; //$NON-NLS-1$
Modified: trunk/build/kits/jboss-container/teiid-releasenotes.html
===================================================================
--- trunk/build/kits/jboss-container/teiid-releasenotes.html 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/build/kits/jboss-container/teiid-releasenotes.html 2011-08-10 20:06:04 UTC (rev 3372)
@@ -26,6 +26,7 @@
</UL>
<H2><A NAME="Highlights"></A>Highlights</H2>
<UL>
+ <LI><B>Procedure language features</B> - Added support for compound/block statements, BEGIN [[NOT] ATOMIC], loop/block labels, and the leave statement. See the reference for more.
</UL>
<h2><a name="Compatibility">Compatibility Issues</a></h2>
@@ -37,6 +38,11 @@
<h4>from 7.4</h4>
<ul>
+ <li>Leave was added as a reserved word.
+</ul>
+
+<h4>from 7.4</h4>
+<ul>
<li>OFFSET and LIKE_REGEX were added as reserved words.
<li>ColumnReference.getName will always return just the element name. Previously it inconsistently returned the qualified and unqualified form depending upon where the ColumnReference appeared.
<li>As per JDBC4, ResultSetMetadata.getColumnName will return the unaliased column name if available rather than return the alias. Set useJDBC4ColumnNameAndLabelSemantics to false to use the alias name as the column name.
Modified: trunk/client/src/test/java/org/teiid/jdbc/TestStatement.java
===================================================================
--- trunk/client/src/test/java/org/teiid/jdbc/TestStatement.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/client/src/test/java/org/teiid/jdbc/TestStatement.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -128,11 +128,11 @@
ResultsFuture<ResultsMessage> future = new ResultsFuture<ResultsMessage>();
Mockito.stub(dqp.executeRequest(Mockito.anyLong(), (RequestMessage) Mockito.anyObject())).toReturn(future);
statement.submitExecute("select 'hello world'");
- Thread.sleep(100);
+ Thread.sleep(300);
Mockito.verify(dqp).cancelRequest(0);
statement.setQueryTimeoutMS(1);
statement.submitExecute("select 'hello world'");
- Thread.sleep(100);
+ Thread.sleep(300);
Mockito.verify(dqp, Mockito.times(2)).cancelRequest(0);
}
Modified: trunk/common-core/src/main/java/org/teiid/core/util/StringUtil.java
===================================================================
--- trunk/common-core/src/main/java/org/teiid/core/util/StringUtil.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/common-core/src/main/java/org/teiid/core/util/StringUtil.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -1011,7 +1011,7 @@
public static String[] getLines(final String value) {
StringReader stringReader = new StringReader(value);
BufferedReader reader = new BufferedReader(stringReader);
- ArrayList result = new ArrayList();
+ ArrayList<String> result = new ArrayList<String>();
try {
String line = reader.readLine();
while (line != null) {
@@ -1021,7 +1021,16 @@
} catch (IOException e) {
throw new TeiidRuntimeException(e);
}
- return (String[]) result.toArray(new String[result.size()]);
+ return result.toArray(new String[result.size()]);
}
+ public static boolean equalsIgnoreCase(String s1, String s2) {
+ if (s1 != null) {
+ return s1.equalsIgnoreCase(s2);
+ } else if (s2 != null) {
+ return false;
+ }
+ return true;
+ }
+
}
Modified: trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesForceExecutionFactory.java
===================================================================
--- trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesForceExecutionFactory.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/SalesForceExecutionFactory.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -23,21 +23,17 @@
package org.teiid.translator.salesforce;
import static org.teiid.translator.TypeFacility.RUNTIME_NAMES.*;
-import java.util.ArrayList;
+
import java.util.Arrays;
-import java.util.Collections;
import java.util.List;
import javax.resource.cci.ConnectionFactory;
-import org.teiid.core.types.DataTypeManager;
import org.teiid.language.Call;
import org.teiid.language.Command;
import org.teiid.language.QueryExpression;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
-import org.teiid.metadata.FunctionMethod;
-import org.teiid.metadata.FunctionParameter;
import org.teiid.metadata.MetadataFactory;
import org.teiid.metadata.RuntimeMetadata;
import org.teiid.translator.ExecutionContext;
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/grammar.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/grammar.xml 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/grammar.xml 2011-08-10 20:06:04 UTC (rev 3372)
@@ -169,6 +169,7 @@
| <LANGUAGE: "language">
| <LARGE: "large">
| <LEADING: "leading">
+| <LEAVE: "leave">
| <LIKE: "like">
| <LIKE_REGEX: "like_regex">
| <LIMIT: "limit">
@@ -384,6 +385,7 @@
| <QMARK: "?">
| <DOLLAR: "$">
| <SEMICOLON: ";">
+| <COLON: ":">
| <CONCAT_OP: "||">
}
@@ -426,11 +428,11 @@
<row>
<entry align="right" valign="top"><para><anchor id="prod12" xreflabel="alter"/>alter</para></entry>
<entry align="left" valign="top"><para>::=
-<ALTER> ( ( <link linkend="prod11">nonReserved</link> <link linkend="prod2">id</link> <AS> <link linkend="prod13">queryExpression</link> ) | ( <PROCEDURE> <link linkend="prod2">id</link> <AS> <link linkend="prod14">block</link> ) | ( <TRIGGER> <ON> <link linkend="prod2">id</link> <link linkend="prod11">nonReserved</link> <OF> ( <INSERT> | <UPDATE> | <DELETE> ) ( ( <AS> <link linkend="prod9">forEachRowTriggerAction</link> ) | <link linkend="prod11">nonReserved</link> ) ) )</para></entry></row>
+<ALTER> ( ( <link linkend="prod11">nonReserved</link> <link linkend="prod2">id</link> <AS> <link linkend="prod13">queryExpression</link> ) | ( <PROCEDURE> <link linkend="prod2">id</link> <AS> <link linkend="prod14">statement</link> ) | ( <TRIGGER> <ON> <link linkend="prod2">id</link> <link linkend="prod11">nonReserved</link> <OF> ( <INSERT> | <UPDATE> | <DELETE> ) ( ( <AS> <link linkend="prod9">forEachRowTriggerAction</link> ) | <link linkend="prod11">nonReserved</link> ) ) )</para></entry></row>
<row>
<entry align="right" valign="top"><para><anchor id="prod9" xreflabel="forEachRowTriggerAction"/>forEachRowTriggerAction</para></entry>
<entry align="left" valign="top"><para>::=
-<FOR> <EACH> <ROW> <link linkend="prod14">block</link></para></entry></row>
+<FOR> <EACH> <ROW> ( ( <BEGIN> ( <ATOMIC> )? ( <link linkend="prod14">statement</link> )* <END> ) | <link linkend="prod14">statement</link> )</para></entry></row>
<row>
<entry align="right" valign="top"><para><anchor id="prod5" xreflabel="userCommand"/>userCommand</para></entry>
<entry align="left" valign="top"><para>::=
@@ -452,207 +454,203 @@
<entry align="left" valign="top"><para>::=
<ERROR> <link linkend="prod24">expression</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod25" xreflabel="statement"/>statement</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod14" xreflabel="statement"/>statement</para></entry>
<entry align="left" valign="top"><para>::=
-( <link linkend="prod26">ifStatement</link> | <link linkend="prod27">loopStatement</link> | <link linkend="prod28">whileStatement</link> | <link linkend="prod29">delimitedStatement</link> )</para></entry></row>
+( ( ( <link linkend="prod2">id</link> <COLON> )? ( <link linkend="prod25">loopStatement</link> | <link linkend="prod26">whileStatement</link> | <link linkend="prod27">compoundStatement</link> ) ) | ( <link linkend="prod28">ifStatement</link> | <link linkend="prod29">delimitedStatement</link> ) )</para></entry></row>
<row>
<entry align="right" valign="top"><para><anchor id="prod29" xreflabel="delimitedStatement"/>delimitedStatement</para></entry>
<entry align="left" valign="top"><para>::=
-( <link linkend="prod30">assignStatement</link> | <link linkend="prod31">sqlStatement</link> | <link linkend="prod23">errorStatement</link> | <link linkend="prod32">declareStatement</link> | <link linkend="prod33">continueStatement</link> | <link linkend="prod34">breakStatement</link> ) <SEMICOLON></para></entry></row>
+( <link linkend="prod30">assignStatement</link> | <link linkend="prod31">sqlStatement</link> | <link linkend="prod23">errorStatement</link> | <link linkend="prod32">declareStatement</link> | <link linkend="prod33">branchingStatement</link> ) <SEMICOLON></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod14" xreflabel="block"/>block</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod27" xreflabel="compoundStatement"/>compoundStatement</para></entry>
<entry align="left" valign="top"><para>::=
-( <link linkend="prod25">statement</link> | ( <BEGIN> ( <link linkend="prod25">statement</link> )* <END> ) )</para></entry></row>
+<BEGIN> ( ( <NOT> )? <ATOMIC> )? ( <link linkend="prod14">statement</link> )* <END></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod34" xreflabel="breakStatement"/>breakStatement</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod33" xreflabel="branchingStatement"/>branchingStatement</para></entry>
<entry align="left" valign="top"><para>::=
-<BREAK></para></entry></row>
+( ( ( <BREAK> | <CONTINUE> ) ( <link linkend="prod2">id</link> )? ) | ( <LEAVE> <link linkend="prod2">id</link> ) )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod33" xreflabel="continueStatement"/>continueStatement</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod26" xreflabel="whileStatement"/>whileStatement</para></entry>
<entry align="left" valign="top"><para>::=
-<CONTINUE></para></entry></row>
+<WHILE> <LPAREN> <link linkend="prod34">criteria</link> <RPAREN> <link linkend="prod14">statement</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod28" xreflabel="whileStatement"/>whileStatement</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod25" xreflabel="loopStatement"/>loopStatement</para></entry>
<entry align="left" valign="top"><para>::=
-<WHILE> <LPAREN> <link linkend="prod35">criteria</link> <RPAREN> <link linkend="prod14">block</link></para></entry></row>
+<LOOP> <ON> <LPAREN> <link linkend="prod13">queryExpression</link> <RPAREN> <AS> <link linkend="prod2">id</link> <link linkend="prod14">statement</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod27" xreflabel="loopStatement"/>loopStatement</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod28" xreflabel="ifStatement"/>ifStatement</para></entry>
<entry align="left" valign="top"><para>::=
-<LOOP> <ON> <LPAREN> <link linkend="prod13">queryExpression</link> <RPAREN> <AS> <link linkend="prod2">id</link> <link linkend="prod14">block</link></para></entry></row>
+<IF> <LPAREN> <link linkend="prod34">criteria</link> <RPAREN> <link linkend="prod14">statement</link> ( <ELSE> <link linkend="prod14">statement</link> )?</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod26" xreflabel="ifStatement"/>ifStatement</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod35" xreflabel="criteriaSelector"/>criteriaSelector</para></entry>
<entry align="left" valign="top"><para>::=
-<IF> <LPAREN> <link linkend="prod35">criteria</link> <RPAREN> <link linkend="prod14">block</link> ( <ELSE> <link linkend="prod14">block</link> )?</para></entry></row>
-<row>
-<entry align="right" valign="top"><para><anchor id="prod36" xreflabel="criteriaSelector"/>criteriaSelector</para></entry>
-<entry align="left" valign="top"><para>::=
( ( <EQ> | <NE> | <NE2> | <LE> | <GE> | <LT> | <GT> | <IN> | <LIKE> | ( <IS> <NULL> ) | <BETWEEN> ) )? <CRITERIA> ( <ON> <LPAREN> <link linkend="prod2">id</link> ( <COMMA> <link linkend="prod2">id</link> )* <RPAREN> )?</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod37" xreflabel="hasCriteria"/>hasCriteria</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod36" xreflabel="hasCriteria"/>hasCriteria</para></entry>
<entry align="left" valign="top"><para>::=
-<HAS> <link linkend="prod36">criteriaSelector</link></para></entry></row>
+<HAS> <link linkend="prod35">criteriaSelector</link></para></entry></row>
<row>
<entry align="right" valign="top"><para><anchor id="prod32" xreflabel="declareStatement"/>declareStatement</para></entry>
<entry align="left" valign="top"><para>::=
-<DECLARE> <link linkend="prod38">dataType</link> <link linkend="prod2">id</link> ( ( <link linkend="prod11">nonReserved</link> | <EQ> ) <link linkend="prod39">assignStatementOperand</link> )?</para></entry></row>
+<DECLARE> <link linkend="prod37">dataType</link> <link linkend="prod2">id</link> ( ( <link linkend="prod11">nonReserved</link> | <EQ> ) <link linkend="prod38">assignStatementOperand</link> )?</para></entry></row>
<row>
<entry align="right" valign="top"><para><anchor id="prod30" xreflabel="assignStatement"/>assignStatement</para></entry>
<entry align="left" valign="top"><para>::=
-<link linkend="prod2">id</link> ( <link linkend="prod11">nonReserved</link> | <EQ> ) <link linkend="prod39">assignStatementOperand</link></para></entry></row>
+<link linkend="prod2">id</link> ( <link linkend="prod11">nonReserved</link> | <EQ> ) <link linkend="prod38">assignStatementOperand</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod39" xreflabel="assignStatementOperand"/>assignStatementOperand</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod38" xreflabel="assignStatementOperand"/>assignStatementOperand</para></entry>
<entry align="left" valign="top"><para>::=
( ( <link linkend="prod16">insert</link> ) | <link linkend="prod17">update</link> | <link linkend="prod18">delete</link> | ( <link linkend="prod24">expression</link> ) | <link linkend="prod13">queryExpression</link> )</para></entry></row>
<row>
<entry align="right" valign="top"><para><anchor id="prod31" xreflabel="sqlStatement"/>sqlStatement</para></entry>
<entry align="left" valign="top"><para>::=
-( ( <link linkend="prod5">userCommand</link> ) | <link linkend="prod40">dynamicCommand</link> | ( <link linkend="prod2">id</link> ( <link linkend="prod11">nonReserved</link> | <EQ> ) <link linkend="prod15">storedProcedure</link> ) )</para></entry></row>
+( ( <link linkend="prod5">userCommand</link> ) | <link linkend="prod39">dynamicCommand</link> | ( <link linkend="prod2">id</link> ( <link linkend="prod11">nonReserved</link> | <EQ> ) <link linkend="prod15">storedProcedure</link> ) )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod41" xreflabel="translateCriteria"/>translateCriteria</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod40" xreflabel="translateCriteria"/>translateCriteria</para></entry>
<entry align="left" valign="top"><para>::=
-<TRANSLATE> <link linkend="prod36">criteriaSelector</link> ( <WITH> <LPAREN> <link linkend="prod2">id</link> <EQ> <link linkend="prod24">expression</link> ( <COMMA> <link linkend="prod2">id</link> <EQ> <link linkend="prod24">expression</link> )* <RPAREN> )?</para></entry></row>
+<TRANSLATE> <link linkend="prod35">criteriaSelector</link> ( <WITH> <LPAREN> <link linkend="prod2">id</link> <EQ> <link linkend="prod24">expression</link> ( <COMMA> <link linkend="prod2">id</link> <EQ> <link linkend="prod24">expression</link> )* <RPAREN> )?</para></entry></row>
<row>
<entry align="right" valign="top"><para><anchor id="prod4" xreflabel="createUpdateProcedure"/>createUpdateProcedure</para></entry>
<entry align="left" valign="top"><para>::=
-<CREATE> ( <VIRTUAL> )? ( <UPDATE> )? <PROCEDURE> <link linkend="prod14">block</link></para></entry></row>
+<CREATE> ( <VIRTUAL> )? ( <UPDATE> )? <PROCEDURE> <link linkend="prod14">statement</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod40" xreflabel="dynamicCommand"/>dynamicCommand</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod39" xreflabel="dynamicCommand"/>dynamicCommand</para></entry>
<entry align="left" valign="top"><para>::=
-( <EXECUTE> | <EXEC> ) ( ( <STRING> | <IMMEDIATE> ) )? <link linkend="prod24">expression</link> ( <AS> <link linkend="prod42">createElementsWithTypes</link> ( <INTO> <link linkend="prod2">id</link> )? )? ( <USING> <link linkend="prod43">setClauseList</link> )? ( <UPDATE> ( ( <INTEGERVAL> ) | ( <STAR> ) ) )?</para></entry></row>
+( <EXECUTE> | <EXEC> ) ( ( <STRING> | <IMMEDIATE> ) )? <link linkend="prod24">expression</link> ( <AS> <link linkend="prod41">createElementsWithTypes</link> ( <INTO> <link linkend="prod2">id</link> )? )? ( <USING> <link linkend="prod42">setClauseList</link> )? ( <UPDATE> ( ( <INTEGERVAL> ) | ( <STAR> ) ) )?</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod43" xreflabel="setClauseList"/>setClauseList</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod42" xreflabel="setClauseList"/>setClauseList</para></entry>
<entry align="left" valign="top"><para>::=
<link linkend="prod2">id</link> <EQ> ( <COMMA> <link linkend="prod2">id</link> <EQ> )*</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod42" xreflabel="createElementsWithTypes"/>createElementsWithTypes</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod41" xreflabel="createElementsWithTypes"/>createElementsWithTypes</para></entry>
<entry align="left" valign="top"><para>::=
<link linkend="prod2">id</link> <link linkend="prod22">dataTypeString</link> ( <COMMA> <link linkend="prod2">id</link> <link linkend="prod22">dataTypeString</link> )*</para></entry></row>
<row>
<entry align="right" valign="top"><para><anchor id="prod6" xreflabel="callableStatement"/>callableStatement</para></entry>
<entry align="left" valign="top"><para>::=
-<LBRACE> ( <QMARK> <EQ> )? <CALL> <link linkend="prod2">id</link> ( <LPAREN> ( <link linkend="prod44">executeUnnamedParams</link> ) <RPAREN> )? <RBRACE> ( <link linkend="prod45">option</link> )?</para></entry></row>
+<LBRACE> ( <QMARK> <EQ> )? <CALL> <link linkend="prod2">id</link> ( <LPAREN> ( <link linkend="prod43">executeUnnamedParams</link> ) <RPAREN> )? <RBRACE> ( <link linkend="prod44">option</link> )?</para></entry></row>
<row>
<entry align="right" valign="top"><para><anchor id="prod15" xreflabel="storedProcedure"/>storedProcedure</para></entry>
<entry align="left" valign="top"><para>::=
-( ( <EXEC> | <EXECUTE> | <CALL> ) <link linkend="prod2">id</link> <LPAREN> ( <link linkend="prod46">executeNamedParams</link> | <link linkend="prod44">executeUnnamedParams</link> ) <RPAREN> ) ( <link linkend="prod45">option</link> )?</para></entry></row>
+( ( <EXEC> | <EXECUTE> | <CALL> ) <link linkend="prod2">id</link> <LPAREN> ( <link linkend="prod45">executeNamedParams</link> | <link linkend="prod43">executeUnnamedParams</link> ) <RPAREN> ) ( <link linkend="prod44">option</link> )?</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod44" xreflabel="executeUnnamedParams"/>executeUnnamedParams</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod43" xreflabel="executeUnnamedParams"/>executeUnnamedParams</para></entry>
<entry align="left" valign="top"><para>::=
( <link linkend="prod24">expression</link> ( <COMMA> <link linkend="prod24">expression</link> )* )?</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod46" xreflabel="executeNamedParams"/>executeNamedParams</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod45" xreflabel="executeNamedParams"/>executeNamedParams</para></entry>
<entry align="left" valign="top"><para>::=
( <link linkend="prod2">id</link> <EQ> ( <GT> )? <link linkend="prod24">expression</link> ( <COMMA> <link linkend="prod2">id</link> <EQ> ( <GT> )? <link linkend="prod24">expression</link> )* )</para></entry></row>
<row>
<entry align="right" valign="top"><para><anchor id="prod16" xreflabel="insert"/>insert</para></entry>
<entry align="left" valign="top"><para>::=
-<INSERT> <INTO> <link linkend="prod2">id</link> ( <link linkend="prod47">columnList</link> )? ( ( <VALUES> <LPAREN> <link linkend="prod48">expressionList</link> <RPAREN> ) | ( <link linkend="prod13">queryExpression</link> ) ) ( <link linkend="prod45">option</link> )?</para></entry></row>
+<INSERT> <INTO> <link linkend="prod2">id</link> ( <link linkend="prod46">columnList</link> )? ( ( <VALUES> <LPAREN> <link linkend="prod47">expressionList</link> <RPAREN> ) | ( <link linkend="prod13">queryExpression</link> ) ) ( <link linkend="prod44">option</link> )?</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod47" xreflabel="columnList"/>columnList</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod46" xreflabel="columnList"/>columnList</para></entry>
<entry align="left" valign="top"><para>::=
<LPAREN> <link linkend="prod2">id</link> ( <COMMA> <link linkend="prod2">id</link> )* <RPAREN></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod48" xreflabel="expressionList"/>expressionList</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod47" xreflabel="expressionList"/>expressionList</para></entry>
<entry align="left" valign="top"><para>::=
<link linkend="prod24">expression</link> ( <COMMA> <link linkend="prod24">expression</link> )*</para></entry></row>
<row>
<entry align="right" valign="top"><para><anchor id="prod17" xreflabel="update"/>update</para></entry>
<entry align="left" valign="top"><para>::=
-<UPDATE> <link linkend="prod2">id</link> <SET> <link linkend="prod43">setClauseList</link> ( <link linkend="prod49">where</link> )? ( <link linkend="prod45">option</link> )?</para></entry></row>
+<UPDATE> <link linkend="prod2">id</link> <SET> <link linkend="prod42">setClauseList</link> ( <link linkend="prod48">where</link> )? ( <link linkend="prod44">option</link> )?</para></entry></row>
<row>
<entry align="right" valign="top"><para><anchor id="prod18" xreflabel="delete"/>delete</para></entry>
<entry align="left" valign="top"><para>::=
-<DELETE> <FROM> <link linkend="prod2">id</link> ( <link linkend="prod49">where</link> )? ( <link linkend="prod45">option</link> )?</para></entry></row>
+<DELETE> <FROM> <link linkend="prod2">id</link> ( <link linkend="prod48">where</link> )? ( <link linkend="prod44">option</link> )?</para></entry></row>
<row>
<entry align="right" valign="top"><para><anchor id="prod13" xreflabel="queryExpression"/>queryExpression</para></entry>
<entry align="left" valign="top"><para>::=
-( <WITH> <link linkend="prod50">withListElement</link> ( <COMMA> <link linkend="prod50">withListElement</link> )* )? <link linkend="prod51">queryExpressionBody</link></para></entry></row>
+( <WITH> <link linkend="prod49">withListElement</link> ( <COMMA> <link linkend="prod49">withListElement</link> )* )? <link linkend="prod50">queryExpressionBody</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod50" xreflabel="withListElement"/>withListElement</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod49" xreflabel="withListElement"/>withListElement</para></entry>
<entry align="left" valign="top"><para>::=
-<link linkend="prod2">id</link> ( <link linkend="prod47">columnList</link> )? <AS> <LPAREN> <link linkend="prod13">queryExpression</link> <RPAREN></para></entry></row>
+<link linkend="prod2">id</link> ( <link linkend="prod46">columnList</link> )? <AS> <LPAREN> <link linkend="prod13">queryExpression</link> <RPAREN></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod51" xreflabel="queryExpressionBody"/>queryExpressionBody</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod50" xreflabel="queryExpressionBody"/>queryExpressionBody</para></entry>
<entry align="left" valign="top"><para>::=
-<link linkend="prod52">queryTerm</link> ( ( <UNION> | <EXCEPT> ) ( <ALL> | <DISTINCT> )? <link linkend="prod52">queryTerm</link> )* ( <link linkend="prod53">orderby</link> )? ( <link linkend="prod54">limit</link> )? ( <link linkend="prod45">option</link> )?</para></entry></row>
+<link linkend="prod51">queryTerm</link> ( ( <UNION> | <EXCEPT> ) ( <ALL> | <DISTINCT> )? <link linkend="prod51">queryTerm</link> )* ( <link linkend="prod52">orderby</link> )? ( <link linkend="prod53">limit</link> )? ( <link linkend="prod44">option</link> )?</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod52" xreflabel="queryTerm"/>queryTerm</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod51" xreflabel="queryTerm"/>queryTerm</para></entry>
<entry align="left" valign="top"><para>::=
-<link linkend="prod55">queryPrimary</link> ( <INTERSECT> ( <ALL> | <DISTINCT> )? <link linkend="prod55">queryPrimary</link> )*</para></entry></row>
+<link linkend="prod54">queryPrimary</link> ( <INTERSECT> ( <ALL> | <DISTINCT> )? <link linkend="prod54">queryPrimary</link> )*</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod55" xreflabel="queryPrimary"/>queryPrimary</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod54" xreflabel="queryPrimary"/>queryPrimary</para></entry>
<entry align="left" valign="top"><para>::=
-( <link linkend="prod56">query</link> | ( <TABLE> <link linkend="prod2">id</link> ) | ( <LPAREN> <link linkend="prod51">queryExpressionBody</link> <RPAREN> ) )</para></entry></row>
+( <link linkend="prod55">query</link> | ( <TABLE> <link linkend="prod2">id</link> ) | ( <LPAREN> <link linkend="prod50">queryExpressionBody</link> <RPAREN> ) )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod56" xreflabel="query"/>query</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod55" xreflabel="query"/>query</para></entry>
<entry align="left" valign="top"><para>::=
-<link linkend="prod57">select</link> ( <link linkend="prod58">into</link> )? ( <link linkend="prod59">from</link> ( <link linkend="prod49">where</link> )? ( <link linkend="prod60">groupBy</link> )? ( <link linkend="prod61">having</link> )? )?</para></entry></row>
+<link linkend="prod56">select</link> ( <link linkend="prod57">into</link> )? ( <link linkend="prod58">from</link> ( <link linkend="prod48">where</link> )? ( <link linkend="prod59">groupBy</link> )? ( <link linkend="prod60">having</link> )? )?</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod58" xreflabel="into"/>into</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod57" xreflabel="into"/>into</para></entry>
<entry align="left" valign="top"><para>::=
<INTO> ( <link linkend="prod2">id</link> )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod57" xreflabel="select"/>select</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod56" xreflabel="select"/>select</para></entry>
<entry align="left" valign="top"><para>::=
-<SELECT> ( <ALL> | ( <DISTINCT> ) )? ( <STAR> | ( <link linkend="prod62">selectSymbol</link> ( <COMMA> <link linkend="prod62">selectSymbol</link> )* ) )</para></entry></row>
+<SELECT> ( <ALL> | ( <DISTINCT> ) )? ( <STAR> | ( <link linkend="prod61">selectSymbol</link> ( <COMMA> <link linkend="prod61">selectSymbol</link> )* ) )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod62" xreflabel="selectSymbol"/>selectSymbol</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod61" xreflabel="selectSymbol"/>selectSymbol</para></entry>
<entry align="left" valign="top"><para>::=
-( <link linkend="prod63">selectExpression</link> | <link linkend="prod64">allInGroupSymbol</link> )</para></entry></row>
+( <link linkend="prod62">selectExpression</link> | <link linkend="prod63">allInGroupSymbol</link> )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod63" xreflabel="selectExpression"/>selectExpression</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod62" xreflabel="selectExpression"/>selectExpression</para></entry>
<entry align="left" valign="top"><para>::=
( <link linkend="prod24">expression</link> ( ( <AS> )? <link linkend="prod2">id</link> )? )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod65" xreflabel="derivedColumn"/>derivedColumn</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod64" xreflabel="derivedColumn"/>derivedColumn</para></entry>
<entry align="left" valign="top"><para>::=
( <link linkend="prod24">expression</link> ( <AS> <link linkend="prod2">id</link> )? )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod64" xreflabel="allInGroupSymbol"/>allInGroupSymbol</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod63" xreflabel="allInGroupSymbol"/>allInGroupSymbol</para></entry>
<entry align="left" valign="top"><para>::=
<ALL_IN_GROUP></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod66" xreflabel="orderedAgg"/>orderedAgg</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod65" xreflabel="orderedAgg"/>orderedAgg</para></entry>
<entry align="left" valign="top"><para>::=
-( <XMLAGG> | <ARRAY_AGG> ) <LPAREN> <link linkend="prod24">expression</link> ( <link linkend="prod53">orderby</link> )? <RPAREN> <link linkend="prod67">filterClause</link></para></entry></row>
+( <XMLAGG> | <ARRAY_AGG> ) <LPAREN> <link linkend="prod24">expression</link> ( <link linkend="prod52">orderby</link> )? <RPAREN> <link linkend="prod66">filterClause</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod68" xreflabel="textAgg"/>textAgg</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod67" xreflabel="textAgg"/>textAgg</para></entry>
<entry align="left" valign="top"><para>::=
-<link linkend="prod11">nonReserved</link> <LPAREN> <FOR> <link linkend="prod65">derivedColumn</link> ( <COMMA> <link linkend="prod65">derivedColumn</link> )* ( <ID> <link linkend="prod69">charVal</link> )? ( ( <ID> <link linkend="prod69">charVal</link> ) )? ( <ID> )? ( ( <ID> <link linkend="prod2">id</link> ) )? ( <link linkend="prod53">orderby</link> )? <RPAREN> <link linkend="prod67">filterClause</link></para></entry></row>
+<link linkend="prod11">nonReserved</link> <LPAREN> <FOR> <link linkend="prod64">derivedColumn</link> ( <COMMA> <link linkend="prod64">derivedColumn</link> )* ( <ID> <link linkend="prod68">charVal</link> )? ( ( <ID> <link linkend="prod68">charVal</link> ) )? ( <ID> )? ( ( <ID> <link linkend="prod2">id</link> ) )? ( <link linkend="prod52">orderby</link> )? <RPAREN> <link linkend="prod66">filterClause</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod70" xreflabel="aggregateSymbol"/>aggregateSymbol</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod69" xreflabel="aggregateSymbol"/>aggregateSymbol</para></entry>
<entry align="left" valign="top"><para>::=
-( ( ( <link linkend="prod11">nonReserved</link> <LPAREN> <STAR> <RPAREN> ) | ( <link linkend="prod11">nonReserved</link> <LPAREN> <RPAREN> ) | ( ( <link linkend="prod11">nonReserved</link> | <ANY> | <SOME> ) <LPAREN> ( <DISTINCT> | <ALL> )? <link linkend="prod24">expression</link> <RPAREN> ) ) <link linkend="prod67">filterClause</link> )</para></entry></row>
+( ( ( <link linkend="prod11">nonReserved</link> <LPAREN> <STAR> <RPAREN> ) | ( <link linkend="prod11">nonReserved</link> <LPAREN> <RPAREN> ) | ( ( <link linkend="prod11">nonReserved</link> | <ANY> | <SOME> ) <LPAREN> ( <DISTINCT> | <ALL> )? <link linkend="prod24">expression</link> <RPAREN> ) ) <link linkend="prod66">filterClause</link> )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod67" xreflabel="filterClause"/>filterClause</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod66" xreflabel="filterClause"/>filterClause</para></entry>
<entry align="left" valign="top"><para>::=
-( <FILTER> <LPAREN> <WHERE> <link linkend="prod71">booleanPrimary</link> <RPAREN> )?</para></entry></row>
+( <FILTER> <LPAREN> <WHERE> <link linkend="prod70">booleanPrimary</link> <RPAREN> )?</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod59" xreflabel="from"/>from</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod58" xreflabel="from"/>from</para></entry>
<entry align="left" valign="top"><para>::=
-<FROM> ( <link linkend="prod72">tableReference</link> ( <COMMA> <link linkend="prod72">tableReference</link> )* )</para></entry></row>
+<FROM> ( <link linkend="prod71">tableReference</link> ( <COMMA> <link linkend="prod71">tableReference</link> )* )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod72" xreflabel="tableReference"/>tableReference</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod71" xreflabel="tableReference"/>tableReference</para></entry>
<entry align="left" valign="top"><para>::=
-( ( <LBRACE> <link linkend="prod11">nonReserved</link> <link linkend="prod73">joinedTable</link> <RBRACE> ) | <link linkend="prod73">joinedTable</link> )</para></entry></row>
+( ( <LBRACE> <link linkend="prod11">nonReserved</link> <link linkend="prod72">joinedTable</link> <RBRACE> ) | <link linkend="prod72">joinedTable</link> )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod73" xreflabel="joinedTable"/>joinedTable</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod72" xreflabel="joinedTable"/>joinedTable</para></entry>
<entry align="left" valign="top"><para>::=
-<link linkend="prod74">tablePrimary</link> ( ( <link linkend="prod75">crossJoin</link> | <link linkend="prod76">qualifiedJoin</link> ) )*</para></entry></row>
+<link linkend="prod73">tablePrimary</link> ( ( <link linkend="prod74">crossJoin</link> | <link linkend="prod75">qualifiedJoin</link> ) )*</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod75" xreflabel="crossJoin"/>crossJoin</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod74" xreflabel="crossJoin"/>crossJoin</para></entry>
<entry align="left" valign="top"><para>::=
-( ( <CROSS> | <UNION> ) <JOIN> <link linkend="prod74">tablePrimary</link> )</para></entry></row>
+( ( <CROSS> | <UNION> ) <JOIN> <link linkend="prod73">tablePrimary</link> )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod76" xreflabel="qualifiedJoin"/>qualifiedJoin</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod75" xreflabel="qualifiedJoin"/>qualifiedJoin</para></entry>
<entry align="left" valign="top"><para>::=
-( ( ( <RIGHT> ( <OUTER> )? ) | ( <LEFT> ( <OUTER> )? ) | ( <FULL> ( <OUTER> )? ) | <INNER> )? <JOIN> <link linkend="prod72">tableReference</link> <ON> <link linkend="prod35">criteria</link> )</para></entry></row>
+( ( ( <RIGHT> ( <OUTER> )? ) | ( <LEFT> ( <OUTER> )? ) | ( <FULL> ( <OUTER> )? ) | <INNER> )? <JOIN> <link linkend="prod71">tableReference</link> <ON> <link linkend="prod34">criteria</link> )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod74" xreflabel="tablePrimary"/>tablePrimary</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod73" xreflabel="tablePrimary"/>tablePrimary</para></entry>
<entry align="left" valign="top"><para>::=
-( <link linkend="prod77">textTable</link> | <link linkend="prod78">arrayTable</link> | <link linkend="prod79">xmlTable</link> | <link linkend="prod80">unaryFromClause</link> | <link linkend="prod81">subqueryFromClause</link> | ( <LPAREN> <link linkend="prod73">joinedTable</link> <RPAREN> ) ) ( ( <MAKEDEP> ) | ( <MAKENOTDEP> ) )?</para></entry></row>
+( <link linkend="prod76">textTable</link> | <link linkend="prod77">arrayTable</link> | <link linkend="prod78">xmlTable</link> | <link linkend="prod79">unaryFromClause</link> | <link linkend="prod80">subqueryFromClause</link> | ( <LPAREN> <link linkend="prod72">joinedTable</link> <RPAREN> ) ) ( ( <MAKEDEP> ) | ( <MAKENOTDEP> ) )?</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod82" xreflabel="xmlSerialize"/>xmlSerialize</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod81" xreflabel="xmlSerialize"/>xmlSerialize</para></entry>
<entry align="left" valign="top"><para>::=
<XMLSERIALIZE> <LPAREN> ( <link linkend="prod11">nonReserved</link> )? <link linkend="prod24">expression</link> ( <AS> ( <STRING> | <VARCHAR> | <CLOB> ) )? <RPAREN></para></entry></row>
<row>
@@ -660,223 +658,223 @@
<entry align="left" valign="top"><para>::=
<ID></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod78" xreflabel="arrayTable"/>arrayTable</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod77" xreflabel="arrayTable"/>arrayTable</para></entry>
<entry align="left" valign="top"><para>::=
-<ID> <LPAREN> <link linkend="prod24">expression</link> <link linkend="prod11">nonReserved</link> <link linkend="prod42">createElementsWithTypes</link> <RPAREN> ( <AS> )? <link linkend="prod2">id</link></para></entry></row>
+<ID> <LPAREN> <link linkend="prod24">expression</link> <link linkend="prod11">nonReserved</link> <link linkend="prod41">createElementsWithTypes</link> <RPAREN> ( <AS> )? <link linkend="prod2">id</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod77" xreflabel="textTable"/>textTable</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod76" xreflabel="textTable"/>textTable</para></entry>
<entry align="left" valign="top"><para>::=
-<ID> <LPAREN> <link linkend="prod24">expression</link> <link linkend="prod11">nonReserved</link> <link linkend="prod83">textColumn</link> ( <COMMA> <link linkend="prod83">textColumn</link> )* ( <ID> <link linkend="prod69">charVal</link> )? ( ( <ESCAPE> <link linkend="prod69">charVal</link> ) | ( <ID> <link linkend="prod69">charVal</link> ) )? ( <ID> ( <link linkend="prod84">intVal</link> )? )? ( <ID> <link linkend="prod84">intVal</link> )? <RPAREN> ( <AS> )? <link linkend="prod2">id</link></para></entry></row>
+<ID> <LPAREN> <link linkend="prod24">expression</link> <link linkend="prod11">nonReserved</link> <link linkend="prod82">textColumn</link> ( <COMMA> <link linkend="prod82">textColumn</link> )* ( <ID> <link linkend="prod68">charVal</link> )? ( ( <ESCAPE> <link linkend="prod68">charVal</link> ) | ( <ID> <link linkend="prod68">charVal</link> ) )? ( <ID> ( <link linkend="prod83">intVal</link> )? )? ( <ID> <link linkend="prod83">intVal</link> )? <RPAREN> ( <AS> )? <link linkend="prod2">id</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod83" xreflabel="textColumn"/>textColumn</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod82" xreflabel="textColumn"/>textColumn</para></entry>
<entry align="left" valign="top"><para>::=
-<link linkend="prod2">id</link> <link linkend="prod38">dataType</link> ( <ID> <link linkend="prod84">intVal</link> )?</para></entry></row>
+<link linkend="prod2">id</link> <link linkend="prod37">dataType</link> ( <ID> <link linkend="prod83">intVal</link> )?</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod85" xreflabel="xmlQuery"/>xmlQuery</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod84" xreflabel="xmlQuery"/>xmlQuery</para></entry>
<entry align="left" valign="top"><para>::=
-<XMLQUERY> <LPAREN> ( <link linkend="prod86">xmlNamespaces</link> <COMMA> )? <link linkend="prod1">stringVal</link> ( <ID> <link linkend="prod65">derivedColumn</link> ( <COMMA> <link linkend="prod65">derivedColumn</link> )* )? ( ( <NULL> | <link linkend="prod11">nonReserved</link> ) <ON> <link linkend="prod11">nonReserved</link> )? <RPAREN></para></entry></row>
+<XMLQUERY> <LPAREN> ( <link linkend="prod85">xmlNamespaces</link> <COMMA> )? <link linkend="prod1">stringVal</link> ( <ID> <link linkend="prod64">derivedColumn</link> ( <COMMA> <link linkend="prod64">derivedColumn</link> )* )? ( ( <NULL> | <link linkend="prod11">nonReserved</link> ) <ON> <link linkend="prod11">nonReserved</link> )? <RPAREN></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod79" xreflabel="xmlTable"/>xmlTable</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod78" xreflabel="xmlTable"/>xmlTable</para></entry>
<entry align="left" valign="top"><para>::=
-<XMLTABLE> <LPAREN> ( <link linkend="prod86">xmlNamespaces</link> <COMMA> )? <link linkend="prod1">stringVal</link> ( <ID> <link linkend="prod65">derivedColumn</link> ( <COMMA> <link linkend="prod65">derivedColumn</link> )* )? ( <ID> <link linkend="prod87">xmlColumn</link> ( <COMMA> <link linkend="prod87">xmlColumn</link> )* )? <RPAREN> ( <AS> )? <link linkend="prod2">id</link></para></entry></row>
+<XMLTABLE> <LPAREN> ( <link linkend="prod85">xmlNamespaces</link> <COMMA> )? <link linkend="prod1">stringVal</link> ( <ID> <link linkend="prod64">derivedColumn</link> ( <COMMA> <link linkend="prod64">derivedColumn</link> )* )? ( <ID> <link linkend="prod86">xmlColumn</link> ( <COMMA> <link linkend="prod86">xmlColumn</link> )* )? <RPAREN> ( <AS> )? <link linkend="prod2">id</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod87" xreflabel="xmlColumn"/>xmlColumn</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod86" xreflabel="xmlColumn"/>xmlColumn</para></entry>
<entry align="left" valign="top"><para>::=
-<link linkend="prod2">id</link> ( ( <FOR> <link linkend="prod11">nonReserved</link> ) | ( <link linkend="prod38">dataType</link> ( <DEFAULT_KEYWORD> <link linkend="prod24">expression</link> )? ( <link linkend="prod11">nonReserved</link> <link linkend="prod1">stringVal</link> )? ) )</para></entry></row>
+<link linkend="prod2">id</link> ( ( <FOR> <link linkend="prod11">nonReserved</link> ) | ( <link linkend="prod37">dataType</link> ( <DEFAULT_KEYWORD> <link linkend="prod24">expression</link> )? ( <link linkend="prod11">nonReserved</link> <link linkend="prod1">stringVal</link> )? ) )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod84" xreflabel="intVal"/>intVal</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod83" xreflabel="intVal"/>intVal</para></entry>
<entry align="left" valign="top"><para>::=
<INTEGERVAL></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod81" xreflabel="subqueryFromClause"/>subqueryFromClause</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod80" xreflabel="subqueryFromClause"/>subqueryFromClause</para></entry>
<entry align="left" valign="top"><para>::=
( <TABLE> )? <LPAREN> ( <link linkend="prod13">queryExpression</link> | <link linkend="prod15">storedProcedure</link> ) <RPAREN> ( <AS> )? <link linkend="prod2">id</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod80" xreflabel="unaryFromClause"/>unaryFromClause</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod79" xreflabel="unaryFromClause"/>unaryFromClause</para></entry>
<entry align="left" valign="top"><para>::=
( <ID> ( ( <AS> )? <link linkend="prod2">id</link> )? )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod49" xreflabel="where"/>where</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod48" xreflabel="where"/>where</para></entry>
<entry align="left" valign="top"><para>::=
-<WHERE> <link linkend="prod35">criteria</link></para></entry></row>
+<WHERE> <link linkend="prod34">criteria</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod35" xreflabel="criteria"/>criteria</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod34" xreflabel="criteria"/>criteria</para></entry>
<entry align="left" valign="top"><para>::=
-<link linkend="prod88">compoundCritOr</link></para></entry></row>
+<link linkend="prod87">compoundCritOr</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod88" xreflabel="compoundCritOr"/>compoundCritOr</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod87" xreflabel="compoundCritOr"/>compoundCritOr</para></entry>
<entry align="left" valign="top"><para>::=
-<link linkend="prod89">compoundCritAnd</link> ( <OR> <link linkend="prod89">compoundCritAnd</link> )*</para></entry></row>
+<link linkend="prod88">compoundCritAnd</link> ( <OR> <link linkend="prod88">compoundCritAnd</link> )*</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod89" xreflabel="compoundCritAnd"/>compoundCritAnd</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod88" xreflabel="compoundCritAnd"/>compoundCritAnd</para></entry>
<entry align="left" valign="top"><para>::=
-<link linkend="prod90">notCrit</link> ( <AND> <link linkend="prod90">notCrit</link> )*</para></entry></row>
+<link linkend="prod89">notCrit</link> ( <AND> <link linkend="prod89">notCrit</link> )*</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod90" xreflabel="notCrit"/>notCrit</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod89" xreflabel="notCrit"/>notCrit</para></entry>
<entry align="left" valign="top"><para>::=
-( <NOT> )? <link linkend="prod71">booleanPrimary</link></para></entry></row>
+( <NOT> )? <link linkend="prod70">booleanPrimary</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod71" xreflabel="booleanPrimary"/>booleanPrimary</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod70" xreflabel="booleanPrimary"/>booleanPrimary</para></entry>
<entry align="left" valign="top"><para>::=
-( <link linkend="prod41">translateCriteria</link> | ( <link linkend="prod91">commonValueExpression</link> ( ( <link linkend="prod92">betweenCrit</link> | <link linkend="prod93">matchCrit</link> | <link linkend="prod94">regexMatchCrit</link> | <link linkend="prod95">setCrit</link> | <link linkend="prod96">isNullCrit</link> | <link linkend="prod97">subqueryCompareCriteria</link> | <link linkend="prod98">compareCrit</link> ) )? ) | <link linkend="prod99">existsCriteria</link> | <link linkend="prod37">hasCriteria</link> )</para></entry></row>
+( <link linkend="prod40">translateCriteria</link> | ( <link linkend="prod90">commonValueExpression</link> ( ( <link linkend="prod91">betweenCrit</link> | <link linkend="prod92">matchCrit</link> | <link linkend="prod93">regexMatchCrit</link> | <link linkend="prod94">setCrit</link> | <link linkend="prod95">isNullCrit</link> | <link linkend="prod96">subqueryCompareCriteria</link> | <link linkend="prod97">compareCrit</link> ) )? ) | <link linkend="prod98">existsCriteria</link> | <link linkend="prod36">hasCriteria</link> )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod100" xreflabel="operator"/>operator</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod99" xreflabel="operator"/>operator</para></entry>
<entry align="left" valign="top"><para>::=
( <EQ> | <NE> | <NE2> | <LT> | <LE> | <GT> | <GE> )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod98" xreflabel="compareCrit"/>compareCrit</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod97" xreflabel="compareCrit"/>compareCrit</para></entry>
<entry align="left" valign="top"><para>::=
-<link linkend="prod100">operator</link> <link linkend="prod91">commonValueExpression</link></para></entry></row>
+<link linkend="prod99">operator</link> <link linkend="prod90">commonValueExpression</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod101" xreflabel="subquery"/>subquery</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod100" xreflabel="subquery"/>subquery</para></entry>
<entry align="left" valign="top"><para>::=
<LPAREN> ( <link linkend="prod13">queryExpression</link> | ( <link linkend="prod15">storedProcedure</link> ) ) <RPAREN></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod102" xreflabel="subqueryAndHint"/>subqueryAndHint</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod101" xreflabel="subqueryAndHint"/>subqueryAndHint</para></entry>
<entry align="left" valign="top"><para>::=
-<link linkend="prod101">subquery</link></para></entry></row>
+<link linkend="prod100">subquery</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod97" xreflabel="subqueryCompareCriteria"/>subqueryCompareCriteria</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod96" xreflabel="subqueryCompareCriteria"/>subqueryCompareCriteria</para></entry>
<entry align="left" valign="top"><para>::=
-<link linkend="prod100">operator</link> ( <ANY> | <SOME> | <ALL> ) <link linkend="prod101">subquery</link></para></entry></row>
+<link linkend="prod99">operator</link> ( <ANY> | <SOME> | <ALL> ) <link linkend="prod100">subquery</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod93" xreflabel="matchCrit"/>matchCrit</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod92" xreflabel="matchCrit"/>matchCrit</para></entry>
<entry align="left" valign="top"><para>::=
-( <NOT> )? ( <LIKE> | ( <SIMILAR> <TO> ) ) <link linkend="prod91">commonValueExpression</link> ( <ESCAPE> <link linkend="prod69">charVal</link> | ( <LBRACE> <ESCAPE> <link linkend="prod69">charVal</link> <RBRACE> ) )?</para></entry></row>
+( <NOT> )? ( <LIKE> | ( <SIMILAR> <TO> ) ) <link linkend="prod90">commonValueExpression</link> ( <ESCAPE> <link linkend="prod68">charVal</link> | ( <LBRACE> <ESCAPE> <link linkend="prod68">charVal</link> <RBRACE> ) )?</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod94" xreflabel="regexMatchCrit"/>regexMatchCrit</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod93" xreflabel="regexMatchCrit"/>regexMatchCrit</para></entry>
<entry align="left" valign="top"><para>::=
-( <NOT> )? <LIKE_REGEX> <link linkend="prod91">commonValueExpression</link></para></entry></row>
+( <NOT> )? <LIKE_REGEX> <link linkend="prod90">commonValueExpression</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod69" xreflabel="charVal"/>charVal</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod68" xreflabel="charVal"/>charVal</para></entry>
<entry align="left" valign="top"><para>::=
<link linkend="prod1">stringVal</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod92" xreflabel="betweenCrit"/>betweenCrit</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod91" xreflabel="betweenCrit"/>betweenCrit</para></entry>
<entry align="left" valign="top"><para>::=
-( <NOT> )? <BETWEEN> <link linkend="prod91">commonValueExpression</link> <AND> <link linkend="prod91">commonValueExpression</link></para></entry></row>
+( <NOT> )? <BETWEEN> <link linkend="prod90">commonValueExpression</link> <AND> <link linkend="prod90">commonValueExpression</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod96" xreflabel="isNullCrit"/>isNullCrit</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod95" xreflabel="isNullCrit"/>isNullCrit</para></entry>
<entry align="left" valign="top"><para>::=
<IS> ( <NOT> )? <NULL></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod95" xreflabel="setCrit"/>setCrit</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod94" xreflabel="setCrit"/>setCrit</para></entry>
<entry align="left" valign="top"><para>::=
-( <NOT> )? <IN> ( ( <link linkend="prod102">subqueryAndHint</link> ) | ( <LPAREN> <link linkend="prod91">commonValueExpression</link> ( <COMMA> <link linkend="prod91">commonValueExpression</link> )* <RPAREN> ) )</para></entry></row>
+( <NOT> )? <IN> ( ( <link linkend="prod101">subqueryAndHint</link> ) | ( <LPAREN> <link linkend="prod90">commonValueExpression</link> ( <COMMA> <link linkend="prod90">commonValueExpression</link> )* <RPAREN> ) )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod99" xreflabel="existsCriteria"/>existsCriteria</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod98" xreflabel="existsCriteria"/>existsCriteria</para></entry>
<entry align="left" valign="top"><para>::=
-<EXISTS> <link linkend="prod102">subqueryAndHint</link></para></entry></row>
+<EXISTS> <link linkend="prod101">subqueryAndHint</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod60" xreflabel="groupBy"/>groupBy</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod59" xreflabel="groupBy"/>groupBy</para></entry>
<entry align="left" valign="top"><para>::=
-<GROUP> <BY> <link linkend="prod48">expressionList</link></para></entry></row>
+<GROUP> <BY> <link linkend="prod47">expressionList</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod61" xreflabel="having"/>having</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod60" xreflabel="having"/>having</para></entry>
<entry align="left" valign="top"><para>::=
-<HAVING> <link linkend="prod35">criteria</link></para></entry></row>
+<HAVING> <link linkend="prod34">criteria</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod53" xreflabel="orderby"/>orderby</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod52" xreflabel="orderby"/>orderby</para></entry>
<entry align="left" valign="top"><para>::=
-<ORDER> <BY> <link linkend="prod103">sortSpecification</link> ( <COMMA> <link linkend="prod103">sortSpecification</link> )*</para></entry></row>
+<ORDER> <BY> <link linkend="prod102">sortSpecification</link> ( <COMMA> <link linkend="prod102">sortSpecification</link> )*</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod103" xreflabel="sortSpecification"/>sortSpecification</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod102" xreflabel="sortSpecification"/>sortSpecification</para></entry>
<entry align="left" valign="top"><para>::=
-<link linkend="prod104">sortKey</link> ( <ASC> | <DESC> )? ( <link linkend="prod11">nonReserved</link> <link linkend="prod11">nonReserved</link> )?</para></entry></row>
+<link linkend="prod103">sortKey</link> ( <ASC> | <DESC> )? ( <link linkend="prod11">nonReserved</link> <link linkend="prod11">nonReserved</link> )?</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod104" xreflabel="sortKey"/>sortKey</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod103" xreflabel="sortKey"/>sortKey</para></entry>
<entry align="left" valign="top"><para>::=
<link linkend="prod24">expression</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod105" xreflabel="intParam"/>intParam</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod104" xreflabel="intParam"/>intParam</para></entry>
<entry align="left" valign="top"><para>::=
-( <link linkend="prod84">intVal</link> | <QMARK> )</para></entry></row>
+( <link linkend="prod83">intVal</link> | <QMARK> )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod54" xreflabel="limit"/>limit</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod53" xreflabel="limit"/>limit</para></entry>
<entry align="left" valign="top"><para>::=
-( ( <LIMIT> <link linkend="prod105">intParam</link> ( <COMMA> <link linkend="prod105">intParam</link> )? ) | ( <OFFSET> <link linkend="prod105">intParam</link> ( <ROW> | <ROWS> ) ( <link linkend="prod106">fetchLimit</link> )? ) | ( <link linkend="prod106">fetchLimit</link> ) )</para></entry></row>
+( ( <LIMIT> <link linkend="prod104">intParam</link> ( <COMMA> <link linkend="prod104">intParam</link> )? ) | ( <OFFSET> <link linkend="prod104">intParam</link> ( <ROW> | <ROWS> ) ( <link linkend="prod105">fetchLimit</link> )? ) | ( <link linkend="prod105">fetchLimit</link> ) )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod106" xreflabel="fetchLimit"/>fetchLimit</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod105" xreflabel="fetchLimit"/>fetchLimit</para></entry>
<entry align="left" valign="top"><para>::=
-<FETCH> <link linkend="prod11">nonReserved</link> ( <link linkend="prod105">intParam</link> )? ( <ROW> | <ROWS> ) <ONLY></para></entry></row>
+<FETCH> <link linkend="prod11">nonReserved</link> ( <link linkend="prod104">intParam</link> )? ( <ROW> | <ROWS> ) <ONLY></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod45" xreflabel="option"/>option</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod44" xreflabel="option"/>option</para></entry>
<entry align="left" valign="top"><para>::=
<OPTION> ( <MAKEDEP> <link linkend="prod2">id</link> ( <COMMA> <link linkend="prod2">id</link> )* | <MAKENOTDEP> <link linkend="prod2">id</link> ( <COMMA> <link linkend="prod2">id</link> )* | <NOCACHE> ( <link linkend="prod2">id</link> ( <COMMA> <link linkend="prod2">id</link> )* )? )*</para></entry></row>
<row>
<entry align="right" valign="top"><para><anchor id="prod24" xreflabel="expression"/>expression</para></entry>
<entry align="left" valign="top"><para>::=
-<link linkend="prod35">criteria</link></para></entry></row>
+<link linkend="prod34">criteria</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod91" xreflabel="commonValueExpression"/>commonValueExpression</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod90" xreflabel="commonValueExpression"/>commonValueExpression</para></entry>
<entry align="left" valign="top"><para>::=
-( <link linkend="prod107">plusExpression</link> ( <CONCAT_OP> <link linkend="prod107">plusExpression</link> )* )</para></entry></row>
+( <link linkend="prod106">plusExpression</link> ( <CONCAT_OP> <link linkend="prod106">plusExpression</link> )* )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod107" xreflabel="plusExpression"/>plusExpression</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod106" xreflabel="plusExpression"/>plusExpression</para></entry>
<entry align="left" valign="top"><para>::=
-( <link linkend="prod108">timesExpression</link> ( <link linkend="prod109">plusOperator</link> <link linkend="prod108">timesExpression</link> )* )</para></entry></row>
+( <link linkend="prod107">timesExpression</link> ( <link linkend="prod108">plusOperator</link> <link linkend="prod107">timesExpression</link> )* )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod109" xreflabel="plusOperator"/>plusOperator</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod108" xreflabel="plusOperator"/>plusOperator</para></entry>
<entry align="left" valign="top"><para>::=
( <PLUS> | <MINUS> )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod108" xreflabel="timesExpression"/>timesExpression</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod107" xreflabel="timesExpression"/>timesExpression</para></entry>
<entry align="left" valign="top"><para>::=
-( <link linkend="prod110">valueExpressionPrimary</link> ( <link linkend="prod111">timesOperator</link> <link linkend="prod110">valueExpressionPrimary</link> )* )</para></entry></row>
+( <link linkend="prod109">valueExpressionPrimary</link> ( <link linkend="prod110">timesOperator</link> <link linkend="prod109">valueExpressionPrimary</link> )* )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod111" xreflabel="timesOperator"/>timesOperator</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod110" xreflabel="timesOperator"/>timesOperator</para></entry>
<entry align="left" valign="top"><para>::=
( <STAR> | <SLASH> )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod110" xreflabel="valueExpressionPrimary"/>valueExpressionPrimary</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod109" xreflabel="valueExpressionPrimary"/>valueExpressionPrimary</para></entry>
<entry align="left" valign="top"><para>::=
-( <QMARK> | <POS_REF> | <link linkend="prod112">literal</link> | ( <LBRACE> <link linkend="prod11">nonReserved</link> <link linkend="prod113">function</link> <RBRACE> ) | ( <link linkend="prod68">textAgg</link> ( <link linkend="prod114">windowSpecification</link> )? ) | ( <link linkend="prod70">aggregateSymbol</link> ( <link linkend="prod114">windowSpecification</link> )? ) | ( <link linkend="prod70">aggregateSymbol</link> ( <link linkend="prod114">windowSpecification</link> )? ) | <link linkend="prod66">orderedAgg</link> ( <link linkend="prod114">windowSpecification</link> )? | ( <link linkend="prod70">aggregateSymbol</link> <link linkend="prod114">windowSpecification</link> ) | ( <link linkend="prod113">function</link> ) | ( <ID> ( <LSBRACE> <link linkend="prod84">intVal</link> <RSBRACE> )? ) | <link linkend="prod101">subquery</link> | ( <LPAREN> <link linkend="prod24">expression</link> <RPAREN> ( <LSBRACE> <link!
linkend="prod84">intVal</link> <RSBRACE> )? ) | <link linkend="prod115">searchedCaseExpression</link> | <link linkend="prod116">caseExpression</link> )</para></entry></row>
+( <QMARK> | <POS_REF> | <link linkend="prod111">literal</link> | ( <LBRACE> <link linkend="prod11">nonReserved</link> <link linkend="prod112">function</link> <RBRACE> ) | ( <link linkend="prod67">textAgg</link> ( <link linkend="prod113">windowSpecification</link> )? ) | ( <link linkend="prod69">aggregateSymbol</link> ( <link linkend="prod113">windowSpecification</link> )? ) | ( <link linkend="prod69">aggregateSymbol</link> ( <link linkend="prod113">windowSpecification</link> )? ) | <link linkend="prod65">orderedAgg</link> ( <link linkend="prod113">windowSpecification</link> )? | ( <link linkend="prod69">aggregateSymbol</link> <link linkend="prod113">windowSpecification</link> ) | ( <link linkend="prod112">function</link> ) | ( <ID> ( <LSBRACE> <link linkend="prod83">intVal</link> <RSBRACE> )? ) | <link linkend="prod100">subquery</link> | ( <LPAREN> <link linkend="prod24">expression</link> <RPAREN> ( <LSBRACE> <link!
linkend="prod83">intVal</link> <RSBRACE> )? ) | <link linkend="prod114">searchedCaseExpression</link> | <link linkend="prod115">caseExpression</link> )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod114" xreflabel="windowSpecification"/>windowSpecification</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod113" xreflabel="windowSpecification"/>windowSpecification</para></entry>
<entry align="left" valign="top"><para>::=
-<OVER> <LPAREN> ( <PARTITION> <BY> <link linkend="prod48">expressionList</link> )? ( <link linkend="prod53">orderby</link> )? <RPAREN></para></entry></row>
+<OVER> <LPAREN> ( <PARTITION> <BY> <link linkend="prod47">expressionList</link> )? ( <link linkend="prod52">orderby</link> )? <RPAREN></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod116" xreflabel="caseExpression"/>caseExpression</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod115" xreflabel="caseExpression"/>caseExpression</para></entry>
<entry align="left" valign="top"><para>::=
<CASE> <link linkend="prod24">expression</link> ( <WHEN> <link linkend="prod24">expression</link> <THEN> <link linkend="prod24">expression</link> )+ ( <ELSE> <link linkend="prod24">expression</link> )? <END></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod115" xreflabel="searchedCaseExpression"/>searchedCaseExpression</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod114" xreflabel="searchedCaseExpression"/>searchedCaseExpression</para></entry>
<entry align="left" valign="top"><para>::=
-<CASE> ( <WHEN> <link linkend="prod35">criteria</link> <THEN> <link linkend="prod24">expression</link> )+ ( <ELSE> <link linkend="prod24">expression</link> )? <END></para></entry></row>
+<CASE> ( <WHEN> <link linkend="prod34">criteria</link> <THEN> <link linkend="prod24">expression</link> )+ ( <ELSE> <link linkend="prod24">expression</link> )? <END></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod113" xreflabel="function"/>function</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod112" xreflabel="function"/>function</para></entry>
<entry align="left" valign="top"><para>::=
-( ( <CONVERT> <LPAREN> <link linkend="prod24">expression</link> <COMMA> <link linkend="prod38">dataType</link> <RPAREN> ) | ( <CAST> <LPAREN> <link linkend="prod24">expression</link> <AS> <link linkend="prod38">dataType</link> <RPAREN> ) | ( <link linkend="prod11">nonReserved</link> <LPAREN> <link linkend="prod24">expression</link> <FROM> <link linkend="prod24">expression</link> ( <FOR> <link linkend="prod24">expression</link> )? <RPAREN> ) | ( <link linkend="prod11">nonReserved</link> <LPAREN> ( <YEAR> | <MONTH> | <DAY> | <HOUR> | <MINUTE> | <SECOND> ) <FROM> <link linkend="prod24">expression</link> <RPAREN> ) | ( <link linkend="prod11">nonReserved</link> <LPAREN> ( ( ( ( <LEADING> | <TRAILING> | <BOTH> ) ( <link linkend="prod24">expression</link> )? ) | <link linkend="prod24">expression</link> ) <FROM> )? <link linkend!
="prod24">expression</link> <RPAREN> ) | ( <link linkend="prod11">nonReserved</link> <LPAREN> <link linkend="prod24">expression</link> <COMMA> <link linkend="prod117">stringConstant</link> <RPAREN> ) | ( <link linkend="prod11">nonReserved</link> <LPAREN> <link linkend="prod118">intervalType</link> <COMMA> <link linkend="prod24">expression</link> <COMMA> <link linkend="prod24">expression</link> <RPAREN> ) | <link linkend="prod119">queryString</link> | ( ( <LEFT> | <RIGHT> | <CHAR> | <USER> | <YEAR> | <MONTH> | <HOUR> | <MINUTE> | <SECOND> | <XMLCONCAT> | <XMLCOMMENT> ) <LPAREN> ( <link linkend="prod48">expressionList</link> )? <RPAREN> ) | ( ( <TRANSLATE> | <INSERT> ) <LPAREN> ( <link linkend="prod48">expressionList</link> )? <RPAREN> ) | <link linkend="prod120">xmlParse</link> | <link linkend="prod121">xmlElement</link> | ( &l!
t;XMLPI> <LPAREN> ( <ID> <link linkend="prod122!
">idExpr
ession</link> | <link linkend="prod122">idExpression</link> ) ( <COMMA> <link linkend="prod24">expression</link> )? <RPAREN> ) | <link linkend="prod123">xmlForest</link> | <link linkend="prod82">xmlSerialize</link> | <link linkend="prod85">xmlQuery</link> | ( <link linkend="prod2">id</link> <LPAREN> ( <link linkend="prod48">expressionList</link> )? <RPAREN> ) )</para></entry></row>
+( ( <CONVERT> <LPAREN> <link linkend="prod24">expression</link> <COMMA> <link linkend="prod37">dataType</link> <RPAREN> ) | ( <CAST> <LPAREN> <link linkend="prod24">expression</link> <AS> <link linkend="prod37">dataType</link> <RPAREN> ) | ( <link linkend="prod11">nonReserved</link> <LPAREN> <link linkend="prod24">expression</link> <FROM> <link linkend="prod24">expression</link> ( <FOR> <link linkend="prod24">expression</link> )? <RPAREN> ) | ( <link linkend="prod11">nonReserved</link> <LPAREN> ( <YEAR> | <MONTH> | <DAY> | <HOUR> | <MINUTE> | <SECOND> ) <FROM> <link linkend="prod24">expression</link> <RPAREN> ) | ( <link linkend="prod11">nonReserved</link> <LPAREN> ( ( ( ( <LEADING> | <TRAILING> | <BOTH> ) ( <link linkend="prod24">expression</link> )? ) | <link linkend="prod24">expression</link> ) <FROM> )? <link linkend!
="prod24">expression</link> <RPAREN> ) | ( <link linkend="prod11">nonReserved</link> <LPAREN> <link linkend="prod24">expression</link> <COMMA> <link linkend="prod116">stringConstant</link> <RPAREN> ) | ( <link linkend="prod11">nonReserved</link> <LPAREN> <link linkend="prod117">intervalType</link> <COMMA> <link linkend="prod24">expression</link> <COMMA> <link linkend="prod24">expression</link> <RPAREN> ) | <link linkend="prod118">queryString</link> | ( ( <LEFT> | <RIGHT> | <CHAR> | <USER> | <YEAR> | <MONTH> | <HOUR> | <MINUTE> | <SECOND> | <XMLCONCAT> | <XMLCOMMENT> ) <LPAREN> ( <link linkend="prod47">expressionList</link> )? <RPAREN> ) | ( ( <TRANSLATE> | <INSERT> ) <LPAREN> ( <link linkend="prod47">expressionList</link> )? <RPAREN> ) | <link linkend="prod119">xmlParse</link> | <link linkend="prod120">xmlElement</link> | ( &l!
t;XMLPI> <LPAREN> ( <ID> <link linkend="prod121!
">idExpr
ession</link> | <link linkend="prod121">idExpression</link> ) ( <COMMA> <link linkend="prod24">expression</link> )? <RPAREN> ) | <link linkend="prod122">xmlForest</link> | <link linkend="prod81">xmlSerialize</link> | <link linkend="prod84">xmlQuery</link> | ( <link linkend="prod2">id</link> <LPAREN> ( <link linkend="prod47">expressionList</link> )? <RPAREN> ) )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod117" xreflabel="stringConstant"/>stringConstant</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod116" xreflabel="stringConstant"/>stringConstant</para></entry>
<entry align="left" valign="top"><para>::=
<link linkend="prod1">stringVal</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod120" xreflabel="xmlParse"/>xmlParse</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod119" xreflabel="xmlParse"/>xmlParse</para></entry>
<entry align="left" valign="top"><para>::=
<XMLPARSE> <LPAREN> <link linkend="prod11">nonReserved</link> <link linkend="prod24">expression</link> ( <link linkend="prod11">nonReserved</link> )? <RPAREN></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod119" xreflabel="queryString"/>queryString</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod118" xreflabel="queryString"/>queryString</para></entry>
<entry align="left" valign="top"><para>::=
-<link linkend="prod11">nonReserved</link> <LPAREN> <link linkend="prod24">expression</link> ( <COMMA> <link linkend="prod65">derivedColumn</link> )* <RPAREN></para></entry></row>
+<link linkend="prod11">nonReserved</link> <LPAREN> <link linkend="prod24">expression</link> ( <COMMA> <link linkend="prod64">derivedColumn</link> )* <RPAREN></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod121" xreflabel="xmlElement"/>xmlElement</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod120" xreflabel="xmlElement"/>xmlElement</para></entry>
<entry align="left" valign="top"><para>::=
-<XMLELEMENT> <LPAREN> ( <ID> <link linkend="prod2">id</link> | <link linkend="prod2">id</link> ) ( <COMMA> <link linkend="prod86">xmlNamespaces</link> )? ( <COMMA> <link linkend="prod124">xmlAttributes</link> )? ( <COMMA> <link linkend="prod24">expression</link> )* <RPAREN></para></entry></row>
+<XMLELEMENT> <LPAREN> ( <ID> <link linkend="prod2">id</link> | <link linkend="prod2">id</link> ) ( <COMMA> <link linkend="prod85">xmlNamespaces</link> )? ( <COMMA> <link linkend="prod123">xmlAttributes</link> )? ( <COMMA> <link linkend="prod24">expression</link> )* <RPAREN></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod124" xreflabel="xmlAttributes"/>xmlAttributes</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod123" xreflabel="xmlAttributes"/>xmlAttributes</para></entry>
<entry align="left" valign="top"><para>::=
-<XMLATTRIBUTES> <LPAREN> <link linkend="prod65">derivedColumn</link> ( <COMMA> <link linkend="prod65">derivedColumn</link> )* <RPAREN></para></entry></row>
+<XMLATTRIBUTES> <LPAREN> <link linkend="prod64">derivedColumn</link> ( <COMMA> <link linkend="prod64">derivedColumn</link> )* <RPAREN></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod123" xreflabel="xmlForest"/>xmlForest</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod122" xreflabel="xmlForest"/>xmlForest</para></entry>
<entry align="left" valign="top"><para>::=
-<XMLFOREST> <LPAREN> ( <link linkend="prod86">xmlNamespaces</link> <COMMA> )? <link linkend="prod65">derivedColumn</link> ( <COMMA> <link linkend="prod65">derivedColumn</link> )* <RPAREN></para></entry></row>
+<XMLFOREST> <LPAREN> ( <link linkend="prod85">xmlNamespaces</link> <COMMA> )? <link linkend="prod64">derivedColumn</link> ( <COMMA> <link linkend="prod64">derivedColumn</link> )* <RPAREN></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod86" xreflabel="xmlNamespaces"/>xmlNamespaces</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod85" xreflabel="xmlNamespaces"/>xmlNamespaces</para></entry>
<entry align="left" valign="top"><para>::=
-<XMLNAMESPACES> <LPAREN> <link linkend="prod125">namespaceItem</link> ( <COMMA> <link linkend="prod125">namespaceItem</link> )* <RPAREN></para></entry></row>
+<XMLNAMESPACES> <LPAREN> <link linkend="prod124">namespaceItem</link> ( <COMMA> <link linkend="prod124">namespaceItem</link> )* <RPAREN></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod125" xreflabel="namespaceItem"/>namespaceItem</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod124" xreflabel="namespaceItem"/>namespaceItem</para></entry>
<entry align="left" valign="top"><para>::=
( <link linkend="prod1">stringVal</link> <AS> <link linkend="prod2">id</link> )</para></entry></row>
<row>
@@ -888,7 +886,7 @@
<entry align="left" valign="top"><para>::=
( <DEFAULT_KEYWORD> <link linkend="prod1">stringVal</link> )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod122" xreflabel="idExpression"/>idExpression</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod121" xreflabel="idExpression"/>idExpression</para></entry>
<entry align="left" valign="top"><para>::=
<link linkend="prod2">id</link></para></entry></row>
<row>
@@ -896,15 +894,15 @@
<entry align="left" valign="top"><para>::=
( <STRING> | <VARCHAR> | <BOOLEAN> | <BYTE> | <TINYINT> | <SHORT> | <SMALLINT> | <CHAR> | <INTEGER> | <LONG> | <BIGINT> | <BIGINTEGER> | <FLOAT> | <REAL> | <DOUBLE> | <BIGDECIMAL> | <DECIMAL> | <DATE> | <TIME> | <TIMESTAMP> | <OBJECT> | <BLOB> | <CLOB> | <XML> )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod38" xreflabel="dataType"/>dataType</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod37" xreflabel="dataType"/>dataType</para></entry>
<entry align="left" valign="top"><para>::=
<link linkend="prod22">dataTypeString</link></para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod118" xreflabel="intervalType"/>intervalType</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod117" xreflabel="intervalType"/>intervalType</para></entry>
<entry align="left" valign="top"><para>::=
( <link linkend="prod11">nonReserved</link> )</para></entry></row>
<row>
-<entry align="right" valign="top"><para><anchor id="prod112" xreflabel="literal"/>literal</para></entry>
+<entry align="right" valign="top"><para><anchor id="prod111" xreflabel="literal"/>literal</para></entry>
<entry align="left" valign="top"><para>::=
( <link linkend="prod1">stringVal</link> | <INTEGERVAL> | <FLOATVAL> | <FALSE> | <TRUE> | <UNKNOWN> | <NULL> | ( ( <BOOLEANTYPE> | <TIMESTAMPTYPE> | <DATETYPE> | <TIMETYPE> ) <link linkend="prod1">stringVal</link> <RBRACE> ) )</para></entry></row>
</tbody>
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/procedures.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/procedures.xml 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/procedures.xml 2011-08-10 20:06:04 UTC (rev 3372)
@@ -218,12 +218,40 @@
</section>
</section>
<section>
+ <title>Compound Statement</title>
+ <para>A compound statement or block logically groups a series of statements. Temporary tables and variables created in a compound statement are local only to that block are destroyed when exiting the block.</para>
+ <para>
+ Usage:
+ <synopsis label="Usage" >[label :] BEGIN [[NOT] ATOMIC]
+ statement*
+END</synopsis>
+ <note><para>When a block is expected by a IF, LOOP, WHILE, etc. a single statement is also accepted by the parser. Even though the block BEGIN/END are not expected, the statement will execute as if wrapped in a BEGIN/END pair.</para></note>
+ </para>
+ <itemizedlist>
+ <para>Syntax Rules</para>
+ <listitem><para>IF NOT ATOMIC or no ATOMIC clause is specificed, the block will be executed non-atomically.</para>
+ </listitem>
+ <listitem><para>IF ATOMIC the block must execute atomically. If a transaction is already associated with the thread, no aditional action will be taken - savepoints and/or sub-transactions are not currrently used. Otherwise a transaction will be associated with the execution of the block.</para>
+ </listitem>
+ <listitem><para>The label must not be the same as any other label used in statements containing this one.</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
<title>If Statement</title>
<para>An IF statement evaluates a condition and executes either
- one of two blocks depending on the result. You can nest IF
+ one of two statements depending on the result. You can nest IF
statements to create complex branching logic. A dependent ELSE
- statement will execute its block of code only if the IF statement
+ statement will execute its statement only if the IF statement
evaluates to false.</para>
+ <para>
+ Usage:
+ <synopsis label="Usage" >IF (criteria)
+ block
+[ELSE
+ block]
+END</synopsis>
+ </para>
<example>
<title>Example If Statement</title>
<programlisting>IF ( var1 = 'North America')
@@ -234,45 +262,90 @@
...statement...
END</programlisting>
</example>
- <note>
+ <tip>
<para>
NULL values should be considered in the criteria of an IF statement. IS NULL criteria can be used to detect the presense of a NULL value.
</para>
- </note>
+ </tip>
</section>
<section>
<title>Loop Statement</title>
<para>A LOOP statement is an iterative control construct that is used to cursor through a result set.</para>
<para>
Usage:
- <synopsis label="Usage" >LOOP ON <select statement> AS <cursorname>
-BEGIN
- ...
-END</synopsis>
+ <synopsis label="Usage" >[label :] LOOP ON <select statement> AS <cursorname>
+ block</synopsis>
</para>
+ <itemizedlist>
+ <para>Syntax Rules</para>
+ <listitem><para>The label must not be the same as any other label used in statements containing this one.</para>
+ </listitem>
+ </itemizedlist>
</section>
<section>
<title>While Statement</title>
- <para>A WHILE statement is an iterative control construct that is used to execute a set of statements repeatedly whenever a specified condition is met.</para>
+ <para>A WHILE statement is an iterative control construct that is used to execute a block repeatedly whenever a specified condition is met.</para>
<para>
Usage:
- <synopsis label="Usage" >WHILE <criteria>
-BEGIN
- ...
-END</synopsis>
+ <synopsis label="Usage" >[label :] WHILE <criteria>
+ block</synopsis>
</para>
+ <itemizedlist>
+ <para>Syntax Rules</para>
+ <listitem><para>The label must not be the same as any other label used in statements containing this one.</para>
+ </listitem>
+ </itemizedlist>
</section>
<section>
<title>Continue Statement</title>
<para>A CONTINUE statement is used inside a LOOP or WHILE construct to continue with the next loop by skipping over the rest of the statements in the loop. It must be used inside a LOOP or WHILE statement.</para>
+ <para>
+ Usage:
+ <synopsis label="Usage" >CONTINUE [label];</synopsis>
+ </para>
+ <itemizedlist>
+ <para>Syntax Rules</para>
+ <listitem><para>If the label is specified, it must exist on a containing LOOP or WHILE statement.</para>
+ </listitem>
+ <listitem><para>If no label is specified, the statement will affect the closest containing LOOP or WHILE statement.</para>
+ </listitem>
+ </itemizedlist>
</section>
<section>
<title>Break Statement</title>
<para>A BREAK statement is used inside a LOOP or WHILE construct to break from the loop. It must be used inside a LOOP or WHILE statement.</para>
+ <para>
+ Usage:
+ <synopsis label="Usage" >BREAK [label];</synopsis>
+ </para>
+ <itemizedlist>
+ <para>Syntax Rules</para>
+ <listitem><para>If the label is specified, it must exist on a containing LOOP or WHILE statement.</para>
+ </listitem>
+ <listitem><para>If no label is specified, the statement will affect the closest containing LOOP or WHILE statement.</para>
+ </listitem>
+ </itemizedlist>
</section>
<section>
+ <title>Leave Statement</title>
+ <para>A LEAVE statement is used inside a compound, LOOP, or WHILE construct to leave to the specified level.</para>
+ <para>
+ Usage:
+ <synopsis label="Usage" >LEAVE label;</synopsis>
+ </para>
+ <itemizedlist>
+ <para>Syntax Rules</para>
+ <listitem><para>The label must exist on a containing compound statement, LOOP, or WHILE statement.</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
<title>Error Statement</title>
<para>An ERROR statement declares that the procedure has entered an error state and should abort. This statement will also roll back the current transaction, if one exists. Any valid expression can be specified after the ERROR keyword.</para>
+ <para>
+ Usage:
+ <synopsis label="Usage" >ERROR message;</synopsis>
+ </para>
<example>
<title>Example Error Statement</title>
<programlisting>ERROR 'Invalid input value: ' || nvl(Acct.GetBalance.AcctID, 'null');</programlisting>
@@ -292,13 +365,10 @@
<para>
Usage:
<synopsis label="Usage" >CREATE VIRTUAL PROCEDURE
-BEGIN
- ...
-END</synopsis>
+block</synopsis>
</para>
<para>The CREATE VIRTUAL PROCEDURE line demarcates the beginning of
- the procedure. The BEGIN and END keywords are used to denote block
- boundaries. Within the body of the procedure, any valid <link linkend="procedure_language">statement</link> may be used.
+ the procedure. Within the body of the procedure, any valid <link linkend="procedure_language">statement</link> may be used.
</para>
<para>There is no explict cursoring or return statement, rather the last command statement executed in the procedure that returns a result set will be
returned as the result. The output of that statement must match the
@@ -462,7 +532,7 @@
There may only be 1 FOR EACH ROW procedure for each INSERT, UPDATE, or DELETE operation against a view. FOR EACH ROW update procedures can also be used to emulate BEFORE/AFTER each row triggers while still retaining the ability to perform an inherent update.
This BEFORE/AFTER trigger behavior with an inherent update can be achieved by creating an additional updatable view over the target view with update proceudres of the form:
<programlisting lang="sql">FOR EACH ROW
- BEGIN
+ BEGIN ATOMIC
--before row logic
--default insert/update/delete against the target view
@@ -476,13 +546,16 @@
<para>
Usage:
<synopsis label="Usage" >FOR EACH ROW
- BEGIN
+ BEGIN ATOMIC
...
END</synopsis>
</para>
<para>The BEGIN and END keywords are used to denote block
boundaries. Within the body of the procedure, any valid <link linkend="procedure_language">statement</link> may be used.
</para>
+ <note>
+ <para>The use of the atomic keyword is currently optional for backward compatibility, but unlike a normal block, the default for instead of triggers is atomic.</para>
+ </note>
</section>
<section>
<title>Special Variables</title>
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/CapabilitiesConverter.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/CapabilitiesConverter.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/CapabilitiesConverter.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -106,11 +106,11 @@
tgtCaps.setCapabilitySupport(Capability.CRITERIA_SIMILAR, srcCaps.supportsSimilarTo());
tgtCaps.setCapabilitySupport(Capability.CRITERIA_LIKE_REGEX, srcCaps.supportsLikeRegex());
- List functions = srcCaps.getSupportedFunctions();
+ List<String> functions = srcCaps.getSupportedFunctions();
if(functions != null && functions.size() > 0) {
- Iterator iter = functions.iterator();
+ Iterator<String> iter = functions.iterator();
while(iter.hasNext()) {
- String func = (String) iter.next();
+ String func = iter.next();
tgtCaps.setFunctionSupport(func.toLowerCase(), true);
}
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/Request.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -253,6 +253,8 @@
this.context.setSession(workContext.getSession());
this.context.setRequestId(this.requestId);
this.context.setDQPWorkContext(this.workContext);
+ this.context.setTransactionService(this.transactionService);
+ this.context.setTransactionContext(this.transactionContext);
}
@Override
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/ProcedurePlanner.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/ProcedurePlanner.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/ProcedurePlanner.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -36,8 +36,7 @@
import org.teiid.query.optimizer.capabilities.CapabilitiesFinder;
import org.teiid.query.processor.ProcessorPlan;
import org.teiid.query.processor.proc.AssignmentInstruction;
-import org.teiid.query.processor.proc.BreakInstruction;
-import org.teiid.query.processor.proc.ContinueInstruction;
+import org.teiid.query.processor.proc.BranchingInstruction;
import org.teiid.query.processor.proc.CreateCursorResultSetInstruction;
import org.teiid.query.processor.proc.ErrorInstruction;
import org.teiid.query.processor.proc.ExecDynamicSqlInstruction;
@@ -53,6 +52,7 @@
import org.teiid.query.sql.lang.StoredProcedure;
import org.teiid.query.sql.proc.AssignmentStatement;
import org.teiid.query.sql.proc.Block;
+import org.teiid.query.sql.proc.BranchingStatement;
import org.teiid.query.sql.proc.CommandStatement;
import org.teiid.query.sql.proc.CreateUpdateProcedureCommand;
import org.teiid.query.sql.proc.IfStatement;
@@ -148,7 +148,8 @@
// Generate program and add instructions
// this program represents the block on the procedure
// instruction in the program would correspond to statements in the block
- Program programBlock = new Program();
+ Program programBlock = new Program(block.isAtomic());
+ programBlock.setLabel(block.getLabel());
// plan each statement in the block
for (Statement statement : block.getStatements()) {
@@ -281,19 +282,14 @@
break;
}
case Statement.TYPE_BREAK:
- {
- if(debug) {
- analysisRecord.println("\tBREAK STATEMENT:\n" + statement); //$NON-NLS-1$
- }
- instruction = new BreakInstruction();
- break;
- }
case Statement.TYPE_CONTINUE:
+ case Statement.TYPE_LEAVE:
{
+ BranchingStatement bs = (BranchingStatement)statement;
if(debug) {
- analysisRecord.println("\tCONTINUE STATEMENT:\n" + statement); //$NON-NLS-1$
+ analysisRecord.println("\t" + statement); //$NON-NLS-1$
}
- instruction = new ContinueInstruction();
+ instruction = new BranchingInstruction(bs);
break;
}
case Statement.TYPE_LOOP:
@@ -307,7 +303,7 @@
ProcessorPlan commandPlan = loopStmt.getCommand().getProcessorPlan();
Program loopProgram = planBlock(parentProcCommand, loopStmt.getBlock(), metadata, debug, idGenerator, capFinder, analysisRecord, context);
- instruction = new LoopInstruction(loopProgram, rsName, commandPlan);
+ instruction = new LoopInstruction(loopProgram, rsName, commandPlan, loopStmt.getLabel());
break;
}
case Statement.TYPE_WHILE:
@@ -317,7 +313,7 @@
if(debug) {
analysisRecord.println("\tWHILE STATEMENT:\n" + statement); //$NON-NLS-1$
}
- instruction = new WhileInstruction(whileProgram, whileStmt.getCondition());
+ instruction = new WhileInstruction(whileProgram, whileStmt.getCondition(), whileStmt.getLabel());
break;
}
default:
Modified: trunk/engine/src/main/java/org/teiid/query/parser/SQLParserUtil.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/parser/SQLParserUtil.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/java/org/teiid/query/parser/SQLParserUtil.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -40,7 +40,9 @@
import org.teiid.query.sql.lang.QueryCommand;
import org.teiid.query.sql.lang.SetQuery;
import org.teiid.query.sql.lang.ExistsCriteria.SubqueryHint;
+import org.teiid.query.sql.proc.Block;
import org.teiid.query.sql.proc.CriteriaSelector;
+import org.teiid.query.sql.proc.Statement;
public class SQLParserUtil {
@@ -319,4 +321,14 @@
return setQuery;
}
+ static Block asBlock(Statement stmt) {
+ if (stmt == null) {
+ return null;
+ }
+ if (stmt instanceof Block) {
+ return (Block)stmt;
+ }
+ return new Block(stmt);
+ }
+
}
Added: trunk/engine/src/main/java/org/teiid/query/processor/proc/BranchingInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/BranchingInstruction.java (rev 0)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/BranchingInstruction.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -0,0 +1,78 @@
+/*
+ * 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.query.processor.proc;
+
+import org.teiid.client.plan.PlanNode;
+import org.teiid.core.TeiidComponentException;
+import org.teiid.query.sql.proc.BranchingStatement;
+import org.teiid.query.sql.proc.BranchingStatement.BranchingMode;
+
+/**
+ * <p>This {@link ProgramInstruction} continue with the next loop when processed</p>.
+ */
+public class BranchingInstruction extends ProgramInstruction {
+
+ private BranchingStatement bs;
+
+ public BranchingInstruction(BranchingStatement bs) {
+ this.bs = bs;
+ }
+
+ public String toString() {
+ return bs.toString();
+ }
+
+ public void process(ProcedurePlan env) throws TeiidComponentException {
+ Program parentProgram = env.peek();
+
+ //find the parent program that contains the loop/while instruction
+ while(true){
+ if (bs.getMode() == BranchingMode.LEAVE && bs.getLabel().equalsIgnoreCase(parentProgram.getLabel())) {
+ env.pop(true);
+ break;
+ }
+ if(parentProgram.getCurrentInstruction() instanceof RepeatedInstruction){
+ if (bs.getLabel() == null) {
+ break;
+ }
+ RepeatedInstruction ri = (RepeatedInstruction)parentProgram.getCurrentInstruction();
+ if (bs.getLabel().equalsIgnoreCase(ri.getLabel())) {
+ break;
+ }
+ }
+ env.pop(true);
+ parentProgram = env.peek();
+ }
+
+ if (bs.getMode() != BranchingMode.CONTINUE) {
+ env.incrementProgramCounter();
+ }
+ }
+
+ public PlanNode getDescriptionProperties() {
+ return new PlanNode(bs.toString());
+ }
+
+}
Property changes on: trunk/engine/src/main/java/org/teiid/query/processor/proc/BranchingInstruction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/engine/src/main/java/org/teiid/query/processor/proc/BreakInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/BreakInstruction.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/BreakInstruction.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -1,49 +0,0 @@
-/*
- * 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.query.processor.proc;
-
-import org.teiid.client.plan.PlanNode;
-import org.teiid.core.TeiidComponentException;
-
-
-/**
- * <p>This {@link ProgramInstruction} break from a loop when processed</p>.
- */
-public class BreakInstruction extends ContinueInstruction {
-
- public String toString() {
- return "BREAK INSTRUCTION"; //$NON-NLS-1$
- }
-
- public void process(ProcedurePlan env) throws TeiidComponentException {
- super.process(env);
- env.incrementProgramCounter();
- }
-
- public PlanNode getDescriptionProperties() {
- return new PlanNode("BREAK"); //$NON-NLS-1$
- }
-
-}
Deleted: trunk/engine/src/main/java/org/teiid/query/processor/proc/ContinueInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/ContinueInstruction.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/ContinueInstruction.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -1,55 +0,0 @@
-/*
- * 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.query.processor.proc;
-
-import org.teiid.client.plan.PlanNode;
-import org.teiid.core.TeiidComponentException;
-
-/**
- * <p>This {@link ProgramInstruction} continue with the next loop when processed</p>.
- */
-public class ContinueInstruction extends ProgramInstruction {
- public String toString() {
- return "CONTINUE INSTRUCTION"; //$NON-NLS-1$
- }
-
- public void process(ProcedurePlan env) throws TeiidComponentException {
- Program parentProgram = env.peek();
-
- //find the parent program that contains the loop/while instruction
- while(true){
- if(parentProgram.getCurrentInstruction() instanceof RepeatedInstruction){
- break;
- }
- env.pop();
- parentProgram = env.peek();
- }
- }
-
- public PlanNode getDescriptionProperties() {
- return new PlanNode("CONTINUE"); //$NON-NLS-1$
- }
-
-}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/proc/ExecDynamicSqlInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/ExecDynamicSqlInstruction.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/ExecDynamicSqlInstruction.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -41,9 +41,11 @@
import org.teiid.dqp.internal.process.Request;
import org.teiid.language.SQLConstants.Reserved;
import org.teiid.logging.LogManager;
+import org.teiid.metadata.Column;
import org.teiid.query.QueryPlugin;
import org.teiid.query.analysis.AnalysisRecord;
import org.teiid.query.metadata.QueryMetadataInterface;
+import org.teiid.query.metadata.TempMetadataAdapter;
import org.teiid.query.metadata.TempMetadataStore;
import org.teiid.query.optimizer.QueryOptimizer;
import org.teiid.query.optimizer.capabilities.CapabilitiesFinder;
@@ -54,6 +56,7 @@
import org.teiid.query.rewriter.QueryRewriter;
import org.teiid.query.sql.ProcedureReservedWords;
import org.teiid.query.sql.lang.Command;
+import org.teiid.query.sql.lang.Create;
import org.teiid.query.sql.lang.DynamicCommand;
import org.teiid.query.sql.lang.Insert;
import org.teiid.query.sql.lang.Query;
@@ -202,13 +205,22 @@
}
};
- dynamicProgram = new Program();
+ dynamicProgram = new Program(false);
dynamicProgram.addInstruction(inst);
if (dynamicCommand.getIntoGroup() != null) {
String groupName = dynamicCommand.getIntoGroup().getCanonicalName();
if (!procEnv.getTempTableStore().getAllTempTables().contains(groupName)) {
- procEnv.getTempContext().add(groupName);
+ //create the temp table in the parent scope
+ Create create = new Create();
+ create.setTable(new GroupSymbol(groupName));
+ for (ElementSymbol es : ((Insert)command).getVariables()) {
+ Column c = new Column();
+ c.setName(es.getShortName());
+ c.setRuntimeType(DataTypeManager.getDataTypeName(es.getType()));
+ create.getColumns().add(c);
+ }
+ procEnv.getDataManager().registerRequest(procEnv.getContext(), create, TempMetadataAdapter.TEMP_MODEL.getName(), null, 0, -1);
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/proc/LoopInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/LoopInstruction.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/LoopInstruction.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -45,11 +45,23 @@
private Program loopProgram;
private List elements;
+ private String label;
- public LoopInstruction(Program loopProgram, String rsName, ProcessorPlan plan) {
+ public LoopInstruction(Program loopProgram, String rsName, ProcessorPlan plan, String label) {
super(rsName, plan, false);
this.loopProgram = loopProgram;
+ this.label = label;
}
+
+ @Override
+ public String getLabel() {
+ return label;
+ }
+
+ @Override
+ public void setLabel(String label) {
+ this.label = label;
+ }
public void process(ProcedurePlan procEnv) throws TeiidComponentException {
List currentRow = procEnv.getCurrentRow(rsName);
@@ -74,7 +86,7 @@
*/
public LoopInstruction clone(){
ProcessorPlan clonedPlan = this.plan.clone();
- return new LoopInstruction((Program)this.loopProgram.clone(), this.rsName, clonedPlan);
+ return new LoopInstruction((Program)this.loopProgram.clone(), this.rsName, clonedPlan, label);
}
public String toString() {
Modified: trunk/engine/src/main/java/org/teiid/query/processor/proc/ProcedurePlan.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/ProcedurePlan.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/ProcedurePlan.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -24,21 +24,21 @@
import static org.teiid.query.analysis.AnalysisRecord.*;
+import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import java.util.Stack;
import org.teiid.api.exception.query.QueryMetadataException;
import org.teiid.api.exception.query.QueryValidatorException;
import org.teiid.client.plan.PlanNode;
+import org.teiid.client.xa.XATransactionException;
import org.teiid.common.buffer.BlockedException;
import org.teiid.common.buffer.BufferManager;
import org.teiid.common.buffer.IndexedTupleSource;
@@ -50,7 +50,14 @@
import org.teiid.core.TeiidProcessingException;
import org.teiid.core.types.DataTypeManager;
import org.teiid.core.util.Assertion;
+import org.teiid.dqp.internal.process.DataTierTupleSource;
+import org.teiid.dqp.service.TransactionContext;
+import org.teiid.dqp.service.TransactionService;
+import org.teiid.dqp.service.TransactionContext.Scope;
+import org.teiid.events.EventDistributor;
+import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
+import org.teiid.metadata.MetadataRepository;
import org.teiid.query.QueryPlugin;
import org.teiid.query.analysis.AnalysisRecord;
import org.teiid.query.metadata.QueryMetadataInterface;
@@ -62,6 +69,7 @@
import org.teiid.query.processor.QueryProcessor;
import org.teiid.query.processor.relational.SubqueryAwareEvaluator;
import org.teiid.query.sql.ProcedureReservedWords;
+import org.teiid.query.sql.lang.Command;
import org.teiid.query.sql.lang.Criteria;
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.Expression;
@@ -122,9 +130,6 @@
private List outputElements;
- private TempTableStore tempTableStore;
-
- private LinkedList<Set<String>> tempContext = new LinkedList<Set<String>>();
private SubqueryAwareEvaluator evaluator;
// Stack of programs, with current program on top
@@ -133,13 +138,18 @@
private boolean evaluatedParams;
private boolean requiresTransaction = true;
+
+ private TransactionContext blockContext;
+ /**
+ * Resources cannot be held open across the txn boundary. This list is a hack at ensuring the resources are closed.
+ */
+ private LinkedList<WeakReference<DataTierTupleSource>> txnTupleSources = new LinkedList<WeakReference<DataTierTupleSource>>();
/**
* Constructor for ProcedurePlan.
*/
public ProcedurePlan(Program originalProgram) {
this.originalProgram = originalProgram;
- this.programs.add(originalProgram);
createVariableContext();
}
@@ -154,7 +164,37 @@
this.bufferMgr = bufferMgr;
this.batchSize = bufferMgr.getProcessorBatchSize();
setContext(context.clone());
- this.dataMgr = dataMgr;
+ this.dataMgr = new ProcessorDataManager() {
+
+ @Override
+ public TupleSource registerRequest(CommandContext context, Command command,
+ String modelName, String connectorBindingId, int nodeID, int limit)
+ throws TeiidComponentException, TeiidProcessingException {
+ TupleSource ts = parentDataMrg.registerRequest(context, command, modelName, connectorBindingId, nodeID, limit);
+ if (blockContext != null && ts instanceof DataTierTupleSource) {
+ txnTupleSources.add(new WeakReference<DataTierTupleSource>((DataTierTupleSource)ts));
+ }
+ return ts;
+ }
+
+ @Override
+ public Object lookupCodeValue(CommandContext context, String codeTableName,
+ String returnElementName, String keyElementName, Object keyValue)
+ throws BlockedException, TeiidComponentException,
+ TeiidProcessingException {
+ return parentDataMrg.lookupCodeValue(context, codeTableName, returnElementName, keyElementName, keyValue);
+ }
+
+ @Override
+ public MetadataRepository getMetadataRepository() {
+ return parentDataMrg.getMetadataRepository();
+ }
+
+ @Override
+ public EventDistributor getEventDistributor() {
+ return parentDataMrg.getEventDistributor();
+ }
+ };
this.parentDataMrg = dataMgr;
if (evaluator == null) {
this.evaluator = new SubqueryAwareEvaluator(Collections.emptyMap(), getDataManager(), getContext(), this.bufferMgr);
@@ -180,10 +220,7 @@
lastBatch = false;
//reset program stack
- originalProgram.resetProgramCounter();
- this.tempContext.clear();
programs.clear();
- programs.push(originalProgram);
LogManager.logTrace(org.teiid.logging.LogConstants.CTX_DQP, "ProcedurePlan reset"); //$NON-NLS-1$
}
@@ -218,8 +255,7 @@
context.setValue(entry.getKey(), value);
}
}
- tempTableStore = new TempTableStore(getContext().getConnectionID());
- getContext().setTempTableStore(tempTableStore);
+ this.push(originalProgram);
}
this.evaluatedParams = true;
}
@@ -236,11 +272,26 @@
VariableContext context, Object value) {
context.setValue(param, value);
}
+
+ @Override
+ public TupleBatch nextBatch() throws BlockedException,
+ TeiidComponentException, TeiidProcessingException {
+ if (blockContext != null) {
+ this.getContext().getTransactionServer().resume(blockContext);
+ }
+ try {
+ return nextBatchDirect();
+ } finally {
+ if (blockContext != null) {
+ this.getContext().getTransactionServer().suspend(blockContext);
+ }
+ }
+ }
/**
* @see ProcessorPlan#nextBatch()
*/
- public TupleBatch nextBatch()
+ public TupleBatch nextBatchDirect()
throws TeiidComponentException, TeiidProcessingException, BlockedException {
// Already returned results?
@@ -261,7 +312,7 @@
// Next, attempt to return batches if processing completed
while(! isBatchFull()) {
// May throw BlockedException and exit here
- List tuple = this.finalTupleSource.nextTuple();
+ List<?> tuple = this.finalTupleSource.nextTuple();
if(tuple == null) {
if (outParams != null) {
VariableContext vc = getCurrentVariableContext();
@@ -311,7 +362,7 @@
inst = program.getCurrentInstruction();
if (inst == null){
LogManager.logTrace(org.teiid.logging.LogConstants.CTX_DQP, "Finished program", program); //$NON-NLS-1$
- this.pop();
+ this.pop(true);
continue;
}
if (inst instanceof RepeatedInstruction) {
@@ -350,14 +401,19 @@
removeResults(rsName);
}
}
- if(getTempTableStore()!=null) {
- getTempTableStore().removeTempTables();
+ while (!programs.isEmpty()) {
+ try {
+ pop(false);
+ } catch (TeiidComponentException e) {
+ LogManager.logDetail(LogConstants.CTX_DQP, e, "Error closing program"); //$NON-NLS-1$
+ }
}
if (this.evaluator != null) {
this.evaluator.close();
}
- this.tempTableStore = null;
this.dataMgr = parentDataMrg;
+ this.txnTupleSources.clear();
+ this.blockContext = null;
}
public String toString() {
@@ -475,18 +531,19 @@
CommandContext subContext = getContext().clone();
subContext.setVariableContext(this.currentVarContext);
- subContext.setTempTableStore(getTempTableStore());
state = new CursorState();
state.processor = new QueryProcessor(command, subContext, this.bufferMgr, this.dataMgr);
state.ts = new BatchIterator(state.processor);
if (procAssignments != null && state.processor.getOutputElements().size() - procAssignments.size() > 0) {
state.resultsBuffer = bufferMgr.createTupleBuffer(state.processor.getOutputElements().subList(0, state.processor.getOutputElements().size() - procAssignments.size()), getContext().getConnectionID(), TupleSourceType.PROCESSOR);
+ } else if (this.blockContext != null) {
+ state.resultsBuffer = bufferMgr.createTupleBuffer(state.processor.getOutputElements(), getContext().getConnectionID(), TupleSourceType.PROCESSOR);
}
this.currentState = state;
}
//force execution to the first batch
this.currentState.ts.hasNext();
- if (procAssignments != null) {
+ if (procAssignments != null) {
while (this.currentState.ts.hasNext()) {
if (this.currentState.currentRow != null && this.currentState.resultsBuffer != null) {
this.currentState.resultsBuffer.addTuple(this.currentState.currentRow.subList(0, this.currentState.resultsBuffer.getSchema().size()));
@@ -511,6 +568,14 @@
}
this.currentState.resultsBuffer.close();
this.currentState.ts = this.currentState.resultsBuffer.createIndexedTupleSource();
+ } else if (this.blockContext != null) {
+ //process fully in a block transaction
+ while (this.currentState.ts.hasNext()) {
+ List<?> tuple = this.currentState.ts.nextTuple();
+ this.currentState.resultsBuffer.addTuple(tuple);
+ }
+ this.currentState.resultsBuffer.close();
+ this.currentState.ts = this.currentState.resultsBuffer.createIndexedTupleSource();
}
this.cursorStates.put(rsName.toUpperCase(), this.currentState);
//keep a reference to the tuple source
@@ -523,43 +588,64 @@
}
/**
+ * @param success
* @throws TeiidComponentException
+ * @throws XATransactionException
*/
- public void pop() throws TeiidComponentException {
+ public void pop(boolean success) throws TeiidComponentException {
Program program = this.programs.pop();
if (this.currentVarContext.getParentContext() != null) {
this.currentVarContext = this.currentVarContext.getParentContext();
}
- Set<String> current = getTempContext();
-
- Set<String> tempTables = getLocalTempTables();
-
- tempTables.addAll(current);
-
- if (program != originalProgram) {
- for (String table : tempTables) {
- this.tempTableStore.removeTempTableByName(table);
- }
- }
- this.tempContext.removeLast();
+ program.getTempTableStore().removeTempTables();
+ if (program.startedTxn() && this.blockContext != null) {
+ TransactionService ts = this.getContext().getTransactionServer();
+ TransactionContext tc = this.blockContext;
+ this.blockContext = null;
+ for (WeakReference<DataTierTupleSource> ref : txnTupleSources) {
+ DataTierTupleSource dtts = ref.get();
+ if (dtts != null) {
+ dtts.fullyCloseSource();
+ }
+ }
+ this.txnTupleSources.clear();
+ try {
+ if (success) {
+ ts.commit(tc);
+ } else {
+ ts.rollback(tc);
+ }
+ } catch (XATransactionException e) {
+ throw new TeiidComponentException(e);
+ }
+ }
}
- public void push(Program program) {
- program.resetProgramCounter();
+ public void push(Program program) throws XATransactionException {
+ program.reset(this.getContext().getConnectionID());
+ TempTableStore tts = getTempTableStore();
+ getContext().setTempTableStore(program.getTempTableStore());
+ program.getTempTableStore().setParentTempTableStore(tts);
this.programs.push(program);
VariableContext context = new VariableContext(true);
context.setParentContext(this.currentVarContext);
this.currentVarContext = context;
- Set<String> current = getTempContext();
-
- Set<String> tempTables = getLocalTempTables();
-
- current.addAll(tempTables);
- this.tempContext.add(new HashSet<String>());
+ if (program.isAtomic()) {
+ TransactionContext tc = this.getContext().getTransactionContext();
+ if (tc != null && tc.getTransactionType() == Scope.NONE) {
+ //start a transaction
+ this.getContext().getTransactionServer().begin(tc);
+ this.blockContext = tc;
+ this.peek().setStartedTxn(true);
+ }
+ }
}
public void incrementProgramCounter() throws TeiidComponentException {
+ if (this.programs.isEmpty()) {
+ return;
+ }
Program program = peek();
ProgramInstruction instr = program.getCurrentInstruction();
if (instr instanceof RepeatedInstruction) {
@@ -569,27 +655,7 @@
peek().incrementProgramCounter();
}
- /**
- * @return
- */
- private Set<String> getLocalTempTables() {
- Set<String> tempTables = this.tempTableStore.getAllTempTables();
-
- //determine what was created in this scope
- for (int i = 0; i < tempContext.size() - 1; i++) {
- tempTables.removeAll(tempContext.get(i));
- }
- return tempTables;
- }
-
- public Set<String> getTempContext() {
- if (this.tempContext.isEmpty()) {
- tempContext.addLast(new HashSet<String>());
- }
- return this.tempContext.getLast();
- }
-
- public List getCurrentRow(String rsName) throws TeiidComponentException {
+ public List<?> getCurrentRow(String rsName) throws TeiidComponentException {
return getCursorState(rsName.toUpperCase()).currentRow;
}
@@ -682,7 +748,10 @@
* @since 5.5
*/
public TempTableStore getTempTableStore() {
- return this.tempTableStore;
+ if (this.programs.isEmpty()) {
+ return null;
+ }
+ return this.peek().getTempTableStore();
}
boolean evaluateCriteria(Criteria condition) throws BlockedException, TeiidProcessingException, TeiidComponentException {
Modified: trunk/engine/src/main/java/org/teiid/query/processor/proc/Program.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/Program.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/Program.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -27,6 +27,8 @@
import org.teiid.client.plan.PlanNode;
import org.teiid.query.processor.ProcessorPlan;
+import org.teiid.query.sql.proc.Statement.Labeled;
+import org.teiid.query.tempdata.TempTableStore;
/**
@@ -34,17 +36,47 @@
* ProgramInstructions, such as {@link IfInstruction} and {@link WhileInstruction} may
* have pointers to sub programs.
*/
-public class Program implements Cloneable {
+public class Program implements Cloneable, Labeled {
private List<ProgramInstruction> programInstructions;
private int counter = 0;
+ private boolean atomic;
+ private String label;
+ private TempTableStore tempTables;
+ private boolean startedTxn;
/**
* Constructor for Program.
*/
- public Program() {
- super();
+ public Program(boolean atomic) {
+ this.atomic = atomic;
}
+
+ public void setStartedTxn(boolean startedTxn) {
+ this.startedTxn = startedTxn;
+ }
+
+ public boolean startedTxn() {
+ return startedTxn;
+ }
+
+ @Override
+ public String getLabel() {
+ return label;
+ }
+
+ @Override
+ public void setLabel(String label) {
+ this.label = label;
+ }
+
+ public boolean isAtomic() {
+ return atomic;
+ }
+
+ public TempTableStore getTempTableStore() {
+ return tempTables;
+ }
/**
* Returns the next instruction to be executed, or null if there are
@@ -79,8 +111,10 @@
/**
* Resets this program, so it can be run through again.
*/
- public void resetProgramCounter(){
+ public void reset(String sessionId){
counter = 0;
+ this.tempTables = new TempTableStore(sessionId);
+ this.startedTxn = false;
}
int getProgramCounter(){
@@ -115,7 +149,7 @@
* Produces a deep clone.
*/
public Object clone(){
- Program program = new Program();
+ Program program = new Program(atomic);
program.counter = this.counter;
if (this.programInstructions != null){
@@ -125,7 +159,7 @@
}
program.programInstructions = clonedInstructions;
}
-
+ program.label = label;
return program;
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/proc/RepeatedInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/RepeatedInstruction.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/RepeatedInstruction.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -24,9 +24,10 @@
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
+import org.teiid.query.sql.proc.Statement.Labeled;
-public interface RepeatedInstruction {
+public interface RepeatedInstruction extends Labeled {
public boolean testCondition(ProcedurePlan procEnv) throws TeiidComponentException, TeiidProcessingException;
Modified: trunk/engine/src/main/java/org/teiid/query/processor/proc/WhileInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/proc/WhileInstruction.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/java/org/teiid/query/processor/proc/WhileInstruction.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -43,11 +43,23 @@
// criteria for the while block
private Criteria condition;
+ private String label;
- public WhileInstruction(Program program, Criteria condition){
+ public WhileInstruction(Program program, Criteria condition, String label){
this.whileProgram = program;
this.condition = condition;
+ this.label = label;
}
+
+ @Override
+ public String getLabel() {
+ return label;
+ }
+
+ @Override
+ public void setLabel(String label) {
+ this.label = label;
+ }
public void process(ProcedurePlan env) throws TeiidComponentException {
//do nothing
@@ -61,7 +73,7 @@
* Returns a deep clone
*/
public WhileInstruction clone(){
- return new WhileInstruction((Program)this.whileProgram.clone(), this.condition);
+ return new WhileInstruction((Program)this.whileProgram.clone(), this.condition, this.label);
}
public String toString() {
Modified: trunk/engine/src/main/java/org/teiid/query/resolver/command/UpdateProcedureResolver.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/resolver/command/UpdateProcedureResolver.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/java/org/teiid/query/resolver/command/UpdateProcedureResolver.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -312,11 +312,6 @@
resolveBlock(command, loopStmt.getBlock(), externalGroups, metadata);
break;
- case Statement.TYPE_BREAK:
- case Statement.TYPE_CONTINUE:
- break;
- default:
- throw new QueryResolverException("ERR.015.008.0015", QueryPlugin.Util.getString("ERR.015.008.0015", statement.getType())); //$NON-NLS-1$ //$NON-NLS-2$
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -326,19 +326,14 @@
private Block rewriteBlock(Block block)
throws TeiidComponentException, TeiidProcessingException{
- List statements = block.getStatements();
- Iterator stmtIter = statements.iterator();
+ List<Statement> statements = block.getStatements();
+ Iterator<Statement> stmtIter = statements.iterator();
- List newStmts = new ArrayList(statements.size());
+ List<Statement> newStmts = new ArrayList<Statement>(statements.size());
// plan each statement in the block
while(stmtIter.hasNext()) {
- Statement stmnt = (Statement) stmtIter.next();
- Object newStmt = rewriteStatement(stmnt);
- if(newStmt instanceof Statement) {
- newStmts.add(newStmt);
- } else if (newStmt instanceof List) {
- newStmts.addAll((List)newStmt);
- }
+ Statement stmnt = stmtIter.next();
+ rewriteStatement(stmnt, newStmts);
}
block.setStatements(newStmts);
@@ -346,7 +341,7 @@
return block;
}
- private Object rewriteStatement(Statement statement)
+ private void rewriteStatement(Statement statement, List<Statement> newStmts)
throws TeiidComponentException, TeiidProcessingException{
// evaluate the HAS Criteria on the procedure and rewrite
@@ -360,13 +355,15 @@
ifStmt.setCondition(evalCrit);
if(evalCrit.equals(TRUE_CRITERIA)) {
Block ifblock = rewriteBlock(ifStmt.getIfBlock());
- return ifblock.getStatements();
+ newStmts.addAll(ifblock.getStatements());
+ return;
} else if(evalCrit.equals(FALSE_CRITERIA) || evalCrit.equals(UNKNOWN_CRITERIA)) {
if(ifStmt.hasElseBlock()) {
Block elseBlock = rewriteBlock(ifStmt.getElseBlock());
- return elseBlock.getStatements();
+ newStmts.addAll(elseBlock.getStatements());
+ return;
}
- return null;
+ return;
} else {
Block ifblock = rewriteBlock(ifStmt.getIfBlock());
ifStmt.setIfBlock(ifblock);
@@ -375,7 +372,7 @@
ifStmt.setElseBlock(elseBlock);
}
}
- return ifStmt;
+ break;
case Statement.TYPE_ERROR:
case Statement.TYPE_DECLARE:
case Statement.TYPE_ASSIGNMENT:
@@ -387,7 +384,7 @@
expr = rewriteExpressionDirect(expr);
exprStmt.setExpression(expr);
}
- return exprStmt;
+ break;
case Statement.TYPE_COMMAND:
CommandStatement cmdStmt = (CommandStatement) statement;
rewriteSubqueryContainer(cmdStmt, false);
@@ -395,10 +392,10 @@
if(cmdStmt.getCommand().getType() == Command.TYPE_UPDATE) {
Update update = (Update)cmdStmt.getCommand();
if (update.getChangeList().isEmpty()) {
- return null;
+ return;
}
}
- return statement;
+ break;
case Statement.TYPE_LOOP:
LoopStatement loop = (LoopStatement)statement;
@@ -407,10 +404,9 @@
rewriteBlock(loop.getBlock());
if (loop.getBlock().getStatements().isEmpty()) {
- return null;
+ return;
}
-
- return loop;
+ break;
case Statement.TYPE_WHILE:
WhileStatement whileStatement = (WhileStatement) statement;
Criteria crit = whileStatement.getCondition();
@@ -420,18 +416,16 @@
if(crit.equals(TRUE_CRITERIA)) {
throw new QueryValidatorException(QueryPlugin.Util.getString("QueryRewriter.infinite_while")); //$NON-NLS-1$
} else if(crit.equals(FALSE_CRITERIA) || crit.equals(UNKNOWN_CRITERIA)) {
- return null;
+ return;
}
whileStatement.setBlock(rewriteBlock(whileStatement.getBlock()));
if (whileStatement.getBlock().getStatements().isEmpty()) {
- return null;
+ return;
}
-
- return whileStatement;
- default:
- return statement;
+ break;
}
+ newStmts.add(statement);
}
/**
Modified: trunk/engine/src/main/java/org/teiid/query/sql/LanguageVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/LanguageVisitor.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/java/org/teiid/query/sql/LanguageVisitor.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -68,9 +68,8 @@
import org.teiid.query.sql.lang.XMLTable;
import org.teiid.query.sql.proc.AssignmentStatement;
import org.teiid.query.sql.proc.Block;
-import org.teiid.query.sql.proc.BreakStatement;
+import org.teiid.query.sql.proc.BranchingStatement;
import org.teiid.query.sql.proc.CommandStatement;
-import org.teiid.query.sql.proc.ContinueStatement;
import org.teiid.query.sql.proc.CreateUpdateProcedureCommand;
import org.teiid.query.sql.proc.CriteriaSelector;
import org.teiid.query.sql.proc.DeclareStatement;
@@ -194,8 +193,7 @@
public void visit(IfStatement obj) {}
public void visit(RaiseErrorStatement obj) {}
public void visit(TranslateCriteria obj) {}
- public void visit(BreakStatement obj) {}
- public void visit(ContinueStatement obj) {}
+ public void visit(BranchingStatement obj) {}
public void visit(WhileStatement obj) {}
public void visit(LoopStatement obj) {}
public void visit(DynamicCommand obj) {}
Modified: trunk/engine/src/main/java/org/teiid/query/sql/navigator/PreOrPostOrderNavigator.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/navigator/PreOrPostOrderNavigator.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/java/org/teiid/query/sql/navigator/PreOrPostOrderNavigator.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -72,9 +72,8 @@
import org.teiid.query.sql.lang.XMLTable;
import org.teiid.query.sql.proc.AssignmentStatement;
import org.teiid.query.sql.proc.Block;
-import org.teiid.query.sql.proc.BreakStatement;
+import org.teiid.query.sql.proc.BranchingStatement;
import org.teiid.query.sql.proc.CommandStatement;
-import org.teiid.query.sql.proc.ContinueStatement;
import org.teiid.query.sql.proc.CreateUpdateProcedureCommand;
import org.teiid.query.sql.proc.CriteriaSelector;
import org.teiid.query.sql.proc.DeclareStatement;
@@ -181,7 +180,7 @@
visitNodes(obj.getStatements());
postVisitVisitor(obj);
}
- public void visit(BreakStatement obj) {
+ public void visit(BranchingStatement obj) {
preVisitVisitor(obj);
postVisitVisitor(obj);
}
@@ -217,10 +216,6 @@
preVisitVisitor(obj);
postVisitVisitor(obj);
}
- public void visit(ContinueStatement obj) {
- preVisitVisitor(obj);
- postVisitVisitor(obj);
- }
public void visit(CreateUpdateProcedureCommand obj) {
preVisitVisitor(obj);
visitNode(obj.getBlock());
Modified: trunk/engine/src/main/java/org/teiid/query/sql/proc/Block.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/proc/Block.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/java/org/teiid/query/sql/proc/Block.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -26,10 +26,11 @@
import java.util.List;
import org.teiid.core.util.EquivalenceUtil;
-import org.teiid.query.sql.LanguageObject;
+import org.teiid.core.util.StringUtil;
import org.teiid.query.sql.LanguageVisitor;
import org.teiid.query.sql.ProcedureReservedWords;
import org.teiid.query.sql.lang.Command;
+import org.teiid.query.sql.proc.Statement.Labeled;
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.visitor.SQLStringVisitor;
@@ -38,10 +39,12 @@
* <p> This class represents a group of <code>Statement</code> objects. The
* statements are stored on this object in the order in which they are added.</p>
*/
-public class Block implements LanguageObject {
+public class Block extends Statement implements Labeled {
// list of statements on this block
private List<Statement> statements;
+ private boolean atomic;
+ private String label;
/**
* Constructor for Block.
@@ -58,6 +61,14 @@
this();
statements.add(statement);
}
+
+ public String getLabel() {
+ return label;
+ }
+
+ public void setLabel(String label) {
+ this.label = label;
+ }
/**
* Get all the statements contained on this block.
@@ -112,9 +123,11 @@
*/
public Block clone() {
Block copy = new Block();
+ copy.setAtomic(atomic);
for (Statement statement : statements) {
copy.addStatement((Statement)statement.clone());
}
+ copy.setLabel(label);
return copy;
}
@@ -134,9 +147,13 @@
if(!(obj instanceof Block)) {
return false;
}
-
+
+ Block other = (Block)obj;
+
// Compare the statements on the block
- return EquivalenceUtil.areEqual(getStatements(), ((Block)obj).getStatements());
+ return this.atomic == other.atomic
+ && StringUtil.equalsIgnoreCase(label, other.label)
+ && EquivalenceUtil.areEqual(getStatements(), other.getStatements());
}
/**
@@ -157,5 +174,18 @@
public String toString() {
return SQLStringVisitor.getSQLString(this);
}
+
+ public boolean isAtomic() {
+ return atomic;
+ }
+
+ public void setAtomic(boolean atomic) {
+ this.atomic = atomic;
+ }
+
+ @Override
+ public int getType() {
+ return Statement.TYPE_COMPOUND;
+ }
}// END CLASS
Added: trunk/engine/src/main/java/org/teiid/query/sql/proc/BranchingStatement.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/proc/BranchingStatement.java (rev 0)
+++ trunk/engine/src/main/java/org/teiid/query/sql/proc/BranchingStatement.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -0,0 +1,136 @@
+/*
+ * 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.query.sql.proc;
+
+import org.teiid.core.util.HashCodeUtil;
+import org.teiid.core.util.StringUtil;
+import org.teiid.query.sql.LanguageVisitor;
+
+/**
+ * <p> This class represents a break statement in the storedprocedure language.
+ * It extends the <code>Statement</code> that could part of a block.</p>
+ */
+public class BranchingStatement extends Statement {
+
+ public enum BranchingMode {
+ /**
+ * Teiid specific - only allowed to target loops
+ */
+ BREAK,
+ /**
+ * Teiid specific - only allowed to target loops
+ */
+ CONTINUE,
+ /**
+ * ANSI - allowed to leave any block
+ */
+ LEAVE
+ }
+
+ private String label;
+ private BranchingMode mode;
+
+ public BranchingStatement() {
+ this(BranchingMode.BREAK);
+ }
+
+ public BranchingStatement(BranchingMode mode) {
+ this.mode = mode;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public void setLabel(String label) {
+ this.label = label;
+ }
+
+ public void setMode(BranchingMode mode) {
+ this.mode = mode;
+ }
+
+ public BranchingMode getMode() {
+ return mode;
+ }
+
+ /**
+ * Return the type for this statement, this is one of the types
+ * defined on the statement object.
+ */
+ public int getType() {
+ switch (mode) {
+ case BREAK:
+ return Statement.TYPE_BREAK;
+ case CONTINUE:
+ return Statement.TYPE_CONTINUE;
+ case LEAVE:
+ return Statement.TYPE_LEAVE;
+ }
+ throw new AssertionError();
+ }
+
+ // =========================================================================
+ // P R O C E S S I N G M E T H O D S
+ // =========================================================================
+
+ public void acceptVisitor(LanguageVisitor visitor) {
+ visitor.visit(this);
+ }
+
+ /**
+ * Deep clone statement to produce a new identical statement.
+ * @return Deep clone
+ */
+ public BranchingStatement clone() {
+ BranchingStatement clone = new BranchingStatement();
+ clone.mode = mode;
+ clone.label = label;
+ return clone;
+ }
+
+ /**
+ * Compare two BreakStatements for equality.
+ * @param obj Other object
+ * @return True if equal
+ */
+ public boolean equals(Object obj) {
+ // Quick same object test
+ if(this == obj) {
+ return true;
+ }
+ if (!(obj instanceof BranchingStatement)) {
+ return false;
+ }
+ BranchingStatement other = (BranchingStatement)obj;
+ return StringUtil.equalsIgnoreCase(label, other.label)
+ && mode == other.mode;
+ }
+
+ public int hashCode() {
+ return HashCodeUtil.hashCode(mode.hashCode());
+ }
+
+}
Property changes on: trunk/engine/src/main/java/org/teiid/query/sql/proc/BranchingStatement.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/engine/src/main/java/org/teiid/query/sql/proc/BreakStatement.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/proc/BreakStatement.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/java/org/teiid/query/sql/proc/BreakStatement.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -1,78 +0,0 @@
-/*
- * 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.query.sql.proc;
-
-import org.teiid.query.sql.LanguageVisitor;
-
-/**
- * <p> This class represents a break statement in the storedprocedure language.
- * It extends the <code>Statement</code> that could part of a block.</p>
- */
-public class BreakStatement extends Statement {
-
- /**
- * Return the type for this statement, this is one of the types
- * defined on the statement object.
- */
- public int getType() {
- return Statement.TYPE_BREAK;
- }
-
- // =========================================================================
- // P R O C E S S I N G M E T H O D S
- // =========================================================================
-
- public void acceptVisitor(LanguageVisitor visitor) {
- visitor.visit(this);
- }
-
- /**
- * Deep clone statement to produce a new identical statement.
- * @return Deep clone
- */
- public Object clone() {
- return new BreakStatement();
- }
-
- /**
- * Compare two BreakStatements for equality.
- * @param obj Other object
- * @return True if equal
- */
- public boolean equals(Object obj) {
- // Quick same object test
- if(this == obj) {
- return true;
- }
-
- return obj instanceof BreakStatement;
- }
-
- public int hashCode() {
- //the break statement are always equal
- return 0;
- }
-
-}
Deleted: trunk/engine/src/main/java/org/teiid/query/sql/proc/ContinueStatement.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/proc/ContinueStatement.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/java/org/teiid/query/sql/proc/ContinueStatement.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -1,84 +0,0 @@
-/*
- * 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.query.sql.proc;
-
-import org.teiid.query.sql.LanguageVisitor;
-import org.teiid.query.sql.visitor.SQLStringVisitor;
-
-/**
- * <p> This class represents a continue statement in the storedprocedure language.
- * It extends the <code>Statement</code> that could part of a block.</p>
- */
-public class ContinueStatement extends Statement {
-
- /**
- * Return the type for this statement, this is one of the types
- * defined on the statement object.
- */
- public int getType() {
- return Statement.TYPE_CONTINUE;
- }
-
- // =========================================================================
- // P R O C E S S I N G M E T H O D S
- // =========================================================================
-
- public void acceptVisitor(LanguageVisitor visitor) {
- visitor.visit(this);
- }
-
- /**
- * Deep clone statement to produce a new identical statement.
- * @return Deep clone
- */
- public Object clone() {
- return new ContinueStatement();
- }
-
- /**
- * Compare two ContinueStatements for equality.
- * @param obj Other object
- * @return True if equal
- */
- public boolean equals(Object obj) {
- // Quick same object test
- if(this == obj) {
- return true;
- }
-
- // Quick fail tests
- if(!(obj instanceof ContinueStatement)) {
- return false;
- }
-
- return true;
- }
-
- public int hashCode() {
- //the continue statements are always equal
- return 0;
- }
-
-}
Modified: trunk/engine/src/main/java/org/teiid/query/sql/proc/IfStatement.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/proc/IfStatement.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/java/org/teiid/query/sql/proc/IfStatement.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -151,11 +151,11 @@
* @return Deep clone
*/
public Object clone() {
- Block otherIf = (Block)this.ifBlock.clone();
+ Block otherIf = this.ifBlock.clone();
Criteria otherCrit = (Criteria) this.condition.clone();
Block otherElse = null;
if(this.hasElseBlock()) {
- otherElse = (Block) this.elseBlock.clone();
+ otherElse = this.elseBlock.clone();
}
return new IfStatement(otherCrit, otherIf, otherElse);
Modified: trunk/engine/src/main/java/org/teiid/query/sql/proc/LoopStatement.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/proc/LoopStatement.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/java/org/teiid/query/sql/proc/LoopStatement.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -26,10 +26,12 @@
import org.teiid.core.util.EquivalenceUtil;
import org.teiid.core.util.HashCodeUtil;
+import org.teiid.core.util.StringUtil;
import org.teiid.query.sql.LanguageVisitor;
import org.teiid.query.sql.lang.Command;
import org.teiid.query.sql.lang.Query;
import org.teiid.query.sql.lang.SubqueryContainer;
+import org.teiid.query.sql.proc.Statement.Labeled;
/**
@@ -39,10 +41,11 @@
* a block, a select statement and a cursor.
* determines which block should be executed..</p>
*/
-public class LoopStatement extends Statement implements SubqueryContainer {
+public class LoopStatement extends Statement implements SubqueryContainer, Labeled {
private String cursorName;
private Block loopBlock;
private Command query;
+ private String label;
public LoopStatement(Block block, Command query, String cursorName){
this.loopBlock = block;
@@ -50,6 +53,14 @@
this.cursorName = cursorName;
}
+ public String getLabel() {
+ return label;
+ }
+
+ public void setLabel(String label) {
+ this.label = label;
+ }
+
/**
* @return
*/
@@ -121,10 +132,12 @@
* @return Deep clone
*/
public Object clone() {
- Block otherBlock = (Block)this.loopBlock.clone();
+ Block otherBlock = this.loopBlock.clone();
Query otherQuery = (Query)this.query.clone();
- return new LoopStatement(otherBlock, otherQuery, this.cursorName);
+ LoopStatement ls = new LoopStatement(otherBlock, otherQuery, this.cursorName);
+ ls.setLabel(label);
+ return ls;
}
/**
@@ -152,7 +165,8 @@
// Compare the if block
EquivalenceUtil.areEqual(loopBlock, other.loopBlock) &&
// Compare the else block
- EquivalenceUtil.areEqual(cursorName, other.cursorName);
+ EquivalenceUtil.areEqual(cursorName, other.cursorName)
+ && StringUtil.equalsIgnoreCase(this.label, other.label);
}
/**
Modified: trunk/engine/src/main/java/org/teiid/query/sql/proc/Statement.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/proc/Statement.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/java/org/teiid/query/sql/proc/Statement.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -22,7 +22,7 @@
package org.teiid.query.sql.proc;
-import org.teiid.query.sql.*;
+import org.teiid.query.sql.LanguageObject;
import org.teiid.query.sql.visitor.SQLStringVisitor;
/**
@@ -31,6 +31,11 @@
* <code>IfStatement</code>, <code>AssignmentStatement</code> etc.</p>
*/
public abstract class Statement implements LanguageObject {
+
+ public interface Labeled {
+ String getLabel();
+ void setLabel(String label);
+ }
/**
* Represents an unknown type of statement
@@ -84,6 +89,10 @@
public static final int TYPE_UPDATE = 10;
+ public static final int TYPE_COMPOUND = 11;
+
+ public static final int TYPE_LEAVE = 12;
+
/**
* Return type of statement to make it easier to build switch statements by statement type.
* @return Type from TYPE constants
Modified: trunk/engine/src/main/java/org/teiid/query/sql/proc/TriggerAction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/proc/TriggerAction.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/java/org/teiid/query/sql/proc/TriggerAction.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -36,7 +36,7 @@
private Block block;
public TriggerAction(Block b) {
- this.block = b;
+ this.setBlock(b);
}
public Block getBlock() {
@@ -44,6 +44,7 @@
}
public void setBlock(Block block) {
+ block.setAtomic(true);
this.block = block;
}
Modified: trunk/engine/src/main/java/org/teiid/query/sql/proc/WhileStatement.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/proc/WhileStatement.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/java/org/teiid/query/sql/proc/WhileStatement.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -26,8 +26,10 @@
import org.teiid.core.util.EquivalenceUtil;
import org.teiid.core.util.HashCodeUtil;
+import org.teiid.core.util.StringUtil;
import org.teiid.query.sql.LanguageVisitor;
import org.teiid.query.sql.lang.Criteria;
+import org.teiid.query.sql.proc.Statement.Labeled;
/**
@@ -36,16 +38,16 @@
* a block and a criteria that
* determines when to exit the while loop.</p>
*/
-public class WhileStatement extends Statement {
+public class WhileStatement extends Statement implements Labeled {
private Block whileBlock;
-
+ private String label;
// criteria on the if block
private Criteria condition;
/**
* Constructor for IfStatement.
- * @param criteria The criteria determining which bleck should be executed
+ * @param criteria The criteria determining which block should be executed
* @param ifBlock The IF <code>Block</code> object.
* @param ifBlock The ELSE <code>Block</code> object.
*/
@@ -53,6 +55,14 @@
this.whileBlock = block;
this.condition = criteria;
}
+
+ public void setLabel(String label) {
+ this.label = label;
+ }
+
+ public String getLabel() {
+ return label;
+ }
/**
* Get the condition that determines which block needs to be executed.
@@ -106,10 +116,12 @@
* @return Deep clone
*/
public Object clone() {
- Block otherBlock = (Block)this.whileBlock.clone();
+ Block otherBlock = this.whileBlock.clone();
Criteria otherCrit = (Criteria) this.condition.clone();
- return new WhileStatement(otherCrit, otherBlock);
+ WhileStatement ws = new WhileStatement(otherCrit, otherBlock);
+ ws.setLabel(label);
+ return ws;
}
/**
@@ -135,7 +147,8 @@
// Compare the condition
EquivalenceUtil.areEqual(getCondition(), other.getCondition()) &&
// Compare the if block
- EquivalenceUtil.areEqual(whileBlock, other.whileBlock);
+ EquivalenceUtil.areEqual(whileBlock, other.whileBlock)
+ && StringUtil.equalsIgnoreCase(this.label, other.label);
}
/**
Modified: trunk/engine/src/main/java/org/teiid/query/sql/visitor/SQLStringVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/visitor/SQLStringVisitor.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/java/org/teiid/query/sql/visitor/SQLStringVisitor.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -93,9 +93,8 @@
import org.teiid.query.sql.lang.XMLTable.XMLColumn;
import org.teiid.query.sql.proc.AssignmentStatement;
import org.teiid.query.sql.proc.Block;
-import org.teiid.query.sql.proc.BreakStatement;
+import org.teiid.query.sql.proc.BranchingStatement;
import org.teiid.query.sql.proc.CommandStatement;
-import org.teiid.query.sql.proc.ContinueStatement;
import org.teiid.query.sql.proc.CreateUpdateProcedureCommand;
import org.teiid.query.sql.proc.CriteriaSelector;
import org.teiid.query.sql.proc.DeclareStatement;
@@ -107,6 +106,7 @@
import org.teiid.query.sql.proc.TranslateCriteria;
import org.teiid.query.sql.proc.TriggerAction;
import org.teiid.query.sql.proc.WhileStatement;
+import org.teiid.query.sql.proc.Statement.Labeled;
import org.teiid.query.sql.symbol.AggregateSymbol;
import org.teiid.query.sql.symbol.AliasSymbol;
import org.teiid.query.sql.symbol.CaseExpression;
@@ -1382,21 +1382,35 @@
// ############ Visitor methods for storedprocedure language objects ####################
public void visit( Block obj ) {
- List statements = obj.getStatements();
+ addLabel(obj);
+ List<Statement> statements = obj.getStatements();
// Add first clause
append(BEGIN);
+ if (obj.isAtomic()) {
+ append(SPACE);
+ append(ATOMIC);
+ }
append("\n"); //$NON-NLS-1$
- Iterator stmtIter = statements.iterator();
+ Iterator<Statement> stmtIter = statements.iterator();
while (stmtIter.hasNext()) {
// Add each statement
addTabs(1);
- visitNode((Statement)stmtIter.next());
+ visitNode(stmtIter.next());
append("\n"); //$NON-NLS-1$
}
addTabs(0);
append(END);
}
+ private void addLabel(Labeled obj) {
+ if (obj.getLabel() != null) {
+ outputDisplayName(obj.getLabel());
+ append(SPACE);
+ append(Tokens.COLON);
+ append(SPACE);
+ }
+ }
+
protected void addTabs( int level ) {
}
@@ -1557,17 +1571,27 @@
append(";"); //$NON-NLS-1$
}
- public void visit( BreakStatement obj ) {
- append(BREAK);
+ public void visit( BranchingStatement obj ) {
+ switch (obj.getMode()) {
+ case CONTINUE:
+ append(CONTINUE);
+ break;
+ case BREAK:
+ append(BREAK);
+ break;
+ case LEAVE:
+ append(LEAVE);
+ break;
+ }
+ if (obj.getLabel() != null) {
+ append(SPACE);
+ outputDisplayName(obj.getLabel());
+ }
append(";"); //$NON-NLS-1$
}
- public void visit( ContinueStatement obj ) {
- append(CONTINUE);
- append(";"); //$NON-NLS-1$
- }
-
public void visit( LoopStatement obj ) {
+ addLabel(obj);
append(LOOP);
append(" "); //$NON-NLS-1$
append(ON);
@@ -1583,6 +1607,7 @@
}
public void visit( WhileStatement obj ) {
+ addLabel(obj);
append(WHILE);
append("("); //$NON-NLS-1$
visitNode(obj.getCondition());
Modified: trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -206,7 +206,7 @@
return null;
}
final String groupKey = group.getNonCorrelationName().toUpperCase();
- final TempTable table = contextStore.getOrCreateTempTable(groupKey, command, bufferManager, false);
+ final TempTable table = contextStore.getOrCreateTempTable(groupKey, command, bufferManager, true);
if (command instanceof Insert) {
Insert insert = (Insert)command;
TupleSource ts = insert.getTupleSource();
Modified: trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableStore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableStore.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableStore.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -217,16 +217,10 @@
}
TempTable getOrCreateTempTable(String tempTableID, Command command, BufferManager buffer, boolean delegate) throws QueryProcessingException{
- TempTable tsID = groupToTupleSourceID.get(tempTableID);
- if(tsID != null) {
- return tsID;
- }
- if(delegate && this.parentTempTableStore != null){
- tsID = this.parentTempTableStore.groupToTupleSourceID.get(tempTableID);
- if(tsID != null) {
- return tsID;
- }
- }
+ TempTable tempTable = getTempTable(tempTableID, command, buffer, delegate);
+ if (tempTable != null) {
+ return tempTable;
+ }
//allow implicit temp group definition
List<ElementSymbol> columns = null;
if (command instanceof Insert) {
@@ -239,11 +233,25 @@
if (columns == null) {
throw new QueryProcessingException(QueryPlugin.Util.getString("TempTableStore.table_doesnt_exist_error", tempTableID)); //$NON-NLS-1$
}
+ LogManager.logDetail(LogConstants.CTX_DQP, "Creating temporary table", tempTableID); //$NON-NLS-1$
Create create = new Create();
create.setTable(new GroupSymbol(tempTableID));
create.setElementSymbolsAsColumns(columns);
return addTempTable(tempTableID, create, buffer, true);
}
+
+ private TempTable getTempTable(String tempTableID, Command command,
+ BufferManager buffer, boolean delegate)
+ throws QueryProcessingException {
+ TempTable tsID = groupToTupleSourceID.get(tempTableID);
+ if(tsID != null) {
+ return tsID;
+ }
+ if(delegate && this.parentTempTableStore != null){
+ return this.parentTempTableStore.getTempTable(tempTableID, command, buffer, delegate);
+ }
+ return null;
+ }
public Set<String> getAllTempTables() {
return new HashSet<String>(this.groupToTupleSourceID.keySet());
Modified: trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/java/org/teiid/query/util/CommandContext.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -46,6 +46,8 @@
import org.teiid.dqp.internal.process.SessionAwareCache;
import org.teiid.dqp.internal.process.SessionAwareCache.CacheID;
import org.teiid.dqp.message.RequestID;
+import org.teiid.dqp.service.TransactionContext;
+import org.teiid.dqp.service.TransactionService;
import org.teiid.metadata.FunctionMethod.Determinism;
import org.teiid.query.QueryPlugin;
import org.teiid.query.eval.SecurityFunctionEvaluator;
@@ -129,6 +131,8 @@
private RequestID requestId;
private DQPWorkContext dqpWorkContext;
+ private TransactionContext transactionContext;
+ private TransactionService transactionService;
}
private GlobalState globalState = new GlobalState();
@@ -614,4 +618,20 @@
return this.globalState.dqpWorkContext;
}
+ public TransactionContext getTransactionContext() {
+ return globalState.transactionContext;
+ }
+
+ public void setTransactionContext(TransactionContext transactionContext) {
+ globalState.transactionContext = transactionContext;
+ }
+
+ public TransactionService getTransactionServer() {
+ return globalState.transactionService;
+ }
+
+ public void setTransactionService(TransactionService transactionService) {
+ globalState.transactionService = transactionService;
+ }
+
}
Modified: trunk/engine/src/main/java/org/teiid/query/validator/AbstractValidationVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/validator/AbstractValidationVisitor.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/java/org/teiid/query/validator/AbstractValidationVisitor.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -26,6 +26,7 @@
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
+import java.util.Stack;
import org.teiid.api.exception.query.QueryMetadataException;
import org.teiid.core.TeiidComponentException;
@@ -50,6 +51,7 @@
private QueryMetadataInterface metadata;
protected Command currentCommand;
+ protected Stack<LanguageObject> stack = new Stack<LanguageObject>();
public AbstractValidationVisitor() {
this.report = new ValidatorReport();
@@ -69,6 +71,7 @@
*/
public void reset() {
this.currentCommand = null;
+ this.stack.clear();
}
// ######################### Store results info #########################
Modified: trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -103,6 +103,8 @@
import org.teiid.query.sql.lang.XMLTable.XMLColumn;
import org.teiid.query.sql.navigator.PreOrderNavigator;
import org.teiid.query.sql.proc.AssignmentStatement;
+import org.teiid.query.sql.proc.Block;
+import org.teiid.query.sql.proc.BranchingStatement;
import org.teiid.query.sql.proc.CommandStatement;
import org.teiid.query.sql.proc.CreateUpdateProcedureCommand;
import org.teiid.query.sql.proc.CriteriaSelector;
@@ -110,6 +112,9 @@
import org.teiid.query.sql.proc.HasCriteria;
import org.teiid.query.sql.proc.LoopStatement;
import org.teiid.query.sql.proc.TranslateCriteria;
+import org.teiid.query.sql.proc.WhileStatement;
+import org.teiid.query.sql.proc.BranchingStatement.BranchingMode;
+import org.teiid.query.sql.proc.Statement.Labeled;
import org.teiid.query.sql.symbol.AggregateSymbol;
import org.teiid.query.sql.symbol.Constant;
import org.teiid.query.sql.symbol.DerivedColumn;
@@ -177,6 +182,7 @@
public void reset() {
super.reset();
this.isXML = false;
+ this.inQuery = false;
}
// ############### Visitor methods for language objects ##################
@@ -805,7 +811,6 @@
Iterator valIter = values.iterator();
GroupSymbol insertGroup = obj.getGroup();
-
try {
// Validate that all elements in variable list are updatable
for (ElementSymbol insertElem : vars) {
@@ -1558,7 +1563,47 @@
}
}
+ public void visit(Block obj) {
+ if (obj.getLabel() == null) {
+ return;
+ }
+ for (LanguageObject lo : stack) {
+ if (lo instanceof Labeled) {
+ Labeled labeled = (Labeled)lo;
+ if (obj.getLabel().equalsIgnoreCase(labeled.getLabel())) {
+ handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.duplicate_block_label", obj.getLabel()), obj); //$NON-NLS-1$
+ }
+ }
+ }
+ }
+
@Override
+ public void visit(BranchingStatement obj) {
+ boolean matchedLabel = false;
+ boolean inLoop = false;
+ for (LanguageObject lo : stack) {
+ if (lo instanceof LoopStatement || lo instanceof WhileStatement) {
+ inLoop = true;
+ if (obj.getLabel() == null) {
+ break;
+ }
+ matchedLabel |= obj.getLabel().equalsIgnoreCase(((Labeled)lo).getLabel());
+ } else if (obj.getLabel() != null && lo instanceof Block && obj.getLabel().equalsIgnoreCase(((Block)lo).getLabel())) {
+ matchedLabel = true;
+ if (obj.getMode() != BranchingMode.LEAVE) {
+ handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.invalid_label", obj.getLabel()), obj); //$NON-NLS-1$
+ }
+ }
+ }
+ if (obj.getMode() != BranchingMode.LEAVE && !inLoop) {
+ handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.no_loop"), obj); //$NON-NLS-1$
+ }
+ if (obj.getLabel() != null && !matchedLabel) {
+ handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.unknown_block_label", obj.getLabel()), obj); //$NON-NLS-1$
+ }
+ }
+
+ @Override
public void visit(AlterTrigger obj) {
validateGroupSupportsUpdate(obj.getTarget());
try {
Modified: trunk/engine/src/main/java/org/teiid/query/validator/Validator.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/validator/Validator.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/java/org/teiid/query/validator/Validator.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -72,7 +72,7 @@
setTempMetadata(metadata, visitor, object);
PreOrderNavigator nav = new PreOrderNavigator(visitor) {
-
+
protected void visitNode(LanguageObject obj) {
QueryMetadataInterface previous = visitor.getMetadata();
setTempMetadata(metadata, visitor, obj);
@@ -80,6 +80,17 @@
visitor.setMetadata(previous);
}
+ @Override
+ protected void preVisitVisitor(LanguageObject obj) {
+ super.preVisitVisitor(obj);
+ visitor.stack.add(obj);
+ }
+
+ @Override
+ protected void postVisitVisitor(LanguageObject obj) {
+ visitor.stack.pop();
+ }
+
};
object.acceptVisitor(nav);
Modified: trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj
===================================================================
--- trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/javacc/org/teiid/query/parser/SQLParser.jj 2011-08-10 20:06:04 UTC (rev 3372)
@@ -193,6 +193,7 @@
| <LANGUAGE: "language">
| <LARGE: "large">
| <LEADING: "leading">
+| <LEAVE: "leave">
| <LIKE: "like">
| <LIKE_REGEX: "like_regex">
| <LIMIT: "limit">
@@ -409,6 +410,7 @@
| <QMARK: "?">
| <DOLLAR: "$">
| <SEMICOLON: ";">
+| <COLON: ":">
| <CONCAT_OP: "||">
}
@@ -513,7 +515,7 @@
{
String target = null;
QueryCommand command = null;
- Block block = null;
+ Statement stmt = null;
TriggerAction triggerAction = null;
Token comment = null;
Token event = null;
@@ -532,9 +534,9 @@
alterView.setDefinition(command);
return alterView;
}
- | (<PROCEDURE> target = id() <AS> { comment = getToken(1).specialToken; } block = block(info))
+ | (<PROCEDURE> target = id() <AS> { comment = getToken(1).specialToken; } stmt = statement(info))
{
- CreateUpdateProcedureCommand cup = new CreateUpdateProcedureCommand(block);
+ CreateUpdateProcedureCommand cup = new CreateUpdateProcedureCommand(asBlock(stmt));
cup.setUpdateProcedure(false);
if (comment != null) {
cup.setCacheHint(getQueryCacheOption(comment.image));
@@ -563,11 +565,29 @@
TriggerAction forEachRowTriggerAction(ParseInfo info) :
{
- Block b = null;
+ Block b = new Block();
+ b.setAtomic(true);
+ Statement stmt = null;
}
{
<FOR> <EACH> <ROW>
- b = block(info)
+ (
+ LOOKAHEAD(1) (<BEGIN> [<ATOMIC>]
+ (
+ stmt = statement(info)
+ {
+ b.addStatement(stmt);
+ }
+ )*
+ <END>
+ )
+ |
+ stmt = statement(info)
+ {
+ b = asBlock(stmt);
+ b.setAtomic(true);
+ }
+ )
{
return new TriggerAction(b);
}
@@ -716,12 +736,25 @@
Statement statement(ParseInfo info) :
{
Statement stmt = null;
+ String label = null;
}
{
- (stmt = ifStatement(info) |
- stmt = loopStatement(info) |
- stmt = whileStatement(info) |
- stmt = delimitedStatement(info)
+ (
+ LOOKAHEAD(2) ([label = id() <COLON>]
+ (
+ stmt = loopStatement(info) |
+ stmt = whileStatement(info) |
+ stmt = compoundStatement(info)
+ )
+ {
+ ((Statement.Labeled)stmt).setLabel(label);
+ }
+ )
+ |
+ (
+ stmt = ifStatement(info) |
+ stmt = delimitedStatement(info)
+ )
)
{
@@ -738,8 +771,7 @@
stmt = sqlStatement(info) |
stmt = errorStatement(info) |
stmt = declareStatement(info) |
- stmt = continueStatement(info) |
- stmt = breakStatement(info)
+ stmt = branchingStatement(info)
)
<SEMICOLON>
{
@@ -747,32 +779,25 @@
}
}
-/**
- * Parse block
- * @throws ParseException
- */
-Block block(ParseInfo info) :
+Block compoundStatement(ParseInfo info) :
{
Statement stmt = null;
Block block = new Block();
+ Boolean atomic = null;
}
{
- (
- stmt = statement(info)
- {
- block.addStatement(stmt);
- }
- |
- (<BEGIN>
- (
- stmt = statement(info)
- {
- block.addStatement(stmt);
- }
- )*
- <END>)
- )
+ <BEGIN> [[<NOT> {atomic = Boolean.FALSE;}] <ATOMIC> {if (atomic == null) {atomic = Boolean.TRUE;}}]
+ (
+ stmt = statement(info)
+ {
+ block.addStatement(stmt);
+ }
+ )*
+ <END>
{
+ if (atomic != null) {
+ block.setAtomic(atomic);
+ }
return block;
}
}
@@ -781,37 +806,28 @@
* Parse break statement
* @throws ParseException if parsing failed
*/
-BreakStatement breakStatement(ParseInfo info) :
+BranchingStatement branchingStatement(ParseInfo info) :
{
- BreakStatement breakStmt = null;
+ BranchingStatement breakStmt = new BranchingStatement();
+ Token mode = null;
+ String label = null;
}
{
- <BREAK>
+ (
+ (
+ (mode = <BREAK> | mode = <CONTINUE>) [label = id()]
+ )
+ |
+ (mode = <LEAVE> label = id())
+ )
{
- breakStmt = new BreakStatement();
-
+ breakStmt.setMode(BranchingStatement.BranchingMode.valueOf(mode.image.toUpperCase()));
+ breakStmt.setLabel(label);
return breakStmt;
}
}
/**
- * Parse break statement
- * @throws ParseException if parsing failed
- */
-ContinueStatement continueStatement(ParseInfo info) :
-{
- ContinueStatement contStmt = null;
-}
-{
- <CONTINUE>
- {
- contStmt = new ContinueStatement();
-
- return contStmt;
- }
-}
-
-/**
* Parse while statement
* @throws ParseException if parsing failed
*/
@@ -819,18 +835,16 @@
{
WhileStatement whileStmt = null;
Criteria criteria = null;
- Block block = null;
+ Statement stmt = null;
}
{
<WHILE>
<LPAREN>
criteria = criteria(info)
<RPAREN>
- block = block(info)
-
+ stmt = statement(info)
{
- whileStmt = new WhileStatement(criteria, block);
-
+ whileStmt = new WhileStatement(criteria, asBlock(stmt));
return whileStmt;
}
}
@@ -844,7 +858,7 @@
LoopStatement loopStmt = null;
String cursor = null;
QueryCommand query = null;
- Block block = null;
+ Statement stmt = null;
}
{
<LOOP>
@@ -854,11 +868,9 @@
<RPAREN>
<AS>
cursor = id()
- block = block(info)
-
+ stmt = statement(info)
{
- loopStmt = new LoopStatement(block, query, cursor);
-
+ loopStmt = new LoopStatement(asBlock(stmt), query, cursor);
return loopStmt;
}
}
@@ -871,21 +883,20 @@
{
IfStatement ifStmt = null;
Criteria criteria = null;
- Block ifBlock = null;
- Block elseBlock = null;
+ Statement ifStatement = null;
+ Statement elseStatement = null;
}
{
<IF>
<LPAREN>
criteria = criteria(info)
<RPAREN>
- ifBlock = block(info)
+ ifStatement = statement(info)
//else blocks will be associated with the closest if block
- [LOOKAHEAD(1)<ELSE> elseBlock = block(info)]
-
+ [LOOKAHEAD(1)<ELSE> elseStatement = statement(info)]
{
- ifStmt = new IfStatement(criteria, ifBlock);
- ifStmt.setElseBlock(elseBlock);
+ ifStmt = new IfStatement(criteria, asBlock(ifStatement));
+ ifStmt.setElseBlock(asBlock(elseStatement));
return ifStmt;
}
}
@@ -1163,16 +1174,16 @@
{
CreateUpdateProcedureCommand updateProcCmd =
new CreateUpdateProcedureCommand();
- Block block = null;
+ Statement stmt = null;
}
{
<CREATE> [<VIRTUAL> {updateProcCmd.setUpdateProcedure(false);}]
[<UPDATE>]
<PROCEDURE>
- block = block(info)
+ stmt = statement(info)
{
- updateProcCmd.setBlock(block);
+ updateProcCmd.setBlock(asBlock(stmt));
return updateProcCmd;
}
}
Modified: trunk/engine/src/main/resources/org/teiid/query/i18n.properties
===================================================================
--- trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2011-08-10 20:06:04 UTC (rev 3372)
@@ -94,7 +94,6 @@
ERR.015.008.0010= INSERT statement must have the same number of elements and values specified. This statement has {0} elements and {1} values.
ERR.015.008.0011= Error parsing query plan transformation for {0}
ERR.015.008.0013= Error parsing query plan transformation for {0}
-ERR.015.008.0015= Unknown statement type: {0}
ERR.015.008.0019= Unable to resolve element: {0}
ERR.015.008.0020= Element is ambiguous and must be qualified: {0}
ERR.015.008.0022= Failed parsing reference binding: {0}
@@ -197,6 +196,10 @@
ValidationVisitor.insert_qe_partition = Inserts with query expressions cannot be performed against a partitioned UNION view {0}.
ValidationVisitor.insert_no_partition = Could not determine INSERT target for a partitioned UNION view {0} with values {1}.
ValidationVisitor.multisource_constant = The multisource column or parameter {0} requires a literal value.
+ValidationVisitor.duplicate_block_label = Duplicate label {0}.
+ValidationVisitor.no_loop = CONTINUE/BREAK can only be used in a LOOP/WHILE statement.
+ValidationVisitor.invalid_label = CONTINUE/BREAK labels can only target LOOP/WHILE statements. {0} targets a block.
+ValidationVisitor.unknown_block_label = No label found in containing scope with name {0}.
ERR.015.012.0029 = INSERT, UPDATE, and DELETE not allowed on XML documents
ERR.015.012.0030 = Commands used in stored procedure language not allowed on XML documents
ERR.015.012.0031 = Queries against XML documents can not have a GROUP By clause
Modified: trunk/engine/src/test/java/org/teiid/query/parser/TestParseAlter.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/parser/TestParseAlter.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/test/java/org/teiid/query/parser/TestParseAlter.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -54,7 +54,7 @@
alterTrigger.setTarget(new GroupSymbol("x"));
alterTrigger.setEvent(TriggerEvent.UPDATE);
alterTrigger.setDefinition((TriggerAction) QueryParser.getQueryParser().parseUpdateProcedure("for each row begin end"));
- helpTest("alter trigger on x instead of update as for each row begin end", "ALTER TRIGGER ON x INSTEAD OF UPDATE AS\nFOR EACH ROW\nBEGIN\nEND", alterTrigger);
+ helpTest("alter trigger on x instead of update as for each row begin end", "ALTER TRIGGER ON x INSTEAD OF UPDATE AS\nFOR EACH ROW\nBEGIN ATOMIC\nEND", alterTrigger);
}
@Test public void testAlterDisabled() throws Exception {
@@ -71,7 +71,7 @@
alterTrigger.setTarget(new GroupSymbol("x"));
alterTrigger.setEvent(TriggerEvent.UPDATE);
alterTrigger.setDefinition((TriggerAction) QueryParser.getQueryParser().parseUpdateProcedure("for each row begin end"));
- helpTest("create trigger on x instead of update as for each row begin end", "CREATE TRIGGER ON x INSTEAD OF UPDATE AS\nFOR EACH ROW\nBEGIN\nEND", alterTrigger);
+ helpTest("create trigger on x instead of update as for each row begin end", "CREATE TRIGGER ON x INSTEAD OF UPDATE AS\nFOR EACH ROW\nBEGIN ATOMIC\nEND", alterTrigger);
}
}
Modified: trunk/engine/src/test/java/org/teiid/query/parser/TestParser.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/parser/TestParser.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/test/java/org/teiid/query/parser/TestParser.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -86,9 +86,8 @@
import org.teiid.query.sql.lang.TextTable.TextColumn;
import org.teiid.query.sql.proc.AssignmentStatement;
import org.teiid.query.sql.proc.Block;
-import org.teiid.query.sql.proc.BreakStatement;
+import org.teiid.query.sql.proc.BranchingStatement;
import org.teiid.query.sql.proc.CommandStatement;
-import org.teiid.query.sql.proc.ContinueStatement;
import org.teiid.query.sql.proc.CreateUpdateProcedureCommand;
import org.teiid.query.sql.proc.CriteriaSelector;
import org.teiid.query.sql.proc.DeclareStatement;
@@ -99,6 +98,7 @@
import org.teiid.query.sql.proc.Statement;
import org.teiid.query.sql.proc.TranslateCriteria;
import org.teiid.query.sql.proc.WhileStatement;
+import org.teiid.query.sql.proc.BranchingStatement.BranchingMode;
import org.teiid.query.sql.symbol.AggregateSymbol;
import org.teiid.query.sql.symbol.AliasSymbol;
import org.teiid.query.sql.symbol.CaseExpression;
@@ -172,7 +172,7 @@
}
private void helpBlockTest(String block, String expectedString, Block expectedBlock) throws ParseException {
- Block actualBlock = new SQLParser(new StringReader(block)).block(new ParseInfo());
+ Block actualBlock = SQLParserUtil.asBlock(new SQLParser(new StringReader(block)).statement(new ParseInfo()));
String actualString = actualBlock.toString();
assertEquals("Parse string does not match: ", expectedString, actualString); //$NON-NLS-1$
assertEquals("Block does not match: ", expectedBlock, actualBlock); //$NON-NLS-1$
@@ -3185,32 +3185,6 @@
stmt);
}
- /*@Test public void testIfStatement1(){
- ElementSymbol a = new ElementSymbol("a");
- String shortType = new String("short");
- Statement ifStmt = new DeclareStatement(a, shortType);
-
- ElementSymbol b = new ElementSymbol("b");
- Statement elseStmt = new DeclareStatement(b, shortType);
-
- Block ifBlock = new Block();
- ifBlock.addStatement(ifStmt);
-
- Block elseBlock = new Block();
- elseBlock.addStatement(elseStmt);
-
- ElementSymbol c = new ElementSymbol("c");
- Criteria crit = new CompareCriteria(c, CompareCriteria.EQ,
- new Constant(new Integer(5)));
-
- IfStatement stmt = new IfStatement(crit, ifBlock, elseBlock);
-
- helpStmtTest("IF(c = 5) BEGIN DECLARE short a; END ELSE ",
- "IF(c = 5)"+"\n"+ "BEGIN"+"\n"+"DECLARE short a;"+"\n"+"END"+"\n"+
- "ELSE"+"\n"+"BEGIN"+"\n"+"DECLARE short b;"+"\n"+"END",
- stmt);
- }*/
-
@Test public void testCriteriaSelector0() throws Exception {
ElementSymbol a = new ElementSymbol("a"); //$NON-NLS-1$
@@ -5463,16 +5437,41 @@
+"\n"+"END", whileStmt); //$NON-NLS-1$ //$NON-NLS-2$
}
+ @Test public void testWhileStatement1() throws Exception {
+ ElementSymbol x = new ElementSymbol("x", false); //$NON-NLS-1$
+ Function f = new Function("+", new Expression[] { x, new Constant(new Integer(1)) }); //$NON-NLS-1$
+ Statement assignmentStmt = new AssignmentStatement(x, f);
+ Block block = new Block();
+ block.setAtomic(true);
+ block.setLabel("1y");
+ block.addStatement(assignmentStmt);
+ BranchingStatement bs = new BranchingStatement(BranchingMode.CONTINUE);
+ bs.setLabel("1y");
+ block.addStatement(bs);
+ Criteria crit = new CompareCriteria(x, CompareCriteria.LT,
+ new Constant(new Integer(100)));
+ WhileStatement whileStmt = new WhileStatement(crit, block);
+ helpStmtTest("WHILE (x < 100) \"1y\": BEGIN ATOMIC x=x+1; CONTINUE \"1y\"; END", //$NON-NLS-1$
+ "WHILE(x < 100)"+"\n"+ "\"1y\" : BEGIN ATOMIC"+"\n"+"x = (x + 1);\nCONTINUE \"1y\";" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+ +"\n"+"END", whileStmt); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
@Test public void testBreakStatement() throws Exception {
- Statement breakStmt = new BreakStatement();
+ Statement breakStmt = new BranchingStatement();
helpStmtTest("break;", "BREAK;", breakStmt); //$NON-NLS-1$ //$NON-NLS-2$
}
@Test public void testContinueStatement() throws Exception {
- Statement contStmt = new ContinueStatement();
+ BranchingStatement contStmt = new BranchingStatement(BranchingMode.CONTINUE);
helpStmtTest("continue;", "CONTINUE;", contStmt); //$NON-NLS-1$ //$NON-NLS-2$
}
+ @Test public void testContinueStatement1() throws Exception {
+ BranchingStatement contStmt = new BranchingStatement(BranchingMode.CONTINUE);
+ contStmt.setLabel("x");
+ helpStmtTest("continue x;", "CONTINUE x;", contStmt); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
@Test public void testVirtualProcedure(){
ElementSymbol x = new ElementSymbol("x"); //$NON-NLS-1$
String intType = new String("integer"); //$NON-NLS-1$
@@ -5498,7 +5497,7 @@
block.addStatement(assignmentStmt);
Block ifBlock = new Block();
- Statement continueStmt = new ContinueStatement();
+ Statement continueStmt = new BranchingStatement(BranchingMode.CONTINUE);
ifBlock.addStatement(continueStmt);
Criteria crit = new CompareCriteria(x, CompareCriteria.GT,
new Constant(new Integer(5)));
Modified: trunk/engine/src/test/java/org/teiid/query/processor/proc/TestProcedureProcessor.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/proc/TestProcedureProcessor.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/test/java/org/teiid/query/processor/proc/TestProcedureProcessor.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -29,12 +29,16 @@
import java.util.List;
import org.junit.Test;
+import org.mockito.Mockito;
import org.teiid.api.exception.query.QueryMetadataException;
import org.teiid.api.exception.query.QueryProcessingException;
import org.teiid.api.exception.query.QueryValidatorException;
import org.teiid.client.metadata.ParameterInfo;
import org.teiid.core.TeiidException;
+import org.teiid.core.TeiidProcessingException;
import org.teiid.core.types.DataTypeManager;
+import org.teiid.dqp.service.TransactionContext;
+import org.teiid.dqp.service.TransactionService;
import org.teiid.metadata.ColumnSet;
import org.teiid.metadata.MetadataStore;
import org.teiid.metadata.Procedure;
@@ -1648,6 +1652,48 @@
helpTestProcess(plan, expected, dataMgr, metadata);
}
+ @Test public void testLoopsWithLabels() throws Exception {
+ TransformationMetadata metadata = RealMetadataFactory.example1();
+
+ StringBuffer procedure = new StringBuffer("CREATE VIRTUAL PROCEDURE \n"); //$NON-NLS-1$
+ procedure.append("y: BEGIN\n"); //$NON-NLS-1$
+ procedure.append("declare integer VARIABLES.e2_total=param1;\n"); //$NON-NLS-1$
+ procedure.append("x: loop on (select e2 as x from pm1.g1) as mycursor\n"); //$NON-NLS-1$
+ procedure.append("BEGIN\n"); //$NON-NLS-1$
+ procedure.append("e2_total=e2_total+mycursor.x;\n"); //$NON-NLS-1$
+ procedure.append("loop on (select e2 as x from pm1.g1) as mycursor1\n"); //$NON-NLS-1$
+ procedure.append("BEGIN\n"); //$NON-NLS-1$
+ procedure.append("if (e2_total < 5)\n"); //$NON-NLS-1$
+ procedure.append("break x;\n"); //$NON-NLS-1$
+ procedure.append("else if (e2_total > 50)\n"); //$NON-NLS-1$
+ procedure.append("leave y;\n"); //$NON-NLS-1$
+ procedure.append("e2_total=e2_total+mycursor1.x;"); //$NON-NLS-1$
+ procedure.append("END\n"); //$NON-NLS-1$
+ procedure.append("END\n"); //$NON-NLS-1$
+ procedure.append("SELECT VARIABLES.e2_total;\n"); //$NON-NLS-1$
+ procedure.append("END"); //$NON-NLS-1$
+
+ addProc(metadata, "sq2", procedure.toString(), new String[] { "e1" }, new String[] { DataTypeManager.DefaultDataTypes.INTEGER }, new String[] {"param1"}, new String[] {DataTypeManager.DefaultDataTypes.INTEGER});
+
+ String userUpdateStr = "EXEC pm1.sq2(1)"; //$NON-NLS-1$
+
+ FakeDataManager dataMgr = exampleDataManager(metadata);
+
+ ProcessorPlan plan = getProcedurePlan(userUpdateStr, metadata);
+
+ //Create expected results
+ List[] expected = new List[] {
+ };
+ helpTestProcess(plan, expected, dataMgr, metadata);
+
+ expected = new List[] {
+ Arrays.asList(0),
+ };
+ userUpdateStr = "EXEC pm1.sq2(-5)"; //$NON-NLS-1$
+ plan = getProcedurePlan(userUpdateStr, metadata);
+ helpTestProcess(plan, expected, dataMgr, metadata);
+ }
+
@Test public void testCreateWithoutDrop() throws Exception {
TransformationMetadata metadata = RealMetadataFactory.example1();
@@ -2433,6 +2479,53 @@
helpTestProcess(plan, expected, dataMgr, metadata);
}
+
+ @Test public void testBeginAtomic() throws Exception {
+ String proc = "CREATE VIRTUAL PROCEDURE " + //$NON-NLS-1$
+ "BEGIN ATOMIC" + //$NON-NLS-1$
+ " select e1, e2, e3, e4 into #t1 from pm1.g1;\n" + //$NON-NLS-1$
+ " update #t1 set e1 = 1 where e4 < 2;\n" + //$NON-NLS-1$
+ " delete from #t1 where e4 > 2;\n" + //$NON-NLS-1$
+ " select e2/\"in\" from #t1;\n" + //$NON-NLS-1$
+ "END"; //$NON-NLS-1$
+ TransformationMetadata tm = RealMetadataFactory.example1();
+ addProc(tm, "sq1", proc, new String[] { "e1" },
+ new String[] { DataTypeManager.DefaultDataTypes.INTEGER }, new String[] {"in"}, new String[] {DataTypeManager.DefaultDataTypes.INTEGER});
+ FakeDataManager dataMgr = exampleDataManager(tm);
+ CommandContext context = new CommandContext("pID", null, null, null, 1); //$NON-NLS-1$
+ QueryMetadataInterface metadata = new TempMetadataAdapter(tm, new TempMetadataStore());
+ context.setMetadata(metadata);
+ TransactionContext tc = new TransactionContext();
+ TransactionService ts = Mockito.mock(TransactionService.class);
+ context.setTransactionService(ts);
+ context.setTransactionContext(tc);
+ String userQuery = "EXEC pm1.sq1(1)"; //$NON-NLS-1$
+ ProcessorPlan plan = getProcedurePlan(userQuery, tm, TestOptimizer.getGenericFinder());
+ List[] expected = new List[] {
+ Arrays.asList(5),
+ };
+ TestProcessor.helpProcess(plan, context, dataMgr, expected);
+ Mockito.verify(ts, Mockito.times(3)).begin(tc);
+ Mockito.verify(ts, Mockito.times(3)).commit(tc);
+
+ tc = new TransactionContext();
+ ts = Mockito.mock(TransactionService.class);
+ context.setTransactionService(ts);
+ context.setTransactionContext(tc);
+ userQuery = "EXEC pm1.sq1(0)"; //$NON-NLS-1$
+ plan = getProcedurePlan(userQuery, tm, TestOptimizer.getGenericFinder());
+ expected = null;
+ try {
+ TestProcessor.helpProcess(plan, context, dataMgr, expected);
+ fail();
+ } catch (TeiidProcessingException e) {
+
+ }
+ Mockito.verify(ts).begin(tc);
+ Mockito.verify(ts, Mockito.times(0)).commit(tc);
+ Mockito.verify(ts).rollback(tc);
+ }
+
private static final boolean DEBUG = false;
}
Modified: trunk/engine/src/test/java/org/teiid/query/resolver/TestAlterResolving.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/resolver/TestAlterResolving.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/test/java/org/teiid/query/resolver/TestAlterResolving.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -49,12 +49,12 @@
}
@Test public void testAlterTriggerInsert() {
- AlterTrigger alterTrigger = (AlterTrigger) helpResolve("alter trigger on SmallA_2589 instead of insert as for each row select new.intkey;", RealMetadataFactory.exampleBQTCached());
+ AlterTrigger alterTrigger = (AlterTrigger) helpResolve("alter trigger on SmallA_2589 instead of insert as for each row begin atomic select new.intkey; end", RealMetadataFactory.exampleBQTCached());
assertNotNull(alterTrigger.getTarget().getMetadataID());
}
@Test public void testAlterTriggerInsert_Invalid() {
- helpResolveException("alter trigger on SmallA_2589 instead of insert as for each row select old.intkey;", RealMetadataFactory.exampleBQTCached());
+ helpResolveException("alter trigger on SmallA_2589 instead of insert as for each row begin atomic select old.intkey; end", RealMetadataFactory.exampleBQTCached());
}
@Test public void testAlterView_Invalid() {
Modified: trunk/engine/src/test/java/org/teiid/query/sql/proc/TestBreakStatement.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/sql/proc/TestBreakStatement.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/test/java/org/teiid/query/sql/proc/TestBreakStatement.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -24,12 +24,11 @@
*/
package org.teiid.query.sql.proc;
+import junit.framework.TestCase;
+
import org.teiid.core.util.UnitTestUtil;
-import org.teiid.query.sql.proc.BreakStatement;
-import org.teiid.query.sql.proc.ContinueStatement;
+import org.teiid.query.sql.proc.BranchingStatement.BranchingMode;
-import junit.framework.*;
-
public class TestBreakStatement extends TestCase{
/**
@@ -41,32 +40,32 @@
// ################################## TEST HELPERS ################################
- public static final BreakStatement sample1() {
- return new BreakStatement();
+ public static final BranchingStatement sample1() {
+ return new BranchingStatement();
}
- public static final BreakStatement sample2() {
- return new BreakStatement();
+ public static final BranchingStatement sample2() {
+ return new BranchingStatement();
}
// ################################## ACTUAL TESTS ################################
public void testSelfEquivalence(){
- BreakStatement s1 = sample1();
+ BranchingStatement s1 = sample1();
int equals = 0;
UnitTestUtil.helpTestEquivalence(equals, s1, s1);
}
public void testEquivalence(){
- BreakStatement s1 = sample1();
- BreakStatement s1a = sample2();
+ BranchingStatement s1 = sample1();
+ BranchingStatement s1a = sample2();
int equals = 0;
UnitTestUtil.helpTestEquivalence(equals, s1, s1a);
}
public void testNonEquivalence(){
- BreakStatement s1 = sample1();
+ BranchingStatement s1 = sample1();
int equals = -1;
- UnitTestUtil.helpTestEquivalence(equals, s1, new ContinueStatement());
+ UnitTestUtil.helpTestEquivalence(equals, s1, new BranchingStatement(BranchingMode.CONTINUE));
}
}
Deleted: trunk/engine/src/test/java/org/teiid/query/sql/proc/TestContinueStatement.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/sql/proc/TestContinueStatement.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/test/java/org/teiid/query/sql/proc/TestContinueStatement.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -1,80 +0,0 @@
-/*
- * 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.query.sql.proc;
-
-import org.teiid.core.util.UnitTestUtil;
-import org.teiid.query.sql.proc.BreakStatement;
-import org.teiid.query.sql.proc.ContinueStatement;
-
-import junit.framework.TestCase;
-
-
-/**
- * @author LLiang
- *
- * To change the template for this generated type comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class TestContinueStatement extends TestCase{
-
- /**
- * Constructor for TestAssignmentStatement.
- */
- public TestContinueStatement(String name) {
- super(name);
- }
-
- // ################################## TEST HELPERS ################################
-
- public static final ContinueStatement sample1() {
- return new ContinueStatement();
- }
-
- public static final ContinueStatement sample2() {
- return new ContinueStatement();
- }
-
- // ################################## ACTUAL TESTS ################################
-
- public void testSelfEquivalence(){
- ContinueStatement s1 = sample1();
- int equals = 0;
- UnitTestUtil.helpTestEquivalence(equals, s1, s1);
- }
-
- public void testEquivalence(){
- ContinueStatement s1 = sample1();
- ContinueStatement s1a = sample2();
- int equals = 0;
- UnitTestUtil.helpTestEquivalence(equals, s1, s1a);
- }
-
- public void testNonEquivalence(){
- ContinueStatement s1 = sample1();
- int equals = -1;
- UnitTestUtil.helpTestEquivalence(equals, s1, new BreakStatement());
- }
-
-}
Modified: trunk/engine/src/test/java/org/teiid/query/validator/TestAlterValidation.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/validator/TestAlterValidation.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/test/java/org/teiid/query/validator/TestAlterValidation.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -41,7 +41,7 @@
}
@Test public void testValidateAlterTrigger() {
- TestValidator.helpValidate("alter trigger on SmallA_2589 instead of insert as for each row select 1;", new String[] {"SmallA_2589"}, RealMetadataFactory.exampleBQTCached());
+ TestValidator.helpValidate("alter trigger on SmallA_2589 instead of insert as for each row begin atomic select 1; end", new String[] {"SmallA_2589"}, RealMetadataFactory.exampleBQTCached());
}
@Test public void testValidateAlterProcedure() {
Modified: trunk/engine/src/test/java/org/teiid/query/validator/TestValidator.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/validator/TestValidator.java 2011-08-10 19:41:34 UTC (rev 3371)
+++ trunk/engine/src/test/java/org/teiid/query/validator/TestValidator.java 2011-08-10 20:06:04 UTC (rev 3372)
@@ -1516,6 +1516,36 @@
assertEquals("Expected report to have no validation failures", false, report.hasItems()); //$NON-NLS-1$
}
+ @Test public void testDupLabel() throws Exception{
+ String sql = "CREATE VIRTUAL PROCEDURE BEGIN IF (pm1.vsp42.param1 > 0) x : begin SELECT 1 AS x; x: begin atomic select 2 as x; end end END"; //$NON-NLS-1$
+
+ QueryMetadataInterface metadata = RealMetadataFactory.example1Cached();
+
+ // Validate
+ ValidatorReport report = helpValidateInModeler("pm1.vsp42", sql, metadata); //$NON-NLS-1$
+ examineReport(sql, new String[] {"x : BEGIN ATOMIC\nSELECT 2 AS x;\nEND"}, report);
+ }
+
+ @Test public void testInvalidContinue() throws Exception{
+ String sql = "CREATE VIRTUAL PROCEDURE BEGIN continue; END"; //$NON-NLS-1$
+
+ QueryMetadataInterface metadata = RealMetadataFactory.example1Cached();
+
+ // Validate
+ ValidatorReport report = helpValidateInModeler("pm1.vsp42", sql, metadata); //$NON-NLS-1$
+ examineReport(sql, new String[] {"CONTINUE;"}, report);
+ }
+
+ @Test public void testInvalidLabel() throws Exception{
+ String sql = "CREATE VIRTUAL PROCEDURE BEGIN IF (pm1.vsp42.param1 > 0) x : begin continue y; end END"; //$NON-NLS-1$
+
+ QueryMetadataInterface metadata = RealMetadataFactory.example1Cached();
+
+ // Validate
+ ValidatorReport report = helpValidateInModeler("pm1.vsp42", sql, metadata); //$NON-NLS-1$
+ examineReport(sql, new String[] {"CONTINUE y;"}, report);
+ }
+
@Test public void testNonQueryAgg() throws Exception{
String sql = "CREATE VIRTUAL PROCEDURE BEGIN IF (max(pm1.vsp42.param1) > 0) SELECT 1 AS x; ELSE SELECT 0 AS x; END"; //$NON-NLS-1$
14 years, 8 months
teiid SVN: r3371 - in trunk: adminshell and 39 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-08-10 15:41:34 -0400 (Wed, 10 Aug 2011)
New Revision: 3371
Modified:
trunk/adminshell/pom.xml
trunk/api/pom.xml
trunk/build/kits/jboss-container/teiid-releasenotes.html
trunk/build/pom.xml
trunk/cache-jbosscache/pom.xml
trunk/client-jdk15/pom.xml
trunk/client/pom.xml
trunk/common-core/pom.xml
trunk/connectors/connector-file/pom.xml
trunk/connectors/connector-ldap/pom.xml
trunk/connectors/connector-salesforce/pom.xml
trunk/connectors/connector-ws/pom.xml
trunk/connectors/pom.xml
trunk/connectors/salesforce-api/pom.xml
trunk/connectors/sandbox/pom.xml
trunk/connectors/sandbox/translator-yahoo/pom.xml
trunk/connectors/translator-file/pom.xml
trunk/connectors/translator-jdbc/pom.xml
trunk/connectors/translator-ldap/pom.xml
trunk/connectors/translator-loopback/pom.xml
trunk/connectors/translator-olap/pom.xml
trunk/connectors/translator-salesforce/pom.xml
trunk/connectors/translator-ws/pom.xml
trunk/console/pom.xml
trunk/documentation/admin-guide/pom.xml
trunk/documentation/caching-guide/pom.xml
trunk/documentation/client-developers-guide/pom.xml
trunk/documentation/developer-guide/pom.xml
trunk/documentation/docbook/custom.dtd
trunk/documentation/pom.xml
trunk/documentation/quick-start-example/pom.xml
trunk/documentation/reference/pom.xml
trunk/engine/pom.xml
trunk/hibernate-dialect/pom.xml
trunk/jboss-integration/pom.xml
trunk/metadata/pom.xml
trunk/pom.xml
trunk/runtime/pom.xml
trunk/test-integration/common/pom.xml
trunk/test-integration/db/pom.xml
trunk/test-integration/pom.xml
Log:
updating trunk to 7.6
Modified: trunk/adminshell/pom.xml
===================================================================
--- trunk/adminshell/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/adminshell/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-adminshell</artifactId>
Modified: trunk/api/pom.xml
===================================================================
--- trunk/api/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/api/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-api</artifactId>
Modified: trunk/build/kits/jboss-container/teiid-releasenotes.html
===================================================================
--- trunk/build/kits/jboss-container/teiid-releasenotes.html 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/build/kits/jboss-container/teiid-releasenotes.html 2011-08-10 19:41:34 UTC (rev 3371)
@@ -10,7 +10,7 @@
<P><A HREF="http://www.teiid.org/"><IMG SRC="https://www.jboss.org/dms/teiid/images/teiid-banner.png" NAME="graphics1" ALT="Teiid" ALIGN=BOTTOM WIDTH=800></A>
<H1>Teiid ${project.version} Release Notes</H1>
-<P>Teiid ${project.version} adds performance, integration, and runtime metadata update features.
+<P>Teiid ${project.version} adds performance and integration features.
<H2>Overview</H2>
<UL>
@@ -26,24 +26,6 @@
</UL>
<H2><A NAME="Highlights"></A>Highlights</H2>
<UL>
- <LI><B>Window function support</B> - Teiid and pushdown support was added for SQL 2003 OLAP window functions. The analytical ranking functions RANK, DENSE_RANK, and ROW_NUMBER were also added. See the reference for more.
- <LI><B>Additional ANSI support</B> - Teiid and pushdown support was added for SUBSTRING using FROM/FOR syntax, TRIM, EXTRACT, SIMILAR TO, and LIKE_REGEX. See the reference for more.
- <LI><B>Subquery optimization control</B> - added the DJ hint to indicate that a subquery should be the independent side of a dependent join.
- <LI><B>MAKEIND Hint</B> - The MAKEIND hint can be used to indicate that the other side of the join should be made dependent.
- <LI><B>ODBC SSL</B> - added support for SSL encrypted ODBC connections.
- <LI><B>Reauthentication Statement</B> - SET SESSION AUTHORIZATION can now be used to perform a reauthentication via JDBC or ODBC.
- <LI><B>Pluggable Authorization</B> - an alternative PolicyDecider can be defined in the teiid-jboss-beans.xml file to customize authorization decisions.
- <LI><B>Streaming XQuery</B> - in situations where document projection applies if the XMLQUERY/XMLTABLE path expressions meet certain conditions, then the incoming document will not only be projected, but the independent subtrees will be processed without loading the entire document. This allows for nearly arbitrarily large XML documents to be processed. See the Reference for more.
- <LI><B>Logging Procedures</B> - added SYSADMIN.isLoggable and SYSADMIN.logMsg to aid in debugging procedure logic.
- <LI><B>ANSI OFFSET/FETCH FIRST</B> - instead of the limit clause, a standard OFFSET and/or FETCH FIRST/NEXT clause can be used to limit results.
- <LI><B>ODBC Cursors</B> - added the capability to use "UseDeclareFetch" with ODBC. This enables users to read results in batches, which is especially useful when dealing with large row counts.
- <LI><B>Internal Materialized Views</B>
- <UL>
- <LI><B>Distributed Refresh</B> - When a internal materialized view is refreshed at one node, an event is issued to all other nodes in the cluster to asynchronously fetch the new contents.
- <LI><B>Sync at Start</B> - When a node is restarted in a cluster, at end of start cycle Teiid will asynchronously fetch the cached internal materialized view contents from other nodes.
- </UL>
- </LI>
- <LI><B>LDAP Pagination</B> - the ldap translator now supports pagination for retrieving large results from directory servers like Active Directory and OpenLDAP.
</UL>
<h2><a name="Compatibility">Compatibility Issues</a></h2>
Modified: trunk/build/pom.xml
===================================================================
--- trunk/build/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/build/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid</artifactId>
Modified: trunk/cache-jbosscache/pom.xml
===================================================================
--- trunk/cache-jbosscache/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/cache-jbosscache/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-cache-jbosscache</artifactId>
Modified: trunk/client/pom.xml
===================================================================
--- trunk/client/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/client/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-client</artifactId>
Modified: trunk/client-jdk15/pom.xml
===================================================================
--- trunk/client-jdk15/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/client-jdk15/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-client-jdk15</artifactId>
Modified: trunk/common-core/pom.xml
===================================================================
--- trunk/common-core/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/common-core/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-common-core</artifactId>
Modified: trunk/connectors/connector-file/pom.xml
===================================================================
--- trunk/connectors/connector-file/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/connectors/connector-file/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-file</artifactId>
Modified: trunk/connectors/connector-ldap/pom.xml
===================================================================
--- trunk/connectors/connector-ldap/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/connectors/connector-ldap/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-ldap</artifactId>
Modified: trunk/connectors/connector-salesforce/pom.xml
===================================================================
--- trunk/connectors/connector-salesforce/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/connectors/connector-salesforce/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-salesforce</artifactId>
Modified: trunk/connectors/connector-ws/pom.xml
===================================================================
--- trunk/connectors/connector-ws/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/connectors/connector-ws/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-ws</artifactId>
Modified: trunk/connectors/pom.xml
===================================================================
--- trunk/connectors/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/connectors/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
Modified: trunk/connectors/salesforce-api/pom.xml
===================================================================
--- trunk/connectors/salesforce-api/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/connectors/salesforce-api/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>salesforce-api</artifactId>
Modified: trunk/connectors/sandbox/pom.xml
===================================================================
--- trunk/connectors/sandbox/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/connectors/sandbox/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid.connectors</groupId>
Modified: trunk/connectors/sandbox/translator-yahoo/pom.xml
===================================================================
--- trunk/connectors/sandbox/translator-yahoo/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/connectors/sandbox/translator-yahoo/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -3,7 +3,7 @@
<parent>
<artifactId>sandbox</artifactId>
<groupId>org.jboss.teiid.connectors</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-yahoo</artifactId>
Modified: trunk/connectors/translator-file/pom.xml
===================================================================
--- trunk/connectors/translator-file/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/connectors/translator-file/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-file</artifactId>
Modified: trunk/connectors/translator-jdbc/pom.xml
===================================================================
--- trunk/connectors/translator-jdbc/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/connectors/translator-jdbc/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-jdbc</artifactId>
Modified: trunk/connectors/translator-ldap/pom.xml
===================================================================
--- trunk/connectors/translator-ldap/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/connectors/translator-ldap/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-ldap</artifactId>
Modified: trunk/connectors/translator-loopback/pom.xml
===================================================================
--- trunk/connectors/translator-loopback/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/connectors/translator-loopback/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-loopback</artifactId>
Modified: trunk/connectors/translator-olap/pom.xml
===================================================================
--- trunk/connectors/translator-olap/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/connectors/translator-olap/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-olap</artifactId>
Modified: trunk/connectors/translator-salesforce/pom.xml
===================================================================
--- trunk/connectors/translator-salesforce/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/connectors/translator-salesforce/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-salesforce</artifactId>
Modified: trunk/connectors/translator-ws/pom.xml
===================================================================
--- trunk/connectors/translator-ws/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/connectors/translator-ws/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-ws</artifactId>
Modified: trunk/console/pom.xml
===================================================================
--- trunk/console/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/console/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/documentation/admin-guide/pom.xml
===================================================================
--- trunk/documentation/admin-guide/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/documentation/admin-guide/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>admin-guide</artifactId>
Modified: trunk/documentation/caching-guide/pom.xml
===================================================================
--- trunk/documentation/caching-guide/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/documentation/caching-guide/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>caching-guide</artifactId>
Modified: trunk/documentation/client-developers-guide/pom.xml
===================================================================
--- trunk/documentation/client-developers-guide/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/documentation/client-developers-guide/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>client-developers-guide</artifactId>
Modified: trunk/documentation/developer-guide/pom.xml
===================================================================
--- trunk/documentation/developer-guide/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/documentation/developer-guide/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>developer-guide</artifactId>
Modified: trunk/documentation/docbook/custom.dtd
===================================================================
--- trunk/documentation/docbook/custom.dtd 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/documentation/docbook/custom.dtd 2011-08-10 19:41:34 UTC (rev 3371)
@@ -1,4 +1,4 @@
-<!ENTITY versionNumber "7.5">
+<!ENTITY versionNumber "7.6">
<!ENTITY copyrightYear "2011">
<!ENTITY copyrightHolder "Red Hat, Inc.">
<!ENTITY url "http://www.jboss.org/teiid/">
Modified: trunk/documentation/pom.xml
===================================================================
--- trunk/documentation/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/documentation/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
Modified: trunk/documentation/quick-start-example/pom.xml
===================================================================
--- trunk/documentation/quick-start-example/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/documentation/quick-start-example/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>quick-start-example</artifactId>
Modified: trunk/documentation/reference/pom.xml
===================================================================
--- trunk/documentation/reference/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/documentation/reference/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>reference</artifactId>
Modified: trunk/engine/pom.xml
===================================================================
--- trunk/engine/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/engine/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-engine</artifactId>
Modified: trunk/hibernate-dialect/pom.xml
===================================================================
--- trunk/hibernate-dialect/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/hibernate-dialect/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-hibernate-dialect</artifactId>
Modified: trunk/jboss-integration/pom.xml
===================================================================
--- trunk/jboss-integration/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/jboss-integration/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
Modified: trunk/metadata/pom.xml
===================================================================
--- trunk/metadata/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/metadata/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-metadata</artifactId>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -5,7 +5,7 @@
<artifactId>teiid-parent</artifactId>
<packaging>pom</packaging>
<name>Teiid</name>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
<description>Federated SQL and XML query engine.</description>
<properties>
<ant.version>1.7.0</ant.version>
Modified: trunk/runtime/pom.xml
===================================================================
--- trunk/runtime/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/runtime/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
Modified: trunk/test-integration/common/pom.xml
===================================================================
--- trunk/test-integration/common/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/test-integration/common/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-test-integration</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>test-integration-common</artifactId>
Modified: trunk/test-integration/db/pom.xml
===================================================================
--- trunk/test-integration/db/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/test-integration/db/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -9,7 +9,7 @@
<parent>
<artifactId>teiid-test-integration</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/test-integration/pom.xml
===================================================================
--- trunk/test-integration/pom.xml 2011-08-10 19:25:47 UTC (rev 3370)
+++ trunk/test-integration/pom.xml 2011-08-10 19:41:34 UTC (rev 3371)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR2-SNAPSHOT</version>
+ <version>7.6.0.Alpha1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-test-integration</artifactId>
14 years, 8 months
teiid SVN: r3370 - branches.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-08-10 15:25:47 -0400 (Wed, 10 Aug 2011)
New Revision: 3370
Added:
branches/7.5.x/
Log:
Adding 7.5.x branch
14 years, 8 months
teiid SVN: r3369 - in trunk: adminshell and 37 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-08-10 14:33:32 -0400 (Wed, 10 Aug 2011)
New Revision: 3369
Modified:
trunk/adminshell/pom.xml
trunk/api/pom.xml
trunk/build/pom.xml
trunk/cache-jbosscache/pom.xml
trunk/client-jdk15/pom.xml
trunk/client/pom.xml
trunk/common-core/pom.xml
trunk/connectors/connector-file/pom.xml
trunk/connectors/connector-ldap/pom.xml
trunk/connectors/connector-salesforce/pom.xml
trunk/connectors/connector-ws/pom.xml
trunk/connectors/pom.xml
trunk/connectors/salesforce-api/pom.xml
trunk/connectors/sandbox/pom.xml
trunk/connectors/sandbox/translator-yahoo/pom.xml
trunk/connectors/translator-file/pom.xml
trunk/connectors/translator-jdbc/pom.xml
trunk/connectors/translator-ldap/pom.xml
trunk/connectors/translator-loopback/pom.xml
trunk/connectors/translator-olap/pom.xml
trunk/connectors/translator-salesforce/pom.xml
trunk/connectors/translator-ws/pom.xml
trunk/console/pom.xml
trunk/documentation/admin-guide/pom.xml
trunk/documentation/caching-guide/pom.xml
trunk/documentation/client-developers-guide/pom.xml
trunk/documentation/developer-guide/pom.xml
trunk/documentation/pom.xml
trunk/documentation/quick-start-example/pom.xml
trunk/documentation/reference/pom.xml
trunk/engine/pom.xml
trunk/hibernate-dialect/pom.xml
trunk/jboss-integration/pom.xml
trunk/metadata/pom.xml
trunk/pom.xml
trunk/runtime/pom.xml
trunk/test-integration/common/pom.xml
trunk/test-integration/db/pom.xml
trunk/test-integration/pom.xml
Log:
[maven-release-plugin] prepare for next development iteration
Modified: trunk/adminshell/pom.xml
===================================================================
--- trunk/adminshell/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/adminshell/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-adminshell</artifactId>
Modified: trunk/api/pom.xml
===================================================================
--- trunk/api/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/api/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-api</artifactId>
Modified: trunk/build/pom.xml
===================================================================
--- trunk/build/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/build/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid</artifactId>
Modified: trunk/cache-jbosscache/pom.xml
===================================================================
--- trunk/cache-jbosscache/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/cache-jbosscache/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-cache-jbosscache</artifactId>
Modified: trunk/client/pom.xml
===================================================================
--- trunk/client/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/client/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-client</artifactId>
Modified: trunk/client-jdk15/pom.xml
===================================================================
--- trunk/client-jdk15/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/client-jdk15/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-client-jdk15</artifactId>
Modified: trunk/common-core/pom.xml
===================================================================
--- trunk/common-core/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/common-core/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-common-core</artifactId>
Modified: trunk/connectors/connector-file/pom.xml
===================================================================
--- trunk/connectors/connector-file/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/connectors/connector-file/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-file</artifactId>
Modified: trunk/connectors/connector-ldap/pom.xml
===================================================================
--- trunk/connectors/connector-ldap/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/connectors/connector-ldap/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-ldap</artifactId>
Modified: trunk/connectors/connector-salesforce/pom.xml
===================================================================
--- trunk/connectors/connector-salesforce/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/connectors/connector-salesforce/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-salesforce</artifactId>
Modified: trunk/connectors/connector-ws/pom.xml
===================================================================
--- trunk/connectors/connector-ws/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/connectors/connector-ws/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-ws</artifactId>
Modified: trunk/connectors/pom.xml
===================================================================
--- trunk/connectors/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/connectors/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
Modified: trunk/connectors/salesforce-api/pom.xml
===================================================================
--- trunk/connectors/salesforce-api/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/connectors/salesforce-api/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>salesforce-api</artifactId>
Modified: trunk/connectors/sandbox/pom.xml
===================================================================
--- trunk/connectors/sandbox/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/connectors/sandbox/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid.connectors</groupId>
Modified: trunk/connectors/sandbox/translator-yahoo/pom.xml
===================================================================
--- trunk/connectors/sandbox/translator-yahoo/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/connectors/sandbox/translator-yahoo/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -3,7 +3,7 @@
<parent>
<artifactId>sandbox</artifactId>
<groupId>org.jboss.teiid.connectors</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-yahoo</artifactId>
Modified: trunk/connectors/translator-file/pom.xml
===================================================================
--- trunk/connectors/translator-file/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/connectors/translator-file/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-file</artifactId>
Modified: trunk/connectors/translator-jdbc/pom.xml
===================================================================
--- trunk/connectors/translator-jdbc/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/connectors/translator-jdbc/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-jdbc</artifactId>
Modified: trunk/connectors/translator-ldap/pom.xml
===================================================================
--- trunk/connectors/translator-ldap/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/connectors/translator-ldap/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-ldap</artifactId>
Modified: trunk/connectors/translator-loopback/pom.xml
===================================================================
--- trunk/connectors/translator-loopback/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/connectors/translator-loopback/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-loopback</artifactId>
Modified: trunk/connectors/translator-olap/pom.xml
===================================================================
--- trunk/connectors/translator-olap/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/connectors/translator-olap/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-olap</artifactId>
Modified: trunk/connectors/translator-salesforce/pom.xml
===================================================================
--- trunk/connectors/translator-salesforce/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/connectors/translator-salesforce/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-salesforce</artifactId>
Modified: trunk/connectors/translator-ws/pom.xml
===================================================================
--- trunk/connectors/translator-ws/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/connectors/translator-ws/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-ws</artifactId>
Modified: trunk/console/pom.xml
===================================================================
--- trunk/console/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/console/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/documentation/admin-guide/pom.xml
===================================================================
--- trunk/documentation/admin-guide/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/documentation/admin-guide/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>admin-guide</artifactId>
Modified: trunk/documentation/caching-guide/pom.xml
===================================================================
--- trunk/documentation/caching-guide/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/documentation/caching-guide/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>caching-guide</artifactId>
Modified: trunk/documentation/client-developers-guide/pom.xml
===================================================================
--- trunk/documentation/client-developers-guide/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/documentation/client-developers-guide/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>client-developers-guide</artifactId>
Modified: trunk/documentation/developer-guide/pom.xml
===================================================================
--- trunk/documentation/developer-guide/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/documentation/developer-guide/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>developer-guide</artifactId>
Modified: trunk/documentation/pom.xml
===================================================================
--- trunk/documentation/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/documentation/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
Modified: trunk/documentation/quick-start-example/pom.xml
===================================================================
--- trunk/documentation/quick-start-example/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/documentation/quick-start-example/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>quick-start-example</artifactId>
Modified: trunk/documentation/reference/pom.xml
===================================================================
--- trunk/documentation/reference/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/documentation/reference/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>reference</artifactId>
Modified: trunk/engine/pom.xml
===================================================================
--- trunk/engine/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/engine/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-engine</artifactId>
Modified: trunk/hibernate-dialect/pom.xml
===================================================================
--- trunk/hibernate-dialect/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/hibernate-dialect/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-hibernate-dialect</artifactId>
Modified: trunk/jboss-integration/pom.xml
===================================================================
--- trunk/jboss-integration/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/jboss-integration/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
Modified: trunk/metadata/pom.xml
===================================================================
--- trunk/metadata/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/metadata/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-metadata</artifactId>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -5,15 +5,15 @@
<artifactId>teiid-parent</artifactId>
<packaging>pom</packaging>
<name>Teiid</name>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
<description>Federated SQL and XML query engine.</description>
<properties>
<ant.version>1.7.0</ant.version>
<site.url>http://www.jboss.org/teiid</site.url>
</properties>
<scm>
- <connection>scm:svn:https://anonsvn.jboss.org/repos/teiid/tags/teiid-parent-7.5.0.CR1</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/teiid/tags/teiid-parent-7.5.0.CR1</developerConnection>
+ <connection>scm:svn:https://anonsvn.jboss.org/repos/teiid/trunk</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/teiid/trunk</developerConnection>
</scm>
<licenses>
<license>
Modified: trunk/runtime/pom.xml
===================================================================
--- trunk/runtime/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/runtime/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
Modified: trunk/test-integration/common/pom.xml
===================================================================
--- trunk/test-integration/common/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/test-integration/common/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-test-integration</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>test-integration-common</artifactId>
Modified: trunk/test-integration/db/pom.xml
===================================================================
--- trunk/test-integration/db/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/test-integration/db/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -9,7 +9,7 @@
<parent>
<artifactId>teiid-test-integration</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/test-integration/pom.xml
===================================================================
--- trunk/test-integration/pom.xml 2011-08-10 18:32:43 UTC (rev 3368)
+++ trunk/test-integration/pom.xml 2011-08-10 18:33:32 UTC (rev 3369)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1</version>
+ <version>7.5.0.CR2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-test-integration</artifactId>
14 years, 8 months
teiid SVN: r3368 - tags.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-08-10 14:32:43 -0400 (Wed, 10 Aug 2011)
New Revision: 3368
Added:
tags/teiid-parent-7.5.0.CR1/
Log:
[maven-release-plugin] copy for tag teiid-parent-7.5.0.CR1
14 years, 8 months
teiid SVN: r3367 - in trunk: adminshell and 37 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-08-10 14:32:22 -0400 (Wed, 10 Aug 2011)
New Revision: 3367
Modified:
trunk/adminshell/pom.xml
trunk/api/pom.xml
trunk/build/pom.xml
trunk/cache-jbosscache/pom.xml
trunk/client-jdk15/pom.xml
trunk/client/pom.xml
trunk/common-core/pom.xml
trunk/connectors/connector-file/pom.xml
trunk/connectors/connector-ldap/pom.xml
trunk/connectors/connector-salesforce/pom.xml
trunk/connectors/connector-ws/pom.xml
trunk/connectors/pom.xml
trunk/connectors/salesforce-api/pom.xml
trunk/connectors/sandbox/pom.xml
trunk/connectors/sandbox/translator-yahoo/pom.xml
trunk/connectors/translator-file/pom.xml
trunk/connectors/translator-jdbc/pom.xml
trunk/connectors/translator-ldap/pom.xml
trunk/connectors/translator-loopback/pom.xml
trunk/connectors/translator-olap/pom.xml
trunk/connectors/translator-salesforce/pom.xml
trunk/connectors/translator-ws/pom.xml
trunk/console/pom.xml
trunk/documentation/admin-guide/pom.xml
trunk/documentation/caching-guide/pom.xml
trunk/documentation/client-developers-guide/pom.xml
trunk/documentation/developer-guide/pom.xml
trunk/documentation/pom.xml
trunk/documentation/quick-start-example/pom.xml
trunk/documentation/reference/pom.xml
trunk/engine/pom.xml
trunk/hibernate-dialect/pom.xml
trunk/jboss-integration/pom.xml
trunk/metadata/pom.xml
trunk/pom.xml
trunk/runtime/pom.xml
trunk/test-integration/common/pom.xml
trunk/test-integration/db/pom.xml
trunk/test-integration/pom.xml
Log:
[maven-release-plugin] prepare release teiid-parent-7.5.0.CR1
Modified: trunk/adminshell/pom.xml
===================================================================
--- trunk/adminshell/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/adminshell/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-adminshell</artifactId>
Modified: trunk/api/pom.xml
===================================================================
--- trunk/api/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/api/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-api</artifactId>
Modified: trunk/build/pom.xml
===================================================================
--- trunk/build/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/build/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid</artifactId>
Modified: trunk/cache-jbosscache/pom.xml
===================================================================
--- trunk/cache-jbosscache/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/cache-jbosscache/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-cache-jbosscache</artifactId>
Modified: trunk/client/pom.xml
===================================================================
--- trunk/client/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/client/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-client</artifactId>
Modified: trunk/client-jdk15/pom.xml
===================================================================
--- trunk/client-jdk15/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/client-jdk15/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-client-jdk15</artifactId>
Modified: trunk/common-core/pom.xml
===================================================================
--- trunk/common-core/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/common-core/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-common-core</artifactId>
Modified: trunk/connectors/connector-file/pom.xml
===================================================================
--- trunk/connectors/connector-file/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/connectors/connector-file/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-file</artifactId>
Modified: trunk/connectors/connector-ldap/pom.xml
===================================================================
--- trunk/connectors/connector-ldap/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/connectors/connector-ldap/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-ldap</artifactId>
Modified: trunk/connectors/connector-salesforce/pom.xml
===================================================================
--- trunk/connectors/connector-salesforce/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/connectors/connector-salesforce/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-salesforce</artifactId>
Modified: trunk/connectors/connector-ws/pom.xml
===================================================================
--- trunk/connectors/connector-ws/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/connectors/connector-ws/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-ws</artifactId>
Modified: trunk/connectors/pom.xml
===================================================================
--- trunk/connectors/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/connectors/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
Modified: trunk/connectors/salesforce-api/pom.xml
===================================================================
--- trunk/connectors/salesforce-api/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/connectors/salesforce-api/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>salesforce-api</artifactId>
Modified: trunk/connectors/sandbox/pom.xml
===================================================================
--- trunk/connectors/sandbox/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/connectors/sandbox/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid.connectors</groupId>
Modified: trunk/connectors/sandbox/translator-yahoo/pom.xml
===================================================================
--- trunk/connectors/sandbox/translator-yahoo/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/connectors/sandbox/translator-yahoo/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -3,7 +3,7 @@
<parent>
<artifactId>sandbox</artifactId>
<groupId>org.jboss.teiid.connectors</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-yahoo</artifactId>
Modified: trunk/connectors/translator-file/pom.xml
===================================================================
--- trunk/connectors/translator-file/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/connectors/translator-file/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-file</artifactId>
Modified: trunk/connectors/translator-jdbc/pom.xml
===================================================================
--- trunk/connectors/translator-jdbc/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/connectors/translator-jdbc/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-jdbc</artifactId>
Modified: trunk/connectors/translator-ldap/pom.xml
===================================================================
--- trunk/connectors/translator-ldap/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/connectors/translator-ldap/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-ldap</artifactId>
Modified: trunk/connectors/translator-loopback/pom.xml
===================================================================
--- trunk/connectors/translator-loopback/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/connectors/translator-loopback/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-loopback</artifactId>
Modified: trunk/connectors/translator-olap/pom.xml
===================================================================
--- trunk/connectors/translator-olap/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/connectors/translator-olap/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-olap</artifactId>
Modified: trunk/connectors/translator-salesforce/pom.xml
===================================================================
--- trunk/connectors/translator-salesforce/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/connectors/translator-salesforce/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-salesforce</artifactId>
Modified: trunk/connectors/translator-ws/pom.xml
===================================================================
--- trunk/connectors/translator-ws/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/connectors/translator-ws/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>translator-ws</artifactId>
Modified: trunk/console/pom.xml
===================================================================
--- trunk/console/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/console/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/documentation/admin-guide/pom.xml
===================================================================
--- trunk/documentation/admin-guide/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/documentation/admin-guide/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>admin-guide</artifactId>
Modified: trunk/documentation/caching-guide/pom.xml
===================================================================
--- trunk/documentation/caching-guide/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/documentation/caching-guide/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>caching-guide</artifactId>
Modified: trunk/documentation/client-developers-guide/pom.xml
===================================================================
--- trunk/documentation/client-developers-guide/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/documentation/client-developers-guide/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>client-developers-guide</artifactId>
Modified: trunk/documentation/developer-guide/pom.xml
===================================================================
--- trunk/documentation/developer-guide/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/documentation/developer-guide/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>developer-guide</artifactId>
Modified: trunk/documentation/pom.xml
===================================================================
--- trunk/documentation/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/documentation/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
Modified: trunk/documentation/quick-start-example/pom.xml
===================================================================
--- trunk/documentation/quick-start-example/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/documentation/quick-start-example/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>quick-start-example</artifactId>
Modified: trunk/documentation/reference/pom.xml
===================================================================
--- trunk/documentation/reference/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/documentation/reference/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.jboss.teiid</groupId>
<artifactId>documentation</artifactId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>reference</artifactId>
Modified: trunk/engine/pom.xml
===================================================================
--- trunk/engine/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/engine/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-engine</artifactId>
Modified: trunk/hibernate-dialect/pom.xml
===================================================================
--- trunk/hibernate-dialect/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/hibernate-dialect/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-hibernate-dialect</artifactId>
Modified: trunk/jboss-integration/pom.xml
===================================================================
--- trunk/jboss-integration/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/jboss-integration/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -2,7 +2,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
Modified: trunk/metadata/pom.xml
===================================================================
--- trunk/metadata/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/metadata/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-metadata</artifactId>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -5,15 +5,15 @@
<artifactId>teiid-parent</artifactId>
<packaging>pom</packaging>
<name>Teiid</name>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
<description>Federated SQL and XML query engine.</description>
<properties>
<ant.version>1.7.0</ant.version>
<site.url>http://www.jboss.org/teiid</site.url>
</properties>
<scm>
- <connection>scm:svn:https://anonsvn.jboss.org/repos/teiid/trunk</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/teiid/trunk</developerConnection>
+ <connection>scm:svn:https://anonsvn.jboss.org/repos/teiid/tags/teiid-parent-7.5.0.CR1</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/teiid/tags/teiid-parent-7.5.0.CR1</developerConnection>
</scm>
<licenses>
<license>
Modified: trunk/runtime/pom.xml
===================================================================
--- trunk/runtime/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/runtime/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
Modified: trunk/test-integration/common/pom.xml
===================================================================
--- trunk/test-integration/common/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/test-integration/common/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-test-integration</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>test-integration-common</artifactId>
Modified: trunk/test-integration/db/pom.xml
===================================================================
--- trunk/test-integration/db/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/test-integration/db/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -9,7 +9,7 @@
<parent>
<artifactId>teiid-test-integration</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/test-integration/pom.xml
===================================================================
--- trunk/test-integration/pom.xml 2011-08-10 18:01:12 UTC (rev 3366)
+++ trunk/test-integration/pom.xml 2011-08-10 18:32:22 UTC (rev 3367)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid-parent</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>7.5.0.CR1-SNAPSHOT</version>
+ <version>7.5.0.CR1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-test-integration</artifactId>
14 years, 8 months
teiid SVN: r3366 - in trunk: client/src/main/java/org/teiid/jdbc and 25 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-08-10 14:01:12 -0400 (Wed, 10 Aug 2011)
New Revision: 3366
Added:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/netezza/
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/netezza/NetezzaExecutionFactory.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaConvertModifier.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorCapabilities.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorDatetimeConversion.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorSourceSystemFunctions.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorTypeMapping.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestSubstringFunctionModifier.java
trunk/engine/src/main/java/org/teiid/query/tempdata/AlterTempTable.java
trunk/engine/src/main/java/org/teiid/query/xquery/saxon/XQueryEvaluator.java
Removed:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/netezza/NetezzaExecutionFactory.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaConvertModifier.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorCapabilities.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorDatetimeConversion.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorSourceSystemFunctions.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorTypeMapping.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestSubstringFunctionModifier.java
Modified:
trunk/build/kits/jboss-container/teiid-releasenotes.html
trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java
trunk/connectors/translator-jdbc/src/main/resources/META-INF/jboss-beans.xml
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPExecutionFactory.java
trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSyncQueryExecution.java
trunk/documentation/admin-guide/src/main/docbook/en-US/content/admin-console.xml
trunk/documentation/admin-guide/src/main/docbook/en-US/images/admin_console.png
trunk/documentation/caching-guide/src/main/docbook/en-US/content/codetable.xml
trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml
trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml
trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
trunk/engine/src/main/java/org/teiid/query/analysis/AnalysisRecord.java
trunk/engine/src/main/java/org/teiid/query/eval/Evaluator.java
trunk/engine/src/main/java/org/teiid/query/mapping/xml/ResultSetInfo.java
trunk/engine/src/main/java/org/teiid/query/metadata/TempMetadataAdapter.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleMergeCriteria.java
trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLPlanToProcessVisitor.java
trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLPlanner.java
trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLPlannerEnvironment.java
trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLQueryPlanner.java
trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLStagaingQueryPlanner.java
trunk/engine/src/main/java/org/teiid/query/processor/xml/ExecSqlInstruction.java
trunk/engine/src/main/java/org/teiid/query/processor/xml/ExecStagingTableInstruction.java
trunk/engine/src/main/java/org/teiid/query/processor/xml/RelationalPlanExecutor.java
trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLProcessorEnvironment.java
trunk/engine/src/main/java/org/teiid/query/resolver/command/InsertResolver.java
trunk/engine/src/main/java/org/teiid/query/resolver/util/ResolverVisitor.java
trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
trunk/engine/src/main/java/org/teiid/query/xquery/saxon/SaxonXQueryExpression.java
trunk/engine/src/main/java/org/teiid/query/xquery/saxon/StreamingUtils.java
trunk/engine/src/test/java/org/teiid/query/processor/eval/TestExpressionEvaluator.java
trunk/engine/src/test/java/org/teiid/query/processor/xml/TestXMLPlanningEnhancements.java
trunk/engine/src/test/java/org/teiid/query/processor/xml/TestXMLProcessor.java
trunk/engine/src/test/java/org/teiid/query/rewriter/TestQueryRewriter.java
Log:
forward merge from 7.4.1
Modified: trunk/build/kits/jboss-container/teiid-releasenotes.html
===================================================================
--- trunk/build/kits/jboss-container/teiid-releasenotes.html 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/build/kits/jboss-container/teiid-releasenotes.html 2011-08-10 18:01:12 UTC (rev 3366)
@@ -43,6 +43,7 @@
<LI><B>Sync at Start</B> - When a node is restarted in a cluster, at end of start cycle Teiid will asynchronously fetch the cached internal materialized view contents from other nodes.
</UL>
</LI>
+ <LI><B>LDAP Pagination</B> - the ldap translator now supports pagination for retrieving large results from directory servers like Active Directory and OpenLDAP.
</UL>
<h2><a name="Compatibility">Compatibility Issues</a></h2>
Modified: trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -1060,9 +1060,15 @@
}
protected void setAnalysisInfo(ResultsMessage resultsMsg) {
- this.debugLog = resultsMsg.getDebugLog();
- this.currentPlanDescription = resultsMsg.getPlanDescription();
- this.annotations = resultsMsg.getAnnotations();
+ if (resultsMsg.getDebugLog() != null) {
+ this.debugLog = resultsMsg.getDebugLog();
+ }
+ if (resultsMsg.getPlanDescription() != null) {
+ this.currentPlanDescription = resultsMsg.getPlanDescription();
+ }
+ if (resultsMsg.getAnnotations() != null) {
+ this.annotations = resultsMsg.getAnnotations();
+ }
this.driverConnection.setDebugLog(debugLog);
this.driverConnection.setCurrentPlanDescription(currentPlanDescription);
this.driverConnection.setAnnotations(annotations);
Property changes on: trunk/client/src/main/java/org/teiid/jdbc/StatementImpl.java
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/7.4.x/client/src/main/java/org/teiid/jdbc/StatementImpl.java:3149-3217,3220-3275,3281-3325
+ /branches/7.4.x/client/src/main/java/org/teiid/jdbc/StatementImpl.java:3149-3217,3220-3275,3281-3325,3355-3365
Deleted: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/netezza/NetezzaExecutionFactory.java
===================================================================
--- branches/7.4.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/netezza/NetezzaExecutionFactory.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/netezza/NetezzaExecutionFactory.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -1,382 +0,0 @@
-/*
- * 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.netezza;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.teiid.language.Expression;
-import org.teiid.language.Function;
-import org.teiid.language.Limit;
-import org.teiid.translator.ExecutionContext;
-import org.teiid.translator.SourceSystemFunctions;
-import org.teiid.translator.Translator;
-import org.teiid.translator.TranslatorException;
-import org.teiid.translator.jdbc.AliasModifier;
-import org.teiid.translator.jdbc.ConvertModifier;
-import org.teiid.translator.jdbc.ExtractFunctionModifier;
-import org.teiid.translator.jdbc.FunctionModifier;
-import org.teiid.translator.jdbc.JDBCExecutionFactory;
-import org.teiid.translator.jdbc.LocateFunctionModifier;
-
-
-@Translator(name = "netezza", description = "A translator for Netezza Database")
-public class NetezzaExecutionFactory extends JDBCExecutionFactory {
-
- private static final String TIME_FORMAT = "HH24:MI:SS";
- private static final String DATE_FORMAT = "YYYY-MM-DD";
- private static final String DATETIME_FORMAT = DATE_FORMAT + " " + TIME_FORMAT;
- private static final String TIMESTAMP_FORMAT = DATETIME_FORMAT + ".MS";
-
- public NetezzaExecutionFactory() {
- setSupportsFullOuterJoins(true);
- setSupportsOrderBy(true);
- setSupportsOuterJoins(true);
- setSupportsSelectDistinct(true);
- setSupportsInnerJoins(true);
- }
-
- public void start() throws TranslatorException {
- super.start();
-
- //STRING FUNCTION MODIFIERS
- ////////////////////////////////////
- registerFunctionModifier(SourceSystemFunctions.CHAR, new AliasModifier("chr"));
- registerFunctionModifier(SourceSystemFunctions.LCASE,new AliasModifier("lower"));
- registerFunctionModifier(SourceSystemFunctions.UCASE,new AliasModifier("upper"));
- registerFunctionModifier(SourceSystemFunctions.LOCATE, new LocateFunctionModifier(getLanguageFactory(), "INSTR", true));
- registerFunctionModifier(SourceSystemFunctions.CONCAT, new AliasModifier("||"));
- ///NUMERIC FUNCTION MODIFIERS
- ////////////////////////////////////
- registerFunctionModifier(SourceSystemFunctions.CEILING, new AliasModifier("ceil"));
- registerFunctionModifier(SourceSystemFunctions.POWER, new AliasModifier("pow"));
- registerFunctionModifier(SourceSystemFunctions.LOG, new AliasModifier("LN"));
- ///BIT FUNCTION MODIFIERS
- ////////////////////////////////////
- registerFunctionModifier(SourceSystemFunctions.BITAND, new AliasModifier("intNand"));
- registerFunctionModifier(SourceSystemFunctions.BITNOT, new AliasModifier("intNnot"));
- registerFunctionModifier(SourceSystemFunctions.BITOR, new AliasModifier("intNor"));
- registerFunctionModifier(SourceSystemFunctions.BITXOR, new AliasModifier("intNxor"));
- //DATE FUNCTION MODIFIERS
- //////////////////////////////////////////
- registerFunctionModifier(SourceSystemFunctions.YEAR, new ExtractFunctionModifier());
- registerFunctionModifier(SourceSystemFunctions.DAYOFYEAR, new ExtractModifier("DOY"));
- registerFunctionModifier(SourceSystemFunctions.QUARTER, new ExtractFunctionModifier());
- registerFunctionModifier(SourceSystemFunctions.MONTH, new ExtractFunctionModifier());
- registerFunctionModifier(SourceSystemFunctions.DAYOFMONTH, new ExtractModifier("DAY"));
- registerFunctionModifier(SourceSystemFunctions.WEEK, new ExtractFunctionModifier());
- registerFunctionModifier(SourceSystemFunctions.DAYOFWEEK, new ExtractModifier("DOW"));
- registerFunctionModifier(SourceSystemFunctions.HOUR, new ExtractFunctionModifier());
- registerFunctionModifier(SourceSystemFunctions.MINUTE, new ExtractFunctionModifier());
- registerFunctionModifier(SourceSystemFunctions.SECOND, new ExtractFunctionModifier());
- registerFunctionModifier(SourceSystemFunctions.CURDATE, new AliasModifier("CURRENT_DATE"));
- registerFunctionModifier(SourceSystemFunctions.CURTIME, new AliasModifier("CURRENT_TIME"));
- //SYSTEM FUNCTIONS
- ////////////////////////////////////
- registerFunctionModifier(SourceSystemFunctions.IFNULL,new AliasModifier("NVL"));
-
-
- // DATA TYPE CONVERSION
- ///////////////////////////////////////////
- ConvertModifier convertModifier = new ConvertModifier();
- convertModifier.addTypeMapping("char(1)", FunctionModifier.CHAR);
- convertModifier.addTypeMapping("byteint", FunctionModifier.BYTE);
- convertModifier.addTypeMapping("smallint", FunctionModifier.SHORT);
- convertModifier.addTypeMapping("bigint", FunctionModifier.LONG);
- convertModifier.addTypeMapping("numeric(38)", FunctionModifier.BIGINTEGER);
- convertModifier.addTypeMapping("numeric(38,18)", FunctionModifier.BIGDECIMAL);
- convertModifier.addTypeMapping("varchar(4000)", FunctionModifier.STRING);
- //convertModifier.addTypeMapping("nvarchar(5)", FunctionModifier.BOOLEAN);
-
- ///NO BOOLEAN, INTEGER, FLOAT, DATE, TIME, TIMESTAMP, as they are directly available in netezza
- ///NO NULL, CLOB, BLOB, OBJECT, XML
-
-
- ///BOOLEAN--BYTE, SHORT, INTEGER, LONG, FLOAT, DOUBLE, BIGINTEGER, BIGDECIMAL--AS IT DOESN'T WORK IMPLICITLY IN NETEZZA
-
- convertModifier.addConvert(FunctionModifier.BOOLEAN, FunctionModifier.INTEGER, new BooleanToNumericConversionModifier());
- convertModifier.addConvert(FunctionModifier.BOOLEAN, FunctionModifier.BYTE, new BooleanToNumericConversionModifier());
- convertModifier.addConvert(FunctionModifier.BOOLEAN, FunctionModifier.SHORT, new BooleanToNumericConversionModifier());
- convertModifier.addConvert(FunctionModifier.BOOLEAN, FunctionModifier.LONG, new BooleanToNumericConversionModifier());
- convertModifier.addConvert(FunctionModifier.BOOLEAN, FunctionModifier.FLOAT, new BooleanToNumericConversionModifier());
- convertModifier.addConvert(FunctionModifier.BOOLEAN, FunctionModifier.DOUBLE, new BooleanToNumericConversionModifier());
- convertModifier.addConvert(FunctionModifier.BOOLEAN, FunctionModifier.BIGINTEGER, new BooleanToNumericConversionModifier());
- convertModifier.addConvert(FunctionModifier.BOOLEAN, FunctionModifier.BIGDECIMAL, new BooleanToNumericConversionModifier());
- convertModifier.addConvert(FunctionModifier.BOOLEAN, FunctionModifier.STRING, new BooleanToStringConversionModifier());
- convertModifier.addConvert(FunctionModifier.STRING, FunctionModifier.BOOLEAN, new FunctionModifier() {
- @Override
- public List<?> translate(Function function) {
- Expression stringValue = function.getParameters().get(0);
- return Arrays.asList("CASE WHEN ", stringValue, " IN ('false', '0') THEN '0' WHEN ", stringValue, " IS NOT NULL THEN '1' END");
- }
- });
- convertModifier.addTypeConversion(new FunctionModifier() {
- @Override
- public List<?> translate(Function function) {
- Expression stringValue = function.getParameters().get(0);
- return Arrays.asList("CASE WHEN ", stringValue, " = 0 THEN '0' WHEN ", stringValue, " IS NOT NULL THEN '1' END");
- }
- }, FunctionModifier.BOOLEAN);
-
-
-
-
- ////////STRING TO DATATYPE CONVERSION OTHER THAN DATE/TIME
- convertModifier.addConvert(FunctionModifier.STRING, FunctionModifier.INTEGER, new CastModifier("integer"));
- convertModifier.addConvert(FunctionModifier.STRING, FunctionModifier.FLOAT, new CastModifier("float"));
- convertModifier.addConvert(FunctionModifier.STRING, FunctionModifier.DOUBLE, new CastModifier("double"));
- ///// STRING --> CHAR, BYTE, SHORT, LONG, BIGI, BIGD, BOOLEAN is taken care by Type Mapping
- ///// NO conversion support for NULL, CLOB, BLOB, OBJECT, XML
- ////STRING TO DATE/TIME CONVERSION////
- //////////////////////////////////////
- convertModifier.addConvert(FunctionModifier.STRING, FunctionModifier.DATE, new ConvertModifier.FormatModifier("to_date", DATE_FORMAT));
- convertModifier.addConvert(FunctionModifier.STRING, FunctionModifier.TIME, new ConvertModifier.FormatModifier("to_timestamp", TIME_FORMAT));
- convertModifier.addConvert(FunctionModifier.STRING, FunctionModifier.TIMESTAMP, new ConvertModifier.FormatModifier("to_timestamp", TIMESTAMP_FORMAT));
- //////DATE/TIME INTERNAL CONVERSION/////////
- convertModifier.addConvert(FunctionModifier.TIMESTAMP, FunctionModifier.TIME, new CastModifier("TIME"));
- convertModifier.addConvert(FunctionModifier.TIMESTAMP, FunctionModifier.DATE, new CastModifier("DATE"));
- convertModifier.addConvert(FunctionModifier.DATE, FunctionModifier.TIMESTAMP, new CastModifier("TIMESTAMP"));
- //convertModifier.addConvert(FunctionModifier.TIME, FunctionModifier.TIMESTAMP, new CastModifier("TIMESTAMP")); //TIME --> TIMESTAMP --DOESN't WORK IN NETEZZA-NO FUNCTION SUPPORT
-
- ////DATE/TIME to STRING CONVERION////
- /////////////////////////////////////
- convertModifier.addConvert(FunctionModifier.TIMESTAMP, FunctionModifier.STRING, new ConvertModifier.FormatModifier("to_char", TIMESTAMP_FORMAT));
- ///NO NETEZAA FUNCTION for DATE, TIME to STRING
-
-
- convertModifier.setWideningNumericImplicit(true);
- registerFunctionModifier(SourceSystemFunctions.CONVERT, convertModifier);
- }
-
- @Override
- public List<String> getSupportedFunctions() {
- List<String> supportedFunctions = new ArrayList<String>();
- supportedFunctions.addAll(super.getSupportedFunctions());
-
- ////////////////////////////////////////////////////////////
- //STRING FUNCTIONS
- //////////////////////////////////////////////////////////
- supportedFunctions.add(SourceSystemFunctions.ASCII);// taken care with alias function modifier
- supportedFunctions.add(SourceSystemFunctions.CHAR);//ALIAS to use 'chr'
- supportedFunctions.add(SourceSystemFunctions.CONCAT); // ALIAS ||
- supportedFunctions.add(SourceSystemFunctions.INITCAP);
- supportedFunctions.add(SourceSystemFunctions.LCASE);//ALIAS 'lower'
- supportedFunctions.add(SourceSystemFunctions.LPAD);
- supportedFunctions.add(SourceSystemFunctions.LENGTH);
- supportedFunctions.add(SourceSystemFunctions.LOCATE); //LOCATE FUNCTIO MODIFIER
- supportedFunctions.add(SourceSystemFunctions.LTRIM);
- //supportedFunctions.add(SourceSystemFunctions.REPEAT);
- supportedFunctions.add(SourceSystemFunctions.RPAD);
- supportedFunctions.add(SourceSystemFunctions.RTRIM);
- supportedFunctions.add(SourceSystemFunctions.SUBSTRING); //No Need of ALIAS as both substring and substr work in netezza
- supportedFunctions.add(SourceSystemFunctions.UCASE); //ALIAS UPPER
- // FUNCTION DIFFERENCE = "difference"; ///NO FUNCTION FOUND--DIFFERENCE
- // FUNCTION INSERT = "insert";
- // supportedFunctions.add(SourceSystemFunctions.LEFT); //is this available or is it simply for LEFT OUTER JOIN?
- // FUNCTION REPLACE = "replace"; // NO REPLACE Function
- // supportedFunctions.add(SourceSystemFunctions.RIGHT);--is this available or is it simply for RIGHT OUTER JOIN?
- // FUNCTION SOUNDEX = "soundex";
- // FUNCTION TO_BYTES = "to_bytes";
- // FUNCTION TO_CHARS = "to_chars";
- ////////// ////////////////////////////////////////////////////////////////////
- //NUMERIC FUNCTIONS////////////////////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- //supportedFunctions.add(SourceSystemFunctions.ABS);
- supportedFunctions.add(SourceSystemFunctions.ACOS);
- supportedFunctions.add(SourceSystemFunctions.ASIN);
- supportedFunctions.add(SourceSystemFunctions.ATAN);
- supportedFunctions.add(SourceSystemFunctions.ATAN2);
- supportedFunctions.add(SourceSystemFunctions.CEILING); ///ALIAS-ceil
- supportedFunctions.add(SourceSystemFunctions.COS);
- supportedFunctions.add(SourceSystemFunctions.COT);
- supportedFunctions.add(SourceSystemFunctions.DEGREES);
- //supportedFunctions.add(SourceSystemFunctions.EXP);
- supportedFunctions.add(SourceSystemFunctions.FLOOR);
- supportedFunctions.add(SourceSystemFunctions.LOG);
- supportedFunctions.add(SourceSystemFunctions.MOD);
- supportedFunctions.add(SourceSystemFunctions.PI);
- supportedFunctions.add(SourceSystemFunctions.POWER);// ALIAS-POW
- supportedFunctions.add(SourceSystemFunctions.RADIANS);
- supportedFunctions.add(SourceSystemFunctions.ROUND);
- supportedFunctions.add(SourceSystemFunctions.SIGN);
- supportedFunctions.add(SourceSystemFunctions.SIN);
- supportedFunctions.add(SourceSystemFunctions.SQRT);
- supportedFunctions.add(SourceSystemFunctions.TAN);
- // FUNCTION TRANSLATE = "translate";
- // FUNCTION TRUNCATE = "truncate";
- // FUNCTION FORMATINTEGER = "formatinteger";
- // FUNCTION FORMATLONG = "formatlong";
- // FUNCTION FORMATDOUBLE = "formatdouble";
- // FUNCTION FORMATFLOAT = "formatfloat";
- // FUNCTION FORMATBIGINTEGER = "formatbiginteger";
- // FUNCTION FORMATBIGDECIMAL = "formatbigdecimal";
- // FUNCTION LOG10 = "log10";
- // FUNCTION PARSEINTEGER = "parseinteger";
- // FUNCTION PARSELONG = "parselong";
- // FUNCTION PARSEDOUBLE = "parsedouble";
- // FUNCTION PARSEFLOAT = "parsefloat";
- // FUNCTION PARSEBIGINTEGER = "parsebiginteger";
- // FUNCTION PARSEBIGDECIMAL = "parsebigdecimal";
- // supportedFunctions.add(SourceSystemFunctions.RAND); --Needs Alias--But, is it required to even have an alias???
- /////////////////////////////////////////////////////////////////////
- //BIT FUNCTIONS//////////////////////////////////////////////////////
- //ALIAS FUNCTION MODIFIER IS APPLIED//////////////////////////////
- supportedFunctions.add(SourceSystemFunctions.BITAND);
- supportedFunctions.add(SourceSystemFunctions.BITOR);
- supportedFunctions.add(SourceSystemFunctions.BITNOT);
- supportedFunctions.add(SourceSystemFunctions.BITXOR);
- // DATE FUNCTIONS
- supportedFunctions.add(SourceSystemFunctions.CURDATE);
- supportedFunctions.add(SourceSystemFunctions.CURTIME);
- supportedFunctions.add(SourceSystemFunctions.DAYOFMONTH);
- supportedFunctions.add(SourceSystemFunctions.DAYOFYEAR);
- supportedFunctions.add(SourceSystemFunctions.DAYOFWEEK);
- supportedFunctions.add(SourceSystemFunctions.HOUR);
- supportedFunctions.add(SourceSystemFunctions.MINUTE);
- supportedFunctions.add(SourceSystemFunctions.MONTH);
- supportedFunctions.add(SourceSystemFunctions.QUARTER);
- supportedFunctions.add(SourceSystemFunctions.SECOND);
- supportedFunctions.add(SourceSystemFunctions.WEEK);
- supportedFunctions.add(SourceSystemFunctions.YEAR);
- // FUNCTION DAYNAME = "dayname";
- // FUNCTION FORMATTIMESTAMP = "formattimestamp";
- // FUNCTION MODIFYTIMEZONE = "modifytimezone";
- // FUNCTION MONTHNAME = "monthname";
- // FUNCTION NOW = "now";
- // FUNCTION PARSETIMESTAMP = "parsetimestamp";
- // FUNCTION TIMESTAMPADD = "timestampadd";
- // FUNCTION TIMESTAMPCREATE = "timestampcreate";
- // FUNCTION TIMESTAMPDIFF = "timestampdiff";
-
-
- //SYSTEM FUNCTIONS
- supportedFunctions.add(SourceSystemFunctions.IFNULL); //ALIAS-NVL
- supportedFunctions.add(SourceSystemFunctions.COALESCE);
- supportedFunctions.add(SourceSystemFunctions.NULLIF);
-
-
- //CONVERSION functions
- supportedFunctions.add(SourceSystemFunctions.CONVERT);
-
-
- return supportedFunctions;
- }
-
- public static class ExtractModifier extends FunctionModifier {
- private String type;
- public ExtractModifier(String type) {
- this.type = type;
- }
- @Override
- public List<?> translate(Function function) {
- return Arrays.asList("extract(",this.type," from ",function.getParameters().get(0) ,")");
- }
- }
-
- public static class BooleanToNumericConversionModifier extends FunctionModifier {
- @Override
- public List<?> translate(Function function) {
- Expression booleanValue = function.getParameters().get(0);
- if (booleanValue instanceof Function) {
- Function nested = (Function)booleanValue;
- if (nested.getName().equalsIgnoreCase("convert") && Number.class.isAssignableFrom(nested.getParameters().get(0).getType())) {
- booleanValue = nested.getParameters().get(0);
- }
- }
- return Arrays.asList("(CASE WHEN ", booleanValue, " IN ( '0', 'FALSE') THEN 0 WHEN ", booleanValue, " IS NOT NULL THEN 1 END)");
- }
-
- }
- public static class BooleanToStringConversionModifier extends FunctionModifier {
- @Override
- public List<?> translate(Function function) {
- Expression booleanValue = function.getParameters().get(0);
- if (booleanValue instanceof Function) {
- Function nested = (Function)booleanValue;
- if (nested.getName().equalsIgnoreCase("convert") && Number.class.isAssignableFrom(nested.getParameters().get(0).getType())) {
- booleanValue = nested.getParameters().get(0);
- }
- }
- return Arrays.asList("CASE WHEN ", booleanValue, " = '0' THEN 'false' WHEN ", booleanValue, " IS NOT NULL THEN 'true' END");
- }
-
- }
-
-
- public static class CastModifier extends FunctionModifier {
- private String target;
- public CastModifier(String target) {
- this.target = target;
- }
- @Override
- public List<?> translate(Function function) {
- return Arrays.asList("cast(", function.getParameters().get(0), " AS "+this.target+")");
- }
- }
-
-
- @Override
- public List<?> translateLimit(Limit limit, ExecutionContext context) {
- if (limit.getRowOffset() > 0) {
- return Arrays.asList("LIMIT ", limit.getRowLimit(), " OFFSET ", limit.getRowOffset());
- }
- return null;
- }
-
- @Override
- public boolean supportsCorrelatedSubqueries() {
- return false;
- }
-
- @Override
- public boolean supportsIntersect() {
- return true;
- }
-
- @Override
- public boolean supportsExcept() {
- return true;
- }
-
- @Override
- public boolean supportsInlineViews() {
- return true;
- }
-
- @Override
- public boolean supportsRowLimit() {
- return true;
- }
-
- @Override
- public boolean supportsRowOffset() {
- return true;
- }
-
- @Override
- public boolean supportsAggregatesEnhancedNumeric() {
- return true;
- }
-
-}
Copied: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/netezza/NetezzaExecutionFactory.java (from rev 3365, branches/7.4.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/netezza/NetezzaExecutionFactory.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/netezza/NetezzaExecutionFactory.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/netezza/NetezzaExecutionFactory.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -0,0 +1,382 @@
+/*
+ * 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.netezza;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.teiid.language.Expression;
+import org.teiid.language.Function;
+import org.teiid.language.Limit;
+import org.teiid.translator.ExecutionContext;
+import org.teiid.translator.SourceSystemFunctions;
+import org.teiid.translator.Translator;
+import org.teiid.translator.TranslatorException;
+import org.teiid.translator.jdbc.AliasModifier;
+import org.teiid.translator.jdbc.ConvertModifier;
+import org.teiid.translator.jdbc.ExtractFunctionModifier;
+import org.teiid.translator.jdbc.FunctionModifier;
+import org.teiid.translator.jdbc.JDBCExecutionFactory;
+import org.teiid.translator.jdbc.LocateFunctionModifier;
+
+
+@Translator(name = "netezza", description = "A translator for Netezza Database")
+public class NetezzaExecutionFactory extends JDBCExecutionFactory {
+
+ private static final String TIME_FORMAT = "HH24:MI:SS";
+ private static final String DATE_FORMAT = "YYYY-MM-DD";
+ private static final String DATETIME_FORMAT = DATE_FORMAT + " " + TIME_FORMAT;
+ private static final String TIMESTAMP_FORMAT = DATETIME_FORMAT + ".MS";
+
+ public NetezzaExecutionFactory() {
+ setSupportsFullOuterJoins(true);
+ setSupportsOrderBy(true);
+ setSupportsOuterJoins(true);
+ setSupportsSelectDistinct(true);
+ setSupportsInnerJoins(true);
+ }
+
+ public void start() throws TranslatorException {
+ super.start();
+
+ //STRING FUNCTION MODIFIERS
+ ////////////////////////////////////
+ registerFunctionModifier(SourceSystemFunctions.CHAR, new AliasModifier("chr"));
+ registerFunctionModifier(SourceSystemFunctions.LCASE,new AliasModifier("lower"));
+ registerFunctionModifier(SourceSystemFunctions.UCASE,new AliasModifier("upper"));
+ registerFunctionModifier(SourceSystemFunctions.LOCATE, new LocateFunctionModifier(getLanguageFactory(), "INSTR", true));
+ registerFunctionModifier(SourceSystemFunctions.CONCAT, new AliasModifier("||"));
+ ///NUMERIC FUNCTION MODIFIERS
+ ////////////////////////////////////
+ registerFunctionModifier(SourceSystemFunctions.CEILING, new AliasModifier("ceil"));
+ registerFunctionModifier(SourceSystemFunctions.POWER, new AliasModifier("pow"));
+ registerFunctionModifier(SourceSystemFunctions.LOG, new AliasModifier("LN"));
+ ///BIT FUNCTION MODIFIERS
+ ////////////////////////////////////
+ registerFunctionModifier(SourceSystemFunctions.BITAND, new AliasModifier("intNand"));
+ registerFunctionModifier(SourceSystemFunctions.BITNOT, new AliasModifier("intNnot"));
+ registerFunctionModifier(SourceSystemFunctions.BITOR, new AliasModifier("intNor"));
+ registerFunctionModifier(SourceSystemFunctions.BITXOR, new AliasModifier("intNxor"));
+ //DATE FUNCTION MODIFIERS
+ //////////////////////////////////////////
+ registerFunctionModifier(SourceSystemFunctions.YEAR, new ExtractFunctionModifier());
+ registerFunctionModifier(SourceSystemFunctions.DAYOFYEAR, new ExtractModifier("DOY"));
+ registerFunctionModifier(SourceSystemFunctions.QUARTER, new ExtractFunctionModifier());
+ registerFunctionModifier(SourceSystemFunctions.MONTH, new ExtractFunctionModifier());
+ registerFunctionModifier(SourceSystemFunctions.DAYOFMONTH, new ExtractModifier("DAY"));
+ registerFunctionModifier(SourceSystemFunctions.WEEK, new ExtractFunctionModifier());
+ registerFunctionModifier(SourceSystemFunctions.DAYOFWEEK, new ExtractModifier("DOW"));
+ registerFunctionModifier(SourceSystemFunctions.HOUR, new ExtractFunctionModifier());
+ registerFunctionModifier(SourceSystemFunctions.MINUTE, new ExtractFunctionModifier());
+ registerFunctionModifier(SourceSystemFunctions.SECOND, new ExtractFunctionModifier());
+ registerFunctionModifier(SourceSystemFunctions.CURDATE, new AliasModifier("CURRENT_DATE"));
+ registerFunctionModifier(SourceSystemFunctions.CURTIME, new AliasModifier("CURRENT_TIME"));
+ //SYSTEM FUNCTIONS
+ ////////////////////////////////////
+ registerFunctionModifier(SourceSystemFunctions.IFNULL,new AliasModifier("NVL"));
+
+
+ // DATA TYPE CONVERSION
+ ///////////////////////////////////////////
+ ConvertModifier convertModifier = new ConvertModifier();
+ convertModifier.addTypeMapping("char(1)", FunctionModifier.CHAR);
+ convertModifier.addTypeMapping("byteint", FunctionModifier.BYTE);
+ convertModifier.addTypeMapping("smallint", FunctionModifier.SHORT);
+ convertModifier.addTypeMapping("bigint", FunctionModifier.LONG);
+ convertModifier.addTypeMapping("numeric(38)", FunctionModifier.BIGINTEGER);
+ convertModifier.addTypeMapping("numeric(38,18)", FunctionModifier.BIGDECIMAL);
+ convertModifier.addTypeMapping("varchar(4000)", FunctionModifier.STRING);
+ //convertModifier.addTypeMapping("nvarchar(5)", FunctionModifier.BOOLEAN);
+
+ ///NO BOOLEAN, INTEGER, FLOAT, DATE, TIME, TIMESTAMP, as they are directly available in netezza
+ ///NO NULL, CLOB, BLOB, OBJECT, XML
+
+
+ ///BOOLEAN--BYTE, SHORT, INTEGER, LONG, FLOAT, DOUBLE, BIGINTEGER, BIGDECIMAL--AS IT DOESN'T WORK IMPLICITLY IN NETEZZA
+
+ convertModifier.addConvert(FunctionModifier.BOOLEAN, FunctionModifier.INTEGER, new BooleanToNumericConversionModifier());
+ convertModifier.addConvert(FunctionModifier.BOOLEAN, FunctionModifier.BYTE, new BooleanToNumericConversionModifier());
+ convertModifier.addConvert(FunctionModifier.BOOLEAN, FunctionModifier.SHORT, new BooleanToNumericConversionModifier());
+ convertModifier.addConvert(FunctionModifier.BOOLEAN, FunctionModifier.LONG, new BooleanToNumericConversionModifier());
+ convertModifier.addConvert(FunctionModifier.BOOLEAN, FunctionModifier.FLOAT, new BooleanToNumericConversionModifier());
+ convertModifier.addConvert(FunctionModifier.BOOLEAN, FunctionModifier.DOUBLE, new BooleanToNumericConversionModifier());
+ convertModifier.addConvert(FunctionModifier.BOOLEAN, FunctionModifier.BIGINTEGER, new BooleanToNumericConversionModifier());
+ convertModifier.addConvert(FunctionModifier.BOOLEAN, FunctionModifier.BIGDECIMAL, new BooleanToNumericConversionModifier());
+ convertModifier.addConvert(FunctionModifier.BOOLEAN, FunctionModifier.STRING, new BooleanToStringConversionModifier());
+ convertModifier.addConvert(FunctionModifier.STRING, FunctionModifier.BOOLEAN, new FunctionModifier() {
+ @Override
+ public List<?> translate(Function function) {
+ Expression stringValue = function.getParameters().get(0);
+ return Arrays.asList("CASE WHEN ", stringValue, " IN ('false', '0') THEN '0' WHEN ", stringValue, " IS NOT NULL THEN '1' END");
+ }
+ });
+ convertModifier.addTypeConversion(new FunctionModifier() {
+ @Override
+ public List<?> translate(Function function) {
+ Expression stringValue = function.getParameters().get(0);
+ return Arrays.asList("CASE WHEN ", stringValue, " = 0 THEN '0' WHEN ", stringValue, " IS NOT NULL THEN '1' END");
+ }
+ }, FunctionModifier.BOOLEAN);
+
+
+
+
+ ////////STRING TO DATATYPE CONVERSION OTHER THAN DATE/TIME
+ convertModifier.addConvert(FunctionModifier.STRING, FunctionModifier.INTEGER, new CastModifier("integer"));
+ convertModifier.addConvert(FunctionModifier.STRING, FunctionModifier.FLOAT, new CastModifier("float"));
+ convertModifier.addConvert(FunctionModifier.STRING, FunctionModifier.DOUBLE, new CastModifier("double"));
+ ///// STRING --> CHAR, BYTE, SHORT, LONG, BIGI, BIGD, BOOLEAN is taken care by Type Mapping
+ ///// NO conversion support for NULL, CLOB, BLOB, OBJECT, XML
+ ////STRING TO DATE/TIME CONVERSION////
+ //////////////////////////////////////
+ convertModifier.addConvert(FunctionModifier.STRING, FunctionModifier.DATE, new ConvertModifier.FormatModifier("to_date", DATE_FORMAT));
+ convertModifier.addConvert(FunctionModifier.STRING, FunctionModifier.TIME, new ConvertModifier.FormatModifier("to_timestamp", TIME_FORMAT));
+ convertModifier.addConvert(FunctionModifier.STRING, FunctionModifier.TIMESTAMP, new ConvertModifier.FormatModifier("to_timestamp", TIMESTAMP_FORMAT));
+ //////DATE/TIME INTERNAL CONVERSION/////////
+ convertModifier.addConvert(FunctionModifier.TIMESTAMP, FunctionModifier.TIME, new CastModifier("TIME"));
+ convertModifier.addConvert(FunctionModifier.TIMESTAMP, FunctionModifier.DATE, new CastModifier("DATE"));
+ convertModifier.addConvert(FunctionModifier.DATE, FunctionModifier.TIMESTAMP, new CastModifier("TIMESTAMP"));
+ //convertModifier.addConvert(FunctionModifier.TIME, FunctionModifier.TIMESTAMP, new CastModifier("TIMESTAMP")); //TIME --> TIMESTAMP --DOESN't WORK IN NETEZZA-NO FUNCTION SUPPORT
+
+ ////DATE/TIME to STRING CONVERION////
+ /////////////////////////////////////
+ convertModifier.addConvert(FunctionModifier.TIMESTAMP, FunctionModifier.STRING, new ConvertModifier.FormatModifier("to_char", TIMESTAMP_FORMAT));
+ ///NO NETEZAA FUNCTION for DATE, TIME to STRING
+
+
+ convertModifier.setWideningNumericImplicit(true);
+ registerFunctionModifier(SourceSystemFunctions.CONVERT, convertModifier);
+ }
+
+ @Override
+ public List<String> getSupportedFunctions() {
+ List<String> supportedFunctions = new ArrayList<String>();
+ supportedFunctions.addAll(super.getSupportedFunctions());
+
+ ////////////////////////////////////////////////////////////
+ //STRING FUNCTIONS
+ //////////////////////////////////////////////////////////
+ supportedFunctions.add(SourceSystemFunctions.ASCII);// taken care with alias function modifier
+ supportedFunctions.add(SourceSystemFunctions.CHAR);//ALIAS to use 'chr'
+ supportedFunctions.add(SourceSystemFunctions.CONCAT); // ALIAS ||
+ supportedFunctions.add(SourceSystemFunctions.INITCAP);
+ supportedFunctions.add(SourceSystemFunctions.LCASE);//ALIAS 'lower'
+ supportedFunctions.add(SourceSystemFunctions.LPAD);
+ supportedFunctions.add(SourceSystemFunctions.LENGTH);
+ supportedFunctions.add(SourceSystemFunctions.LOCATE); //LOCATE FUNCTIO MODIFIER
+ supportedFunctions.add(SourceSystemFunctions.LTRIM);
+ //supportedFunctions.add(SourceSystemFunctions.REPEAT);
+ supportedFunctions.add(SourceSystemFunctions.RPAD);
+ supportedFunctions.add(SourceSystemFunctions.RTRIM);
+ supportedFunctions.add(SourceSystemFunctions.SUBSTRING); //No Need of ALIAS as both substring and substr work in netezza
+ supportedFunctions.add(SourceSystemFunctions.UCASE); //ALIAS UPPER
+ // FUNCTION DIFFERENCE = "difference"; ///NO FUNCTION FOUND--DIFFERENCE
+ // FUNCTION INSERT = "insert";
+ // supportedFunctions.add(SourceSystemFunctions.LEFT); //is this available or is it simply for LEFT OUTER JOIN?
+ // FUNCTION REPLACE = "replace"; // NO REPLACE Function
+ // supportedFunctions.add(SourceSystemFunctions.RIGHT);--is this available or is it simply for RIGHT OUTER JOIN?
+ // FUNCTION SOUNDEX = "soundex";
+ // FUNCTION TO_BYTES = "to_bytes";
+ // FUNCTION TO_CHARS = "to_chars";
+ ////////// ////////////////////////////////////////////////////////////////////
+ //NUMERIC FUNCTIONS////////////////////////////////////////////////////////////
+ //////////////////////////////////////////////////////////////////////////////
+ //supportedFunctions.add(SourceSystemFunctions.ABS);
+ supportedFunctions.add(SourceSystemFunctions.ACOS);
+ supportedFunctions.add(SourceSystemFunctions.ASIN);
+ supportedFunctions.add(SourceSystemFunctions.ATAN);
+ supportedFunctions.add(SourceSystemFunctions.ATAN2);
+ supportedFunctions.add(SourceSystemFunctions.CEILING); ///ALIAS-ceil
+ supportedFunctions.add(SourceSystemFunctions.COS);
+ supportedFunctions.add(SourceSystemFunctions.COT);
+ supportedFunctions.add(SourceSystemFunctions.DEGREES);
+ //supportedFunctions.add(SourceSystemFunctions.EXP);
+ supportedFunctions.add(SourceSystemFunctions.FLOOR);
+ supportedFunctions.add(SourceSystemFunctions.LOG);
+ supportedFunctions.add(SourceSystemFunctions.MOD);
+ supportedFunctions.add(SourceSystemFunctions.PI);
+ supportedFunctions.add(SourceSystemFunctions.POWER);// ALIAS-POW
+ supportedFunctions.add(SourceSystemFunctions.RADIANS);
+ supportedFunctions.add(SourceSystemFunctions.ROUND);
+ supportedFunctions.add(SourceSystemFunctions.SIGN);
+ supportedFunctions.add(SourceSystemFunctions.SIN);
+ supportedFunctions.add(SourceSystemFunctions.SQRT);
+ supportedFunctions.add(SourceSystemFunctions.TAN);
+ // FUNCTION TRANSLATE = "translate";
+ // FUNCTION TRUNCATE = "truncate";
+ // FUNCTION FORMATINTEGER = "formatinteger";
+ // FUNCTION FORMATLONG = "formatlong";
+ // FUNCTION FORMATDOUBLE = "formatdouble";
+ // FUNCTION FORMATFLOAT = "formatfloat";
+ // FUNCTION FORMATBIGINTEGER = "formatbiginteger";
+ // FUNCTION FORMATBIGDECIMAL = "formatbigdecimal";
+ // FUNCTION LOG10 = "log10";
+ // FUNCTION PARSEINTEGER = "parseinteger";
+ // FUNCTION PARSELONG = "parselong";
+ // FUNCTION PARSEDOUBLE = "parsedouble";
+ // FUNCTION PARSEFLOAT = "parsefloat";
+ // FUNCTION PARSEBIGINTEGER = "parsebiginteger";
+ // FUNCTION PARSEBIGDECIMAL = "parsebigdecimal";
+ // supportedFunctions.add(SourceSystemFunctions.RAND); --Needs Alias--But, is it required to even have an alias???
+ /////////////////////////////////////////////////////////////////////
+ //BIT FUNCTIONS//////////////////////////////////////////////////////
+ //ALIAS FUNCTION MODIFIER IS APPLIED//////////////////////////////
+ supportedFunctions.add(SourceSystemFunctions.BITAND);
+ supportedFunctions.add(SourceSystemFunctions.BITOR);
+ supportedFunctions.add(SourceSystemFunctions.BITNOT);
+ supportedFunctions.add(SourceSystemFunctions.BITXOR);
+ // DATE FUNCTIONS
+ supportedFunctions.add(SourceSystemFunctions.CURDATE);
+ supportedFunctions.add(SourceSystemFunctions.CURTIME);
+ supportedFunctions.add(SourceSystemFunctions.DAYOFMONTH);
+ supportedFunctions.add(SourceSystemFunctions.DAYOFYEAR);
+ supportedFunctions.add(SourceSystemFunctions.DAYOFWEEK);
+ supportedFunctions.add(SourceSystemFunctions.HOUR);
+ supportedFunctions.add(SourceSystemFunctions.MINUTE);
+ supportedFunctions.add(SourceSystemFunctions.MONTH);
+ supportedFunctions.add(SourceSystemFunctions.QUARTER);
+ supportedFunctions.add(SourceSystemFunctions.SECOND);
+ supportedFunctions.add(SourceSystemFunctions.WEEK);
+ supportedFunctions.add(SourceSystemFunctions.YEAR);
+ // FUNCTION DAYNAME = "dayname";
+ // FUNCTION FORMATTIMESTAMP = "formattimestamp";
+ // FUNCTION MODIFYTIMEZONE = "modifytimezone";
+ // FUNCTION MONTHNAME = "monthname";
+ // FUNCTION NOW = "now";
+ // FUNCTION PARSETIMESTAMP = "parsetimestamp";
+ // FUNCTION TIMESTAMPADD = "timestampadd";
+ // FUNCTION TIMESTAMPCREATE = "timestampcreate";
+ // FUNCTION TIMESTAMPDIFF = "timestampdiff";
+
+
+ //SYSTEM FUNCTIONS
+ supportedFunctions.add(SourceSystemFunctions.IFNULL); //ALIAS-NVL
+ supportedFunctions.add(SourceSystemFunctions.COALESCE);
+ supportedFunctions.add(SourceSystemFunctions.NULLIF);
+
+
+ //CONVERSION functions
+ supportedFunctions.add(SourceSystemFunctions.CONVERT);
+
+
+ return supportedFunctions;
+ }
+
+ public static class ExtractModifier extends FunctionModifier {
+ private String type;
+ public ExtractModifier(String type) {
+ this.type = type;
+ }
+ @Override
+ public List<?> translate(Function function) {
+ return Arrays.asList("extract(",this.type," from ",function.getParameters().get(0) ,")");
+ }
+ }
+
+ public static class BooleanToNumericConversionModifier extends FunctionModifier {
+ @Override
+ public List<?> translate(Function function) {
+ Expression booleanValue = function.getParameters().get(0);
+ if (booleanValue instanceof Function) {
+ Function nested = (Function)booleanValue;
+ if (nested.getName().equalsIgnoreCase("convert") && Number.class.isAssignableFrom(nested.getParameters().get(0).getType())) {
+ booleanValue = nested.getParameters().get(0);
+ }
+ }
+ return Arrays.asList("(CASE WHEN ", booleanValue, " IN ( '0', 'FALSE') THEN 0 WHEN ", booleanValue, " IS NOT NULL THEN 1 END)");
+ }
+
+ }
+ public static class BooleanToStringConversionModifier extends FunctionModifier {
+ @Override
+ public List<?> translate(Function function) {
+ Expression booleanValue = function.getParameters().get(0);
+ if (booleanValue instanceof Function) {
+ Function nested = (Function)booleanValue;
+ if (nested.getName().equalsIgnoreCase("convert") && Number.class.isAssignableFrom(nested.getParameters().get(0).getType())) {
+ booleanValue = nested.getParameters().get(0);
+ }
+ }
+ return Arrays.asList("CASE WHEN ", booleanValue, " = '0' THEN 'false' WHEN ", booleanValue, " IS NOT NULL THEN 'true' END");
+ }
+
+ }
+
+
+ public static class CastModifier extends FunctionModifier {
+ private String target;
+ public CastModifier(String target) {
+ this.target = target;
+ }
+ @Override
+ public List<?> translate(Function function) {
+ return Arrays.asList("cast(", function.getParameters().get(0), " AS "+this.target+")");
+ }
+ }
+
+
+ @Override
+ public List<?> translateLimit(Limit limit, ExecutionContext context) {
+ if (limit.getRowOffset() > 0) {
+ return Arrays.asList("LIMIT ", limit.getRowLimit(), " OFFSET ", limit.getRowOffset());
+ }
+ return null;
+ }
+
+ @Override
+ public boolean supportsCorrelatedSubqueries() {
+ return false;
+ }
+
+ @Override
+ public boolean supportsIntersect() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsExcept() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsInlineViews() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsRowLimit() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsRowOffset() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsAggregatesEnhancedNumeric() {
+ return true;
+ }
+
+}
Modified: trunk/connectors/translator-jdbc/src/main/resources/META-INF/jboss-beans.xml
===================================================================
--- trunk/connectors/translator-jdbc/src/main/resources/META-INF/jboss-beans.xml 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/connectors/translator-jdbc/src/main/resources/META-INF/jboss-beans.xml 2011-08-10 18:01:12 UTC (rev 3366)
@@ -335,5 +335,21 @@
<parameter class="java.lang.String">translator-intersystems-cache</parameter>
<parameter class="java.lang.String">InterSystems Cache</parameter>
</constructor>
- </bean>
+ </bean>
+
+ <!-- Netezza -->
+ <bean name="translator-neteza-template" class="org.teiid.templates.TranslatorDeploymentTemplate">
+ <property name="info"><inject bean="translator-netezza" /> </property>
+ <property name="managedObjectFactory"> <inject bean="ManagedObjectFactory" /> </property>
+ </bean>
+
+ <bean name="translator-netezza" class="org.teiid.templates.TranslatorTemplateInfo">
+ <constructor factoryMethod="createTemplateInfo">
+ <factory bean="TranslatorDeploymentTemplateInfoFactory" />
+ <parameter class="java.lang.Class">org.teiid.templates.TranslatorTemplateInfo</parameter>
+ <parameter class="java.lang.Class">org.teiid.translator.jdbc.netezza.NetezzaExecutionFactory</parameter>
+ <parameter class="java.lang.String">translator-netezza</parameter>
+ <parameter class="java.lang.String">Netezza</parameter>
+ </constructor>
+ </bean>
</deployment>
\ No newline at end of file
Deleted: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaConvertModifier.java
===================================================================
--- branches/7.4.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaConvertModifier.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaConvertModifier.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -1,509 +0,0 @@
-/*
- * 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.netezza;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.Arrays;
-
-import junit.framework.TestCase;
-
-import org.teiid.language.Expression;
-import org.teiid.language.Function;
-import org.teiid.language.LanguageFactory;
-import org.teiid.translator.TypeFacility;
-import org.teiid.translator.jdbc.SQLConversionVisitor;
-
-
-/**
- */
-public class TestNetezzaConvertModifier extends TestCase {
-
- private static final LanguageFactory LANG_FACTORY = new LanguageFactory();
-
- public TestNetezzaConvertModifier(String name) {
- super(name);
- }
-
- public String helpGetString(Expression expr) throws Exception {
- NetezzaExecutionFactory trans = new NetezzaExecutionFactory();
- trans.start();
- SQLConversionVisitor sqlVisitor = trans.getSQLConversionVisitor();
- sqlVisitor.append(expr);
-
- return sqlVisitor.toString();
- }
-
- public void helpTest(Expression srcExpression, String tgtType, String expectedExpression) throws Exception {
- Function func = LANG_FACTORY.createFunction("convert", //$NON-NLS-1$
- Arrays.asList(
- srcExpression,
- LANG_FACTORY.createLiteral(tgtType, String.class)),
- TypeFacility.getDataTypeClass(tgtType));
-
- assertEquals("Error converting from " + srcExpression.getType() + " to " + tgtType,
- expectedExpression, helpGetString(func));
- }
-
-
-
-
- // Source = STRING
- public void testStringToChar() throws Exception {
- helpTest(LANG_FACTORY.createLiteral("5", String.class), "char", "cast('5' AS char(1))");
- }
-
- public void testStringToBoolean() throws Exception {
- helpTest(LANG_FACTORY.createLiteral("5", String.class), "boolean", "CASE WHEN '5' IN ('false', '0') THEN '0' WHEN '5' IS NOT NULL THEN '1' END");
- }
-
- public void testStringToByte() throws Exception {
- helpTest(LANG_FACTORY.createLiteral("5", String.class), "byte", "cast('5' AS byteint)");
- }
-
- public void testStringToShort() throws Exception {
- helpTest(LANG_FACTORY.createLiteral("5", String.class), "short", "cast('5' AS smallint)");
- }
-
- public void testStringToInteger() throws Exception {
- helpTest(LANG_FACTORY.createLiteral("5", String.class), "integer", "cast('5' AS integer)");
- }
-
- public void testStringToLong() throws Exception {
- helpTest(LANG_FACTORY.createLiteral("5", String.class), "long", "cast('5' AS bigint)");
- }
-
- public void testStringToBigInteger() throws Exception {
- helpTest(LANG_FACTORY.createLiteral("5", String.class), "biginteger", "cast('5' AS numeric(38))"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
- }
-
- public void testStringToFloat() throws Exception {
- helpTest(LANG_FACTORY.createLiteral("5", String.class), "float", "cast('5' AS float)");
- }
-
- public void testStringToDouble() throws Exception {
- helpTest(LANG_FACTORY.createLiteral("5", String.class), "double", "cast('5' AS double)");
- }
-
- public void testStringToDate() throws Exception {
- helpTest(LANG_FACTORY.createLiteral("2004-06-29", String.class), "date", "to_date('2004-06-29', 'YYYY-MM-DD')");
- }
-
- public void testStringToTime() throws Exception {
- helpTest(LANG_FACTORY.createLiteral("23:59:59", String.class), "time", "to_timestamp('23:59:59', 'HH24:MI:SS')");
- }
-
- public void testStringToTimestamp() throws Exception {
- helpTest(LANG_FACTORY.createLiteral("2004-06-29 23:59:59.987", String.class), "timestamp", "to_timestamp('2004-06-29 23:59:59.987', 'YYYY-MM-DD HH24:MI:SS.MS')");
- }
-
- public void testStringToBigDecimal() throws Exception {
- helpTest(LANG_FACTORY.createLiteral("5", String.class), "bigdecimal", "cast('5' AS numeric(38,18))");
- }
-
- // Source = CHAR
-
- public void testCharToString() throws Exception {
- helpTest(LANG_FACTORY.createLiteral(new Character('5'), Character.class), "string", "'5'");
- }
-
- // Source = BOOLEAN
-
- public void testBooleanToString() throws Exception {
- helpTest(LANG_FACTORY.createLiteral(Boolean.TRUE, Boolean.class), "string", "CASE WHEN 1 = '0' THEN 'false' WHEN 1 IS NOT NULL THEN 'true' END");
- }
-
- public void testBooleanToByte() throws Exception {
- helpTest(LANG_FACTORY.createLiteral(Boolean.FALSE, Boolean.class), "byte", "(CASE WHEN 0 IN ( '0', 'FALSE') THEN 0 WHEN 0 IS NOT NULL THEN 1 END)");
- }
-
- public void testBooleanToShort() throws Exception {
- helpTest(LANG_FACTORY.createLiteral(Boolean.FALSE, Boolean.class), "short", "(CASE WHEN 0 IN ( '0', 'FALSE') THEN 0 WHEN 0 IS NOT NULL THEN 1 END)");
- }
-
- public void testBooleanToInteger() throws Exception {
- helpTest(LANG_FACTORY.createLiteral(Boolean.FALSE, Boolean.class), "integer", "(CASE WHEN 0 IN ( '0', 'FALSE') THEN 0 WHEN 0 IS NOT NULL THEN 1 END)");
- }
-
- public void testBooleanToLong() throws Exception {
- helpTest(LANG_FACTORY.createLiteral(Boolean.FALSE, Boolean.class), "long", "(CASE WHEN 0 IN ( '0', 'FALSE') THEN 0 WHEN 0 IS NOT NULL THEN 1 END)");
- }
-
- public void testBooleanToBigInteger() throws Exception {
- helpTest(LANG_FACTORY.createLiteral(Boolean.FALSE, Boolean.class), "biginteger", "(CASE WHEN 0 IN ( '0', 'FALSE') THEN 0 WHEN 0 IS NOT NULL THEN 1 END)");
- }
-
- public void testBooleanToFloat() throws Exception {
- helpTest(LANG_FACTORY.createLiteral(Boolean.FALSE, Boolean.class), "float", "(CASE WHEN 0 IN ( '0', 'FALSE') THEN 0 WHEN 0 IS NOT NULL THEN 1 END)");
- }
-
- public void testBooleanToDouble() throws Exception {
- helpTest(LANG_FACTORY.createLiteral(Boolean.FALSE, Boolean.class), "double", "(CASE WHEN 0 IN ( '0', 'FALSE') THEN 0 WHEN 0 IS NOT NULL THEN 1 END)");
- }
-
- public void testBooleanToBigDecimal() throws Exception {
- helpTest(LANG_FACTORY.createLiteral(Boolean.FALSE, Boolean.class), "bigdecimal", "(CASE WHEN 0 IN ( '0', 'FALSE') THEN 0 WHEN 0 IS NOT NULL THEN 1 END)");
- }
-
- // Source = BYTE
-
- public void testByteToString() throws Exception {
- helpTest(LANG_FACTORY.createLiteral(new Byte((byte)1), Byte.class), "string", "cast(1 AS varchar(4000))");
- }
-
- public void testByteToBoolean() throws Exception {
- helpTest(LANG_FACTORY.createLiteral(new Byte((byte)1), Byte.class), "boolean", "CASE WHEN 1 = 0 THEN '0' WHEN 1 IS NOT NULL THEN '1' END");
- }
-
-// public void testByteToShort() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Byte((byte)1), Byte.class), "short", "1");
-// }
-//
-// public void testByteToInteger() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Byte((byte)1), Byte.class), "integer", "integer(1)");
-// }
-//
-// public void testByteToLong() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Byte((byte)1), Byte.class), "long", "bigint(1)");
-// }
-//
-// public void testByteToBigInteger() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Byte((byte)1), Byte.class), "biginteger", "cast(1 AS numeric(31,0))");
-// }
-//
-// public void testByteToFloat() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Byte((byte)1), Byte.class), "float", "cast(1 AS real)");
-// }
-//
-// public void testByteToDouble() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Byte((byte)1), Byte.class), "double", "double(1)");
-// }
-//
-// public void testByteToBigDecimal() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Byte((byte)1), Byte.class), "bigdecimal", "cast(1 AS numeric(31,12))");
-// }
-
- // Source = SHORT
-
- public void testShortToString() throws Exception {
- helpTest(LANG_FACTORY.createLiteral(new Short((short)1), Short.class), "string", "cast(1 AS varchar(4000))");
- }
-
- public void testShortToBoolean() throws Exception {
- helpTest(LANG_FACTORY.createLiteral(new Short((short)1), Short.class), "boolean", "CASE WHEN 1 = 0 THEN '0' WHEN 1 IS NOT NULL THEN '1' END");
- }
-
-// public void testShortToByte() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Short((short)1), Short.class), "byte", "1");
-// }
-//
-// public void testShortToInteger() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Short((short)1), Short.class), "integer", "integer(1)");
-// }
-//
-// public void testShortToLong() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Short((short)1), Short.class), "long", "bigint(1)");
-// }
-//
-// public void testShortToBigInteger() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Short((short)1), Short.class), "biginteger", "cast(1 AS numeric(31,0))");
-// }
-//
-// public void testShortToFloat() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Short((short)1), Short.class), "float", "cast(1 AS real)");
-// }
-//
-// public void testShortToDouble() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Short((short)1), Short.class), "double", "double(1)");
-// }
-//
-// public void testShortToBigDecimal() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Short((short)1), Short.class), "bigdecimal", "cast(1 AS numeric(31,12))");
-// }
-
- // Source = INTEGER
-
- public void testIntegerToString() throws Exception {
- helpTest(LANG_FACTORY.createLiteral(new Integer(1), Integer.class), "string", "cast(1 AS varchar(4000))");
- }
-
- public void testIntegerToBoolean() throws Exception {
- helpTest(LANG_FACTORY.createLiteral(new Integer(1), Integer.class), "boolean", "CASE WHEN 1 = 0 THEN '0' WHEN 1 IS NOT NULL THEN '1' END");
- }
-
-// public void testIntegerToByte() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Integer(1), Integer.class), "byte", "smallint(1)");
-// }
-//
-// public void testIntegerToShort() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Integer(1), Integer.class), "short", "smallint(1)");
-// }
-//
-// public void testIntegerToLong() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Integer(1), Integer.class), "long", "bigint(1)");
-// }
-//
-// public void testIntegerToBigInteger() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Integer(1), Integer.class), "biginteger", "cast(1 AS numeric(31,0))");
-// }
-//
-// public void testIntegerToFloat() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Integer(1), Integer.class), "float", "cast(1 AS real)");
-// }
-//
-// public void testIntegerToDouble() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Integer(1), Integer.class), "double", "double(1)");
-// }
-//
-// public void testIntegerToBigDecimal() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Integer(1), Integer.class), "bigdecimal", "cast(1 AS numeric(31,12))");
-// }
-
- // Source = LONG
-
- public void testLongToString() throws Exception {
- helpTest(LANG_FACTORY.createLiteral(new Long(1), Long.class), "string", "cast(1 AS varchar(4000))");
- }
-
- public void testLongToBoolean() throws Exception {
- helpTest(LANG_FACTORY.createLiteral(new Long(1), Long.class), "boolean", "CASE WHEN 1 = 0 THEN '0' WHEN 1 IS NOT NULL THEN '1' END");
- }
-
-// public void testLongToByte() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Long(1), Long.class), "byte", "smallint(1)");
-// }
-//
-// public void testLongToShort() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Long(1), Long.class), "short", "smallint(1)");
-// }
-//
-// public void testLongToInteger() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Long(1), Long.class), "integer", "integer(1)");
-// }
-//
-// public void testLongToBigInteger() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Long(1), Long.class), "biginteger", "cast(1 AS numeric(31,0))");
-// }
-//
-// public void testLongToFloat() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Long(1), Long.class), "float", "cast(1 AS real)");
-// }
-//
-// public void testLongToDouble() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Long(1), Long.class), "double", "double(1)");
-// }
-//
-// public void testLongToBigDecimal() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Long(1), Long.class), "bigdecimal", "cast(1 AS numeric(31,12))");
-// }
-
- // Source = BIGINTEGER
-
- public void testBigIntegerToString() throws Exception {
- helpTest(LANG_FACTORY.createLiteral(new BigInteger("1"), BigInteger.class), "string", "cast(1 AS varchar(4000))");
- }
-
- public void testBigIntegerToBoolean() throws Exception {
- helpTest(LANG_FACTORY.createLiteral(new BigInteger("1"), BigInteger.class), "boolean", "CASE WHEN 1 = 0 THEN '0' WHEN 1 IS NOT NULL THEN '1' END");
- }
-
-// public void testBigIntegerToByte() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new BigInteger("1"), BigInteger.class), "byte", "smallint(1)");
-// }
-//
-// public void testBigIntegerToShort() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new BigInteger("1"), BigInteger.class), "short", "smallint(1)");
-// }
-//
-// public void testBigIntegerToInteger() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new BigInteger("1"), BigInteger.class), "integer", "integer(1)");
-// }
-//
-// public void testBigIntegerToLong() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new BigInteger("1"), BigInteger.class), "long", "bigint(1)");
-// }
-//
-// public void testBigIntegerToFloat() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new BigInteger("1"), BigInteger.class), "float", "cast(1 AS real)");
-// }
-//
-// public void testBigIntegerToDouble() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new BigInteger("1"), BigInteger.class), "double", "double(1)");
-// }
-//
-// public void testBigIntegerToBigDecimal() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new BigInteger("1"), BigInteger.class), "bigdecimal", "cast(1 AS numeric(31,12))");
-// }
-
- // Source = FLOAT
-
- public void testFloatToString() throws Exception {
- helpTest(LANG_FACTORY.createLiteral(new Float(1.2f), Float.class), "string", "cast(1.2 AS varchar(4000))");
- }
-
- public void testFloatToBoolean() throws Exception {
- helpTest(LANG_FACTORY.createLiteral(new Float(1.2f), Float.class), "boolean", "CASE WHEN 1.2 = 0 THEN '0' WHEN 1.2 IS NOT NULL THEN '1' END");
- }
-
-// public void testFloatToByte() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Float(1.2f), Float.class), "byte", "smallint(1.2)");
-// }
-//
-// public void testFloatToShort() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Float(1.2f), Float.class), "short", "smallint(1.2)");
-// }
-//
-// public void testFloatToInteger() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Float(1.2f), Float.class), "integer", "integer(1.2)");
-// }
-//
-// public void testFloatToLong() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Float(1.2f), Float.class), "long", "bigint(1.2)");
-// }
-//
-// public void testFloatToBigInteger() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Float(1.2f), Float.class), "biginteger", "cast(1.2 AS numeric(31,0))");
-// }
-//
-// public void testFloatToDouble() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Float(1.2f), Float.class), "double", "double(1.2)");
-// }
-//
-// public void testFloatToBigDecimal() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Float(1.2f), Float.class), "bigdecimal", "cast(1.2 AS numeric(31,12))");
-// }
-
- // Source = DOUBLE
-
- public void testDoubleToString() throws Exception {
- helpTest(LANG_FACTORY.createLiteral(new Double(1.2), Double.class), "string", "cast(1.2 AS varchar(4000))");
- }
-
- public void testDoubleToBoolean() throws Exception {
- helpTest(LANG_FACTORY.createLiteral(new Double(1.2), Double.class), "boolean", "CASE WHEN 1.2 = 0 THEN '0' WHEN 1.2 IS NOT NULL THEN '1' END");
- }
-
-// public void testDoubleToByte() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Double(1.2), Double.class), "byte", "smallint(1.2)");
-// }
-//
-// public void testDoubleToShort() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Double(1.2), Double.class), "short", "smallint(1.2)");
-// }
-//
-// public void testDoubleToInteger() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Double(1.2), Double.class), "integer", "integer(1.2)");
-// }
-//
-// public void testDoubleToLong() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Double(1.2), Double.class), "long", "bigint(1.2)");
-// }
-//
-// public void testDoubleToBigInteger() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Double(1.2), Double.class), "biginteger", "cast(1.2 AS numeric(31,0))");
-// }
-//
-// public void testDoubleToFloat() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Double(1.2), Double.class), "float", "cast(1.2 AS real)");
-// }
-//
-// public void testDoubleToBigDecimal() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new Double(1.2), Double.class), "bigdecimal", "cast(1.2 AS numeric(31,12))");
-// }
-
- // Source = BIGDECIMAL
-
- public void testBigDecimalToString() throws Exception {
- helpTest(LANG_FACTORY.createLiteral(new BigDecimal("1.0"), BigDecimal.class), "string", "cast(1.0 AS varchar(4000))");
- }
-
- public void testBigDecimalToBoolean() throws Exception {
- helpTest(LANG_FACTORY.createLiteral(new BigDecimal("1.0"), BigDecimal.class), "boolean", "CASE WHEN 1.0 = 0 THEN '0' WHEN 1.0 IS NOT NULL THEN '1' END");
- }
-
-// public void testBigDecimalToByte() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new BigDecimal("1.0"), BigDecimal.class), "byte", "smallint(1.0)");
-// }
-//
-// public void testBigDecimalToShort() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new BigDecimal("1.0"), BigDecimal.class), "short", "smallint(1.0)");
-// }
-//
-// public void testBigDecimalToInteger() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new BigDecimal("1.0"), BigDecimal.class), "integer", "integer(1.0)");
-// }
-//
-// public void testBigDecimalToLong() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new BigDecimal("1.0"), BigDecimal.class), "long", "bigint(1.0)");
-// }
-//
-// public void testBigDecimalToBigInteger() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new BigDecimal("1.0"), BigDecimal.class), "biginteger", "cast(1.0 AS numeric(31,0))");
-// }
-//
-// public void testBigDecimalToFloat() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new BigDecimal("1.0"), BigDecimal.class), "float", "cast(1.0 AS real)");
-// }
-//
-// public void testBigDecimalToDouble() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(new BigDecimal("1.0"), BigDecimal.class), "double", "double(1.0)");
-// }
-
-// // Source = DATE
-//
-// public void testDateToString() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(TimestampUtil.createDate(103, 10, 1), java.sql.Date.class), "string", "char({d '2003-11-01'})");
-// }
-//
-// public void testDateToTimestamp() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(TimestampUtil.createDate(103, 10, 1), java.sql.Date.class), "timestamp", "timestamp({d '2003-11-01'}, '00:00:00')");
-// }
-//
-// // Source = TIME
-//
-// public void testTimeToString() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(TimestampUtil.createTime(23, 59, 59), java.sql.Time.class), "string", "char({t '23:59:59'})");
-// }
-//
-// public void testTimeToTimestamp() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(TimestampUtil.createTime(23, 59, 59), java.sql.Time.class), "timestamp", "timestamp('1970-01-01', {t '23:59:59'})");
-// }
-//
-// // Source = TIMESTAMP
-//
-// public void testTimestampToString() throws Exception {
-// Timestamp ts = TimestampUtil.createTimestamp(103, 10, 1, 12, 5, 2, 0);
-// helpTest(LANG_FACTORY.createLiteral(ts, Timestamp.class), "string", "char({ts '2003-11-01 12:05:02.0'})");
-// }
-//
-// public void testTimestampToDate() throws Exception {
-// Timestamp ts = TimestampUtil.createTimestamp(103, 10, 1, 12, 5, 2, 0);
-// helpTest(LANG_FACTORY.createLiteral(ts, Timestamp.class), "date", "date({ts '2003-11-01 12:05:02.0'})");
-// }
-//
-// public void testTimestampToTime() throws Exception {
-// Timestamp ts = TimestampUtil.createTimestamp(103, 10, 1, 12, 5, 2, 0);
-// helpTest(LANG_FACTORY.createLiteral(ts, Timestamp.class), "time", "time({ts '2003-11-01 12:05:02.0'})");
-// }
-
-}
Copied: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaConvertModifier.java (from rev 3365, branches/7.4.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaConvertModifier.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaConvertModifier.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaConvertModifier.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -0,0 +1,509 @@
+/*
+ * 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.netezza;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.Arrays;
+
+import junit.framework.TestCase;
+
+import org.teiid.language.Expression;
+import org.teiid.language.Function;
+import org.teiid.language.LanguageFactory;
+import org.teiid.translator.TypeFacility;
+import org.teiid.translator.jdbc.SQLConversionVisitor;
+
+
+/**
+ */
+public class TestNetezzaConvertModifier extends TestCase {
+
+ private static final LanguageFactory LANG_FACTORY = new LanguageFactory();
+
+ public TestNetezzaConvertModifier(String name) {
+ super(name);
+ }
+
+ public String helpGetString(Expression expr) throws Exception {
+ NetezzaExecutionFactory trans = new NetezzaExecutionFactory();
+ trans.start();
+ SQLConversionVisitor sqlVisitor = trans.getSQLConversionVisitor();
+ sqlVisitor.append(expr);
+
+ return sqlVisitor.toString();
+ }
+
+ public void helpTest(Expression srcExpression, String tgtType, String expectedExpression) throws Exception {
+ Function func = LANG_FACTORY.createFunction("convert", //$NON-NLS-1$
+ Arrays.asList(
+ srcExpression,
+ LANG_FACTORY.createLiteral(tgtType, String.class)),
+ TypeFacility.getDataTypeClass(tgtType));
+
+ assertEquals("Error converting from " + srcExpression.getType() + " to " + tgtType,
+ expectedExpression, helpGetString(func));
+ }
+
+
+
+
+ // Source = STRING
+ public void testStringToChar() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral("5", String.class), "char", "cast('5' AS char(1))");
+ }
+
+ public void testStringToBoolean() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral("5", String.class), "boolean", "CASE WHEN '5' IN ('false', '0') THEN '0' WHEN '5' IS NOT NULL THEN '1' END");
+ }
+
+ public void testStringToByte() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral("5", String.class), "byte", "cast('5' AS byteint)");
+ }
+
+ public void testStringToShort() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral("5", String.class), "short", "cast('5' AS smallint)");
+ }
+
+ public void testStringToInteger() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral("5", String.class), "integer", "cast('5' AS integer)");
+ }
+
+ public void testStringToLong() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral("5", String.class), "long", "cast('5' AS bigint)");
+ }
+
+ public void testStringToBigInteger() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral("5", String.class), "biginteger", "cast('5' AS numeric(38))"); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$
+ }
+
+ public void testStringToFloat() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral("5", String.class), "float", "cast('5' AS float)");
+ }
+
+ public void testStringToDouble() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral("5", String.class), "double", "cast('5' AS double)");
+ }
+
+ public void testStringToDate() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral("2004-06-29", String.class), "date", "to_date('2004-06-29', 'YYYY-MM-DD')");
+ }
+
+ public void testStringToTime() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral("23:59:59", String.class), "time", "to_timestamp('23:59:59', 'HH24:MI:SS')");
+ }
+
+ public void testStringToTimestamp() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral("2004-06-29 23:59:59.987", String.class), "timestamp", "to_timestamp('2004-06-29 23:59:59.987', 'YYYY-MM-DD HH24:MI:SS.MS')");
+ }
+
+ public void testStringToBigDecimal() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral("5", String.class), "bigdecimal", "cast('5' AS numeric(38,18))");
+ }
+
+ // Source = CHAR
+
+ public void testCharToString() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(new Character('5'), Character.class), "string", "'5'");
+ }
+
+ // Source = BOOLEAN
+
+ public void testBooleanToString() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(Boolean.TRUE, Boolean.class), "string", "CASE WHEN 1 = '0' THEN 'false' WHEN 1 IS NOT NULL THEN 'true' END");
+ }
+
+ public void testBooleanToByte() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(Boolean.FALSE, Boolean.class), "byte", "(CASE WHEN 0 IN ( '0', 'FALSE') THEN 0 WHEN 0 IS NOT NULL THEN 1 END)");
+ }
+
+ public void testBooleanToShort() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(Boolean.FALSE, Boolean.class), "short", "(CASE WHEN 0 IN ( '0', 'FALSE') THEN 0 WHEN 0 IS NOT NULL THEN 1 END)");
+ }
+
+ public void testBooleanToInteger() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(Boolean.FALSE, Boolean.class), "integer", "(CASE WHEN 0 IN ( '0', 'FALSE') THEN 0 WHEN 0 IS NOT NULL THEN 1 END)");
+ }
+
+ public void testBooleanToLong() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(Boolean.FALSE, Boolean.class), "long", "(CASE WHEN 0 IN ( '0', 'FALSE') THEN 0 WHEN 0 IS NOT NULL THEN 1 END)");
+ }
+
+ public void testBooleanToBigInteger() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(Boolean.FALSE, Boolean.class), "biginteger", "(CASE WHEN 0 IN ( '0', 'FALSE') THEN 0 WHEN 0 IS NOT NULL THEN 1 END)");
+ }
+
+ public void testBooleanToFloat() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(Boolean.FALSE, Boolean.class), "float", "(CASE WHEN 0 IN ( '0', 'FALSE') THEN 0 WHEN 0 IS NOT NULL THEN 1 END)");
+ }
+
+ public void testBooleanToDouble() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(Boolean.FALSE, Boolean.class), "double", "(CASE WHEN 0 IN ( '0', 'FALSE') THEN 0 WHEN 0 IS NOT NULL THEN 1 END)");
+ }
+
+ public void testBooleanToBigDecimal() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(Boolean.FALSE, Boolean.class), "bigdecimal", "(CASE WHEN 0 IN ( '0', 'FALSE') THEN 0 WHEN 0 IS NOT NULL THEN 1 END)");
+ }
+
+ // Source = BYTE
+
+ public void testByteToString() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(new Byte((byte)1), Byte.class), "string", "cast(1 AS varchar(4000))");
+ }
+
+ public void testByteToBoolean() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(new Byte((byte)1), Byte.class), "boolean", "CASE WHEN 1 = 0 THEN '0' WHEN 1 IS NOT NULL THEN '1' END");
+ }
+
+// public void testByteToShort() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Byte((byte)1), Byte.class), "short", "1");
+// }
+//
+// public void testByteToInteger() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Byte((byte)1), Byte.class), "integer", "integer(1)");
+// }
+//
+// public void testByteToLong() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Byte((byte)1), Byte.class), "long", "bigint(1)");
+// }
+//
+// public void testByteToBigInteger() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Byte((byte)1), Byte.class), "biginteger", "cast(1 AS numeric(31,0))");
+// }
+//
+// public void testByteToFloat() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Byte((byte)1), Byte.class), "float", "cast(1 AS real)");
+// }
+//
+// public void testByteToDouble() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Byte((byte)1), Byte.class), "double", "double(1)");
+// }
+//
+// public void testByteToBigDecimal() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Byte((byte)1), Byte.class), "bigdecimal", "cast(1 AS numeric(31,12))");
+// }
+
+ // Source = SHORT
+
+ public void testShortToString() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(new Short((short)1), Short.class), "string", "cast(1 AS varchar(4000))");
+ }
+
+ public void testShortToBoolean() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(new Short((short)1), Short.class), "boolean", "CASE WHEN 1 = 0 THEN '0' WHEN 1 IS NOT NULL THEN '1' END");
+ }
+
+// public void testShortToByte() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Short((short)1), Short.class), "byte", "1");
+// }
+//
+// public void testShortToInteger() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Short((short)1), Short.class), "integer", "integer(1)");
+// }
+//
+// public void testShortToLong() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Short((short)1), Short.class), "long", "bigint(1)");
+// }
+//
+// public void testShortToBigInteger() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Short((short)1), Short.class), "biginteger", "cast(1 AS numeric(31,0))");
+// }
+//
+// public void testShortToFloat() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Short((short)1), Short.class), "float", "cast(1 AS real)");
+// }
+//
+// public void testShortToDouble() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Short((short)1), Short.class), "double", "double(1)");
+// }
+//
+// public void testShortToBigDecimal() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Short((short)1), Short.class), "bigdecimal", "cast(1 AS numeric(31,12))");
+// }
+
+ // Source = INTEGER
+
+ public void testIntegerToString() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(new Integer(1), Integer.class), "string", "cast(1 AS varchar(4000))");
+ }
+
+ public void testIntegerToBoolean() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(new Integer(1), Integer.class), "boolean", "CASE WHEN 1 = 0 THEN '0' WHEN 1 IS NOT NULL THEN '1' END");
+ }
+
+// public void testIntegerToByte() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Integer(1), Integer.class), "byte", "smallint(1)");
+// }
+//
+// public void testIntegerToShort() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Integer(1), Integer.class), "short", "smallint(1)");
+// }
+//
+// public void testIntegerToLong() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Integer(1), Integer.class), "long", "bigint(1)");
+// }
+//
+// public void testIntegerToBigInteger() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Integer(1), Integer.class), "biginteger", "cast(1 AS numeric(31,0))");
+// }
+//
+// public void testIntegerToFloat() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Integer(1), Integer.class), "float", "cast(1 AS real)");
+// }
+//
+// public void testIntegerToDouble() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Integer(1), Integer.class), "double", "double(1)");
+// }
+//
+// public void testIntegerToBigDecimal() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Integer(1), Integer.class), "bigdecimal", "cast(1 AS numeric(31,12))");
+// }
+
+ // Source = LONG
+
+ public void testLongToString() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(new Long(1), Long.class), "string", "cast(1 AS varchar(4000))");
+ }
+
+ public void testLongToBoolean() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(new Long(1), Long.class), "boolean", "CASE WHEN 1 = 0 THEN '0' WHEN 1 IS NOT NULL THEN '1' END");
+ }
+
+// public void testLongToByte() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Long(1), Long.class), "byte", "smallint(1)");
+// }
+//
+// public void testLongToShort() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Long(1), Long.class), "short", "smallint(1)");
+// }
+//
+// public void testLongToInteger() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Long(1), Long.class), "integer", "integer(1)");
+// }
+//
+// public void testLongToBigInteger() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Long(1), Long.class), "biginteger", "cast(1 AS numeric(31,0))");
+// }
+//
+// public void testLongToFloat() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Long(1), Long.class), "float", "cast(1 AS real)");
+// }
+//
+// public void testLongToDouble() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Long(1), Long.class), "double", "double(1)");
+// }
+//
+// public void testLongToBigDecimal() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Long(1), Long.class), "bigdecimal", "cast(1 AS numeric(31,12))");
+// }
+
+ // Source = BIGINTEGER
+
+ public void testBigIntegerToString() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(new BigInteger("1"), BigInteger.class), "string", "cast(1 AS varchar(4000))");
+ }
+
+ public void testBigIntegerToBoolean() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(new BigInteger("1"), BigInteger.class), "boolean", "CASE WHEN 1 = 0 THEN '0' WHEN 1 IS NOT NULL THEN '1' END");
+ }
+
+// public void testBigIntegerToByte() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new BigInteger("1"), BigInteger.class), "byte", "smallint(1)");
+// }
+//
+// public void testBigIntegerToShort() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new BigInteger("1"), BigInteger.class), "short", "smallint(1)");
+// }
+//
+// public void testBigIntegerToInteger() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new BigInteger("1"), BigInteger.class), "integer", "integer(1)");
+// }
+//
+// public void testBigIntegerToLong() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new BigInteger("1"), BigInteger.class), "long", "bigint(1)");
+// }
+//
+// public void testBigIntegerToFloat() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new BigInteger("1"), BigInteger.class), "float", "cast(1 AS real)");
+// }
+//
+// public void testBigIntegerToDouble() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new BigInteger("1"), BigInteger.class), "double", "double(1)");
+// }
+//
+// public void testBigIntegerToBigDecimal() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new BigInteger("1"), BigInteger.class), "bigdecimal", "cast(1 AS numeric(31,12))");
+// }
+
+ // Source = FLOAT
+
+ public void testFloatToString() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(new Float(1.2f), Float.class), "string", "cast(1.2 AS varchar(4000))");
+ }
+
+ public void testFloatToBoolean() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(new Float(1.2f), Float.class), "boolean", "CASE WHEN 1.2 = 0 THEN '0' WHEN 1.2 IS NOT NULL THEN '1' END");
+ }
+
+// public void testFloatToByte() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Float(1.2f), Float.class), "byte", "smallint(1.2)");
+// }
+//
+// public void testFloatToShort() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Float(1.2f), Float.class), "short", "smallint(1.2)");
+// }
+//
+// public void testFloatToInteger() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Float(1.2f), Float.class), "integer", "integer(1.2)");
+// }
+//
+// public void testFloatToLong() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Float(1.2f), Float.class), "long", "bigint(1.2)");
+// }
+//
+// public void testFloatToBigInteger() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Float(1.2f), Float.class), "biginteger", "cast(1.2 AS numeric(31,0))");
+// }
+//
+// public void testFloatToDouble() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Float(1.2f), Float.class), "double", "double(1.2)");
+// }
+//
+// public void testFloatToBigDecimal() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Float(1.2f), Float.class), "bigdecimal", "cast(1.2 AS numeric(31,12))");
+// }
+
+ // Source = DOUBLE
+
+ public void testDoubleToString() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(new Double(1.2), Double.class), "string", "cast(1.2 AS varchar(4000))");
+ }
+
+ public void testDoubleToBoolean() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(new Double(1.2), Double.class), "boolean", "CASE WHEN 1.2 = 0 THEN '0' WHEN 1.2 IS NOT NULL THEN '1' END");
+ }
+
+// public void testDoubleToByte() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Double(1.2), Double.class), "byte", "smallint(1.2)");
+// }
+//
+// public void testDoubleToShort() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Double(1.2), Double.class), "short", "smallint(1.2)");
+// }
+//
+// public void testDoubleToInteger() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Double(1.2), Double.class), "integer", "integer(1.2)");
+// }
+//
+// public void testDoubleToLong() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Double(1.2), Double.class), "long", "bigint(1.2)");
+// }
+//
+// public void testDoubleToBigInteger() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Double(1.2), Double.class), "biginteger", "cast(1.2 AS numeric(31,0))");
+// }
+//
+// public void testDoubleToFloat() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Double(1.2), Double.class), "float", "cast(1.2 AS real)");
+// }
+//
+// public void testDoubleToBigDecimal() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new Double(1.2), Double.class), "bigdecimal", "cast(1.2 AS numeric(31,12))");
+// }
+
+ // Source = BIGDECIMAL
+
+ public void testBigDecimalToString() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(new BigDecimal("1.0"), BigDecimal.class), "string", "cast(1.0 AS varchar(4000))");
+ }
+
+ public void testBigDecimalToBoolean() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(new BigDecimal("1.0"), BigDecimal.class), "boolean", "CASE WHEN 1.0 = 0 THEN '0' WHEN 1.0 IS NOT NULL THEN '1' END");
+ }
+
+// public void testBigDecimalToByte() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new BigDecimal("1.0"), BigDecimal.class), "byte", "smallint(1.0)");
+// }
+//
+// public void testBigDecimalToShort() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new BigDecimal("1.0"), BigDecimal.class), "short", "smallint(1.0)");
+// }
+//
+// public void testBigDecimalToInteger() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new BigDecimal("1.0"), BigDecimal.class), "integer", "integer(1.0)");
+// }
+//
+// public void testBigDecimalToLong() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new BigDecimal("1.0"), BigDecimal.class), "long", "bigint(1.0)");
+// }
+//
+// public void testBigDecimalToBigInteger() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new BigDecimal("1.0"), BigDecimal.class), "biginteger", "cast(1.0 AS numeric(31,0))");
+// }
+//
+// public void testBigDecimalToFloat() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new BigDecimal("1.0"), BigDecimal.class), "float", "cast(1.0 AS real)");
+// }
+//
+// public void testBigDecimalToDouble() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(new BigDecimal("1.0"), BigDecimal.class), "double", "double(1.0)");
+// }
+
+// // Source = DATE
+//
+// public void testDateToString() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(TimestampUtil.createDate(103, 10, 1), java.sql.Date.class), "string", "char({d '2003-11-01'})");
+// }
+//
+// public void testDateToTimestamp() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(TimestampUtil.createDate(103, 10, 1), java.sql.Date.class), "timestamp", "timestamp({d '2003-11-01'}, '00:00:00')");
+// }
+//
+// // Source = TIME
+//
+// public void testTimeToString() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(TimestampUtil.createTime(23, 59, 59), java.sql.Time.class), "string", "char({t '23:59:59'})");
+// }
+//
+// public void testTimeToTimestamp() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(TimestampUtil.createTime(23, 59, 59), java.sql.Time.class), "timestamp", "timestamp('1970-01-01', {t '23:59:59'})");
+// }
+//
+// // Source = TIMESTAMP
+//
+// public void testTimestampToString() throws Exception {
+// Timestamp ts = TimestampUtil.createTimestamp(103, 10, 1, 12, 5, 2, 0);
+// helpTest(LANG_FACTORY.createLiteral(ts, Timestamp.class), "string", "char({ts '2003-11-01 12:05:02.0'})");
+// }
+//
+// public void testTimestampToDate() throws Exception {
+// Timestamp ts = TimestampUtil.createTimestamp(103, 10, 1, 12, 5, 2, 0);
+// helpTest(LANG_FACTORY.createLiteral(ts, Timestamp.class), "date", "date({ts '2003-11-01 12:05:02.0'})");
+// }
+//
+// public void testTimestampToTime() throws Exception {
+// Timestamp ts = TimestampUtil.createTimestamp(103, 10, 1, 12, 5, 2, 0);
+// helpTest(LANG_FACTORY.createLiteral(ts, Timestamp.class), "time", "time({ts '2003-11-01 12:05:02.0'})");
+// }
+
+}
Deleted: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorCapabilities.java
===================================================================
--- branches/7.4.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorCapabilities.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorCapabilities.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -1,394 +0,0 @@
-/*
- * 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.netezza;
-
-import junit.framework.TestCase;
-
-import org.junit.Test;
-import org.mockito.Mockito;
-import org.teiid.cdk.unittest.FakeTranslationFactory;
-import org.teiid.dqp.internal.datamgr.FakeExecutionContextImpl;
-import org.teiid.language.Command;
-import org.teiid.translator.ExecutionContext;
-import org.teiid.translator.TranslatorException;
-import org.teiid.translator.jdbc.TranslatedCommand;
-import org.teiid.translator.jdbc.TranslationHelper;
-
-public class TestNetezzaTranslatorCapabilities extends TestCase {
-
- private static NetezzaExecutionFactory TRANSLATOR;
- private static ExecutionContext EMPTY_CONTEXT = new FakeExecutionContextImpl();
-
- static {
- try {
- TRANSLATOR = new NetezzaExecutionFactory();
- TRANSLATOR.start();
- } catch(TranslatorException e) {
- e.printStackTrace();
- }
- }
-
-
- private String getTestBQTVDB() {
- return TranslationHelper.BQT_VDB;
- }
-
- public void helpTestVisitor(String input, String expectedOutput) throws TranslatorException {
- // Convert from sql to objects
- Command obj = FakeTranslationFactory.getInstance().getBQTTranslationUtility().parseCommand(input);
-
- TranslatedCommand tc = new TranslatedCommand(Mockito.mock(ExecutionContext.class), TRANSLATOR);
- tc.translateCommand(obj);
-
-
- // Check stuff
- assertEquals("Did not get correct sql", expectedOutput, tc.getSql());
- }
-
-
- /////////BASIC TEST CASES FOR CAPABILITIES/////////////
- /////////////////////////////////////////////////
- @Test
- public void testRowLimit() throws Exception {
- String input = "select intkey from bqt1.smalla limit 100";
- String output = "SELECT SmallA.IntKey FROM SmallA LIMIT 100";
-
- helpTestVisitor(
- input,
- output);
-
- }
- @Test
- public void testSelectDistinct() throws Exception {
- String input = "select distinct intkey from bqt1.smalla limit 100";
- String output = "SELECT DISTINCT SmallA.IntKey FROM SmallA LIMIT 100";
-
- helpTestVisitor(
- input,
- output);
- }
- @Test
- public void testSelectExpression() throws Exception {
- String input = "select intkey, intkey + longnum / 2 as test from bqt1.smalla";
- String output = "SELECT SmallA.IntKey, (SmallA.IntKey + (SmallA.LongNum / 2)) AS test FROM SmallA";
-
- helpTestVisitor(
- input,
- output);
- }
-
- public void testBetweenCriteria() throws Exception {
- String input = "select intkey, intnum from bqt1.smalla where intnum BETWEEN 2 AND 10";
- String output = "SELECT SmallA.IntKey, SmallA.IntNum FROM SmallA WHERE SmallA.IntNum >= 2 AND SmallA.IntNum <= 10";
-
- helpTestVisitor(
- input,
- output);
- }
- public void testCompareCriteriaEquals() throws Exception {
- String input = "select intkey, intnum from bqt1.smalla where intnum = 10";
- String output = "SELECT SmallA.IntKey, SmallA.IntNum FROM SmallA WHERE SmallA.IntNum = 10";
-
- helpTestVisitor(
- input,
- output);
- }
- public void testCompareCriteriaOrdered() throws Exception {
- String input = "select intkey, intnum from bqt1.smalla where intnum < 10";
- String output = "SELECT SmallA.IntKey, SmallA.IntNum FROM SmallA WHERE SmallA.IntNum < 10";
-
- helpTestVisitor(
- input,
- output);
- }
- public void testLikeCriteria() throws Exception {
- String input = "select intkey, intnum from bqt1.smalla where stringkey like '4%'";
- String output = "SELECT SmallA.IntKey, SmallA.IntNum FROM SmallA WHERE SmallA.StringKey LIKE '4%'";
-
- helpTestVisitor(
- input,
- output);
- }
- public void testLikeWithEscapeCriteria() throws Exception {
- String input = "select intkey, intnum from bqt1.smalla where stringkey like '4\\%'";
- String output = "SELECT SmallA.IntKey, SmallA.IntNum FROM SmallA WHERE SmallA.StringKey LIKE '4\\%'";
-
- helpTestVisitor(
- input,
- output);
- }
-
- public void testInCriteria() throws Exception {
- String input = "select intkey, intnum from bqt1.smalla where stringkey IN ('10', '11', '12')";
- String output = "SELECT SmallA.IntKey, SmallA.IntNum FROM SmallA WHERE SmallA.StringKey IN ('10', '11', '12')";
-
- helpTestVisitor(
- input,
- output);
- }
- public void testInCriteriaSubQuery() throws Exception {
- String input = "select intkey, intnum from bqt1.smalla where stringkey IN (select stringkey from bqt1.smalla where intkey < 10)";
- String output = "SELECT SmallA.IntKey, SmallA.IntNum FROM SmallA WHERE SmallA.StringKey IN (SELECT SmallA.StringKey FROM SmallA WHERE SmallA.IntKey < 10)";
-
- helpTestVisitor(
- input,
- output);
- }
-
- public void testIsNullCriteria() throws Exception {
- String input = "select intkey, intnum from bqt1.smalla where intnum IS NULL";
- String output = "SELECT SmallA.IntKey, SmallA.IntNum FROM SmallA WHERE SmallA.IntNum IS NULL";
-
- helpTestVisitor(
- input,
- output);
- }
- public void testOrCriteria() throws Exception {
- String input = "select intkey, intnum from bqt1.smalla where intnum < 2 OR intnum > 10";
- String output = "SELECT SmallA.IntKey, SmallA.IntNum FROM SmallA WHERE SmallA.IntNum < 2 OR SmallA.IntNum > 10";
-
- helpTestVisitor(
- input,
- output);
- }
- @Test public void testIsNotNullCriteria() throws Exception {
- String input = "select intkey, intnum from bqt1.smalla where intnum IS NOT NULL";
- String output = "SELECT SmallA.IntKey, SmallA.IntNum FROM SmallA WHERE SmallA.IntNum IS NOT NULL";
-
- helpTestVisitor(
- input,
- output);
- }
-
- @Test public void testExistsCriteria() throws Exception {
- String input = "select intkey, intnum from bqt1.smalla where exists (select intkey from bqt1.smallb)";
- String output = "SELECT SmallA.IntKey, SmallA.IntNum FROM SmallA WHERE EXISTS (SELECT SmallB.IntKey FROM SmallB LIMIT 1)";
-
- helpTestVisitor(
- input,
- output);
- }
- @Test public void testHavingClauseCriteria() throws Exception {
- String input = "SELECT INTKEY FROM BQT1.SMALLA GROUP BY INTKEY HAVING INTKEY = (SELECT INTKEY FROM BQT1.SMALLA WHERE STRINGKEY = 20)";
- String output = "SELECT SmallA.IntKey FROM SmallA GROUP BY SmallA.IntKey HAVING SmallA.IntKey = (SELECT SmallA.IntKey FROM SmallA WHERE SmallA.StringKey = '20' LIMIT 2)";
-
- helpTestVisitor(
- input,
- output);
- }
-
- @Test public void testScalarSubQuery() throws Exception {
- String input = "select intkey, intnum from bqt1.smalla where intnum < (0.01 * (select sum(intnum) from bqt1.smalla ))";
- String output = "SELECT SmallA.IntKey, SmallA.IntNum FROM SmallA WHERE SmallA.IntNum < (0.010000000000000 * (SELECT SUM(SmallA.IntNum) FROM SmallA))";
-
- helpTestVisitor(
- input,
- output);
- }
-
- @Test public void testSimpleCaseExpression() throws Exception {
- String input = "SELECT stringnum, intnum, CASE BOOLEANVALUE WHEN 'true' then 'true' WHEN false THEN 'FALSE' ELSE 'GOOD' END FROM bqt1.smalla;";
- String output = "SELECT SmallA.StringNum, SmallA.IntNum, CASE WHEN SmallA.BooleanValue = 1 THEN 'true' WHEN SmallA.BooleanValue = 0 THEN 'FALSE' ELSE 'GOOD' END FROM SmallA";
-
- helpTestVisitor(
- input,
- output);
- }
-
- @Test public void testSearchedCaseExpression() throws Exception {
- String input = "SELECT AVG(CASE WHEN intnum > 10 THEN intnum ELSE intkey END) \"Average\" FROM bqt1.smalla";
- String output = "SELECT AVG(CASE WHEN SmallA.IntNum > 10 THEN SmallA.IntNum ELSE SmallA.IntKey END) AS Average FROM SmallA";
-
- helpTestVisitor(
- input,
- output);
- }
-
-// @Test public void testQuantifiedCompareSOMEorANY() throws Exception {
-// String input = "SELECT INTKEY, BYTENUM FROM BQT1.SmallA WHERE BYTENUM = ANY (SELECT BYTENUM FROM BQT1.SmallA WHERE BYTENUM >= '-108')";
-// String output = "SELECT SmallA.IntKey, SmallA.ByteNum FROM SmallA WHERE SmallA.ByteNum = SOME (SELECT SmallA.ByteNum FROM SmallA WHERE SmallA.ByteNum >= -108)";
-//
-// helpTestVisitor(
-// input,
-// output);
-// }
-
- @Test public void testQuantifiedCompareALL() throws Exception {
- String input = "SELECT INTKEY, STRINGKEY FROM BQT1.SMALLA WHERE STRINGKEY = ALL (SELECT STRINGKEY FROM BQT1.SMALLA WHERE INTKEY = 40)";
- String output = "SELECT SmallA.IntKey, SmallA.StringKey FROM SmallA WHERE SmallA.StringKey = ALL (SELECT SmallA.StringKey FROM SmallA WHERE SmallA.IntKey = 40)";
-
- helpTestVisitor(
- input,
- output);
- }
-
- @Test public void testSelfJoin() throws Exception {
- String input = "SELECT x.intnum, y.intkey FROM bqt1.smalla x, bqt1.smalla y WHERE x.stringnum = y.intnum;";
- String output = "SELECT x.IntNum, y.IntKey FROM SmallA AS x, SmallA AS y WHERE x.StringNum = cast(y.IntNum AS varchar(4000))";
-
- helpTestVisitor(
- input,
- output);
- }
-
- @Test public void testLimitWithNestedInlineView() throws Exception {
- String input = "select max(intkey), stringkey from (select intkey, stringkey from bqt1.smalla order by intkey limit 100) x group by stringkey";
- String output = "SELECT MAX(x.intkey), x.stringkey FROM (SELECT SmallA.IntKey, SmallA.StringKey FROM SmallA ORDER BY SmallA.IntKey LIMIT 100) AS x GROUP BY x.stringkey";
-
- helpTestVisitor( input, output);
- }
-
- @Test public void testAggregatesAndEnhancedNumeric() throws Exception {
- String input = "select count(*), min(intkey), max(intkey), sum(intkey), avg(intkey), count(intkey), STDDEV_SAMP(intkey), STDDEV_POP(intkey), VAR_SAMP(intkey), VAR_POP(intkey) from bqt1.smalla";
- String output = "SELECT COUNT(*), MIN(SmallA.IntKey), MAX(SmallA.IntKey), SUM(SmallA.IntKey), AVG(SmallA.IntKey), COUNT(SmallA.IntKey), STDDEV_SAMP(SmallA.IntKey), STDDEV_POP(SmallA.IntKey), VAR_SAMP(SmallA.IntKey), VAR_POP(SmallA.IntKey) FROM SmallA";
-
- helpTestVisitor( input, output);
- }
- @Test public void testAggregatesDistinct() throws Exception {
- String input = "select avg(DISTINCT intnum) from bqt1.smalla";
- String output = "SELECT AVG(DISTINCT SmallA.IntNum) FROM SmallA";
-
- helpTestVisitor( input, output);
- }
-
-
- @Test public void testExceptAsMinus() throws Exception {
- String input = "select intkey, intnum from bqt1.smalla except select intnum, intkey from bqt1.smallb";
- String output = "SELECT SmallA.IntKey, SmallA.IntNum FROM SmallA EXCEPT SELECT SmallB.IntNum, SmallB.IntKey FROM SmallB";
-
- helpTestVisitor( input, output);
- }
-
- @Test public void testUnionAsPlus() throws Exception {
- String input = "select intkey, intnum from bqt1.smalla union select intnum, intkey from bqt1.smallb";
- String output = "SELECT SmallA.IntKey, SmallA.IntNum FROM SmallA UNION SELECT SmallB.IntNum, SmallB.IntKey FROM SmallB";
-
- helpTestVisitor( input, output);
- }
- @Test public void testUnionAllAsPlus() throws Exception {
- String input = "select intkey, intnum from bqt1.smalla union all select intnum, intkey from bqt1.smallb";
- String output = "SELECT SmallA.IntKey, SmallA.IntNum FROM SmallA UNION ALL SELECT SmallB.IntNum, SmallB.IntKey FROM SmallB";
-
- helpTestVisitor( input, output);
- }
-
- @Test public void testUnionAllAsPlusWithAggregates() throws Exception {
- String input = "select intkey, Sum(intnum) from bqt1.smalla group by intkey union all select intnum, intkey from bqt1.smallb";
- String output = "SELECT SmallA.IntKey, SUM(SmallA.IntNum) FROM SmallA GROUP BY SmallA.IntKey UNION ALL SELECT SmallB.IntNum, SmallB.IntKey AS IntKey FROM SmallB";
-
- helpTestVisitor( input, output);
- }
-
-
- @Test public void testintersect() throws Exception {
- String input = "select intkey from bqt1.smalla where intkey < 20 INTERSECT select intkey from bqt1.smalla where intkey > 10";
- String output = "SELECT SmallA.IntKey FROM SmallA WHERE SmallA.IntKey < 20 INTERSECT SELECT SmallA.IntKey FROM SmallA WHERE SmallA.IntKey > 10";
-
-
- helpTestVisitor( input, output);
- }
-
-
- @Test public void testUnionOrderBy() throws Exception {
- String input = "(select intkey from bqt1.smalla) union select intnum from bqt1.smalla order by intkey";
- String output = "SELECT SmallA.IntKey FROM SmallA UNION SELECT SmallA.IntNum FROM SmallA ORDER BY intkey";
-
- helpTestVisitor( input, output);
-
- }
-
- @Test public void testIntersectOrderBy() throws Exception {
- String input = "(select intkey from bqt1.smalla) intersect select intnum from bqt1.smalla order by intkey";
- String output = "SELECT SmallA.IntKey FROM SmallA INTERSECT SELECT SmallA.IntNum FROM SmallA ORDER BY intkey";
-
- helpTestVisitor( input, output);
-
- }
-
- @Test public void testExceptOrderBy() throws Exception {
- String input = "(select intkey from bqt1.smalla) except select intnum from bqt1.smalla order by intkey";
- String output = "SELECT SmallA.IntKey FROM SmallA EXCEPT SELECT SmallA.IntNum FROM SmallA ORDER BY intkey";
-
- helpTestVisitor( input, output);
-
- }
-
-
- @Test public void testRowLimitOFFSET() throws Exception {
- String input = "select intkey from bqt1.smalla limit 20, 30";
- String output = "SELECT SmallA.IntKey FROM SmallA LIMIT 30 OFFSET 20";
-
- helpTestVisitor( input, output);
- }
-
-
- @Test public void testOrderByNullsFirstLast() throws Exception {
- String input = "select intkey, longnum from bqt1.smalla order by longnum NULLS LAST";
- String output = "SELECT SmallA.IntKey, SmallA.LongNum FROM SmallA ORDER BY SmallA.LongNum NULLS LAST";
-
- helpTestVisitor( input, output);
- }
-
- @Test public void testOrderByUnRelated() throws Exception {
- String input = "select intkey, longnum from bqt1.smalla order by floatnum";
- String output = "SELECT SmallA.IntKey, SmallA.LongNum FROM SmallA ORDER BY SmallA.FloatNum";
-
- helpTestVisitor( input, output);
- }
-
-
- @Test public void testInnerJoin() throws Exception {
- String input = "SELECT BQT1.SmallA.IntKey FROM BQT1.SmallA, BQT2.SmallB WHERE BQT1.SmallA.IntKey = BQT2.SmallB.IntKey AND BQT1.SmallA.IntKey >= 0 AND BQT2.SmallB.IntKey >= 0 ORDER BY BQT1.SmallA.IntKey";
- String output = "SELECT SmallA.IntKey FROM SmallA, SmallB WHERE SmallA.IntKey = SmallB.IntKey AND SmallA.IntKey >= 0 AND SmallB.IntKey >= 0 ORDER BY SmallA.IntKey";
-
- helpTestVisitor( input, output);
- }
-
-
- @Test public void testOuterJoin() throws Exception {
- String input = "SELECT BQT1.SmallA.IntKey FROM BQT1.SmallA, BQT2.SmallB WHERE BQT1.SmallA.IntKey = BQT2.SmallB.IntKey AND BQT1.SmallA.IntKey >= 0 AND BQT2.SmallB.IntKey >= 0 ORDER BY BQT1.SmallA.IntKey";
- String output = "SELECT SmallA.IntKey FROM SmallA, SmallB WHERE SmallA.IntKey = SmallB.IntKey AND SmallA.IntKey >= 0 AND SmallB.IntKey >= 0 ORDER BY SmallA.IntKey";
-
- helpTestVisitor( input, output);
- }
-
- @Test public void testFullOuterJoin() throws Exception {
- String input = "SELECT BQT1.SmallA.IntNum, BQT2.SmallB.IntNum FROM BQT1.SmallA FULL OUTER JOIN BQT2.SmallB ON BQT1.SmallA.IntNum = BQT2.SmallB.IntNum ORDER BY BQT1.SmallA.IntNum";
- String output = "SELECT SmallA.IntNum, SmallB.IntNum FROM SmallA FULL OUTER JOIN SmallB ON SmallA.IntNum = SmallB.IntNum ORDER BY SmallA.IntNum";
-
- helpTestVisitor( input, output);
- }
-
- @Test public void testRightOuterJoin() throws Exception {
- String input = "SELECT BQT1.SmallA.IntNum, BQT2.SmallB.IntNum FROM BQT1.SmallA RIGHT OUTER JOIN BQT2.SmallB ON BQT1.SmallA.IntNum = BQT2.SmallB.IntNum ORDER BY BQT2.SmallB.IntNum";
- String output= "SELECT SmallA.IntNum, SmallB.IntNum FROM SmallB LEFT OUTER JOIN SmallA ON SmallA.IntNum = SmallB.IntNum ORDER BY SmallB.IntNum";
-
- helpTestVisitor( input, output);
- }
- @Test public void testLeftOuterJoin() throws Exception {
- String input = "SELECT BQT1.SmallA.IntNum, BQT2.SmallB.IntNum FROM BQT1.SmallA LEFT OUTER JOIN BQT2.SmallB ON BQT1.SmallA.IntNum = BQT2.SmallB.IntNum ORDER BY BQT1.SmallA.IntNum";
- String output = "SELECT SmallA.IntNum, SmallB.IntNum FROM SmallA LEFT OUTER JOIN SmallB ON SmallA.IntNum = SmallB.IntNum ORDER BY SmallA.IntNum";
-
- helpTestVisitor( input, output);
- }
-
-}
Copied: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorCapabilities.java (from rev 3365, branches/7.4.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorCapabilities.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorCapabilities.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorCapabilities.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -0,0 +1,394 @@
+/*
+ * 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.netezza;
+
+import junit.framework.TestCase;
+
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.teiid.cdk.unittest.FakeTranslationFactory;
+import org.teiid.dqp.internal.datamgr.FakeExecutionContextImpl;
+import org.teiid.language.Command;
+import org.teiid.translator.ExecutionContext;
+import org.teiid.translator.TranslatorException;
+import org.teiid.translator.jdbc.TranslatedCommand;
+import org.teiid.translator.jdbc.TranslationHelper;
+
+public class TestNetezzaTranslatorCapabilities extends TestCase {
+
+ private static NetezzaExecutionFactory TRANSLATOR;
+ private static ExecutionContext EMPTY_CONTEXT = new FakeExecutionContextImpl();
+
+ static {
+ try {
+ TRANSLATOR = new NetezzaExecutionFactory();
+ TRANSLATOR.start();
+ } catch(TranslatorException e) {
+ e.printStackTrace();
+ }
+ }
+
+
+ private String getTestBQTVDB() {
+ return TranslationHelper.BQT_VDB;
+ }
+
+ public void helpTestVisitor(String input, String expectedOutput) throws TranslatorException {
+ // Convert from sql to objects
+ Command obj = FakeTranslationFactory.getInstance().getBQTTranslationUtility().parseCommand(input);
+
+ TranslatedCommand tc = new TranslatedCommand(Mockito.mock(ExecutionContext.class), TRANSLATOR);
+ tc.translateCommand(obj);
+
+
+ // Check stuff
+ assertEquals("Did not get correct sql", expectedOutput, tc.getSql());
+ }
+
+
+ /////////BASIC TEST CASES FOR CAPABILITIES/////////////
+ /////////////////////////////////////////////////
+ @Test
+ public void testRowLimit() throws Exception {
+ String input = "select intkey from bqt1.smalla limit 100";
+ String output = "SELECT SmallA.IntKey FROM SmallA LIMIT 100";
+
+ helpTestVisitor(
+ input,
+ output);
+
+ }
+ @Test
+ public void testSelectDistinct() throws Exception {
+ String input = "select distinct intkey from bqt1.smalla limit 100";
+ String output = "SELECT DISTINCT SmallA.IntKey FROM SmallA LIMIT 100";
+
+ helpTestVisitor(
+ input,
+ output);
+ }
+ @Test
+ public void testSelectExpression() throws Exception {
+ String input = "select intkey, intkey + longnum / 2 as test from bqt1.smalla";
+ String output = "SELECT SmallA.IntKey, (SmallA.IntKey + (SmallA.LongNum / 2)) AS test FROM SmallA";
+
+ helpTestVisitor(
+ input,
+ output);
+ }
+
+ public void testBetweenCriteria() throws Exception {
+ String input = "select intkey, intnum from bqt1.smalla where intnum BETWEEN 2 AND 10";
+ String output = "SELECT SmallA.IntKey, SmallA.IntNum FROM SmallA WHERE SmallA.IntNum >= 2 AND SmallA.IntNum <= 10";
+
+ helpTestVisitor(
+ input,
+ output);
+ }
+ public void testCompareCriteriaEquals() throws Exception {
+ String input = "select intkey, intnum from bqt1.smalla where intnum = 10";
+ String output = "SELECT SmallA.IntKey, SmallA.IntNum FROM SmallA WHERE SmallA.IntNum = 10";
+
+ helpTestVisitor(
+ input,
+ output);
+ }
+ public void testCompareCriteriaOrdered() throws Exception {
+ String input = "select intkey, intnum from bqt1.smalla where intnum < 10";
+ String output = "SELECT SmallA.IntKey, SmallA.IntNum FROM SmallA WHERE SmallA.IntNum < 10";
+
+ helpTestVisitor(
+ input,
+ output);
+ }
+ public void testLikeCriteria() throws Exception {
+ String input = "select intkey, intnum from bqt1.smalla where stringkey like '4%'";
+ String output = "SELECT SmallA.IntKey, SmallA.IntNum FROM SmallA WHERE SmallA.StringKey LIKE '4%'";
+
+ helpTestVisitor(
+ input,
+ output);
+ }
+ public void testLikeWithEscapeCriteria() throws Exception {
+ String input = "select intkey, intnum from bqt1.smalla where stringkey like '4\\%'";
+ String output = "SELECT SmallA.IntKey, SmallA.IntNum FROM SmallA WHERE SmallA.StringKey LIKE '4\\%'";
+
+ helpTestVisitor(
+ input,
+ output);
+ }
+
+ public void testInCriteria() throws Exception {
+ String input = "select intkey, intnum from bqt1.smalla where stringkey IN ('10', '11', '12')";
+ String output = "SELECT SmallA.IntKey, SmallA.IntNum FROM SmallA WHERE SmallA.StringKey IN ('10', '11', '12')";
+
+ helpTestVisitor(
+ input,
+ output);
+ }
+ public void testInCriteriaSubQuery() throws Exception {
+ String input = "select intkey, intnum from bqt1.smalla where stringkey IN (select stringkey from bqt1.smalla where intkey < 10)";
+ String output = "SELECT SmallA.IntKey, SmallA.IntNum FROM SmallA WHERE SmallA.StringKey IN (SELECT SmallA.StringKey FROM SmallA WHERE SmallA.IntKey < 10)";
+
+ helpTestVisitor(
+ input,
+ output);
+ }
+
+ public void testIsNullCriteria() throws Exception {
+ String input = "select intkey, intnum from bqt1.smalla where intnum IS NULL";
+ String output = "SELECT SmallA.IntKey, SmallA.IntNum FROM SmallA WHERE SmallA.IntNum IS NULL";
+
+ helpTestVisitor(
+ input,
+ output);
+ }
+ public void testOrCriteria() throws Exception {
+ String input = "select intkey, intnum from bqt1.smalla where intnum < 2 OR intnum > 10";
+ String output = "SELECT SmallA.IntKey, SmallA.IntNum FROM SmallA WHERE SmallA.IntNum < 2 OR SmallA.IntNum > 10";
+
+ helpTestVisitor(
+ input,
+ output);
+ }
+ @Test public void testIsNotNullCriteria() throws Exception {
+ String input = "select intkey, intnum from bqt1.smalla where intnum IS NOT NULL";
+ String output = "SELECT SmallA.IntKey, SmallA.IntNum FROM SmallA WHERE SmallA.IntNum IS NOT NULL";
+
+ helpTestVisitor(
+ input,
+ output);
+ }
+
+ @Test public void testExistsCriteria() throws Exception {
+ String input = "select intkey, intnum from bqt1.smalla where exists (select intkey from bqt1.smallb)";
+ String output = "SELECT SmallA.IntKey, SmallA.IntNum FROM SmallA WHERE EXISTS (SELECT SmallB.IntKey FROM SmallB LIMIT 1)";
+
+ helpTestVisitor(
+ input,
+ output);
+ }
+ @Test public void testHavingClauseCriteria() throws Exception {
+ String input = "SELECT INTKEY FROM BQT1.SMALLA GROUP BY INTKEY HAVING INTKEY = (SELECT INTKEY FROM BQT1.SMALLA WHERE STRINGKEY = 20)";
+ String output = "SELECT SmallA.IntKey FROM SmallA GROUP BY SmallA.IntKey HAVING SmallA.IntKey = (SELECT SmallA.IntKey FROM SmallA WHERE SmallA.StringKey = '20' LIMIT 2)";
+
+ helpTestVisitor(
+ input,
+ output);
+ }
+
+ @Test public void testScalarSubQuery() throws Exception {
+ String input = "select intkey, intnum from bqt1.smalla where intnum < (0.01 * (select sum(intnum) from bqt1.smalla ))";
+ String output = "SELECT SmallA.IntKey, SmallA.IntNum FROM SmallA WHERE SmallA.IntNum < (0.010000000000000 * (SELECT SUM(SmallA.IntNum) FROM SmallA))";
+
+ helpTestVisitor(
+ input,
+ output);
+ }
+
+ @Test public void testSimpleCaseExpression() throws Exception {
+ String input = "SELECT stringnum, intnum, CASE BOOLEANVALUE WHEN 'true' then 'true' WHEN false THEN 'FALSE' ELSE 'GOOD' END FROM bqt1.smalla;";
+ String output = "SELECT SmallA.StringNum, SmallA.IntNum, CASE WHEN SmallA.BooleanValue = 1 THEN 'true' WHEN SmallA.BooleanValue = 0 THEN 'FALSE' ELSE 'GOOD' END FROM SmallA";
+
+ helpTestVisitor(
+ input,
+ output);
+ }
+
+ @Test public void testSearchedCaseExpression() throws Exception {
+ String input = "SELECT AVG(CASE WHEN intnum > 10 THEN intnum ELSE intkey END) \"Average\" FROM bqt1.smalla";
+ String output = "SELECT AVG(CASE WHEN SmallA.IntNum > 10 THEN SmallA.IntNum ELSE SmallA.IntKey END) AS Average FROM SmallA";
+
+ helpTestVisitor(
+ input,
+ output);
+ }
+
+// @Test public void testQuantifiedCompareSOMEorANY() throws Exception {
+// String input = "SELECT INTKEY, BYTENUM FROM BQT1.SmallA WHERE BYTENUM = ANY (SELECT BYTENUM FROM BQT1.SmallA WHERE BYTENUM >= '-108')";
+// String output = "SELECT SmallA.IntKey, SmallA.ByteNum FROM SmallA WHERE SmallA.ByteNum = SOME (SELECT SmallA.ByteNum FROM SmallA WHERE SmallA.ByteNum >= -108)";
+//
+// helpTestVisitor(
+// input,
+// output);
+// }
+
+ @Test public void testQuantifiedCompareALL() throws Exception {
+ String input = "SELECT INTKEY, STRINGKEY FROM BQT1.SMALLA WHERE STRINGKEY = ALL (SELECT STRINGKEY FROM BQT1.SMALLA WHERE INTKEY = 40)";
+ String output = "SELECT SmallA.IntKey, SmallA.StringKey FROM SmallA WHERE SmallA.StringKey = ALL (SELECT SmallA.StringKey FROM SmallA WHERE SmallA.IntKey = 40)";
+
+ helpTestVisitor(
+ input,
+ output);
+ }
+
+ @Test public void testSelfJoin() throws Exception {
+ String input = "SELECT x.intnum, y.intkey FROM bqt1.smalla x, bqt1.smalla y WHERE x.stringnum = y.intnum;";
+ String output = "SELECT x.IntNum, y.IntKey FROM SmallA AS x, SmallA AS y WHERE x.StringNum = cast(y.IntNum AS varchar(4000))";
+
+ helpTestVisitor(
+ input,
+ output);
+ }
+
+ @Test public void testLimitWithNestedInlineView() throws Exception {
+ String input = "select max(intkey), stringkey from (select intkey, stringkey from bqt1.smalla order by intkey limit 100) x group by stringkey";
+ String output = "SELECT MAX(x.intkey), x.stringkey FROM (SELECT SmallA.IntKey, SmallA.StringKey FROM SmallA ORDER BY SmallA.IntKey LIMIT 100) AS x GROUP BY x.stringkey";
+
+ helpTestVisitor( input, output);
+ }
+
+ @Test public void testAggregatesAndEnhancedNumeric() throws Exception {
+ String input = "select count(*), min(intkey), max(intkey), sum(intkey), avg(intkey), count(intkey), STDDEV_SAMP(intkey), STDDEV_POP(intkey), VAR_SAMP(intkey), VAR_POP(intkey) from bqt1.smalla";
+ String output = "SELECT COUNT(*), MIN(SmallA.IntKey), MAX(SmallA.IntKey), SUM(SmallA.IntKey), AVG(SmallA.IntKey), COUNT(SmallA.IntKey), STDDEV_SAMP(SmallA.IntKey), STDDEV_POP(SmallA.IntKey), VAR_SAMP(SmallA.IntKey), VAR_POP(SmallA.IntKey) FROM SmallA";
+
+ helpTestVisitor( input, output);
+ }
+ @Test public void testAggregatesDistinct() throws Exception {
+ String input = "select avg(DISTINCT intnum) from bqt1.smalla";
+ String output = "SELECT AVG(DISTINCT SmallA.IntNum) FROM SmallA";
+
+ helpTestVisitor( input, output);
+ }
+
+
+ @Test public void testExceptAsMinus() throws Exception {
+ String input = "select intkey, intnum from bqt1.smalla except select intnum, intkey from bqt1.smallb";
+ String output = "SELECT SmallA.IntKey, SmallA.IntNum FROM SmallA EXCEPT SELECT SmallB.IntNum, SmallB.IntKey FROM SmallB";
+
+ helpTestVisitor( input, output);
+ }
+
+ @Test public void testUnionAsPlus() throws Exception {
+ String input = "select intkey, intnum from bqt1.smalla union select intnum, intkey from bqt1.smallb";
+ String output = "SELECT SmallA.IntKey, SmallA.IntNum FROM SmallA UNION SELECT SmallB.IntNum, SmallB.IntKey FROM SmallB";
+
+ helpTestVisitor( input, output);
+ }
+ @Test public void testUnionAllAsPlus() throws Exception {
+ String input = "select intkey, intnum from bqt1.smalla union all select intnum, intkey from bqt1.smallb";
+ String output = "SELECT SmallA.IntKey, SmallA.IntNum FROM SmallA UNION ALL SELECT SmallB.IntNum, SmallB.IntKey FROM SmallB";
+
+ helpTestVisitor( input, output);
+ }
+
+ @Test public void testUnionAllAsPlusWithAggregates() throws Exception {
+ String input = "select intkey, Sum(intnum) from bqt1.smalla group by intkey union all select intnum, intkey from bqt1.smallb";
+ String output = "SELECT SmallA.IntKey, SUM(SmallA.IntNum) FROM SmallA GROUP BY SmallA.IntKey UNION ALL SELECT SmallB.IntNum, SmallB.IntKey AS IntKey FROM SmallB";
+
+ helpTestVisitor( input, output);
+ }
+
+
+ @Test public void testintersect() throws Exception {
+ String input = "select intkey from bqt1.smalla where intkey < 20 INTERSECT select intkey from bqt1.smalla where intkey > 10";
+ String output = "SELECT SmallA.IntKey FROM SmallA WHERE SmallA.IntKey < 20 INTERSECT SELECT SmallA.IntKey FROM SmallA WHERE SmallA.IntKey > 10";
+
+
+ helpTestVisitor( input, output);
+ }
+
+
+ @Test public void testUnionOrderBy() throws Exception {
+ String input = "(select intkey from bqt1.smalla) union select intnum from bqt1.smalla order by intkey";
+ String output = "SELECT SmallA.IntKey FROM SmallA UNION SELECT SmallA.IntNum FROM SmallA ORDER BY intkey";
+
+ helpTestVisitor( input, output);
+
+ }
+
+ @Test public void testIntersectOrderBy() throws Exception {
+ String input = "(select intkey from bqt1.smalla) intersect select intnum from bqt1.smalla order by intkey";
+ String output = "SELECT SmallA.IntKey FROM SmallA INTERSECT SELECT SmallA.IntNum FROM SmallA ORDER BY intkey";
+
+ helpTestVisitor( input, output);
+
+ }
+
+ @Test public void testExceptOrderBy() throws Exception {
+ String input = "(select intkey from bqt1.smalla) except select intnum from bqt1.smalla order by intkey";
+ String output = "SELECT SmallA.IntKey FROM SmallA EXCEPT SELECT SmallA.IntNum FROM SmallA ORDER BY intkey";
+
+ helpTestVisitor( input, output);
+
+ }
+
+
+ @Test public void testRowLimitOFFSET() throws Exception {
+ String input = "select intkey from bqt1.smalla limit 20, 30";
+ String output = "SELECT SmallA.IntKey FROM SmallA LIMIT 30 OFFSET 20";
+
+ helpTestVisitor( input, output);
+ }
+
+
+ @Test public void testOrderByNullsFirstLast() throws Exception {
+ String input = "select intkey, longnum from bqt1.smalla order by longnum NULLS LAST";
+ String output = "SELECT SmallA.IntKey, SmallA.LongNum FROM SmallA ORDER BY SmallA.LongNum NULLS LAST";
+
+ helpTestVisitor( input, output);
+ }
+
+ @Test public void testOrderByUnRelated() throws Exception {
+ String input = "select intkey, longnum from bqt1.smalla order by floatnum";
+ String output = "SELECT SmallA.IntKey, SmallA.LongNum FROM SmallA ORDER BY SmallA.FloatNum";
+
+ helpTestVisitor( input, output);
+ }
+
+
+ @Test public void testInnerJoin() throws Exception {
+ String input = "SELECT BQT1.SmallA.IntKey FROM BQT1.SmallA, BQT2.SmallB WHERE BQT1.SmallA.IntKey = BQT2.SmallB.IntKey AND BQT1.SmallA.IntKey >= 0 AND BQT2.SmallB.IntKey >= 0 ORDER BY BQT1.SmallA.IntKey";
+ String output = "SELECT SmallA.IntKey FROM SmallA, SmallB WHERE SmallA.IntKey = SmallB.IntKey AND SmallA.IntKey >= 0 AND SmallB.IntKey >= 0 ORDER BY SmallA.IntKey";
+
+ helpTestVisitor( input, output);
+ }
+
+
+ @Test public void testOuterJoin() throws Exception {
+ String input = "SELECT BQT1.SmallA.IntKey FROM BQT1.SmallA, BQT2.SmallB WHERE BQT1.SmallA.IntKey = BQT2.SmallB.IntKey AND BQT1.SmallA.IntKey >= 0 AND BQT2.SmallB.IntKey >= 0 ORDER BY BQT1.SmallA.IntKey";
+ String output = "SELECT SmallA.IntKey FROM SmallA, SmallB WHERE SmallA.IntKey = SmallB.IntKey AND SmallA.IntKey >= 0 AND SmallB.IntKey >= 0 ORDER BY SmallA.IntKey";
+
+ helpTestVisitor( input, output);
+ }
+
+ @Test public void testFullOuterJoin() throws Exception {
+ String input = "SELECT BQT1.SmallA.IntNum, BQT2.SmallB.IntNum FROM BQT1.SmallA FULL OUTER JOIN BQT2.SmallB ON BQT1.SmallA.IntNum = BQT2.SmallB.IntNum ORDER BY BQT1.SmallA.IntNum";
+ String output = "SELECT SmallA.IntNum, SmallB.IntNum FROM SmallA FULL OUTER JOIN SmallB ON SmallA.IntNum = SmallB.IntNum ORDER BY SmallA.IntNum";
+
+ helpTestVisitor( input, output);
+ }
+
+ @Test public void testRightOuterJoin() throws Exception {
+ String input = "SELECT BQT1.SmallA.IntNum, BQT2.SmallB.IntNum FROM BQT1.SmallA RIGHT OUTER JOIN BQT2.SmallB ON BQT1.SmallA.IntNum = BQT2.SmallB.IntNum ORDER BY BQT2.SmallB.IntNum";
+ String output= "SELECT SmallA.IntNum, SmallB.IntNum FROM SmallB LEFT OUTER JOIN SmallA ON SmallA.IntNum = SmallB.IntNum ORDER BY SmallB.IntNum";
+
+ helpTestVisitor( input, output);
+ }
+ @Test public void testLeftOuterJoin() throws Exception {
+ String input = "SELECT BQT1.SmallA.IntNum, BQT2.SmallB.IntNum FROM BQT1.SmallA LEFT OUTER JOIN BQT2.SmallB ON BQT1.SmallA.IntNum = BQT2.SmallB.IntNum ORDER BY BQT1.SmallA.IntNum";
+ String output = "SELECT SmallA.IntNum, SmallB.IntNum FROM SmallA LEFT OUTER JOIN SmallB ON SmallA.IntNum = SmallB.IntNum ORDER BY SmallA.IntNum";
+
+ helpTestVisitor( input, output);
+ }
+
+}
Deleted: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorDatetimeConversion.java
===================================================================
--- branches/7.4.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorDatetimeConversion.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorDatetimeConversion.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -1,141 +0,0 @@
-/*
- * 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.netezza;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.Arrays;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.teiid.language.Expression;
-import org.teiid.language.Function;
-import org.teiid.language.LanguageFactory;
-import org.teiid.translator.TranslatorException;
-import org.teiid.translator.TypeFacility;
-import org.teiid.translator.jdbc.SQLConversionVisitor;
-import org.teiid.translator.jdbc.TranslationHelper;
-
-/**
- */
-public class TestNetezzaTranslatorDatetimeConversion {
-
- private static NetezzaExecutionFactory TRANSLATOR;
- private static final LanguageFactory LANG_FACTORY = new LanguageFactory();
-
- @BeforeClass public static void oneTimeSetup() throws TranslatorException {
- TRANSLATOR = new NetezzaExecutionFactory();
- TRANSLATOR.setUseBindVariables(false);
- TRANSLATOR.start();
-
-
- }
-
- /////////////////UTILLITY FUNCTIONS/////////
- ////////////////////////////////////////////
-
- private String getTestVDB() {
- //return TranslationHelper.NETEZZA_VDB;
- return TranslationHelper.PARTS_VDB;
- }
-
- private String getTestBQTVDB() {
- return TranslationHelper.BQT_VDB;
- }
-
- public void helpTest(Expression srcExpression, String tgtType, String expectedExpression) throws Exception {
- Function func = LANG_FACTORY.createFunction("convert",
- Arrays.asList( srcExpression,LANG_FACTORY.createLiteral(tgtType, String.class)),TypeFacility.getDataTypeClass(tgtType));
-
- assertEquals("Error converting from " + srcExpression.getType() + " to " + tgtType,
- expectedExpression, helpGetString(func));
- }
- public String helpGetString(Expression expr) throws Exception {
- SQLConversionVisitor sqlVisitor = TRANSLATOR.getSQLConversionVisitor();
- sqlVisitor.append(expr);
-
- return sqlVisitor.toString();
- }
-
-
- ///////////////DATE/TIME CONVERSION TESTCASES///////
- ////////////////////////////////////////////////////
-
- @Test public void testdayofmonth() throws Exception {
- String input = "SELECT dayofmonth(datevalue) FROM BQT1.SMALLA";
- String output = "SELECT extract(DAY from SmallA.DateValue) FROM SmallA";
-
- TranslationHelper.helpTestVisitor(getTestBQTVDB(), input, output, TRANSLATOR);
- }
-
-
- ///BEGIN--FROM TIMESTAMP->DATE, TIME, STRING////////
- @Test public void testTimestampToDate() throws Exception {
- String input = "SELECT convert(convert(TIMESTAMPVALUE, date), string) FROM BQT1.SMALLA";
- String output = "SELECT cast(cast(SmallA.TimestampValue AS DATE) AS varchar(4000)) FROM SmallA";
-
- TranslationHelper.helpTestVisitor(getTestBQTVDB(), input, output, TRANSLATOR);
- }
- @Test public void testTimestampToTime() throws Exception {
- String input = "SELECT convert(convert(TIMESTAMPVALUE, time), string) FROM BQT1.SMALLA";
- String output = "SELECT cast(cast(SmallA.TimestampValue AS TIME) AS varchar(4000)) FROM SmallA";
-
- TranslationHelper.helpTestVisitor(getTestBQTVDB(), input, output, TRANSLATOR);
- }
-
- @Test public void testTimestampToString() throws Exception {
- String input = "SELECT convert(timestampvalue, string) FROM BQT1.SMALLA";
- String output = "SELECT to_char(SmallA.TimestampValue, 'YYYY-MM-DD HH24:MI:SS.MS') FROM SmallA";
-
- TranslationHelper.helpTestVisitor(getTestBQTVDB(), input, output, TRANSLATOR);
- }
- ///END--FROM TIMESTAMP->DATE, TIME, STRING////////
-
- ///BEGIN--FROM DATE->TIMESTAMP////////
- @Test public void testDateToTimestamp() throws Exception {
- String input = "SELECT convert(convert(datevalue, timestamp), string) FROM BQT1.SMALLA";
- String output = "SELECT to_char(cast(SmallA.DateValue AS TIMESTAMP), 'YYYY-MM-DD HH24:MI:SS.MS') FROM SmallA";
-
- TranslationHelper.helpTestVisitor(getTestBQTVDB(), input, output, TRANSLATOR);
- }
- ///END--FROM DATE->TIMESTAMP////////
-
- ///BEGIN--FROM TIME->TIMESTAMP////////
- @Test public void testTimeToTimestamp() throws Exception {
- String input = "SELECT convert(convert(TIMEVALUE, timestamp), string) FROM BQT1.SMALLA";
- //String output = "SELECT to_char(cast(SmallA.TimeValue AS timestamp), 'YYYY-MM-DD HH24:MI:SS.FF') FROM SmallA";
- String output = "SELECT to_char(SmallA.TimeValue, 'YYYY-MM-DD HH24:MI:SS.MS') FROM SmallA";
-
- TranslationHelper.helpTestVisitor(getTestBQTVDB(), input, output, TRANSLATOR);
- }
- ///END--FROM TIME->TIMESTAMP////////
-
-
-// @Test public void testTimestampToTime() throws Exception {
-// helpTest(LANG_FACTORY.createLiteral(TimestampUtil.createTimestamp(111, 4, 5, 9, 16, 34, 220000000), Timestamp.class), "TIME", "cast(cast('2011-05-05 09:16:34.22' AS TIMESTAMP(6)) AS TIME)");
-// }
-
-
-
-
-}
Copied: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorDatetimeConversion.java (from rev 3365, branches/7.4.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorDatetimeConversion.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorDatetimeConversion.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorDatetimeConversion.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -0,0 +1,141 @@
+/*
+ * 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.netezza;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.Arrays;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.teiid.language.Expression;
+import org.teiid.language.Function;
+import org.teiid.language.LanguageFactory;
+import org.teiid.translator.TranslatorException;
+import org.teiid.translator.TypeFacility;
+import org.teiid.translator.jdbc.SQLConversionVisitor;
+import org.teiid.translator.jdbc.TranslationHelper;
+
+/**
+ */
+public class TestNetezzaTranslatorDatetimeConversion {
+
+ private static NetezzaExecutionFactory TRANSLATOR;
+ private static final LanguageFactory LANG_FACTORY = new LanguageFactory();
+
+ @BeforeClass public static void oneTimeSetup() throws TranslatorException {
+ TRANSLATOR = new NetezzaExecutionFactory();
+ TRANSLATOR.setUseBindVariables(false);
+ TRANSLATOR.start();
+
+
+ }
+
+ /////////////////UTILLITY FUNCTIONS/////////
+ ////////////////////////////////////////////
+
+ private String getTestVDB() {
+ //return TranslationHelper.NETEZZA_VDB;
+ return TranslationHelper.PARTS_VDB;
+ }
+
+ private String getTestBQTVDB() {
+ return TranslationHelper.BQT_VDB;
+ }
+
+ public void helpTest(Expression srcExpression, String tgtType, String expectedExpression) throws Exception {
+ Function func = LANG_FACTORY.createFunction("convert",
+ Arrays.asList( srcExpression,LANG_FACTORY.createLiteral(tgtType, String.class)),TypeFacility.getDataTypeClass(tgtType));
+
+ assertEquals("Error converting from " + srcExpression.getType() + " to " + tgtType,
+ expectedExpression, helpGetString(func));
+ }
+ public String helpGetString(Expression expr) throws Exception {
+ SQLConversionVisitor sqlVisitor = TRANSLATOR.getSQLConversionVisitor();
+ sqlVisitor.append(expr);
+
+ return sqlVisitor.toString();
+ }
+
+
+ ///////////////DATE/TIME CONVERSION TESTCASES///////
+ ////////////////////////////////////////////////////
+
+ @Test public void testdayofmonth() throws Exception {
+ String input = "SELECT dayofmonth(datevalue) FROM BQT1.SMALLA";
+ String output = "SELECT extract(DAY from SmallA.DateValue) FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(getTestBQTVDB(), input, output, TRANSLATOR);
+ }
+
+
+ ///BEGIN--FROM TIMESTAMP->DATE, TIME, STRING////////
+ @Test public void testTimestampToDate() throws Exception {
+ String input = "SELECT convert(convert(TIMESTAMPVALUE, date), string) FROM BQT1.SMALLA";
+ String output = "SELECT cast(cast(SmallA.TimestampValue AS DATE) AS varchar(4000)) FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(getTestBQTVDB(), input, output, TRANSLATOR);
+ }
+ @Test public void testTimestampToTime() throws Exception {
+ String input = "SELECT convert(convert(TIMESTAMPVALUE, time), string) FROM BQT1.SMALLA";
+ String output = "SELECT cast(cast(SmallA.TimestampValue AS TIME) AS varchar(4000)) FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(getTestBQTVDB(), input, output, TRANSLATOR);
+ }
+
+ @Test public void testTimestampToString() throws Exception {
+ String input = "SELECT convert(timestampvalue, string) FROM BQT1.SMALLA";
+ String output = "SELECT to_char(SmallA.TimestampValue, 'YYYY-MM-DD HH24:MI:SS.MS') FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(getTestBQTVDB(), input, output, TRANSLATOR);
+ }
+ ///END--FROM TIMESTAMP->DATE, TIME, STRING////////
+
+ ///BEGIN--FROM DATE->TIMESTAMP////////
+ @Test public void testDateToTimestamp() throws Exception {
+ String input = "SELECT convert(convert(datevalue, timestamp), string) FROM BQT1.SMALLA";
+ String output = "SELECT to_char(cast(SmallA.DateValue AS TIMESTAMP), 'YYYY-MM-DD HH24:MI:SS.MS') FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(getTestBQTVDB(), input, output, TRANSLATOR);
+ }
+ ///END--FROM DATE->TIMESTAMP////////
+
+ ///BEGIN--FROM TIME->TIMESTAMP////////
+ @Test public void testTimeToTimestamp() throws Exception {
+ String input = "SELECT convert(convert(TIMEVALUE, timestamp), string) FROM BQT1.SMALLA";
+ //String output = "SELECT to_char(cast(SmallA.TimeValue AS timestamp), 'YYYY-MM-DD HH24:MI:SS.FF') FROM SmallA";
+ String output = "SELECT to_char(SmallA.TimeValue, 'YYYY-MM-DD HH24:MI:SS.MS') FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(getTestBQTVDB(), input, output, TRANSLATOR);
+ }
+ ///END--FROM TIME->TIMESTAMP////////
+
+
+// @Test public void testTimestampToTime() throws Exception {
+// helpTest(LANG_FACTORY.createLiteral(TimestampUtil.createTimestamp(111, 4, 5, 9, 16, 34, 220000000), Timestamp.class), "TIME", "cast(cast('2011-05-05 09:16:34.22' AS TIMESTAMP(6)) AS TIME)");
+// }
+
+
+
+
+}
Deleted: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorSourceSystemFunctions.java
===================================================================
--- branches/7.4.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorSourceSystemFunctions.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorSourceSystemFunctions.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -1,243 +0,0 @@
-/*
- * 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.netezza;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.teiid.language.LanguageFactory;
-import org.teiid.translator.TranslatorException;
-import org.teiid.translator.jdbc.TranslationHelper;
-
-/**
- */
-public class TestNetezzaTranslatorSourceSystemFunctions {
-
- private static NetezzaExecutionFactory TRANSLATOR;
- private static final LanguageFactory LANG_FACTORY = new LanguageFactory();
-
- @BeforeClass public static void oneTimeSetup() throws TranslatorException {
- TRANSLATOR = new NetezzaExecutionFactory();
- TRANSLATOR.setUseBindVariables(false);
- TRANSLATOR.start();
-
-
- }
-
-
- /////////////////UTILLITY FUNCTIONS/////////
- ////////////////////////////////////////////
-
-
- private String getTestBQTVDB() {
- return TranslationHelper.BQT_VDB;
- }
-
-
- /////SOURCESYSTEM FUNCTION TESTCASES//////////////
- ///////////////////////////////////////////////
-
-
- //////////////////BEGIN---STRING FUNCTIONS TESTCASES///////////////////
-
- @Test
- public void testLcaseUcase() throws Exception {
- String input = "select lcase(StringKey), ucase(StringKey) FROM BQT1.SmallA";
- String output = "SELECT lower(SmallA.StringKey), upper(SmallA.StringKey) FROM SmallA";
-
- TranslationHelper.helpTestVisitor(getTestBQTVDB(), input, output,TRANSLATOR);
- }
- @Test public void testPad() throws Exception {
- String input = "select lpad(smalla.stringkey, 18), rpad(smalla.stringkey, 12) from bqt1.smalla"; //$NON-NLS-1$
- String output = "SELECT lpad(SmallA.StringKey, 18), rpad(SmallA.StringKey, 12) FROM SmallA"; //$NON-NLS-1$
-
- TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB,
- input,
- output, TRANSLATOR);
- }
-
- @Test
- public void testIFNull() throws Exception {
- String input = "SELECT ifnull(StringKey, 'otherString') FROM BQT1.SmallA";
- String output = "SELECT NVL(SmallA.StringKey, 'otherString') FROM SmallA";
- //SELECT IFNULL(GL_ACTG_APPL_ID, 'otherString') FROM ACTG_UNIT_BAL_FACT
- //SELECT nvl(GL_ACTG_APPL_ID, 'otherString') FROM ACTG_UNIT_BAL_FACT
-
- TranslationHelper.helpTestVisitor(getTestBQTVDB(), input, output, TRANSLATOR);
- }
-
-
- @Test public void testSubstring1() throws Exception {
-
- //////////BOTH SUBSTRING AND SUBSTR work in NETEZZA//
- //////////////////////////////////////////////////////
- String input = "SELECT substring(StringKey, 1) FROM BQT1.SmallA";
- String output = "SELECT substring(SmallA.StringKey, 1) FROM SmallA";
- //SELECT substring(FDL_PMF_ACCT, 3) FROM ACTG_UNIT_BAL_FACT
- //SELECT substr(FDL_PMF_ACCT, 3) FROM ACTG_UNIT_BAL_FACT
- TranslationHelper.helpTestVisitor(getTestBQTVDB(), input, output, TRANSLATOR);
- }
- @Test public void testSubstring2() throws Exception {
-
- //////////BOTH SUBSTRING AND SUBSTR work in NETEZZA//
- //////////////////////////////////////////////////////
- String input = "SELECT substring(StringKey, 1, 5) FROM BQT1.SmallA";
- String output = "SELECT substring(SmallA.StringKey, 1, 5) FROM SmallA";
- TranslationHelper.helpTestVisitor(getTestBQTVDB(), input, output, TRANSLATOR);
- }
-
-
-
- @Test public void testConcat_withLiteral() throws Exception {
-// String sql = "select stringnum || '1' from BQT1.Smalla";
-// String expected = "SELECT CASE WHEN SmallA.StringNum IS NULL THEN NULL ELSE concat(SmallA.StringNum, '1') END FROM SmallA";
-// helpTestVisitor(FakeMetadataFactory.exampleBQTCached(), sql, EMPTY_CONTEXT, null, expected);
- String input = "select stringnum || '1' from BQT1.Smalla";
- String output = "SELECT (SmallA.StringNum || '1') FROM SmallA";
-
- TranslationHelper.helpTestVisitor(getTestBQTVDB(), input, output, TRANSLATOR);
- }
-
-
-
- ////BEGIN-LOCATE FUNCTION
- @Test public void testLocate() throws Exception {
- String input = "SELECT locate(INTNUM, 'chimp', 1) FROM BQT1.SMALLA";
- String output = "SELECT INSTR('chimp', cast(SmallA.IntNum AS varchar(4000)), 1) FROM SmallA";
-
- TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB,
- input, output,
- TRANSLATOR);
- }
-
- @Test public void testLocate2() throws Exception {
- String input = "SELECT locate(STRINGNUM, 'chimp') FROM BQT1.SMALLA";
- String output = "SELECT INSTR('chimp', SmallA.StringNum) FROM SmallA";
-
- TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB,
- input, output,
- TRANSLATOR);
- }
-
- @Test public void testLocate3() throws Exception {
- String input = "SELECT locate(INTNUM, '234567890', 1) FROM BQT1.SMALLA WHERE INTKEY = 26";
- String output = "SELECT INSTR('234567890', cast(SmallA.IntNum AS varchar(4000)), 1) FROM SmallA WHERE SmallA.IntKey = 26";
-
- TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB, input, output, TRANSLATOR);
- }
-
- @Test public void testLocate4() throws Exception {
- String input = "SELECT locate('c', 'chimp', 1) FROM BQT1.SMALLA";
- String output = "SELECT 1 FROM SmallA";
-
- TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB, input, output, TRANSLATOR);
- }
-
- @Test public void testLocate5() throws Exception {
- String input = "SELECT locate(STRINGNUM, 'chimp', -5) FROM BQT1.SMALLA";
- String output = "SELECT INSTR('chimp', SmallA.StringNum, 1) FROM SmallA";
-
- TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB, input, output, TRANSLATOR);
- }
-
- @Test public void testLocate6() throws Exception {
- String input = "SELECT locate(STRINGNUM, 'chimp', INTNUM) FROM BQT1.SMALLA";
- String output = "SELECT INSTR('chimp', SmallA.StringNum, CASE WHEN SmallA.IntNum < 1 THEN 1 ELSE SmallA.IntNum END) FROM SmallA";
-
- TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB, input, output, TRANSLATOR);
- }
-
- @Test public void testLocate7() throws Exception {
- String input = "SELECT locate(STRINGNUM, 'chimp', LOCATE(STRINGNUM, 'chimp') + 1) FROM BQT1.SMALLA";
- String output = "SELECT INSTR('chimp', SmallA.StringNum, CASE WHEN (INSTR('chimp', SmallA.StringNum) + 1) < 1 THEN 1 ELSE (INSTR('chimp', SmallA.StringNum) + 1) END) FROM SmallA";
-
- TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB, input, output, TRANSLATOR);
- }
- ////END-LOCATE FUNCTION
-
-
-
-
- //////////////////BEGIN---NUMERIC FUNCTIONS TESTCASES///////////////////
- @Test public void testCeil() throws Exception {
- //select ceiling(sqrt(MEAS_PRD_ID)) from ACTG_UNIT_BAL_FACT
- //select ceil(sqrt(MEAS_PRD_ID)) from ACTG_UNIT_BAL_FACT
- String input = "SELECT ceiling(sqrt(INTKEY)) FROM BQT1.SMALLA";
- String output = "SELECT ceil(sqrt(SmallA.IntKey)) FROM SmallA";
- TranslationHelper.helpTestVisitor(getTestBQTVDB(),
- input,
- output, TRANSLATOR);
- }
-
- @Test public void testPower() throws Exception {
-
- //select power(MEAS_PRD_ID, 2) from ACTG_UNIT_BAL_FACT
- //select pow(MEAS_PRD_ID, 2) from ACTG_UNIT_BAL_FACT
- String input = "SELECT power(INTKEY, 2) FROM BQT1.SMALLA";
- String output = "SELECT pow(SmallA.IntKey, 2) FROM SmallA";
- TranslationHelper.helpTestVisitor(getTestBQTVDB(),
- input,
- output, TRANSLATOR);
- }
- //////////////////END---NUMERIC FUNCTIONS TESTCASES///////////////////
-
-
- //////////////////BEGIN---BIT FUNCTIONS CONVERSION TESTCASES///////////////////
- ///////////////////////////////////////////////////////////////////
-
- @Test public void testBitAnd() throws Exception {
- String input = "select bitand(intkey, intnum) from bqt1.smalla";
- String output = "SELECT intNand(SmallA.IntKey, SmallA.IntNum) FROM SmallA";
-
- TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB,
- input,
- output, TRANSLATOR);
- }
- @Test public void testBitNot() throws Exception {
- String input = "select bitnot(intkey) from bqt1.smalla";
- String output = "SELECT intNnot(SmallA.IntKey) FROM SmallA";
-
- TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB,
- input,
- output, TRANSLATOR);
- }
- @Test public void testBitOr() throws Exception {
- String input = "select bitor(intkey, intnum) from bqt1.smalla";
- String output = "SELECT intNor(SmallA.IntKey, SmallA.IntNum) FROM SmallA";
-
- TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB,
- input,
- output, TRANSLATOR);
- }
- @Test public void testBitXor() throws Exception {
- String input = "select bitxor(intkey, intnum) from bqt1.smalla";
- String output = "SELECT intNxor(SmallA.IntKey, SmallA.IntNum) FROM SmallA";
-
- TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB,
- input,
- output, TRANSLATOR);
- }
- //////////////////END---BIT FUNCTIONS CONVERSION TESTCASES///////////////////
- /////////////////////////////////////////////////////////////////////////////
-
-
-}
Copied: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorSourceSystemFunctions.java (from rev 3365, branches/7.4.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorSourceSystemFunctions.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorSourceSystemFunctions.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorSourceSystemFunctions.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -0,0 +1,243 @@
+/*
+ * 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.netezza;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.teiid.language.LanguageFactory;
+import org.teiid.translator.TranslatorException;
+import org.teiid.translator.jdbc.TranslationHelper;
+
+/**
+ */
+public class TestNetezzaTranslatorSourceSystemFunctions {
+
+ private static NetezzaExecutionFactory TRANSLATOR;
+ private static final LanguageFactory LANG_FACTORY = new LanguageFactory();
+
+ @BeforeClass public static void oneTimeSetup() throws TranslatorException {
+ TRANSLATOR = new NetezzaExecutionFactory();
+ TRANSLATOR.setUseBindVariables(false);
+ TRANSLATOR.start();
+
+
+ }
+
+
+ /////////////////UTILLITY FUNCTIONS/////////
+ ////////////////////////////////////////////
+
+
+ private String getTestBQTVDB() {
+ return TranslationHelper.BQT_VDB;
+ }
+
+
+ /////SOURCESYSTEM FUNCTION TESTCASES//////////////
+ ///////////////////////////////////////////////
+
+
+ //////////////////BEGIN---STRING FUNCTIONS TESTCASES///////////////////
+
+ @Test
+ public void testLcaseUcase() throws Exception {
+ String input = "select lcase(StringKey), ucase(StringKey) FROM BQT1.SmallA";
+ String output = "SELECT lower(SmallA.StringKey), upper(SmallA.StringKey) FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(getTestBQTVDB(), input, output,TRANSLATOR);
+ }
+ @Test public void testPad() throws Exception {
+ String input = "select lpad(smalla.stringkey, 18), rpad(smalla.stringkey, 12) from bqt1.smalla"; //$NON-NLS-1$
+ String output = "SELECT lpad(SmallA.StringKey, 18), rpad(SmallA.StringKey, 12) FROM SmallA"; //$NON-NLS-1$
+
+ TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB,
+ input,
+ output, TRANSLATOR);
+ }
+
+ @Test
+ public void testIFNull() throws Exception {
+ String input = "SELECT ifnull(StringKey, 'otherString') FROM BQT1.SmallA";
+ String output = "SELECT NVL(SmallA.StringKey, 'otherString') FROM SmallA";
+ //SELECT IFNULL(GL_ACTG_APPL_ID, 'otherString') FROM ACTG_UNIT_BAL_FACT
+ //SELECT nvl(GL_ACTG_APPL_ID, 'otherString') FROM ACTG_UNIT_BAL_FACT
+
+ TranslationHelper.helpTestVisitor(getTestBQTVDB(), input, output, TRANSLATOR);
+ }
+
+
+ @Test public void testSubstring1() throws Exception {
+
+ //////////BOTH SUBSTRING AND SUBSTR work in NETEZZA//
+ //////////////////////////////////////////////////////
+ String input = "SELECT substring(StringKey, 1) FROM BQT1.SmallA";
+ String output = "SELECT substring(SmallA.StringKey, 1) FROM SmallA";
+ //SELECT substring(FDL_PMF_ACCT, 3) FROM ACTG_UNIT_BAL_FACT
+ //SELECT substr(FDL_PMF_ACCT, 3) FROM ACTG_UNIT_BAL_FACT
+ TranslationHelper.helpTestVisitor(getTestBQTVDB(), input, output, TRANSLATOR);
+ }
+ @Test public void testSubstring2() throws Exception {
+
+ //////////BOTH SUBSTRING AND SUBSTR work in NETEZZA//
+ //////////////////////////////////////////////////////
+ String input = "SELECT substring(StringKey, 1, 5) FROM BQT1.SmallA";
+ String output = "SELECT substring(SmallA.StringKey, 1, 5) FROM SmallA";
+ TranslationHelper.helpTestVisitor(getTestBQTVDB(), input, output, TRANSLATOR);
+ }
+
+
+
+ @Test public void testConcat_withLiteral() throws Exception {
+// String sql = "select stringnum || '1' from BQT1.Smalla";
+// String expected = "SELECT CASE WHEN SmallA.StringNum IS NULL THEN NULL ELSE concat(SmallA.StringNum, '1') END FROM SmallA";
+// helpTestVisitor(FakeMetadataFactory.exampleBQTCached(), sql, EMPTY_CONTEXT, null, expected);
+ String input = "select stringnum || '1' from BQT1.Smalla";
+ String output = "SELECT (SmallA.StringNum || '1') FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(getTestBQTVDB(), input, output, TRANSLATOR);
+ }
+
+
+
+ ////BEGIN-LOCATE FUNCTION
+ @Test public void testLocate() throws Exception {
+ String input = "SELECT locate(INTNUM, 'chimp', 1) FROM BQT1.SMALLA";
+ String output = "SELECT INSTR('chimp', cast(SmallA.IntNum AS varchar(4000)), 1) FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB,
+ input, output,
+ TRANSLATOR);
+ }
+
+ @Test public void testLocate2() throws Exception {
+ String input = "SELECT locate(STRINGNUM, 'chimp') FROM BQT1.SMALLA";
+ String output = "SELECT INSTR('chimp', SmallA.StringNum) FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB,
+ input, output,
+ TRANSLATOR);
+ }
+
+ @Test public void testLocate3() throws Exception {
+ String input = "SELECT locate(INTNUM, '234567890', 1) FROM BQT1.SMALLA WHERE INTKEY = 26";
+ String output = "SELECT INSTR('234567890', cast(SmallA.IntNum AS varchar(4000)), 1) FROM SmallA WHERE SmallA.IntKey = 26";
+
+ TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB, input, output, TRANSLATOR);
+ }
+
+ @Test public void testLocate4() throws Exception {
+ String input = "SELECT locate('c', 'chimp', 1) FROM BQT1.SMALLA";
+ String output = "SELECT 1 FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB, input, output, TRANSLATOR);
+ }
+
+ @Test public void testLocate5() throws Exception {
+ String input = "SELECT locate(STRINGNUM, 'chimp', -5) FROM BQT1.SMALLA";
+ String output = "SELECT INSTR('chimp', SmallA.StringNum, 1) FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB, input, output, TRANSLATOR);
+ }
+
+ @Test public void testLocate6() throws Exception {
+ String input = "SELECT locate(STRINGNUM, 'chimp', INTNUM) FROM BQT1.SMALLA";
+ String output = "SELECT INSTR('chimp', SmallA.StringNum, CASE WHEN SmallA.IntNum < 1 THEN 1 ELSE SmallA.IntNum END) FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB, input, output, TRANSLATOR);
+ }
+
+ @Test public void testLocate7() throws Exception {
+ String input = "SELECT locate(STRINGNUM, 'chimp', LOCATE(STRINGNUM, 'chimp') + 1) FROM BQT1.SMALLA";
+ String output = "SELECT INSTR('chimp', SmallA.StringNum, CASE WHEN (INSTR('chimp', SmallA.StringNum) + 1) < 1 THEN 1 ELSE (INSTR('chimp', SmallA.StringNum) + 1) END) FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB, input, output, TRANSLATOR);
+ }
+ ////END-LOCATE FUNCTION
+
+
+
+
+ //////////////////BEGIN---NUMERIC FUNCTIONS TESTCASES///////////////////
+ @Test public void testCeil() throws Exception {
+ //select ceiling(sqrt(MEAS_PRD_ID)) from ACTG_UNIT_BAL_FACT
+ //select ceil(sqrt(MEAS_PRD_ID)) from ACTG_UNIT_BAL_FACT
+ String input = "SELECT ceiling(sqrt(INTKEY)) FROM BQT1.SMALLA";
+ String output = "SELECT ceil(sqrt(SmallA.IntKey)) FROM SmallA";
+ TranslationHelper.helpTestVisitor(getTestBQTVDB(),
+ input,
+ output, TRANSLATOR);
+ }
+
+ @Test public void testPower() throws Exception {
+
+ //select power(MEAS_PRD_ID, 2) from ACTG_UNIT_BAL_FACT
+ //select pow(MEAS_PRD_ID, 2) from ACTG_UNIT_BAL_FACT
+ String input = "SELECT power(INTKEY, 2) FROM BQT1.SMALLA";
+ String output = "SELECT pow(SmallA.IntKey, 2) FROM SmallA";
+ TranslationHelper.helpTestVisitor(getTestBQTVDB(),
+ input,
+ output, TRANSLATOR);
+ }
+ //////////////////END---NUMERIC FUNCTIONS TESTCASES///////////////////
+
+
+ //////////////////BEGIN---BIT FUNCTIONS CONVERSION TESTCASES///////////////////
+ ///////////////////////////////////////////////////////////////////
+
+ @Test public void testBitAnd() throws Exception {
+ String input = "select bitand(intkey, intnum) from bqt1.smalla";
+ String output = "SELECT intNand(SmallA.IntKey, SmallA.IntNum) FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB,
+ input,
+ output, TRANSLATOR);
+ }
+ @Test public void testBitNot() throws Exception {
+ String input = "select bitnot(intkey) from bqt1.smalla";
+ String output = "SELECT intNnot(SmallA.IntKey) FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB,
+ input,
+ output, TRANSLATOR);
+ }
+ @Test public void testBitOr() throws Exception {
+ String input = "select bitor(intkey, intnum) from bqt1.smalla";
+ String output = "SELECT intNor(SmallA.IntKey, SmallA.IntNum) FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB,
+ input,
+ output, TRANSLATOR);
+ }
+ @Test public void testBitXor() throws Exception {
+ String input = "select bitxor(intkey, intnum) from bqt1.smalla";
+ String output = "SELECT intNxor(SmallA.IntKey, SmallA.IntNum) FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB,
+ input,
+ output, TRANSLATOR);
+ }
+ //////////////////END---BIT FUNCTIONS CONVERSION TESTCASES///////////////////
+ /////////////////////////////////////////////////////////////////////////////
+
+
+}
Deleted: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorTypeMapping.java
===================================================================
--- branches/7.4.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorTypeMapping.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorTypeMapping.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -1,246 +0,0 @@
-/*
- * 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.netezza;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.Arrays;
-
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.teiid.language.Expression;
-import org.teiid.language.Function;
-import org.teiid.language.LanguageFactory;
-import org.teiid.translator.TranslatorException;
-import org.teiid.translator.TypeFacility;
-import org.teiid.translator.jdbc.SQLConversionVisitor;
-import org.teiid.translator.jdbc.TranslationHelper;
-
-
-public class TestNetezzaTranslatorTypeMapping {
-
- private static NetezzaExecutionFactory TRANSLATOR;
- private static final LanguageFactory LANG_FACTORY = new LanguageFactory();
-
- @BeforeClass public static void oneTimeSetup() throws TranslatorException {
- TRANSLATOR = new NetezzaExecutionFactory();
- TRANSLATOR.setUseBindVariables(false);
- TRANSLATOR.start();
-
-
- }
-
-
- /////////////////UTILLITY FUNCTIONS/////////
- ////////////////////////////////////////////
-
- private String getTestBQTVDB() {
-
- return TranslationHelper.BQT_VDB;
- }
-
-
- public void helpTest(Expression srcExpression, String tgtType, String expectedExpression) throws Exception {
- Function func = LANG_FACTORY.createFunction("convert",
- Arrays.asList( srcExpression,LANG_FACTORY.createLiteral(tgtType, String.class)),TypeFacility.getDataTypeClass(tgtType));
-
- assertEquals("Error converting from " + srcExpression.getType() + " to " + tgtType,
- expectedExpression, helpGetString(func));
- }
- public String helpGetString(Expression expr) throws Exception {
- SQLConversionVisitor sqlVisitor = TRANSLATOR.getSQLConversionVisitor();
- sqlVisitor.append(expr);
-
- return sqlVisitor.toString();
- }
-
-
- /////////TYPE MAPPING TESTS/////////
- ///////////////////////////////////
-
- @Test public void testCHARtoChar1() throws Exception {
- String input = "SELECT convert(StringKey, CHAR) FROM BQT1.SmallA";
- String output = "SELECT cast(SmallA.StringKey AS char(1)) FROM SmallA";
-
- TranslationHelper.helpTestVisitor(getTestBQTVDB(),
- input,
- output, TRANSLATOR);
- }
-
- @Test public void testLongToBigInt() throws Exception {
- String input = "SELECT convert(convert(StringKey, long), string) FROM BQT1.SmallA";
- String output = "SELECT cast(cast(SmallA.StringKey AS bigint) AS varchar(4000)) FROM SmallA";
-
- TranslationHelper.helpTestVisitor(getTestBQTVDB(),
- input,
- output, TRANSLATOR);
- }
- @Test public void testStringToByte() throws Exception {
- String input = "SELECT char(convert(stringnum, byte) + 100) FROM BQT1.SMALLA";
- String output = "SELECT chr((cast(SmallA.StringNum AS byteint) + 100)) FROM SmallA";
-
- TranslationHelper.helpTestVisitor(getTestBQTVDB(),
- input,
- output, TRANSLATOR);
- }
- @Test public void testStringToShort() throws Exception {
- String input = "SELECT char(convert(stringnum, short) + 100) FROM BQT1.SMALLA";
- String output = "SELECT chr((cast(SmallA.StringNum AS smallint) + 100)) FROM SmallA";
-
- TranslationHelper.helpTestVisitor(getTestBQTVDB(),
- input,
- output, TRANSLATOR);
- }
- @Test public void testStringToLong() throws Exception {
-// String input = "SELECT char(convert(PART_WEIGHT, long) + 100) FROM PARTS";
-// String output = "SELECT chr((cast(PARTS.PART_WEIGHT AS bigint) + 100)) FROM PARTS";
- String input = "SELECT convert(stringnum, long) FROM BQT1.SMALLA";
- String output = "SELECT cast(SmallA.StringNum AS bigint) FROM SmallA";
-
- TranslationHelper.helpTestVisitor(getTestBQTVDB(),
- input,
- output, TRANSLATOR);
- }
- @Test public void testStringToBiginteger() throws Exception {
- String input = "SELECT convert(stringnum, BIGINTEGER) FROM BQT1.SMALLA";
- String output = "SELECT cast(SmallA.StringNum AS numeric(38)) FROM SmallA";
-
- TranslationHelper.helpTestVisitor(getTestBQTVDB(),
- input,
- output, TRANSLATOR);
- }
-
- @Test public void testStringToBigdecimal() throws Exception {
- String input = "SELECT convert(stringnum, BIGDECIMAL) FROM BQT1.SMALLA";
- String output = "SELECT cast(SmallA.StringNum AS numeric(38,18)) FROM SmallA";
-
- TranslationHelper.helpTestVisitor(getTestBQTVDB(),
- input,
- output, TRANSLATOR);
- }
-
- @Test public void testStringToVarchar() throws Exception {
- String input = "SELECT convert(intkey, STRING) FROM BQT1.SMALLA";
- String output = "SELECT cast(SmallA.IntKey AS varchar(4000)) FROM SmallA";
-
- TranslationHelper.helpTestVisitor(getTestBQTVDB(),
- input,
- output, TRANSLATOR);
- }
-
-
-
-
- ////NON-MAPPED TYPES TEST/////////////
- //////////////////////////////////////
-
- @Test public void testStringToInteger() throws Exception {
- String input = "SELECT char(convert(stringnum, integer) + 100) FROM BQT1.SMALLA";
- String output = "SELECT chr((cast(SmallA.StringNum AS integer) + 100)) FROM SmallA";
-
- TranslationHelper.helpTestVisitor(getTestBQTVDB(),
- input,
- output, TRANSLATOR);
- }
-
- @Test public void testStringToFloat() throws Exception {
- String input = "SELECT convert(stringnum, float) FROM BQT1.SMALLA";
- String output = "SELECT cast(SmallA.StringNum AS float) FROM SmallA";
-
- TranslationHelper.helpTestVisitor(getTestBQTVDB(),
- input,
- output, TRANSLATOR);
- }
- @Test public void testStringToReal() throws Exception {
- String input = "SELECT convert(stringnum, real) FROM BQT1.SMALLA";
- String output = "SELECT cast(SmallA.StringNum AS float) FROM SmallA";
-
- TranslationHelper.helpTestVisitor(getTestBQTVDB(),
- input,
- output, TRANSLATOR);
- }
- @Test public void testStringToDouble() throws Exception {
- String input = "SELECT convert(stringnum, double) FROM BQT1.SMALLA";
- String output = "SELECT cast(SmallA.StringNum AS double) FROM SmallA";
- //SELECT cast(MEAS_PRD_ID AS DOUBLE) from ACTG_UNIT_BAL_FACT
-
- TranslationHelper.helpTestVisitor(getTestBQTVDB(),
- input,
- output, TRANSLATOR);
- }
- @Test public void testStringToBoolean() throws Exception {
- String input = "SELECT convert(stringnum, boolean) FROM BQT1.SMALLA";
- String output = "SELECT CASE WHEN SmallA.StringNum IN ('false', '0') THEN '0' WHEN SmallA.StringNum IS NOT NULL THEN '1' END FROM SmallA";
-
- TranslationHelper.helpTestVisitor(getTestBQTVDB(),
- input,
- output, TRANSLATOR);
- }
- @Test public void testStringToDate() throws Exception {
- String input = "SELECT convert(stringnum, date) FROM BQT1.SMALLA";
- String output = "SELECT to_date(SmallA.StringNum, 'YYYY-MM-DD') FROM SmallA";
-
- TranslationHelper.helpTestVisitor(getTestBQTVDB(),
- input,
- output, TRANSLATOR);
- }
- @Test public void testStringToTime() throws Exception {
- String input = "SELECT convert(stringnum, time) FROM BQT1.SMALLA";
- String output = "SELECT to_timestamp(SmallA.StringNum, 'HH24:MI:SS') FROM SmallA";
-
- TranslationHelper.helpTestVisitor(getTestBQTVDB(),
- input,
- output, TRANSLATOR);
- }
- @Test public void testStringToTimestamp() throws Exception {
- String input = "SELECT convert(stringnum, timestamp) FROM BQT1.SMALLA";
- String output = "SELECT to_timestamp(SmallA.StringNum, 'YYYY-MM-DD HH24:MI:SS.MS') FROM SmallA";
-
- TranslationHelper.helpTestVisitor(getTestBQTVDB(),
- input,
- output, TRANSLATOR);
- }
-
-
- @Test public void testbooleanToIntegerConversion() throws Exception {
- String input = "SELECT BQT1.SmallA.IntNum, BQT2.SmallB.BooleanValue FROM BQT1.SmallA, BQT2.SmallB WHERE BQT1.SmallA.IntNum = convert(BQT2.SmallB.booleanvalue, integer)";
- String output = "SELECT SmallA.IntNum, SmallB.BooleanValue FROM SmallA, SmallB WHERE SmallA.IntNum = (CASE WHEN SmallB.BooleanValue IN ( '0', 'FALSE') THEN 0 WHEN SmallB.BooleanValue IS NOT NULL THEN 1 END)";
- TranslationHelper.helpTestVisitor(getTestBQTVDB(),
- input,
- output, TRANSLATOR);
-
-
- }
-
- @Test public void testIntegerToBooleanconversion() throws Exception {
- String input = "SELECT BQT1.SmallA.IntNum, BQT2.SmallB.BooleanValue FROM BQT1.SmallA, BQT2.SmallB WHERE BQT1.SmallA.booleanvalue = convert(BQT2.SmallB.IntNum, boolean) AND BQT1.SmallA.IntKey >= 0 AND BQT2.SmallB.IntKey >= 0 ORDER BY BQT1.SmallA.IntNum";
- String output = "SELECT SmallA.IntNum, SmallB.BooleanValue FROM SmallA, SmallB WHERE SmallA.BooleanValue = CASE WHEN SmallB.IntNum = 0 THEN '0' WHEN SmallB.IntNum IS NOT NULL THEN '1' END AND SmallA.IntKey >= 0 AND SmallB.IntKey >= 0 ORDER BY SmallA.IntNum";
- TranslationHelper.helpTestVisitor(getTestBQTVDB(),
- input,
- output, TRANSLATOR);
-
-
- }
-
-
-}
Copied: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorTypeMapping.java (from rev 3365, branches/7.4.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorTypeMapping.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorTypeMapping.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestNetezzaTranslatorTypeMapping.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -0,0 +1,246 @@
+/*
+ * 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.netezza;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.Arrays;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.teiid.language.Expression;
+import org.teiid.language.Function;
+import org.teiid.language.LanguageFactory;
+import org.teiid.translator.TranslatorException;
+import org.teiid.translator.TypeFacility;
+import org.teiid.translator.jdbc.SQLConversionVisitor;
+import org.teiid.translator.jdbc.TranslationHelper;
+
+
+public class TestNetezzaTranslatorTypeMapping {
+
+ private static NetezzaExecutionFactory TRANSLATOR;
+ private static final LanguageFactory LANG_FACTORY = new LanguageFactory();
+
+ @BeforeClass public static void oneTimeSetup() throws TranslatorException {
+ TRANSLATOR = new NetezzaExecutionFactory();
+ TRANSLATOR.setUseBindVariables(false);
+ TRANSLATOR.start();
+
+
+ }
+
+
+ /////////////////UTILLITY FUNCTIONS/////////
+ ////////////////////////////////////////////
+
+ private String getTestBQTVDB() {
+
+ return TranslationHelper.BQT_VDB;
+ }
+
+
+ public void helpTest(Expression srcExpression, String tgtType, String expectedExpression) throws Exception {
+ Function func = LANG_FACTORY.createFunction("convert",
+ Arrays.asList( srcExpression,LANG_FACTORY.createLiteral(tgtType, String.class)),TypeFacility.getDataTypeClass(tgtType));
+
+ assertEquals("Error converting from " + srcExpression.getType() + " to " + tgtType,
+ expectedExpression, helpGetString(func));
+ }
+ public String helpGetString(Expression expr) throws Exception {
+ SQLConversionVisitor sqlVisitor = TRANSLATOR.getSQLConversionVisitor();
+ sqlVisitor.append(expr);
+
+ return sqlVisitor.toString();
+ }
+
+
+ /////////TYPE MAPPING TESTS/////////
+ ///////////////////////////////////
+
+ @Test public void testCHARtoChar1() throws Exception {
+ String input = "SELECT convert(StringKey, CHAR) FROM BQT1.SmallA";
+ String output = "SELECT cast(SmallA.StringKey AS char(1)) FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(getTestBQTVDB(),
+ input,
+ output, TRANSLATOR);
+ }
+
+ @Test public void testLongToBigInt() throws Exception {
+ String input = "SELECT convert(convert(StringKey, long), string) FROM BQT1.SmallA";
+ String output = "SELECT cast(cast(SmallA.StringKey AS bigint) AS varchar(4000)) FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(getTestBQTVDB(),
+ input,
+ output, TRANSLATOR);
+ }
+ @Test public void testStringToByte() throws Exception {
+ String input = "SELECT char(convert(stringnum, byte) + 100) FROM BQT1.SMALLA";
+ String output = "SELECT chr((cast(SmallA.StringNum AS byteint) + 100)) FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(getTestBQTVDB(),
+ input,
+ output, TRANSLATOR);
+ }
+ @Test public void testStringToShort() throws Exception {
+ String input = "SELECT char(convert(stringnum, short) + 100) FROM BQT1.SMALLA";
+ String output = "SELECT chr((cast(SmallA.StringNum AS smallint) + 100)) FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(getTestBQTVDB(),
+ input,
+ output, TRANSLATOR);
+ }
+ @Test public void testStringToLong() throws Exception {
+// String input = "SELECT char(convert(PART_WEIGHT, long) + 100) FROM PARTS";
+// String output = "SELECT chr((cast(PARTS.PART_WEIGHT AS bigint) + 100)) FROM PARTS";
+ String input = "SELECT convert(stringnum, long) FROM BQT1.SMALLA";
+ String output = "SELECT cast(SmallA.StringNum AS bigint) FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(getTestBQTVDB(),
+ input,
+ output, TRANSLATOR);
+ }
+ @Test public void testStringToBiginteger() throws Exception {
+ String input = "SELECT convert(stringnum, BIGINTEGER) FROM BQT1.SMALLA";
+ String output = "SELECT cast(SmallA.StringNum AS numeric(38)) FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(getTestBQTVDB(),
+ input,
+ output, TRANSLATOR);
+ }
+
+ @Test public void testStringToBigdecimal() throws Exception {
+ String input = "SELECT convert(stringnum, BIGDECIMAL) FROM BQT1.SMALLA";
+ String output = "SELECT cast(SmallA.StringNum AS numeric(38,18)) FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(getTestBQTVDB(),
+ input,
+ output, TRANSLATOR);
+ }
+
+ @Test public void testStringToVarchar() throws Exception {
+ String input = "SELECT convert(intkey, STRING) FROM BQT1.SMALLA";
+ String output = "SELECT cast(SmallA.IntKey AS varchar(4000)) FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(getTestBQTVDB(),
+ input,
+ output, TRANSLATOR);
+ }
+
+
+
+
+ ////NON-MAPPED TYPES TEST/////////////
+ //////////////////////////////////////
+
+ @Test public void testStringToInteger() throws Exception {
+ String input = "SELECT char(convert(stringnum, integer) + 100) FROM BQT1.SMALLA";
+ String output = "SELECT chr((cast(SmallA.StringNum AS integer) + 100)) FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(getTestBQTVDB(),
+ input,
+ output, TRANSLATOR);
+ }
+
+ @Test public void testStringToFloat() throws Exception {
+ String input = "SELECT convert(stringnum, float) FROM BQT1.SMALLA";
+ String output = "SELECT cast(SmallA.StringNum AS float) FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(getTestBQTVDB(),
+ input,
+ output, TRANSLATOR);
+ }
+ @Test public void testStringToReal() throws Exception {
+ String input = "SELECT convert(stringnum, real) FROM BQT1.SMALLA";
+ String output = "SELECT cast(SmallA.StringNum AS float) FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(getTestBQTVDB(),
+ input,
+ output, TRANSLATOR);
+ }
+ @Test public void testStringToDouble() throws Exception {
+ String input = "SELECT convert(stringnum, double) FROM BQT1.SMALLA";
+ String output = "SELECT cast(SmallA.StringNum AS double) FROM SmallA";
+ //SELECT cast(MEAS_PRD_ID AS DOUBLE) from ACTG_UNIT_BAL_FACT
+
+ TranslationHelper.helpTestVisitor(getTestBQTVDB(),
+ input,
+ output, TRANSLATOR);
+ }
+ @Test public void testStringToBoolean() throws Exception {
+ String input = "SELECT convert(stringnum, boolean) FROM BQT1.SMALLA";
+ String output = "SELECT CASE WHEN SmallA.StringNum IN ('false', '0') THEN '0' WHEN SmallA.StringNum IS NOT NULL THEN '1' END FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(getTestBQTVDB(),
+ input,
+ output, TRANSLATOR);
+ }
+ @Test public void testStringToDate() throws Exception {
+ String input = "SELECT convert(stringnum, date) FROM BQT1.SMALLA";
+ String output = "SELECT to_date(SmallA.StringNum, 'YYYY-MM-DD') FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(getTestBQTVDB(),
+ input,
+ output, TRANSLATOR);
+ }
+ @Test public void testStringToTime() throws Exception {
+ String input = "SELECT convert(stringnum, time) FROM BQT1.SMALLA";
+ String output = "SELECT to_timestamp(SmallA.StringNum, 'HH24:MI:SS') FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(getTestBQTVDB(),
+ input,
+ output, TRANSLATOR);
+ }
+ @Test public void testStringToTimestamp() throws Exception {
+ String input = "SELECT convert(stringnum, timestamp) FROM BQT1.SMALLA";
+ String output = "SELECT to_timestamp(SmallA.StringNum, 'YYYY-MM-DD HH24:MI:SS.MS') FROM SmallA";
+
+ TranslationHelper.helpTestVisitor(getTestBQTVDB(),
+ input,
+ output, TRANSLATOR);
+ }
+
+
+ @Test public void testbooleanToIntegerConversion() throws Exception {
+ String input = "SELECT BQT1.SmallA.IntNum, BQT2.SmallB.BooleanValue FROM BQT1.SmallA, BQT2.SmallB WHERE BQT1.SmallA.IntNum = convert(BQT2.SmallB.booleanvalue, integer)";
+ String output = "SELECT SmallA.IntNum, SmallB.BooleanValue FROM SmallA, SmallB WHERE SmallA.IntNum = (CASE WHEN SmallB.BooleanValue IN ( '0', 'FALSE') THEN 0 WHEN SmallB.BooleanValue IS NOT NULL THEN 1 END)";
+ TranslationHelper.helpTestVisitor(getTestBQTVDB(),
+ input,
+ output, TRANSLATOR);
+
+
+ }
+
+ @Test public void testIntegerToBooleanconversion() throws Exception {
+ String input = "SELECT BQT1.SmallA.IntNum, BQT2.SmallB.BooleanValue FROM BQT1.SmallA, BQT2.SmallB WHERE BQT1.SmallA.booleanvalue = convert(BQT2.SmallB.IntNum, boolean) AND BQT1.SmallA.IntKey >= 0 AND BQT2.SmallB.IntKey >= 0 ORDER BY BQT1.SmallA.IntNum";
+ String output = "SELECT SmallA.IntNum, SmallB.BooleanValue FROM SmallA, SmallB WHERE SmallA.BooleanValue = CASE WHEN SmallB.IntNum = 0 THEN '0' WHEN SmallB.IntNum IS NOT NULL THEN '1' END AND SmallA.IntKey >= 0 AND SmallB.IntKey >= 0 ORDER BY SmallA.IntNum";
+ TranslationHelper.helpTestVisitor(getTestBQTVDB(),
+ input,
+ output, TRANSLATOR);
+
+
+ }
+
+
+}
Deleted: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestSubstringFunctionModifier.java
===================================================================
--- branches/7.4.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestSubstringFunctionModifier.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestSubstringFunctionModifier.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -1,98 +0,0 @@
-/*
- * 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.netezza;
-
-import java.util.Arrays;
-
-import junit.framework.TestCase;
-
-import org.teiid.language.Expression;
-import org.teiid.language.Function;
-import org.teiid.language.LanguageFactory;
-import org.teiid.translator.TypeFacility;
-import org.teiid.translator.jdbc.SQLConversionVisitor;
-
-/**
- */
-public class TestSubstringFunctionModifier extends TestCase {
-
- private static final LanguageFactory LANG_FACTORY = new LanguageFactory();
-
-
- /**
- * Constructor for TestSubstringFunctionModifier.
- * @param name
- */
- public TestSubstringFunctionModifier(String name) {
- super(name);
- }
-
- public void helpTestMod(Expression[] args, String expectedStr) throws Exception {
- Function func = LANG_FACTORY.createFunction("substring",
- Arrays.asList(args), TypeFacility.RUNTIME_TYPES.STRING);
-
- NetezzaExecutionFactory trans = new NetezzaExecutionFactory();
- trans.start();
-
- SQLConversionVisitor sqlVisitor = trans.getSQLConversionVisitor();
- sqlVisitor.append(func);
-
- assertEquals(expectedStr, sqlVisitor.toString());
- }
-
- public void testTwoArgs() throws Exception {
- Expression[] args = new Expression[] {
- LANG_FACTORY.createLiteral("a.b.c", String.class),
- LANG_FACTORY.createLiteral(new Integer(1), Integer.class)
- };
- helpTestMod(args, "substring('a.b.c', 1)");
- }
-
- public void testThreeArgsWithConstant() throws Exception {
- Expression[] args = new Expression[] {
- LANG_FACTORY.createLiteral("a.b.c", String.class),
- LANG_FACTORY.createLiteral(new Integer(3), Integer.class),
- LANG_FACTORY.createLiteral(new Integer(1), Integer.class)
- };
- helpTestMod(args, "substring('a.b.c', 3, 1)");
- }
-
- public void testThreeArgsWithElement() throws Exception {
- Expression[] args = new Expression[] {
- LANG_FACTORY.createLiteral("a.b.c", String.class),
- LANG_FACTORY.createColumnReference("e1", null, null, Integer.class),
- LANG_FACTORY.createLiteral(new Integer(1), Integer.class)
- };
- helpTestMod(args, "substring('a.b.c', e1, 1)");
- }
-
- public void testThreeArgsWithNull() throws Exception {
- Expression[] args = new Expression[] {
- LANG_FACTORY.createLiteral("a.b.c", String.class),
- LANG_FACTORY.createLiteral(null, Integer.class),
- LANG_FACTORY.createLiteral(new Integer(5), Integer.class)
- };
- helpTestMod(args, "substring('a.b.c', NULL, 5)");
- }
-
-}
Copied: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestSubstringFunctionModifier.java (from rev 3365, branches/7.4.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestSubstringFunctionModifier.java)
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestSubstringFunctionModifier.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/netezza/TestSubstringFunctionModifier.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -0,0 +1,98 @@
+/*
+ * 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.netezza;
+
+import java.util.Arrays;
+
+import junit.framework.TestCase;
+
+import org.teiid.language.Expression;
+import org.teiid.language.Function;
+import org.teiid.language.LanguageFactory;
+import org.teiid.translator.TypeFacility;
+import org.teiid.translator.jdbc.SQLConversionVisitor;
+
+/**
+ */
+public class TestSubstringFunctionModifier extends TestCase {
+
+ private static final LanguageFactory LANG_FACTORY = new LanguageFactory();
+
+
+ /**
+ * Constructor for TestSubstringFunctionModifier.
+ * @param name
+ */
+ public TestSubstringFunctionModifier(String name) {
+ super(name);
+ }
+
+ public void helpTestMod(Expression[] args, String expectedStr) throws Exception {
+ Function func = LANG_FACTORY.createFunction("substring",
+ Arrays.asList(args), TypeFacility.RUNTIME_TYPES.STRING);
+
+ NetezzaExecutionFactory trans = new NetezzaExecutionFactory();
+ trans.start();
+
+ SQLConversionVisitor sqlVisitor = trans.getSQLConversionVisitor();
+ sqlVisitor.append(func);
+
+ assertEquals(expectedStr, sqlVisitor.toString());
+ }
+
+ public void testTwoArgs() throws Exception {
+ Expression[] args = new Expression[] {
+ LANG_FACTORY.createLiteral("a.b.c", String.class),
+ LANG_FACTORY.createLiteral(new Integer(1), Integer.class)
+ };
+ helpTestMod(args, "substring('a.b.c', 1)");
+ }
+
+ public void testThreeArgsWithConstant() throws Exception {
+ Expression[] args = new Expression[] {
+ LANG_FACTORY.createLiteral("a.b.c", String.class),
+ LANG_FACTORY.createLiteral(new Integer(3), Integer.class),
+ LANG_FACTORY.createLiteral(new Integer(1), Integer.class)
+ };
+ helpTestMod(args, "substring('a.b.c', 3, 1)");
+ }
+
+ public void testThreeArgsWithElement() throws Exception {
+ Expression[] args = new Expression[] {
+ LANG_FACTORY.createLiteral("a.b.c", String.class),
+ LANG_FACTORY.createColumnReference("e1", null, null, Integer.class),
+ LANG_FACTORY.createLiteral(new Integer(1), Integer.class)
+ };
+ helpTestMod(args, "substring('a.b.c', e1, 1)");
+ }
+
+ public void testThreeArgsWithNull() throws Exception {
+ Expression[] args = new Expression[] {
+ LANG_FACTORY.createLiteral("a.b.c", String.class),
+ LANG_FACTORY.createLiteral(null, Integer.class),
+ LANG_FACTORY.createLiteral(new Integer(5), Integer.class)
+ };
+ helpTestMod(args, "substring('a.b.c', NULL, 5)");
+ }
+
+}
Modified: trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPExecutionFactory.java
===================================================================
--- trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPExecutionFactory.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPExecutionFactory.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -53,6 +53,7 @@
private String searchDefaultBaseDN;
private boolean restrictToObjectClass;
private SearchDefaultScope searchDefaultScope = SearchDefaultScope.ONELEVEL_SCOPE;
+ private boolean usePagination;
public LDAPExecutionFactory() {
this.setMaxInCriteriaSize(1000);
@@ -89,7 +90,7 @@
@Override
public ResultSetExecution createResultSetExecution(QueryExpression command,ExecutionContext executionContext, RuntimeMetadata metadata, LdapContext context)
throws TranslatorException {
- return new LDAPSyncQueryExecution((Select)command, this, context);
+ return new LDAPSyncQueryExecution((Select)command, this, executionContext, context);
}
@Override
@@ -142,5 +143,15 @@
@Override
public boolean supportsNotCriteria() {
return true;
+ }
+
+ @TranslatorProperty(display="Use Pagination", description="Use a PagedResultsControl to page through large results. This is not supported by all directory servers.")
+ public boolean usePagination() {
+ return usePagination;
}
+
+ public void setUsePagination(boolean usePagination) {
+ this.usePagination = usePagination;
+ }
+
}
Modified: trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSyncQueryExecution.java
===================================================================
--- trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSyncQueryExecution.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/connectors/translator-ldap/src/main/java/org/teiid/translator/ldap/LDAPSyncQueryExecution.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -91,6 +91,8 @@
import javax.naming.directory.SearchResult;
import javax.naming.ldap.Control;
import javax.naming.ldap.LdapContext;
+import javax.naming.ldap.PagedResultsControl;
+import javax.naming.ldap.PagedResultsResponseControl;
import javax.naming.ldap.SortControl;
import javax.naming.ldap.SortKey;
@@ -98,6 +100,7 @@
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.metadata.Column;
+import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ResultSetExecution;
import org.teiid.translator.TranslatorException;
import org.teiid.translator.TypeFacility;
@@ -119,6 +122,8 @@
private IQueryToLdapSearchParser parser;
private Select query;
private LDAPExecutionFactory executionFactory;
+ private ExecutionContext executionContext;
+ private SearchControls ctrls;
/**
* Constructor
@@ -127,10 +132,11 @@
* @param logger the ConnectorLogger
* @param ldapCtx the LDAP Context
*/
- public LDAPSyncQueryExecution(Select query, LDAPExecutionFactory factory, LdapContext ldapCtx) {
+ public LDAPSyncQueryExecution(Select query, LDAPExecutionFactory factory, ExecutionContext context, LdapContext ldapCtx) {
this.ldapConnection = ldapCtx;
this.query = query;
this.executionFactory = factory;
+ this.executionContext = context;
}
/**
@@ -146,31 +152,40 @@
// Create and configure the new search context.
createSearchContext();
- SearchControls ctrls = setSearchControls();
- setStandardRequestControls();
+ ctrls = setSearchControls();
+ String ctxName = searchDetails.getContextName();
+ String filter = searchDetails.getContextFilter();
+ if (ctxName == null || filter == null || ctrls == null) {
+ throw new TranslatorException(LogConstants.CTX_CONNECTOR, "Search context, filter, or controls were null. Cannot execute search."); //$NON-NLS-1$
+ }
+ setRequestControls(null);
// Execute the search.
- executeSearch(ctrls);
+ executeSearch();
}
/**
* Set the standard request controls
*/
- private void setStandardRequestControls() throws TranslatorException {
- Control[] sortCtrl = new Control[1];
+ private void setRequestControls(byte[] cookie) throws TranslatorException {
+ List<Control> ctrl = new ArrayList<Control>();
SortKey[] keys = searchDetails.getSortKeys();
- if (keys != null) {
- try {
- sortCtrl[0] = new SortControl(keys, Control.NONCRITICAL);
- this.ldapCtx.setRequestControls(sortCtrl);
- LogManager.logTrace(LogConstants.CTX_CONNECTOR, "Sort ordering was requested, and sort control was created successfully."); //$NON-NLS-1$
- } catch (NamingException ne) {
- final String msg = LDAPPlugin.Util.getString("LDAPSyncQueryExecution.setControlsError") + //$NON-NLS-1$
- " : "+ne.getExplanation(); //$NON-NLS-1$
- throw new TranslatorException(msg);
- } catch(IOException e) {
- final String msg = LDAPPlugin.Util.getString("LDAPSyncQueryExecution.setControlsError"); //$NON-NLS-1$
- throw new TranslatorException(e,msg);
+ try {
+ if (keys != null) {
+ ctrl.add(new SortControl(keys, Control.NONCRITICAL));
}
+ if (this.executionFactory.usePagination()) {
+ ctrl.add(new PagedResultsControl(this.executionContext.getBatchSize(), cookie, Control.CRITICAL));
+ }
+ if (!ctrl.isEmpty()) {
+ this.ldapCtx.setRequestControls(ctrl.toArray(new Control[ctrl.size()]));
+ LogManager.logTrace(LogConstants.CTX_CONNECTOR, "Sort/pagination controls were created successfully."); //$NON-NLS-1$
+ }
+ } catch (NamingException ne) {
+ final String msg = LDAPPlugin.Util.getString("LDAPSyncQueryExecution.setControlsError") + //$NON-NLS-1$
+ " : "+ne.getExplanation(); //$NON-NLS-1$
+ throw new TranslatorException(ne, msg);
+ } catch(IOException e) {
+ throw new TranslatorException(e);
}
}
@@ -219,22 +234,14 @@
* Perform the LDAP search against the subcontext, using the filter and
* search controls appropriate to the query and model metadata.
*/
- private void executeSearch(SearchControls ctrls) throws TranslatorException {
- String ctxName = searchDetails.getContextName();
+ private void executeSearch() throws TranslatorException {
String filter = searchDetails.getContextFilter();
- if (ctxName == null || filter == null || ctrls == null) {
- LogManager.logError(LogConstants.CTX_CONNECTOR, "Search context, filter, or controls were null. Cannot execute search."); //$NON-NLS-1$
- }
try {
searchEnumeration = this.ldapCtx.search("", filter, ctrls); //$NON-NLS-1$
} catch (NamingException ne) {
- LogManager.logError(LogConstants.CTX_CONNECTOR, "LDAP search failed. Attempted to search context " //$NON-NLS-1$
- + ctxName + " using filter " + filter); //$NON-NLS-1$
final String msg = LDAPPlugin.Util.getString("LDAPSyncQueryExecution.execSearchError"); //$NON-NLS-1$
- throw new TranslatorException(msg + " : " + ne.getExplanation()); //$NON-NLS-1$
+ throw new TranslatorException(ne, msg + " : " + ne.getExplanation()); //$NON-NLS-1$
} catch(Exception e) {
- LogManager.logError(LogConstants.CTX_CONNECTOR, "LDAP search failed. Attempted to search context " //$NON-NLS-1$
- + ctxName + " using filter " + filter); //$NON-NLS-1$
final String msg = LDAPPlugin.Util.getString("LDAPSyncQueryExecution.execSearchError"); //$NON-NLS-1$
throw new TranslatorException(e, msg);
}
@@ -294,6 +301,27 @@
SearchResult searchResult = (SearchResult) searchEnumeration.next();
result = getRow(searchResult);
}
+
+ if (result == null && this.executionFactory.usePagination()) {
+ byte[] cookie = null;
+ Control[] controls = ldapCtx.getResponseControls();
+ if (controls != null) {
+ for (int i = 0; i < controls.length; i++) {
+ if (controls[i] instanceof PagedResultsResponseControl) {
+ PagedResultsResponseControl prrc = (PagedResultsResponseControl)controls[i];
+ cookie = prrc.getCookie();
+ }
+ }
+ }
+
+ if (cookie == null) {
+ return null;
+ }
+
+ setRequestControls(cookie);
+ executeSearch();
+ return next();
+ }
return result;
} catch (SizeLimitExceededException e) {
@@ -451,22 +479,4 @@
}
}
-
- /**
- * Active Directory and OpenLDAP supports PagedResultsControls, so I left
- * this method in here in case we decide to extend support for this control
- * in the future.
- */
-// private void setADRequestControls(int maxBatchSize) {
-// try {
-// ldapCtx.setRequestControls(new Control[] { new PagedResultsControl(
-// maxBatchSize, Control.CRITICAL) });
-// } catch (NamingException ne) {
-// logger.logError("Failed to set page size for LDAP results. Please ensure that paged results controls are supported by the LDAP server implementation."); //$NON-NLS-1$
-// ne.printStackTrace();
-// } catch (IOException ioe) {
-// logger.logError("IO Exception while setting paged results control."); //$NON-NLS-1$
-// ioe.printStackTrace();
-// }
-// }
}
Modified: trunk/documentation/admin-guide/src/main/docbook/en-US/content/admin-console.xml
===================================================================
--- trunk/documentation/admin-guide/src/main/docbook/en-US/content/admin-console.xml 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/documentation/admin-guide/src/main/docbook/en-US/content/admin-console.xml 2011-08-10 18:01:12 UTC (rev 3366)
@@ -1,92 +1,199 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version='1.0'?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<chapter id="admin-console">
- <title>Teiid Admin Console</title>
- <para>The Teiid Admin Console is a web based administrative and monitoring tool for Teiid.
- Teiid's Admin Console is built using the <ulink url="http://www.jboss.org/embjopr">Embedded JOPR</ulink> library and adds a additional plugin into the Embeeded JOPR program already available in the
- <ulink url="http://www.jboss.org/jbossas">JBoss AS</ulink>.</para>
-
- <mediaobject>
- <imageobject>
- <imagedata scalefit="1" fileref="../images/admin_console.png"/>
- </imageobject>
- </mediaobject>
-
- <section>
- <title>What can be monitored and/or configured?</title>
- <para>Here are the steps to follow to install Teiid</para>
-
- <orderedlist>
- <listitem> <para><emphasis>The Teiid Runtime Engine</emphasis> (Data Services node in the tree)</para> </listitem>
- <listitem> <para><emphasis>VDBs</emphasis> - Virtual databases</para>
+ <title>Teiid Admin Console</title>
+ <para>The Teiid Admin Console is a web based administrative and
+ monitoring tool for Teiid. Teiid's Admin Console is built using
+ the <ulink url="http://www.jboss.org/embjopr">Embedded JOPR</ulink>
+ library and adds a additional plugin into the Embedded JOPR program
+ already available in the <ulink url="http://www.jboss.org/jbossas">
+ JBoss AS</ulink>.</para>
+ <mediaobject><imageobject>
+ <imagedata fileref="../images/admin_console.png" scalefit="1"/></imageobject></mediaobject>
+ <section>
+ <title>What can be monitored and/or configured?</title>
+ <para>Here are the steps to follow to install Teiid</para>
+ <orderedlist>
+ <listitem>
+ <para><emphasis>The Teiid Runtime Engine</emphasis> (Data
+ Services node in the tree)</para>
+ </listitem>
+ <listitem>
+ <para><emphasis>VDBs</emphasis> - Virtual databases</para>
+ <orderedlist>
+ <listitem>
+ <para><emphasis>Models</emphasis></para>
<orderedlist>
- <listitem> <para><emphasis>Models</emphasis></para>
- <orderedlist>
- <listitem> <para><emphasis>Source</emphasis>- these are physical sources</para></listitem>
- <listitem> <para><emphasis>Multi-source</emphasis> - these are multiple sourced models</para></listitem>
- <listitem> <para><emphasis>Logical</emphasis> - these are virtual sources</para></listitem>
- </orderedlist>
- </listitem>
- <listitem> <para><emphasis>Translator instances</emphasis>- any Translator instances defined for use by this VDB</para> </listitem>
+ <listitem>
+ <para><emphasis>Source</emphasis>- these are physical
+ sources</para>
+ </listitem>
+ <listitem>
+ <para><emphasis>Multi-source</emphasis> - these are
+ multiple sourced models</para>
+ </listitem>
+ <listitem>
+ <para><emphasis>Logical</emphasis> - these are virtual
+ sources</para>
+ </listitem>
</orderedlist>
+ </listitem>
+ <listitem>
+ <para><emphasis>Translator instances</emphasis>- any
+ Translator instances defined for use by this VDB</para>
+ </listitem>
+ <listitem>
+ <para><emphasis>Data Roles</emphasis>- any
+ data roles defined for use by this VDB</para>
+ </listitem>
+ </orderedlist>
+ </listitem>
+ <listitem>
+ <para>Translators - These are the extensions to supported
+ datasources that come with Teiid out-of-the-box.</para>
+ </listitem>
+ </orderedlist>
+ <note>
+ <para>The creation/modification of the datasource is managed by
+ the JBossAS plugin.</para>
+ </note>
+ <section>
+ <title>Configuration</title>
+ <orderedlist>
+ <listitem>
+ <para>Settings for the Data Services plugin</para>
</listitem>
- <listitem> <para>Translators - These are the extensions to supported datasources that come with Teiid out-of-the-box.</para> </listitem>
- </orderedlist>
-
- <note>
- <para>The creation/modification of the datasource is managed by the JBossAS plugin.</para>
- </note>
-
+ <listitem>
+ <para>Runtime Engine properties</para>
+ </listitem>
+ <listitem>
+ <para>Buffer Service</para>
+ </listitem>
+ <listitem>
+ <para>Jdbc Socket configuration</para>
+ </listitem>
+ <listitem>
+ <para>Session Service</para>
+ </listitem>
+ </orderedlist>
+ </section>
<section>
- <title>Configuration</title>
- <orderedlist>
- <listitem> <para>Runtime Engine properties</para> </listitem>
- <listitem> <para>Buffer Service</para> </listitem>
- <listitem> <para>Jdbc Socket configuration</para> </listitem>
- <listitem> <para>Session Service</para> </listitem>
- </orderedlist>
+ <title>Metrics</title>
+ <orderedlist>
+ <listitem>
+ <para>Long Running Query count</para>
+ </listitem>
+ <listitem>
+ <para>Active Query count</para>
+ </listitem>
+ <listitem>
+ <para>Active Session count</para>
+ </listitem>
+ <listitem>
+ <para>Prepared Plan Cache Hit Ratio %</para>
+ </listitem>
+ <listitem>
+ <para>Prepared Plan Cache Size</para>
+ </listitem>
+ <listitem>
+ <para>Prepared Plan Cache # of Requests</para>
+ </listitem>
+ <listitem>
+ <para>ResultSet Cache Hit Ratio %</para>
+ </listitem>
+ <listitem>
+ <para>ResultSet Cache Size</para>
+ </listitem>
+ <listitem>
+ <para>ResultSet Cache # of Requests</para>
+ </listitem>
+ <listitem>
+ <para>Used Buffer Space</para>
+ </listitem>
+ </orderedlist>
</section>
-
<section>
- <title>Metrics</title>
+ <title>Control (Operations)</title>
+ <listitem>
+ <para>Data Services Engine</para>
<orderedlist>
- <listitem> <para>Long Running Query count</para> </listitem>
- <listitem> <para>Active Query count</para> </listitem>
- <listitem> <para>Active Session count</para> </listitem>
+ <listitem>
+ <para>View Long Running Queries</para>
+ </listitem>
+ <listitem>
+ <para>View Current Sessions</para>
+ </listitem>
+ <listitem>
+ <para>Deploy a VDB via URL</para>
+ </listitem>
+ <listitem>
+ <para>Terminate Session</para>
+ </listitem>
+ <listitem>
+ <para>View Current Requests</para>
+ </listitem>
+ <listitem>
+ <para>Terminate requests</para>
+ </listitem>
+ <listitem>
+ <para>View Current Transactions</para>
+ </listitem>
+ <listitem>
+ <para>Terminate Transaction</para>
+ </listitem>
</orderedlist>
- </section>
-
- <section>
- <title>Control (Operations)</title>
+ </listitem>
+ <listitem>
+ <para>Virtual Database</para>
<orderedlist>
- <listitem> <para>View Long Running Queries</para> </listitem>
- <listitem> <para>View Current Sessions</para> </listitem>
- <listitem> <para>Terminate Session</para> </listitem>
- <listitem> <para>View Current Requests</para> </listitem>
- <listitem> <para>Terminate requests</para> </listitem>
- <listitem> <para>View Current Transactions</para> </listitem>
- <listitem> <para>Terminate Transaction</para> </listitem>
+ <listitem>
+ <para>View VDB Requests</para>
+ </listitem>
+ <listitem>
+ <para>View VDB Sessions</para>
+ </listitem>
+ <listitem>
+ <para>List Materialized View Info</para>
+ </listitem>
+ <listitem>
+ <para>Refresh a Materialized View</para>
+ </listitem>
+ <listitem>
+ <para>Clear Cache</para>
+ </listitem>
</orderedlist>
+ </listitem>
</section>
-
<section id="vdb_deploy">
- <title>Deploying the VDB</title>
- <para>VDB archive files created it the Designer Tool or Dynamic VDBs can be deployed into Teiid server using
- the Admin Console.</para>
-
- <orderedlist>
- <listitem> <para>Select the Virtual Database node in the Admin Console tree and click the Add New Resource button.</para> </listitem>
- <listitem> <para>Select the VDB archive file from the file system and click continue.</para> </listitem>
- <listitem> <para>The VDB will deploy if no fatal errors are found in the archive. The status of
- the VDB will be UP if no errors are found with the models in the VDB.</para> </listitem>
- <listitem> <para>If there are model errors, the VDB will be deployed with a status of DOWN and the errors will be
- listed on the configuration tab of the VDB. VDBs that are not UP will be marked with a red X in the tree.</para> </listitem>
- </orderedlist>
-
- <para>Only Model's "connection-jndi-name" can be modified using this tool by clicking on the "configuration"
- tab, all other proeprties are read-only.</para>
- </section>
-
- </section>
-
-</chapter>
\ No newline at end of file
+ <title>Deploying the VDB</title>
+ <para>VDB archive files created it the Designer Tool or Dynamic
+ VDBs can be deployed into Teiid server using the Admin
+ Console.</para>
+ <orderedlist>
+ <listitem>
+ <para>Select the Virtual Database node in the Admin Console
+ tree and click the Add New Resource button.</para>
+ </listitem>
+ <listitem>
+ <para>Select the VDB archive file from the file system and
+ click continue.</para>
+ </listitem>
+ <listitem>
+ <para>The VDB will deploy if no fatal errors are found in the
+ archive. The status of the VDB will be UP if no errors are
+ found with the models in the VDB.</para>
+ </listitem>
+ <listitem>
+ <para>If there are model errors, the VDB will be deployed
+ with a status of DOWN and the errors will be listed on the
+ configuration tab of the VDB. VDBs that are not UP will be
+ marked with a red X in the tree.</para>
+ </listitem>
+ </orderedlist>
+ <para>Only Model's "connection-jndi-name" can be
+ modified using this tool by clicking on the
+ "configuration" tab, all other properties are
+ read-only.</para>
+ </section>
+ </section>
+</chapter>
Modified: trunk/documentation/admin-guide/src/main/docbook/en-US/images/admin_console.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/caching-guide/src/main/docbook/en-US/content/codetable.xml
===================================================================
--- trunk/documentation/caching-guide/src/main/docbook/en-US/content/codetable.xml 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/documentation/caching-guide/src/main/docbook/en-US/content/codetable.xml 2011-08-10 18:01:12 UTC (rev 3366)
@@ -29,7 +29,7 @@
<para>See the Reference for more information on use of the lookup function.</para>
<example>
<title>Country Code Lookup</title>
- <programlisting>lookup(‘ISOCountryCodes, ‘CountryName’, ‘CountryCode’, ‘US’)</programlisting>
+ <programlisting>lookup('ISOCountryCodes', 'CountryName', 'CountryCode', 'US')</programlisting>
</example>
</section>
<section>
@@ -47,7 +47,12 @@
</section>
<section>
<title>Materialized View Alternative</title>
- <para>The lookup function is a shortcut to create an internal materialized view. In many situations, it may be better to directly create the analogous materialized view rather than to use a code table.</para>
+ <para>The lookup function is a shortcut to create an internal materialized view with an appropriate primary key. In many situations, it may be better to directly create the analogous materialized view rather than to use a code table.</para>
+ <example>
+ <title>Country Code Lookup Against A Mat View</title>
+ <programlisting>SELECT (SELECT CountryCode From MatISOCountryCodes WHERE CountryName = tbl.CountryName) as cc FROM tbl</programlisting>
+ <para>Here MatISOCountryCodes is a view selecting from ISOCountryCodes that has been marked as materialized and has a primary key or index on CountryName. The scalar subquery will use the index to lookup the country code for each country name in tbl.</para>
+ </example>
<itemizedlist>
<title>Reasons to use a materialized view:</title>
<listitem>
@@ -63,7 +68,7 @@
<para>The ability to use <link linkend="nocache">OPTION NOCACHE</link>.</para>
</listitem>
<listitem>
- <para>Usage of a materialized view lookup as an uncorrelated subquery is no different than the use of the lookup function.</para>
+ <para>There is almost no performance difference.</para>
</listitem>
</itemizedlist>
<orderedlist>
@@ -72,7 +77,7 @@
<para>Create a view selecting the appropriate columns from the desired table. In general, this view may have an arbitrarily complicated transformation query.</para>
</listitem>
<listitem>
- <para>Designate the appropriate column(s) as the primary key.</para>
+ <para>Designate the appropriate column(s) as the primary key. Additional indexes can be added if needed.</para>
</listitem>
<listitem>
<para>Set the materialized property to true.</para>
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml 2011-08-10 18:01:12 UTC (rev 3366)
@@ -1824,20 +1824,21 @@
<para><synopsis>LOOKUP(codeTable, returnColumn, keyColumn, keyValue)</synopsis></para>
<para>In the lookup table codeTable, find the row where
keyColumn has the value keyValue and return the
- associated returnColumn. codeTable must be a fully-qualified string
- literal containing metadata identifiers, keyValue datatype
- must match datatype of the keyColumn, return datatype
- matches that of returnColumn. returnColumn and
- keyColumn parameters should use their shortened names.
+ associated returnColumn value or null if no matching key is found. codeTable must be a string literal that is the fully-qualified name of the target table.
+ returnColumn and key Column must also be string literals of just the relevant column names.
+ The keyValue can be any expression that must match the datatype of the keyColumn. The return datatype
+ matches that of returnColumn.
</para>
- <para>For example, a StatePostalCodes table used to translate postal codes to
- complete state names might represent an example of this type of
- lookup table. One column, PostalCode, represents a key column.
- Other tables refer to this two-letter code. A
- second column, StateDisplayName, would represent the complete name
- of the state. Hence, a query to this lookup table would typically
- provide the PostalCode and expect the StateDisplayName in response.
- </para>
+ <example>
+ <title>Country Code Lookup</title>
+ <programlisting>lookup('ISOCountryCodes', 'CountryName', 'CountryCode', 'US')</programlisting>
+ <para>A ISOCountryCodes table used to translate country name to
+ ISO codes. One column, CountryName, represents a key column.
+ A second column, CountryCode, would represent the ISO code of the country.
+ Hence, a query to this lookup table would
+ provide a CountryName, shown above as 'US', and expect a CountryCode value in response.
+ </para>
+ </example>
<para>When you call this function for any combination of codeTable, returnColumn, and
keyColumn for the first time, the Teiid System caches the result.
The Teiid System uses this cache for all
@@ -1846,6 +1847,7 @@
the Teiid System. Thus, you should not use this function for
data that is subject to updates. Instead, you can use it against
static data that does not change over time.</para>
+ <para>See the Caching Guide for more on the caching aspects of the lookup function.</para>
<note>
<itemizedlist>
<listitem>
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml 2011-08-10 18:01:12 UTC (rev 3366)
@@ -545,6 +545,11 @@
<entry>Restrict Searches to objectClass named in the Name field for a table</entry>
<entry>false</entry>
</row>
+ <row>
+ <entry>UsePagination</entry>
+ <entry>Use a PagedResultsControl to page through large results. This is not supported by all directory servers.</entry>
+ <entry>false</entry>
+ </row>
</tbody>
</tgroup>
</table>
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/CachedResults.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -41,7 +41,6 @@
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.query.QueryPlugin;
-import org.teiid.query.analysis.AnalysisRecord;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.parser.ParseInfo;
import org.teiid.query.parser.QueryParser;
@@ -58,8 +57,6 @@
private transient Command command;
private transient TupleBuffer results;
- private AnalysisRecord analysisRecord;
-
private String[] types;
private CacheHint hint;
private int batchSize;
@@ -73,14 +70,6 @@
return this.uuid;
}
- public AnalysisRecord getAnalysisRecord() {
- return analysisRecord;
- }
-
- public void setAnalysisRecord(AnalysisRecord analysisRecord) {
- this.analysisRecord = analysisRecord;
- }
-
public TupleBuffer getResults() {
return results;
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -456,7 +456,6 @@
CachedResults cr = rsCache.get(cacheId);
if (cr != null) {
this.resultsBuffer = cr.getResults();
- this.analysisRecord = cr.getAnalysisRecord();
request.initMetadata();
this.originalCommand = cr.getCommand(requestMsg.getCommandString(), request.metadata, pi);
request.validateAccess(this.originalCommand);
@@ -530,7 +529,6 @@
Determinism determinismLevel = processor.getContext().getDeterminismLevel();
CachedResults cr = new CachedResults();
cr.setCommand(originalCommand);
- cr.setAnalysisRecord(analysisRecord);
cr.setResults(resultsBuffer, processor.getProcessorPlan());
if (originalCommand.getCacheHint() != null) {
LogManager.logDetail(LogConstants.CTX_DQP, requestID, "Using cache hint", originalCommand.getCacheHint()); //$NON-NLS-1$
@@ -659,6 +657,7 @@
if (requestMsg.getShowPlan() == ShowPlan.DEBUG) {
response.setDebugLog(analysisRecord.getDebugLog());
}
+ this.analysisRecord = null;
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/analysis/AnalysisRecord.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/analysis/AnalysisRecord.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/engine/src/main/java/org/teiid/query/analysis/AnalysisRecord.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -53,7 +53,7 @@
* <li>Debug trace information, if requested</LI>
* </ul>
*/
-public class AnalysisRecord implements Serializable {
+public class AnalysisRecord {
// Common
public static final String PROP_OUTPUT_COLS = "Output Columns"; //$NON-NLS-1$
Modified: trunk/engine/src/main/java/org/teiid/query/eval/Evaluator.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/eval/Evaluator.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/engine/src/main/java/org/teiid/query/eval/Evaluator.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -118,6 +118,7 @@
import org.teiid.query.sql.util.VariableContext;
import org.teiid.query.util.CommandContext;
import org.teiid.query.xquery.saxon.SaxonXQueryExpression;
+import org.teiid.query.xquery.saxon.XQueryEvaluator;
import org.teiid.query.xquery.saxon.SaxonXQueryExpression.Result;
import org.teiid.query.xquery.saxon.SaxonXQueryExpression.RowProcessor;
import org.teiid.translator.WSConnection.Util;
@@ -203,7 +204,7 @@
}
}
- public final static char[] REGEX_RESERVED = new char[] {'$', '(', ')', '*', '.', '?', '[', '\\', ']', '^', '{', '|', '}'}; //in sorted order
+ public final static char[] REGEX_RESERVED = new char[] {'$', '(', ')', '*', '+', '.', '?', '[', '\\', ']', '^', '{', '|', '}'}; //in sorted order
private final static MatchCriteria.PatternTranslator LIKE_TO_REGEX = new MatchCriteria.PatternTranslator(new char[] {'%', '_'}, new String[] {".*", "."}, REGEX_RESERVED, '\\', Pattern.DOTALL); //$NON-NLS-1$ //$NON-NLS-2$
private final static char[] SIMILAR_REGEX_RESERVED = new char[] {'$', '.', '\\', '^'}; //in sorted order
@@ -933,7 +934,7 @@
parameters.put(passing.getAlias(), value);
}
}
- return xquery.evaluateXQuery(contextItem, parameters, processor, context);
+ return XQueryEvaluator.evaluateXQuery(xquery, contextItem, parameters, processor, context);
}
private Evaluator.NameValuePair<Object>[] getNameValuePairs(List<?> tuple, List<DerivedColumn> args, boolean xmlNames)
Modified: trunk/engine/src/main/java/org/teiid/query/mapping/xml/ResultSetInfo.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/mapping/xml/ResultSetInfo.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/engine/src/main/java/org/teiid/query/mapping/xml/ResultSetInfo.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -23,11 +23,13 @@
package org.teiid.query.mapping.xml;
import java.util.HashSet;
+import java.util.List;
import java.util.Set;
import org.teiid.query.processor.ProcessorPlan;
import org.teiid.query.sql.lang.Command;
import org.teiid.query.sql.lang.Criteria;
+import org.teiid.query.sql.lang.Insert;
import org.teiid.query.sql.lang.OrderBy;
import org.teiid.query.sql.symbol.ElementSymbol;
@@ -61,21 +63,21 @@
private boolean criteriaRaised = false;
- private boolean stagedResult = false;
-
- //joined source node state
- private int mappingClassNumber = 0;
private ElementSymbol mappingClassSymbol;
private boolean inputSet;
private boolean isCritNullDependent;
+
+ //auto-staging related info
+ private String stagingRoot;
+ private String tempTable;
+ private Command tempSelect;
+ private Insert tempInsert;
+ private Command tempDrop;
+ private boolean isAutoStaged;
+ private List<ElementSymbol> fkColumns;
public ResultSetInfo(String resultName) {
- this(resultName, false);
- }
-
- public ResultSetInfo(String resultName, boolean staged) {
this.resultSetName = resultName;
- this.stagedResult = staged;
}
public String getResultSetName() {
@@ -144,14 +146,19 @@
}
public Object clone() {
- ResultSetInfo clone = new ResultSetInfo(this.resultSetName, this.stagedResult);
+ ResultSetInfo clone = new ResultSetInfo(this.resultSetName);
clone.rsPlan = this.rsPlan;
clone.userRowLimit = this.userRowLimit;
clone.exceptionOnRowLimit = this.exceptionOnRowLimit;
clone.rsCommand = (Command)this.rsCommand.clone();
clone.criteriaRaised = this.criteriaRaised;
- clone.mappingClassNumber = this.mappingClassNumber;
clone.mappingClassSymbol = this.mappingClassSymbol;
+ clone.tempInsert = this.tempInsert;
+ clone.tempSelect = this.tempSelect;
+ clone.tempTable = this.tempTable;
+ clone.tempDrop = this.tempDrop;
+ clone.isAutoStaged = this.isAutoStaged;
+ clone.fkColumns = this.fkColumns;
return clone;
}
@@ -159,14 +166,6 @@
return resultSetName + ", resultSetObject " + rsCommand; //$NON-NLS-1$
}
- public int getMappingClassNumber() {
- return this.mappingClassNumber;
- }
-
- public void setMappingClassNumber(int mappingClassNumber) {
- this.mappingClassNumber = mappingClassNumber;
- }
-
public ElementSymbol getMappingClassSymbol() {
return this.mappingClassSymbol;
}
@@ -175,10 +174,6 @@
this.mappingClassSymbol = mappingClassSymbol;
}
- public boolean isStagedResult() {
- return this.stagedResult;
- }
-
public boolean hasInputSet() {
return inputSet;
}
@@ -194,4 +189,60 @@
public boolean isCritNullDependent(){
return this.isCritNullDependent;
}
+
+ public String getStagingRoot() {
+ return stagingRoot;
+ }
+
+ public void setStagingRoot(String stagingRoot) {
+ this.stagingRoot = stagingRoot;
+ }
+
+ public void setTempSelect(Command tempSelect) {
+ this.tempSelect = tempSelect;
+ }
+
+ public Command getTempSelect() {
+ return tempSelect;
+ }
+
+ public void setTempInsert(Insert tempInsert) {
+ this.tempInsert = tempInsert;
+ }
+
+ public Insert getTempInsert() {
+ return tempInsert;
+ }
+
+ public Command getTempDrop() {
+ return tempDrop;
+ }
+
+ public void setTempDrop(Command tempDrop) {
+ this.tempDrop = tempDrop;
+ }
+
+ public String getTempTable() {
+ return tempTable;
+ }
+
+ public void setTempTable(String rsTempTable) {
+ this.tempTable = rsTempTable;
+ }
+
+ public boolean isAutoStaged() {
+ return isAutoStaged;
+ }
+
+ public void setAutoStaged(boolean isAutoStaged) {
+ this.isAutoStaged = isAutoStaged;
+ }
+
+ public void setFkColumns(List<ElementSymbol> fkColumns) {
+ this.fkColumns = fkColumns;
+ }
+
+ public List<ElementSymbol> getFkColumns() {
+ return this.fkColumns;
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/query/metadata/TempMetadataAdapter.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/metadata/TempMetadataAdapter.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/engine/src/main/java/org/teiid/query/metadata/TempMetadataAdapter.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -325,7 +325,7 @@
return true;
}
- if(groupID instanceof TempMetadataID) {
+ if(groupID instanceof TempMetadataID && !(actualMetadata instanceof TempMetadataAdapter)) {
return false;
}
@@ -347,7 +347,7 @@
}
}
- if(groupID instanceof TempMetadataID) {
+ if(groupID instanceof TempMetadataID && !(actualMetadata instanceof TempMetadataAdapter)) {
return null;
}
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleMergeCriteria.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleMergeCriteria.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleMergeCriteria.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -420,6 +420,7 @@
result.not = exists.isNegated();
//the correlations can only be in where (if no group by or aggregates) or having
result.mergeJoin = exists.getSubqueryHint().isMergeJoin();
+ result.makeInd = exists.getSubqueryHint().isDepJoin();
if (!UNNEST && !result.mergeJoin) {
return result;
}
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLPlanToProcessVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLPlanToProcessVisitor.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLPlanToProcessVisitor.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -22,6 +22,8 @@
package org.teiid.query.optimizer.xml;
+import java.util.HashMap;
+import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Stack;
@@ -70,7 +72,7 @@
Stack<Program> programStack = new Stack<Program>();
XMLPlannerEnvironment planEnv;
Program originalProgram ;
- Program cleanupProgram = new Program();
+ Map<String, List<String>> unloadInstructions = new HashMap<String, List<String>>();
public XMLPlanToProcessVisitor(XMLPlannerEnvironment env) {
this.planEnv = env;
@@ -85,8 +87,7 @@
// remove the current program from the stack; we no longer need this
originalProgram=this.programStack.pop();
- // cleanup program will have instructions to unload the staging table.
- originalProgram.addInstructions(cleanupProgram);
+ addUnloads(originalProgram, null);
}
public void start(MappingAttribute attribute, Map context){
@@ -289,7 +290,6 @@
Program currentProgram = programStack.peek();
String source = node.getActualResultSetName();
- ResultSetInfo info= node.getResultSetInfo();
// move to next row.
currentProgram.addInstruction(new MoveCursorInstruction(source));
@@ -327,15 +327,22 @@
}
List<String> stagingTables = node.getStagingTables();
+ Program currentProgram = programStack.peek();
+
for (String table : stagingTables) {
- Program currentProgram = programStack.peek();
-
// load staging
- currentProgram.addInstruction(new ExecStagingTableInstruction(table, planEnv.getStagingTableResultsInfo(table)));
+ ResultSetInfo stagingTableResultsInfo = planEnv.getStagingTableResultsInfo(table);
+ currentProgram.addInstruction(new ExecStagingTableInstruction(table, stagingTableResultsInfo));
// unload staging
String unloadName = planEnv.unLoadResultName(table);
- cleanupProgram.addInstruction(new ExecStagingTableInstruction(unloadName, planEnv.getStagingTableResultsInfo(unloadName)));
+ String parent = stagingTableResultsInfo.getStagingRoot();
+ List<String> instructions = this.unloadInstructions.get(parent);
+ if (instructions == null) {
+ instructions = new LinkedList<String>();
+ this.unloadInstructions.put(parent, instructions);
+ }
+ instructions.add(unloadName);
} // for
}
@@ -344,7 +351,22 @@
// stop recording and update the program
endRootRecursive(node, context);
}
+
+ Program currentProgram = programStack.peek();
+ if (node instanceof MappingSourceNode) {
+ String name = node.getSource();
+ addUnloads(currentProgram, name);
+ }
}
+
+ private void addUnloads(Program currentProgram, String name) {
+ List<String> unloads = this.unloadInstructions.get(name);
+ if (unloads != null) {
+ for (String string : unloads) {
+ currentProgram.addInstruction(new ExecStagingTableInstruction(string, planEnv.getStagingTableResultsInfo(string)));
+ }
+ }
+ }
public void start(final MappingRecursiveElement element, Map context){
Program currentProgram = programStack.peek();
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLPlanner.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLPlanner.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLPlanner.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -226,8 +226,8 @@
}
static void removeExcluded(MappingNode node) {
- for (Iterator i = node.getChildren().iterator(); i.hasNext();) {
- MappingNode child = (MappingNode)i.next();
+ for (Iterator<MappingNode> i = node.getChildren().iterator(); i.hasNext();) {
+ MappingNode child = i.next();
if (!(node instanceof MappingRecursiveElement) && child.isExcluded()) {
i.remove();
} else {
@@ -305,7 +305,7 @@
by = new OrderBy();
}
ElementSymbol mappedSymbol = (ElementSymbol)sourceNode.getSymbolMap().get(new ElementSymbol(elementNode.getNameInSource()));
- by.addVariable(mappedSymbol.clone(), ((Boolean)types.get(i)).booleanValue());
+ by.addVariable(mappedSymbol.clone(), types.get(i));
rs.setOrderBy(by);
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLPlannerEnvironment.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLPlannerEnvironment.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLPlannerEnvironment.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -124,7 +124,7 @@
public ResultSetInfo getStagingTableResultsInfo(String groupName) {
ResultSetInfo info = (ResultSetInfo)this.stagingResultsInfo.get(groupName.toUpperCase());
if (info == null) {
- info = new ResultSetInfo(groupName, true);
+ info = new ResultSetInfo(groupName);
this.stagingResultsInfo.put(info.getResultSetName().toUpperCase(), info);
}
return info;
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLQueryPlanner.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLQueryPlanner.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLQueryPlanner.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -55,7 +55,6 @@
import org.teiid.query.processor.relational.RelationalPlan;
import org.teiid.query.resolver.QueryResolver;
import org.teiid.query.resolver.util.ResolverUtil;
-import org.teiid.query.rewriter.QueryRewriter;
import org.teiid.query.sql.lang.Command;
import org.teiid.query.sql.lang.Criteria;
import org.teiid.query.sql.lang.Drop;
@@ -140,10 +139,10 @@
prepareQuery(sourceNode, planEnv, command);
- QueryUtil.rewriteQuery(command, planEnv.getGlobalMetadata(), planEnv.context);
+ Command cmd = QueryUtil.rewriteQuery(command, planEnv.getGlobalMetadata(), planEnv.context);
// Plan the result set.
- ProcessorPlan queryPlan = optimizePlan(command, planEnv);
+ ProcessorPlan queryPlan = optimizePlan(cmd, planEnv);
rsInfo.setPlan(queryPlan);
} catch (Exception e) {
throw new TeiidRuntimeException(e);
@@ -441,7 +440,7 @@
return finder.msn;
}
- private static void updateSymbolMap(Map symbolMap, String oldGroup, final String newGroup, QueryMetadataInterface metadata)
+ static void updateSymbolMap(Map symbolMap, String oldGroup, final String newGroup, QueryMetadataInterface metadata)
throws QueryResolverException,QueryMetadataException,TeiidComponentException {
GroupSymbol oldGroupSymbol = new GroupSymbol(oldGroup);
@@ -485,7 +484,7 @@
GroupSymbol srcGroup = QueryUtil.createResolvedGroup(srcGroupName, planEnv.getGlobalMetadata());
- String intoGroupName = "#"+stageGroupName.replace('.', '_'); //$NON-NLS-1$
+ String intoGroupName = getTempTableName(stageGroupName);
GroupSymbol intoGroupSymbol = new GroupSymbol(intoGroupName);
query.setInto(new Into(intoGroupSymbol));
@@ -571,6 +570,11 @@
return true;
}
+
+ static String getTempTableName(String stageGroupName) {
+ String intoGroupName = "#"+stageGroupName.replace('.', '_'); //$NON-NLS-1$
+ return intoGroupName;
+ }
/**
* This builds a command in the following form; If staging table name is "FOO"
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLStagaingQueryPlanner.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLStagaingQueryPlanner.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/xml/XMLStagaingQueryPlanner.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -22,23 +22,54 @@
package org.teiid.query.optimizer.xml;
+import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
import org.teiid.api.exception.query.QueryMetadataException;
+import org.teiid.api.exception.query.QueryParserException;
import org.teiid.api.exception.query.QueryPlannerException;
import org.teiid.api.exception.query.QueryResolverException;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidRuntimeException;
+import org.teiid.logging.LogConstants;
+import org.teiid.logging.LogManager;
import org.teiid.query.mapping.relational.QueryNode;
+import org.teiid.query.mapping.xml.MappingBaseNode;
import org.teiid.query.mapping.xml.MappingDocument;
+import org.teiid.query.mapping.xml.MappingNode;
import org.teiid.query.mapping.xml.MappingSourceNode;
import org.teiid.query.mapping.xml.MappingVisitor;
import org.teiid.query.mapping.xml.Navigator;
import org.teiid.query.mapping.xml.ResultSetInfo;
+import org.teiid.query.metadata.TempMetadataStore;
import org.teiid.query.optimizer.relational.RelationalPlanner;
+import org.teiid.query.parser.QueryParser;
+import org.teiid.query.resolver.QueryResolver;
+import org.teiid.query.resolver.util.ResolverUtil;
+import org.teiid.query.resolver.util.ResolverVisitor;
+import org.teiid.query.sql.lang.Command;
+import org.teiid.query.sql.lang.CompareCriteria;
+import org.teiid.query.sql.lang.Criteria;
+import org.teiid.query.sql.lang.ExistsCriteria;
+import org.teiid.query.sql.lang.From;
+import org.teiid.query.sql.lang.GroupBy;
+import org.teiid.query.sql.lang.Insert;
import org.teiid.query.sql.lang.Option;
import org.teiid.query.sql.lang.Query;
+import org.teiid.query.sql.lang.Select;
+import org.teiid.query.sql.lang.UnaryFromClause;
+import org.teiid.query.sql.symbol.Constant;
+import org.teiid.query.sql.symbol.ElementSymbol;
+import org.teiid.query.sql.symbol.ExpressionSymbol;
import org.teiid.query.sql.symbol.GroupSymbol;
+import org.teiid.query.sql.symbol.Reference;
+import org.teiid.query.sql.symbol.SingleElementSymbol;
+import org.teiid.query.sql.visitor.ExpressionMappingVisitor;
import org.teiid.query.sql.visitor.GroupCollectorVisitor;
@@ -47,7 +78,6 @@
*/
public class XMLStagaingQueryPlanner {
-
static void stageQueries(MappingDocument doc, final XMLPlannerEnvironment planEnv)
throws QueryPlannerException, QueryMetadataException, TeiidComponentException {
@@ -86,7 +116,7 @@
}
static boolean stagePlannedQuery(MappingSourceNode sourceNode, XMLPlannerEnvironment planEnv)
- throws QueryPlannerException, QueryMetadataException, TeiidComponentException, QueryResolverException {
+ throws QueryPlannerException, QueryMetadataException, TeiidComponentException, QueryResolverException, QueryParserException {
Option option = planEnv.xmlCommand.getOption();
@@ -114,18 +144,6 @@
return false;
}
- //id as mapping class
- Object metadataID = planEnv.getGlobalMetadata().getGroupID(sourceNode.getResultName());
- if (RelationalPlanner.isNoCacheGroup(planEnv.getGlobalMetadata(), metadataID, option)) {
- return false;
- }
-
- //id as generated mapping class name
- metadataID = planEnv.getGlobalMetadata().getGroupID(sourceNode.getActualResultSetName());
- if (RelationalPlanner.isNoCacheGroup(planEnv.getGlobalMetadata(), metadataID, option)) {
- return false;
- }
-
// get the original transformation of the mapping class before planning.
Query stagableQuery = (Query)QueryUtil.getQueryFromQueryNode(groupName, planEnv);
@@ -140,17 +158,192 @@
}
}
+ Criteria crit = ((Query)rsInfo.getCommand()).getCriteria();
+
+ GroupSymbol parent = null;
+ LinkedHashSet<ElementSymbol> outerReferences = new LinkedHashSet<ElementSymbol>();
+ LinkedHashSet<ElementSymbol> fkColumns = new LinkedHashSet<ElementSymbol>();
+ //see if we can perform a dependent join
+ for (Criteria conjunct : Criteria.separateCriteriaByAnd(crit)) {
+ if (!(conjunct instanceof CompareCriteria)) {
+ continue;
+ }
+ CompareCriteria cc = (CompareCriteria)conjunct;
+ if (cc.getOperator() != CompareCriteria.EQ) {
+ continue;
+ }
+ if (!(cc.getLeftExpression() instanceof ElementSymbol)
+ || !(cc.getRightExpression() instanceof ElementSymbol)) {
+ continue;
+ }
+ ElementSymbol les = (ElementSymbol)cc.getLeftExpression();
+ ElementSymbol res = (ElementSymbol)cc.getRightExpression();
+ if (les.getGroupSymbol().getNonCorrelationName().equalsIgnoreCase(groupName)) {
+ parent = res.getGroupSymbol();
+ outerReferences.add(res.clone());
+ fkColumns.add(les.clone());
+ } else if (res.getGroupSymbol().getNonCorrelationName().equalsIgnoreCase(groupName)) {
+ parent = les.getGroupSymbol();
+ outerReferences.add(les.clone());
+ fkColumns.add(res.clone());
+ }
+ }
+ String stagingGroupName = planEnv.getStagedResultName(groupName);
+
+ boolean recursive = false;
+ MappingSourceNode msn = sourceNode;
+ while (!recursive && msn != null) {
+ MappingNode mappingNode = msn.getChildren().get(0);
+ if (mappingNode instanceof MappingBaseNode) {
+ recursive = ((MappingBaseNode)mappingNode).isRootRecursiveNode();
+ }
+ msn = msn.getParentSourceNode();
+ }
+
+ if (parent != null && !recursive) {
+ stagableQuery = (Query)stagableQuery.clone();
+ String parentName = parent.getNonCorrelationName();
+
+ String parentStagingName = planEnv.getStagedResultName(parentName);
+ GroupSymbol parentTempTable = new GroupSymbol(XMLQueryPlanner.getTempTableName(parentStagingName));
+ ResultSetInfo parentRsInfo = planEnv.getStagingTableResultsInfo(parentStagingName);
+ String stagingRoot = sourceNode.getParentSourceNode().getSource();
+
+ boolean parentStaged = parentRsInfo.getPlan() != null;
+ //TODO: check to see if the parent was manually staged
+
+ if (!parentStaged) {
+ //TODO: if not a level 1 child we could use the old auto staging logic instead
+
+ //switch the parent over to the source
+ parentRsInfo = sourceNode.getParentSourceNode().getResultSetInfo();
+
+ if (parentRsInfo.getTempTable() == null) {
+ //create a temp table to represent the resultset
+ List<SingleElementSymbol> projectedSymbols = parentRsInfo.getCommand().getProjectedSymbols();
+ ArrayList<SingleElementSymbol> elements = new ArrayList<SingleElementSymbol>(projectedSymbols.size());
+ for (SingleElementSymbol singleElementSymbol : projectedSymbols) {
+ singleElementSymbol = (SingleElementSymbol) singleElementSymbol.clone();
+ ResolverVisitor.resolveLanguageObject(singleElementSymbol, planEnv.getGlobalMetadata());
+ elements.add(singleElementSymbol);
+ }
+ TempMetadataStore store = planEnv.getGlobalMetadata().getMetadataStore();
+ // create a new group name and to the temp store
+ GroupSymbol newGroup = new GroupSymbol(SourceNodePlannerVisitor.getNewName("#" + planEnv.getAliasName(parentName) + "_RS", store)); //$NON-NLS-1$ //$NON-NLS-2$
+ newGroup.setMetadataID(store.addTempGroup(newGroup.getName(), elements, false, true));
+
+ parentStagingName = newGroup.getName();
+ parentTempTable = newGroup;
+ } else {
+ parentStagingName = parentRsInfo.getTempTable();
+ parentTempTable = new GroupSymbol(parentRsInfo.getTempTable());
+ parentStaged = true;
+ }
+ } else {
+ stagingRoot = parentRsInfo.getStagingRoot();
+ }
+
+ Query query = new Query();
+ query.setSelect(new Select(Arrays.asList(new ExpressionSymbol("expr", new Constant(1))))); //$NON-NLS-1$
+
+ query.setFrom(new From(Arrays.asList(new UnaryFromClause(parentTempTable))));
+
+ Map symbolMap = new HashMap();
+ String inlineViewName = planEnv.getAliasName(rsInfo.getResultSetName());
+ XMLQueryPlanner.updateSymbolMap(symbolMap, rsInfo.getResultSetName(), inlineViewName, planEnv.getGlobalMetadata());
+ XMLQueryPlanner.updateSymbolMap(symbolMap, parentName, parentTempTable.getName(), planEnv.getGlobalMetadata());
+
+ crit = (Criteria) crit.clone();
+ ExpressionMappingVisitor.mapExpressions(crit, symbolMap);
+
+ if (!stagableQuery.getSelect().isDistinct()) {
+ query.setHaving(crit);
+ //group by is added so that subquery planning sees that we are distinct
+ query.setGroupBy(new GroupBy(new ArrayList<ElementSymbol>(outerReferences)));
+ ExpressionMappingVisitor.mapExpressions(query.getGroupBy(), symbolMap);
+ } else {
+ query.setCriteria(crit);
+ }
+ ExistsCriteria ec = new ExistsCriteria();
+ ec.setSubqueryHint(new ExistsCriteria.SubqueryHint());
+ ec.getSubqueryHint().setDepJoin(true);
+ ec.setCommand(query);
+ Criteria existing = stagableQuery.getCriteria();
+ stagableQuery.setCriteria(Criteria.combineCriteria(existing, ec));
+ if (!XMLQueryPlanner.planStagaingQuery(false, groupName, stagingGroupName, stagableQuery, planEnv)) {
+ return false;
+ }
+ if (!parentStaged) {
+ //need to associate temp load/get/drop with the rsinfo for use by the execsqlinstruction
+ Insert insert = new Insert();
+ insert.setGroup(parentTempTable);
+ int valCount = parentRsInfo.getCommand().getProjectedSymbols().size();
+ ArrayList<Reference> vals = new ArrayList<Reference>(valCount);
+ for (int i = 0; i < valCount; i++) {
+ vals.add(new Reference(i+1));
+ }
+ insert.setValues(vals);
+ QueryResolver.resolveCommand(insert, planEnv.getGlobalMetadata());
+
+ Command tempCommand = QueryParser.getQueryParser().parseCommand("select * from " + parentStagingName); //$NON-NLS-1$
+ QueryResolver.resolveCommand(tempCommand, planEnv.getGlobalMetadata());
+
+ Command dropCommand = QueryParser.getQueryParser().parseCommand("drop table " + parentStagingName); //$NON-NLS-1$
+ QueryResolver.resolveCommand(dropCommand, planEnv.getGlobalMetadata());
+
+ parentRsInfo.setTempTable(parentStagingName);
+ parentRsInfo.setTempSelect(tempCommand);
+ parentRsInfo.setTempInsert(insert);
+ parentRsInfo.setTempDrop(dropCommand);
+ }
+ LogManager.logDetail(LogConstants.CTX_XML_PLANNER, "Using a dependent join to load the mapping class", groupName); //$NON-NLS-1$
+ // add to the document that a staging table has been added
+ sourceNode.addStagingTable(stagingGroupName);
+ GroupSymbol tempGroup = new GroupSymbol(XMLQueryPlanner.getTempTableName(stagingGroupName));
+ ResolverUtil.resolveGroup(tempGroup, planEnv.getGlobalMetadata());
+ Collection<GroupSymbol> temp = Arrays.asList(tempGroup);
+ List<ElementSymbol> fk = new ArrayList<ElementSymbol>(fkColumns.size());
+ for (ElementSymbol elementSymbol : fkColumns) {
+ ElementSymbol es = new ElementSymbol(elementSymbol.getShortName());
+ ResolverVisitor.resolveLanguageObject(es, temp, planEnv.getGlobalMetadata());
+ fk.add(es);
+ }
+ ResultSetInfo stagedInfo = planEnv.getStagingTableResultsInfo(stagingGroupName);
+ stagedInfo.setStagingRoot(stagingRoot);
+ stagedInfo.setAutoStaged(true);
+ stagedInfo.setFkColumns(fk);
+ stagedInfo.setTempTable(tempGroup.getName());
+
+ rsInfo.setAutoStaged(true);
+ return true;
+ }
+
+ //id as mapping class
+ Object metadataID = planEnv.getGlobalMetadata().getGroupID(sourceNode.getResultName());
+ if (RelationalPlanner.isNoCacheGroup(planEnv.getGlobalMetadata(), metadataID, option)) {
+ return false;
+ }
+
+ //id as generated mapping class name
+ metadataID = planEnv.getGlobalMetadata().getGroupID(sourceNode.getActualResultSetName());
+ if (RelationalPlanner.isNoCacheGroup(planEnv.getGlobalMetadata(), metadataID, option)) {
+ return false;
+ }
+
stagableQuery = (Query)stagableQuery.clone();
-
+
// stage the transformation query and it is successful
- String stagingGroupName = planEnv.getStagedResultName(groupName);
if (!XMLQueryPlanner.planStagaingQuery(true, groupName, stagingGroupName, stagableQuery, planEnv)) {
return false;
}
// add to the document that a staging table has been added
sourceNode.addStagingTable(stagingGroupName);
-
+ ResultSetInfo stagedInfo = planEnv.getStagingTableResultsInfo(stagingGroupName);
+ stagedInfo.setAutoStaged(true);
+ stagedInfo.setTempTable(XMLQueryPlanner.getTempTableName(stagingGroupName));
+
+ rsInfo.setAutoStaged(true);
return true;
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/xml/ExecSqlInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/xml/ExecSqlInstruction.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/engine/src/main/java/org/teiid/query/processor/xml/ExecSqlInstruction.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -36,7 +36,7 @@
* Executes a SQL statement, defines a result set.
*/
public class ExecSqlInstruction extends ProcessorInstruction {
- private String resultSetName;
+ String resultSetName;
ResultSetInfo info;
public ExecSqlInstruction(String resultSetName, ResultSetInfo info) {
@@ -48,7 +48,16 @@
public XMLContext process(XMLProcessorEnvironment env, XMLContext context)
throws BlockedException, TeiidComponentException, TeiidProcessingException{
- LogManager.logTrace(org.teiid.logging.LogConstants.CTX_XML_PLAN, new Object[]{"SQL: Result set DOESN'T exist:",resultSetName}); //$NON-NLS-1$
+ execute(env, context);
+
+ env.incrementCurrentProgramCounter();
+ return context;
+ }
+
+ protected void execute(XMLProcessorEnvironment env, XMLContext context)
+ throws TeiidComponentException, BlockedException,
+ TeiidProcessingException {
+ LogManager.logTrace(org.teiid.logging.LogConstants.CTX_XML_PLAN, new Object[]{"SQL: Result set DOESN'T exist:",resultSetName}); //$NON-NLS-1$
PlanExecutor executor = getPlanExecutor(env, context);
// this execute can throw the blocked exception
@@ -60,10 +69,7 @@
// save this executioner in the context, so that all the nodes
// below can access the data.
context.setResultSet(this.resultSetName, executor);
-
- env.incrementCurrentProgramCounter();
- return context;
- }
+ }
public PlanExecutor getPlanExecutor(XMLProcessorEnvironment env,
XMLContext context) throws TeiidComponentException {
Modified: trunk/engine/src/main/java/org/teiid/query/processor/xml/ExecStagingTableInstruction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/xml/ExecStagingTableInstruction.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/engine/src/main/java/org/teiid/query/processor/xml/ExecStagingTableInstruction.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -24,13 +24,10 @@
import static org.teiid.query.analysis.AnalysisRecord.*;
-import java.util.Map;
-
import org.teiid.client.plan.PlanNode;
import org.teiid.common.buffer.BlockedException;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
-import org.teiid.logging.LogManager;
import org.teiid.query.mapping.xml.ResultSetInfo;
@@ -38,20 +35,14 @@
/**
* This instruction is to start loading a staging table. The difference between the loading the
* staging table and execute sql node is that sql node will capture the results and save them in
- * the context object, where as staging does not care about the results, beacuse they are actully
+ * the context object, where as staging does not care about the results, because they are actually
* stored in the temp table store, will be accessed by required query directly from there, as these
* results are nothing do with producing the document directly.
- *
- * NOTE: In future we can improve this to load parallelly, if there are more than single
- * staging table defined on the mapping document
*/
-public class ExecStagingTableInstruction extends ProcessorInstruction {
- String resultSetName;
- ResultSetInfo info;
+public class ExecStagingTableInstruction extends ExecSqlInstruction {
public ExecStagingTableInstruction(String resultName, ResultSetInfo info) {
- this.resultSetName = resultName;
- this.info = info;
+ super(resultName, info);
}
/**
@@ -61,19 +52,8 @@
throws BlockedException, TeiidComponentException, TeiidProcessingException {
if (!env.isStagingTableLoaded(this.resultSetName)) {
- LogManager.logTrace(org.teiid.logging.LogConstants.CTX_XML_PLAN, new Object[]{"SQL: Result set DOESN'T exist:",resultSetName}); //$NON-NLS-1$
+ super.execute(env, context);
- PlanExecutor executor = context.getResultExecutor(resultSetName);
- if (executor == null) {
- executor = env.createResultExecutor(resultSetName, info);
- context.setResultExecutor(resultSetName, executor);
- }
-
- // this execute can throw the blocked exception; note that staging tables will not have any
- // bound references; they are not part of the document; so they do not know about document
- // details.
- Map referenceValues = null;
- executor.execute(referenceValues, false);
env.markStagingTableAsLoaded(this.resultSetName);
// now that we done executing the plan; remove the plan from context
Modified: trunk/engine/src/main/java/org/teiid/query/processor/xml/RelationalPlanExecutor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/xml/RelationalPlanExecutor.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/engine/src/main/java/org/teiid/query/processor/xml/RelationalPlanExecutor.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -27,32 +27,53 @@
import org.teiid.common.buffer.BlockedException;
import org.teiid.common.buffer.BufferManager;
-import org.teiid.common.buffer.IndexedTupleSource;
+import org.teiid.common.buffer.TupleSource;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
+import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.query.QueryPlugin;
import org.teiid.query.mapping.xml.ResultSetInfo;
+import org.teiid.query.metadata.TempMetadataAdapter;
import org.teiid.query.processor.BatchIterator;
import org.teiid.query.processor.ProcessorDataManager;
import org.teiid.query.processor.ProcessorPlan;
import org.teiid.query.processor.QueryProcessor;
+import org.teiid.query.sql.lang.Insert;
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.util.VariableContext;
+import org.teiid.query.tempdata.AlterTempTable;
import org.teiid.query.util.CommandContext;
-
-
/**
* This is a helper class which can execute a supplied relational plan and supply
* resulting query results to the caller.
- * Note: in future we would want to replace this class with submitting the requests directly to
- * process worker queue.
*/
class RelationalPlanExecutor implements PlanExecutor {
- QueryProcessor internalProcessor;
+ private final class TempLoadTupleSource implements TupleSource {
+ @Override
+ public List<?> nextTuple() throws TeiidComponentException,
+ TeiidProcessingException {
+ try {
+ List<?> tuple = tupleSource.nextTuple();
+ if (tuple == null) {
+ doneLoading = true;
+ }
+ return tuple;
+ } catch (BlockedException e) {
+ return null;
+ }
+ }
+ @Override
+ public void closeSource() {
+ tupleSource.closeSource();
+ }
+ }
+
+ QueryProcessor internalProcessor;
+
// information about the result set.
ResultSetInfo resultInfo;
// buffer store
@@ -60,16 +81,20 @@
// flag to denote the end of rows
boolean endOfRows = false;
// results after the execution bucket.
- IndexedTupleSource tupleSource;
+ TupleSource tupleSource;
// cached current row of results.
- List currentRow;
+ List<?> currentRow;
int currentRowNumber = 0;
+ private ProcessorDataManager dataManager;
+ private boolean executed;
+ private boolean doneLoading;
public RelationalPlanExecutor (ResultSetInfo resultInfo, CommandContext context, ProcessorDataManager dataMgr, BufferManager bufferMgr)
throws TeiidComponentException{
this.resultInfo = resultInfo;
this.bufferMgr = bufferMgr;
+ this.dataManager = dataMgr;
ProcessorPlan plan = resultInfo.getPlan();
CommandContext subContext = context.clone();
@@ -97,9 +122,38 @@
internalProcessor.init();
}
}
- if (!openOnly) {
- //force execution
- this.tupleSource.hasNext();
+ if (!openOnly && !executed) {
+ String tempTable = this.resultInfo.getTempTable();
+ if (tempTable != null && !doneLoading && !this.resultInfo.isAutoStaged()) {
+ LogManager.logDetail(LogConstants.CTX_XML_PLAN, "Loading result set temp table", tempTable); //$NON-NLS-1$
+
+ Insert insert = this.resultInfo.getTempInsert();
+ insert.setTupleSource(new TempLoadTupleSource());
+ this.dataManager.registerRequest(this.internalProcessor.getContext(), insert, TempMetadataAdapter.TEMP_MODEL.getName(), null, 0, -1);
+ if (!doneLoading) {
+ throw BlockedException.block("Blocking on result set load"); //$NON-NLS-1$
+ }
+ internalProcessor.closeProcessing();
+ AlterTempTable att = new AlterTempTable(tempTable);
+ //mark the temp table as non-updatable
+ this.dataManager.registerRequest(this.internalProcessor.getContext(), att, TempMetadataAdapter.TEMP_MODEL.getName(), null, 0, -1);
+ this.tupleSource = this.dataManager.registerRequest(this.internalProcessor.getContext(), this.resultInfo.getTempSelect(), TempMetadataAdapter.TEMP_MODEL.getName(), null, 0, -1);
+ }
+ //force execution
+ currentRow();
+
+ if (this.resultInfo.isAutoStaged() && tempTable != null) {
+ AlterTempTable att = new AlterTempTable(tempTable);
+ int size = (Integer)this.currentRow.get(0);
+ if (size > this.bufferMgr.getProcessorBatchSize() * 2) {
+ //TODO: if the parent is small, then this is not necessary
+ att.setIndexColumns(this.resultInfo.getFkColumns());
+ }
+ this.dataManager.registerRequest(this.internalProcessor.getContext(), att, TempMetadataAdapter.TEMP_MODEL.getName(), null, 0, -1);
+ }
+
+ this.currentRowNumber = 0;
+ this.executed = true;
}
}
@@ -122,7 +176,9 @@
if (!endOfRows) {
// get the next row
- this.currentRow = this.tupleSource.nextTuple();
+ if (this.currentRow == null || this.currentRowNumber > 0) {
+ this.currentRow = this.tupleSource.nextTuple();
+ }
this.currentRowNumber++;
// check if we walked over the row limit
@@ -159,6 +215,19 @@
*/
public void close() throws TeiidComponentException {
this.internalProcessor.closeProcessing();
+ if (this.tupleSource != null) {
+ this.tupleSource.closeSource();
+ }
+ String rsTempTable = this.resultInfo.getTempTable();
+ if (rsTempTable != null) {
+ LogManager.logDetail(LogConstants.CTX_XML_PLAN, "Unloading result set temp table", rsTempTable); //$NON-NLS-1$
+ internalProcessor.closeProcessing();
+ try {
+ this.tupleSource = this.dataManager.registerRequest(this.internalProcessor.getContext(), this.resultInfo.getTempDrop(), TempMetadataAdapter.TEMP_MODEL.getName(), null, 0, -1);
+ } catch (TeiidProcessingException e) {
+ LogManager.logDetail(org.teiid.logging.LogConstants.CTX_XML_PLAN, e, "Error dropping result set temp table", rsTempTable); //$NON-NLS-1$
+ }
+ }
LogManager.logTrace(org.teiid.logging.LogConstants.CTX_XML_PLAN, new Object[]{"closed executor", resultInfo.getResultSetName()}); //$NON-NLS-1$
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLProcessorEnvironment.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLProcessorEnvironment.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/engine/src/main/java/org/teiid/query/processor/xml/XMLProcessorEnvironment.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -179,18 +179,25 @@
if (programState.programCounter >= programState.lookaheadCounter && instrs.size() > programState.programCounter + 1) {
for (programState.lookaheadCounter = programState.programCounter; programState.lookaheadCounter < instrs.size(); programState.lookaheadCounter++) {
ProcessorInstruction pi = instrs.get(programState.lookaheadCounter);
+ boolean staging = false;
if (pi instanceof ExecStagingTableInstruction) {
- //need to load staging tables prior to source queries
- break;
+ staging = true;
+ ExecStagingTableInstruction esti = (ExecStagingTableInstruction)pi;
+ if (!esti.info.isAutoStaged()) {
+ //need to load staging tables prior to source queries
+ break;
+ }
}
if (pi instanceof ExecSqlInstruction) {
ExecSqlInstruction esi = (ExecSqlInstruction)pi;
+ if (!staging && esi.info.isAutoStaged() && esi.info.getTempTable() == null) {
+ continue; //derived load
+ }
PlanExecutor pe = esi.getPlanExecutor(this, context);
pe.execute(context.getReferenceValues(), true);
}
}
}
-
return programState.program.getInstructionAt(programState.programCounter);
}
Modified: trunk/engine/src/main/java/org/teiid/query/resolver/command/InsertResolver.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/resolver/command/InsertResolver.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/engine/src/main/java/org/teiid/query/resolver/command/InsertResolver.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -97,9 +97,9 @@
if (insert.getVariables().isEmpty()) {
if (insert.getGroup().isResolved()) {
- List variables = ResolverUtil.resolveElementsInGroup(insert.getGroup(), metadata);
- for (Iterator i = variables.iterator(); i.hasNext();) {
- insert.addVariable((ElementSymbol)((ElementSymbol)i.next()).clone());
+ List<ElementSymbol> variables = ResolverUtil.resolveElementsInGroup(insert.getGroup(), metadata);
+ for (Iterator<ElementSymbol> i = variables.iterator(); i.hasNext();) {
+ insert.addVariable(i.next().clone());
}
} else {
for (int i = 0; i < values.size(); i++) {
@@ -178,11 +178,11 @@
}
Iterator valueIter = values.iterator();
- Iterator varIter = insert.getVariables().iterator();
+ Iterator<ElementSymbol> varIter = insert.getVariables().iterator();
while(valueIter.hasNext()) {
// Walk through both elements and expressions, which should match up
Expression expression = (Expression) valueIter.next();
- ElementSymbol element = (ElementSymbol) varIter.next();
+ ElementSymbol element = varIter.next();
if (!usingQuery) {
ResolverUtil.setDesiredType(expression, element.getType(), insert);
Modified: trunk/engine/src/main/java/org/teiid/query/resolver/util/ResolverVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/resolver/util/ResolverVisitor.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/engine/src/main/java/org/teiid/query/resolver/util/ResolverVisitor.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -34,9 +34,11 @@
import org.teiid.api.exception.query.QueryMetadataException;
import org.teiid.api.exception.query.QueryResolverException;
import org.teiid.api.exception.query.UnresolvedSymbolDescription;
+import org.teiid.core.CoreConstants;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.types.DataTypeManager;
import org.teiid.core.types.DataTypeManager.DefaultDataClasses;
+import org.teiid.core.util.StringUtil;
import org.teiid.query.QueryPlugin;
import org.teiid.query.function.FunctionDescriptor;
import org.teiid.query.function.FunctionForm;
@@ -75,7 +77,9 @@
public class ResolverVisitor extends LanguageVisitor {
- private static class ElementMatch {
+ private static final String SYS_PREFIX = CoreConstants.SYSTEM_MODEL + '.';
+
+ private static class ElementMatch {
ElementSymbol element;
GroupSymbol group;
@@ -547,6 +551,9 @@
function.setFunctionDescriptor(fd);
function.setType(fd.getReturnType());
+ if (CoreConstants.SYSTEM_MODEL.equals(fd.getSchema()) && StringUtil.startsWithIgnoreCase(function.getName(), SYS_PREFIX)) {
+ function.setName(function.getName().substring(SYS_PREFIX.length()));
+ }
}
/**
Copied: trunk/engine/src/main/java/org/teiid/query/tempdata/AlterTempTable.java (from rev 3365, branches/7.4.x/engine/src/main/java/org/teiid/query/tempdata/AlterTempTable.java)
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/tempdata/AlterTempTable.java (rev 0)
+++ trunk/engine/src/main/java/org/teiid/query/tempdata/AlterTempTable.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -0,0 +1,78 @@
+package org.teiid.query.tempdata;
+
+import java.util.List;
+
+import org.teiid.query.sql.LanguageVisitor;
+import org.teiid.query.sql.lang.Command;
+import org.teiid.query.sql.symbol.ElementSymbol;
+import org.teiid.query.sql.symbol.SingleElementSymbol;
+
+/*
+ * 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.
+ */
+
+public class AlterTempTable extends Command {
+
+ private String tempTable;
+ private List<ElementSymbol> indexColumns;
+
+ public AlterTempTable(String tempTable) {
+ this.tempTable = tempTable;
+ }
+
+ public String getTempTable() {
+ return tempTable;
+ }
+
+ public List<ElementSymbol> getIndexColumns() {
+ return indexColumns;
+ }
+
+ public void setIndexColumns(List<ElementSymbol> indexColumns) {
+ this.indexColumns = indexColumns;
+ }
+
+ @Override
+ public boolean areResultsCachable() {
+ return false;
+ }
+
+ @Override
+ public Object clone() {
+ return this;
+ }
+
+ @Override
+ public List<SingleElementSymbol> getProjectedSymbols() {
+ return Command.getUpdateCommandSymbol();
+ }
+
+ @Override
+ public int getType() {
+ return Command.TYPE_UNKNOWN;
+ }
+
+ @Override
+ public void acceptVisitor(LanguageVisitor visitor) {
+
+ }
+
+}
Modified: trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/engine/src/main/java/org/teiid/query/tempdata/TempTableDataManager.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -249,6 +249,15 @@
contextStore.removeTempTableByName(tempTableName);
return CollectionTupleSource.createUpdateCountTupleSource(0);
}
+ if (command instanceof AlterTempTable) {
+ AlterTempTable att = (AlterTempTable)command;
+ TempTable tt = contextStore.getOrCreateTempTable(att.getTempTable().toUpperCase(), command, bufferManager, true);
+ tt.setUpdatable(false);
+ if (att.getIndexColumns() != null) {
+ tt.addIndex(att.getIndexColumns(), false);
+ }
+ return CollectionTupleSource.createUpdateCountTupleSource(0);
+ }
return null;
}
Modified: trunk/engine/src/main/java/org/teiid/query/xquery/saxon/SaxonXQueryExpression.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/xquery/saxon/SaxonXQueryExpression.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/engine/src/main/java/org/teiid/query/xquery/saxon/SaxonXQueryExpression.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -23,9 +23,7 @@
package org.teiid.query.xquery.saxon;
import java.io.IOException;
-import java.io.InputStream;
import java.io.Writer;
-import java.sql.SQLXML;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
@@ -40,9 +38,7 @@
import javax.xml.transform.Source;
import javax.xml.transform.TransformerException;
-import net.sf.saxon.AugmentedSource;
import net.sf.saxon.Configuration;
-import net.sf.saxon.event.ProxyReceiver;
import net.sf.saxon.expr.AxisExpression;
import net.sf.saxon.expr.ContextItemExpression;
import net.sf.saxon.expr.Expression;
@@ -53,14 +49,12 @@
import net.sf.saxon.expr.PathMap.PathMapNodeSet;
import net.sf.saxon.expr.PathMap.PathMapRoot;
import net.sf.saxon.om.Axis;
-import net.sf.saxon.om.DocumentInfo;
import net.sf.saxon.om.Item;
import net.sf.saxon.om.NodeInfo;
import net.sf.saxon.om.SequenceIterator;
import net.sf.saxon.om.StructuredQName;
import net.sf.saxon.pattern.AnyNodeTest;
import net.sf.saxon.pattern.NodeKindTest;
-import net.sf.saxon.query.DynamicQueryContext;
import net.sf.saxon.query.QueryResult;
import net.sf.saxon.query.StaticQueryContext;
import net.sf.saxon.query.XQueryExpression;
@@ -72,12 +66,6 @@
import net.sf.saxon.type.ItemType;
import net.sf.saxon.type.TypeHierarchy;
import net.sf.saxon.value.SequenceType;
-import nu.xom.Builder;
-import nu.xom.Element;
-import nu.xom.Nodes;
-import nu.xom.ParsingException;
-import nux.xom.xquery.StreamingPathFilter;
-import nux.xom.xquery.StreamingTransform;
import org.teiid.api.exception.query.QueryResolverException;
import org.teiid.common.buffer.BufferManager;
@@ -89,9 +77,6 @@
import org.teiid.core.types.XMLTranslator;
import org.teiid.core.types.XMLType;
import org.teiid.core.types.XMLType.Type;
-import org.teiid.logging.LogConstants;
-import org.teiid.logging.LogManager;
-import org.teiid.logging.MessageLevel;
import org.teiid.query.QueryPlugin;
import org.teiid.query.analysis.AnalysisRecord;
import org.teiid.query.function.source.XMLSystemFunctions;
@@ -100,7 +85,6 @@
import org.teiid.query.sql.symbol.DerivedColumn;
import org.teiid.query.sql.symbol.XMLNamespaces;
import org.teiid.query.sql.symbol.XMLNamespaces.NamespaceItem;
-import org.teiid.query.util.CommandContext;
import org.teiid.translator.WSConnection.Util;
@SuppressWarnings("serial")
@@ -113,15 +97,6 @@
DEFAULT_OUTPUT_PROPERTIES.setProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); //$NON-NLS-1$
}
- private static Nodes NONE = new Nodes();
- private static InputStream FAKE_IS = new InputStream() {
-
- @Override
- public int read() throws IOException {
- return 0;
- }
- };
-
public interface RowProcessor {
void processRow(NodeInfo row);
@@ -182,12 +157,12 @@
}
};
- private XQueryExpression xQuery;
- private String xQueryString;
- private Map<String, String> namespaceMap = new HashMap<String, String>();
- private Configuration config = new Configuration();
- private PathMapRoot contextRoot;
- private StreamingPathFilter streamingPathFilter;
+ XQueryExpression xQuery;
+ String xQueryString;
+ Map<String, String> namespaceMap = new HashMap<String, String>();
+ Configuration config = new Configuration();
+ PathMapRoot contextRoot;
+ String streamingPath;
public SaxonXQueryExpression(String xQueryString, XMLNamespaces namespaces, List<DerivedColumn> passing, List<XMLTable.XMLColumn> columns)
throws QueryResolverException {
@@ -246,7 +221,7 @@
clone.config = config;
clone.contextRoot = contextRoot;
clone.namespaceMap = namespaceMap;
- clone.streamingPathFilter = streamingPathFilter;
+ clone.streamingPath = streamingPath;
return clone;
}
@@ -256,7 +231,7 @@
public void useDocumentProjection(List<XMLTable.XMLColumn> columns, AnalysisRecord record) {
try {
- streamingPathFilter = StreamingUtils.getStreamingPathFilter(xQueryString, namespaceMap);
+ streamingPath = StreamingUtils.getStreamingPath(xQueryString, namespaceMap);
} catch (IllegalArgumentException e) {
if (record.recordDebug()) {
record.println("Document streaming will not be used: " + e.getMessage()); //$NON-NLS-1$
@@ -362,8 +337,8 @@
continue;
}
for (PathMapArc arc : subContextRoot.getArcs()) {
- if (streamingPathFilter != null && !validateColumnForStreaming(record, xmlColumn, arc)) {
- streamingPathFilter = null;
+ if (streamingPath != null && !validateColumnForStreaming(record, xmlColumn, arc)) {
+ streamingPath = null;
}
finalNode.createArc(arc.getStep(), arc.getTarget());
}
@@ -491,90 +466,7 @@
}
}
- public Result evaluateXQuery(Object context, Map<String, Object> parameterValues, final RowProcessor processor, CommandContext commandContext) throws TeiidProcessingException {
- DynamicQueryContext dynamicContext = new DynamicQueryContext(config);
-
- Result result = new Result();
- try {
- try {
- for (Map.Entry<String, Object> entry : parameterValues.entrySet()) {
- Object value = entry.getValue();
- if(value instanceof SQLXML) {
- value = XMLSystemFunctions.convertToSource(value);
- result.sources.add((Source)value);
- } else if (value instanceof java.util.Date) {
- value = XMLSystemFunctions.convertToAtomicValue(value);
- }
- dynamicContext.setParameter(entry.getKey(), value);
- }
- } catch (TransformerException e) {
- throw new TeiidProcessingException(e);
- }
- if (context != null) {
- Source source = XMLSystemFunctions.convertToSource(context);
- result.sources.add(source);
- if (contextRoot != null) {
- //create our own filter as this logic is not provided in the free saxon
- ProxyReceiver filter = new PathMapFilter(contextRoot);
- AugmentedSource sourceInput = AugmentedSource.makeAugmentedSource(source);
- sourceInput.addFilter(filter);
- source = sourceInput;
-
- //use streamable processing instead
- if (streamingPathFilter != null && processor != null) {
- if (LogManager.isMessageToBeRecorded(LogConstants.CTX_DQP, MessageLevel.DETAIL)) {
- LogManager.logDetail(LogConstants.CTX_DQP, "Using stream processing for evaluation of", this.xQueryString); //$NON-NLS-1$
- }
- //set to non-blocking in case default expression evaluation blocks
- boolean isNonBlocking = commandContext.isNonBlocking();
- commandContext.setNonBlocking(true);
-
- final StreamingTransform myTransform = new StreamingTransform() {
- public Nodes transform(Element elem) {
- processor.processRow(StreamingUtils.wrap(elem, config));
- return NONE;
- }
- };
-
- Builder builder = new Builder(new SaxonReader(config, sourceInput), false,
- streamingPathFilter.createNodeFactory(null, myTransform));
- try {
- //the builder is hard wired to parse the source, but the api will throw an exception if the stream is null
- builder.build(FAKE_IS);
- return result;
- } catch (ParsingException e) {
- throw new TeiidProcessingException(e, QueryPlugin.Util.getString("SaxonXQueryExpression.bad_context")); //$NON-NLS-1$
- } catch (IOException e) {
- throw new TeiidProcessingException(e, QueryPlugin.Util.getString("SaxonXQueryExpression.bad_context")); //$NON-NLS-1$
- } finally {
- if (!isNonBlocking) {
- commandContext.setNonBlocking(false);
- }
- }
- }
- }
- DocumentInfo doc;
- try {
- doc = config.buildDocument(source);
- } catch (XPathException e) {
- throw new TeiidProcessingException(e, QueryPlugin.Util.getString("SaxonXQueryExpression.bad_context")); //$NON-NLS-1$
- }
- dynamicContext.setContextItem(doc);
- }
- try {
- result.iter = xQuery.iterator(dynamicContext);
- return result;
- } catch (TransformerException e) {
- throw new TeiidProcessingException(e, QueryPlugin.Util.getString("SaxonXQueryExpression.bad_xquery")); //$NON-NLS-1$
- }
- } finally {
- if (result.iter == null) {
- result.close();
- }
- }
- }
-
- public XMLType createXMLType(final SequenceIterator iter, BufferManager bufferManager, boolean emptyOnEmpty) throws XPathException, TeiidComponentException, TeiidProcessingException {
+ public XMLType createXMLType(final SequenceIterator iter, BufferManager bufferManager, boolean emptyOnEmpty) throws XPathException, TeiidComponentException, TeiidProcessingException {
Item item = iter.next();
if (item == null && !emptyOnEmpty) {
return null;
@@ -634,7 +526,7 @@
}
public boolean isStreaming() {
- return streamingPathFilter != null;
+ return streamingPath != null;
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/xquery/saxon/StreamingUtils.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/xquery/saxon/StreamingUtils.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/engine/src/main/java/org/teiid/query/xquery/saxon/StreamingUtils.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -32,11 +32,7 @@
import net.sf.saxon.event.ProxyReceiver;
import net.sf.saxon.event.Receiver;
import net.sf.saxon.om.Name11Checker;
-import net.sf.saxon.om.NodeInfo;
import net.sf.saxon.trans.XPathException;
-import nu.xom.DocType;
-import nu.xom.Node;
-import nux.xom.xquery.StreamingPathFilter;
import org.xml.sax.ContentHandler;
import org.xml.sax.DTDHandler;
@@ -51,28 +47,6 @@
final class StreamingUtils {
/**
- * Converts a xom node into something readable by Saxon
- * @param node
- * @param config
- * @return
- */
- static NodeInfo wrap(Node node, Configuration config) {
- if (node == null)
- throw new IllegalArgumentException("node must not be null"); //$NON-NLS-1$
- if (node instanceof DocType)
- throw new IllegalArgumentException("DocType can't be queried by XQuery/XPath"); //$NON-NLS-1$
-
- Node root = node;
- while (root.getParent() != null) {
- root = root.getParent();
- }
-
- DocumentWrapper docWrapper = new DocumentWrapper(root, root.getBaseURI(), config);
-
- return docWrapper.wrap(node);
- }
-
- /**
* Pre-parser that adds validation and handles a default name space
*
* TODO: add support for more general paths including node tests
@@ -83,7 +57,7 @@
* @param prefixMap
* @return
*/
- public static StreamingPathFilter getStreamingPathFilter(String locationPath, Map<String, String> prefixMap) {
+ public static String getStreamingPath(String locationPath, Map<String, String> prefixMap) {
if (locationPath.indexOf("//") >= 0) //$NON-NLS-1$
throw new IllegalArgumentException("DESCENDANT axis is not supported"); //$NON-NLS-1$
@@ -124,7 +98,7 @@
}
fixedPath += localNames[i];
}
- return new StreamingPathFilter(fixedPath, prefixMap);
+ return fixedPath;
}
}
Copied: trunk/engine/src/main/java/org/teiid/query/xquery/saxon/XQueryEvaluator.java (from rev 3365, branches/7.4.x/engine/src/main/java/org/teiid/query/xquery/saxon/XQueryEvaluator.java)
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/xquery/saxon/XQueryEvaluator.java (rev 0)
+++ trunk/engine/src/main/java/org/teiid/query/xquery/saxon/XQueryEvaluator.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -0,0 +1,177 @@
+/*
+ * 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.query.xquery.saxon;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.sql.SQLXML;
+import java.util.Map;
+
+import javax.xml.transform.Source;
+import javax.xml.transform.TransformerException;
+
+import net.sf.saxon.AugmentedSource;
+import net.sf.saxon.Configuration;
+import net.sf.saxon.event.ProxyReceiver;
+import net.sf.saxon.om.DocumentInfo;
+import net.sf.saxon.om.NodeInfo;
+import net.sf.saxon.query.DynamicQueryContext;
+import net.sf.saxon.trans.XPathException;
+import nu.xom.Builder;
+import nu.xom.DocType;
+import nu.xom.Element;
+import nu.xom.Node;
+import nu.xom.Nodes;
+import nu.xom.ParsingException;
+import nux.xom.xquery.StreamingPathFilter;
+import nux.xom.xquery.StreamingTransform;
+
+import org.teiid.core.TeiidProcessingException;
+import org.teiid.logging.LogConstants;
+import org.teiid.logging.LogManager;
+import org.teiid.logging.MessageLevel;
+import org.teiid.query.QueryPlugin;
+import org.teiid.query.function.source.XMLSystemFunctions;
+import org.teiid.query.util.CommandContext;
+import org.teiid.query.xquery.saxon.SaxonXQueryExpression.RowProcessor;
+
+/**
+ * Used to isolate the xom/nux dependency and to better isolate the saxon processing logic.
+ */
+public class XQueryEvaluator {
+
+ private static Nodes NONE = new Nodes();
+ private static InputStream FAKE_IS = new InputStream() {
+
+ @Override
+ public int read() throws IOException {
+ return 0;
+ }
+ };
+
+ public static SaxonXQueryExpression.Result evaluateXQuery(final SaxonXQueryExpression xquery, Object context, Map<String, Object> parameterValues, final RowProcessor processor, CommandContext commandContext) throws TeiidProcessingException {
+ DynamicQueryContext dynamicContext = new DynamicQueryContext(xquery.config);
+
+ SaxonXQueryExpression.Result result = new SaxonXQueryExpression.Result();
+ try {
+ try {
+ for (Map.Entry<String, Object> entry : parameterValues.entrySet()) {
+ Object value = entry.getValue();
+ if(value instanceof SQLXML) {
+ value = XMLSystemFunctions.convertToSource(value);
+ result.sources.add((Source)value);
+ } else if (value instanceof java.util.Date) {
+ value = XMLSystemFunctions.convertToAtomicValue(value);
+ }
+ dynamicContext.setParameter(entry.getKey(), value);
+ }
+ } catch (TransformerException e) {
+ throw new TeiidProcessingException(e);
+ }
+ if (context != null) {
+ Source source = XMLSystemFunctions.convertToSource(context);
+ result.sources.add(source);
+ if (xquery.contextRoot != null) {
+ //create our own filter as this logic is not provided in the free saxon
+ ProxyReceiver filter = new PathMapFilter(xquery.contextRoot);
+ AugmentedSource sourceInput = AugmentedSource.makeAugmentedSource(source);
+ sourceInput.addFilter(filter);
+ source = sourceInput;
+
+ //use streamable processing instead
+ if (xquery.streamingPath != null && processor != null) {
+ if (LogManager.isMessageToBeRecorded(LogConstants.CTX_DQP, MessageLevel.DETAIL)) {
+ LogManager.logDetail(LogConstants.CTX_DQP, "Using stream processing for evaluation of", xquery.xQueryString); //$NON-NLS-1$
+ }
+ //set to non-blocking in case default expression evaluation blocks
+ boolean isNonBlocking = commandContext.isNonBlocking();
+ commandContext.setNonBlocking(true);
+
+ final StreamingTransform myTransform = new StreamingTransform() {
+ public Nodes transform(Element elem) {
+ processor.processRow(XQueryEvaluator.wrap(elem, xquery.config));
+ return NONE;
+ }
+ };
+
+ Builder builder = new Builder(new SaxonReader(xquery.config, sourceInput), false,
+ new StreamingPathFilter(xquery.streamingPath, xquery.namespaceMap).createNodeFactory(null, myTransform));
+ try {
+ //the builder is hard wired to parse the source, but the api will throw an exception if the stream is null
+ builder.build(FAKE_IS);
+ return result;
+ } catch (ParsingException e) {
+ throw new TeiidProcessingException(e, QueryPlugin.Util.getString("SaxonXQueryExpression.bad_context")); //$NON-NLS-1$
+ } catch (IOException e) {
+ throw new TeiidProcessingException(e, QueryPlugin.Util.getString("SaxonXQueryExpression.bad_context")); //$NON-NLS-1$
+ } finally {
+ if (!isNonBlocking) {
+ commandContext.setNonBlocking(false);
+ }
+ }
+ }
+ }
+ DocumentInfo doc;
+ try {
+ doc = xquery.config.buildDocument(source);
+ } catch (XPathException e) {
+ throw new TeiidProcessingException(e, QueryPlugin.Util.getString("SaxonXQueryExpression.bad_context")); //$NON-NLS-1$
+ }
+ dynamicContext.setContextItem(doc);
+ }
+ try {
+ result.iter = xquery.xQuery.iterator(dynamicContext);
+ return result;
+ } catch (TransformerException e) {
+ throw new TeiidProcessingException(e, QueryPlugin.Util.getString("SaxonXQueryExpression.bad_xquery")); //$NON-NLS-1$
+ }
+ } finally {
+ if (result.iter == null) {
+ result.close();
+ }
+ }
+ }
+
+ /**
+ * Converts a xom node into something readable by Saxon
+ * @param node
+ * @param config
+ * @return
+ */
+ static NodeInfo wrap(Node node, Configuration config) {
+ if (node == null)
+ throw new IllegalArgumentException("node must not be null"); //$NON-NLS-1$
+ if (node instanceof DocType)
+ throw new IllegalArgumentException("DocType can't be queried by XQuery/XPath"); //$NON-NLS-1$
+
+ Node root = node;
+ while (root.getParent() != null) {
+ root = root.getParent();
+ }
+
+ DocumentWrapper docWrapper = new DocumentWrapper(root, root.getBaseURI(), config);
+
+ return docWrapper.wrap(node);
+ }
+
+}
Modified: trunk/engine/src/test/java/org/teiid/query/processor/eval/TestExpressionEvaluator.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/eval/TestExpressionEvaluator.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/engine/src/test/java/org/teiid/query/processor/eval/TestExpressionEvaluator.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -502,4 +502,9 @@
assertEquals(Boolean.FALSE, Evaluator.evaluate(ex));
}
+ @Test public void testLikePlus() throws Exception {
+ Expression ex = TestFunctionResolving.getExpression("'+' like '+'");
+ assertEquals(Boolean.TRUE, Evaluator.evaluate(ex));
+ }
+
}
Modified: trunk/engine/src/test/java/org/teiid/query/processor/xml/TestXMLPlanningEnhancements.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/xml/TestXMLPlanningEnhancements.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/engine/src/test/java/org/teiid/query/processor/xml/TestXMLPlanningEnhancements.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -28,6 +28,7 @@
import java.util.List;
import java.util.Map;
+import org.junit.Ignore;
import org.junit.Test;
import org.teiid.client.metadata.ParameterInfo;
import org.teiid.common.buffer.BufferManager;
@@ -309,6 +310,7 @@
TestXMLProcessor.helpTestProcess("SELECT * FROM xmltest.doc18a where supplierID<56", expectedDoc, metadata, dataMgr); //$NON-NLS-1$
}
+ @Ignore("Will plan with a dependent join")
@Test public void testAutoStagingFailsForMappingClassWithProcRelational() throws Exception {
TransformationMetadata metadata = getMetadata("SELECT supplierNum, supplierName, supplierZipCode FROM v1.supplierProc where itemnum = ?"); //$NON-NLS-1$
@@ -386,6 +388,7 @@
/**
* @see #testNested2WithCriteria2
*/
+ @Ignore("Will use a dependent join instead")
@Test public void testAutoStagingFailsByCosting() throws Exception {
TransformationMetadata metadata = TestXMLProcessor.exampleMetadata();
FakeDataManager dataMgr = TestXMLProcessor.exampleDataManagerNested(metadata);
@@ -404,6 +407,7 @@
assertNull(stats.get(ExecStagingTableInstruction.class));
}
+ @Ignore("Will use dependent join instead")
@Test public void testAutoStagingFailsByNoCache() throws Exception {
QueryMetadataInterface metadata = TestXMLProcessor.exampleMetadataCached();
FakeDataManager dataMgr = TestXMLProcessor.exampleDataManagerNested(metadata);
@@ -417,6 +421,7 @@
assertNull(stats.get(ExecStagingTableInstruction.class));
}
+ @Ignore("Will use dependent join")
@Test public void testAutoStagingFailsByNoCacheByGroup() throws Exception {
QueryMetadataInterface metadata = TestXMLProcessor.exampleMetadataCached();
FakeDataManager dataMgr = TestXMLProcessor.exampleDataManagerNested(metadata);
Modified: trunk/engine/src/test/java/org/teiid/query/processor/xml/TestXMLProcessor.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/xml/TestXMLProcessor.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/engine/src/test/java/org/teiid/query/processor/xml/TestXMLProcessor.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -8866,33 +8866,6 @@
helpTestProcess("SELECT * FROM xmltest.doc1 WHERE NOT (ItemID IN (SELECT itemNum FROM stock.items WHERE itemNum = '001') )", expectedDoc, metadata, dataMgr); //$NON-NLS-1$
}
- public void XXXtestSubqueryInXMLQueryCriteria4() throws Exception {
- QueryMetadataInterface metadata = exampleMetadataCached();
- FakeDataManager dataMgr = exampleDataManager(metadata);
- String expectedDoc =
- "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" + //$NON-NLS-1$
- "<Catalogs xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\r\n" + //$NON-NLS-1$
- " <Catalog>\r\n" + //$NON-NLS-1$
- " <Items>\r\n" + //$NON-NLS-1$
- " <Item ItemID=\"001\">\r\n" + //$NON-NLS-1$
- " <Name>Lamp</Name>\r\n" + //$NON-NLS-1$
- " <Quantity>5</Quantity>\r\n" + //$NON-NLS-1$
- " </Item>\r\n" + //$NON-NLS-1$
- " <Item ItemID=\"002\">\r\n" + //$NON-NLS-1$
- " <Name>Screwdriver</Name>\r\n" + //$NON-NLS-1$
- " <Quantity>100</Quantity>\r\n" + //$NON-NLS-1$
- " </Item>\r\n" + //$NON-NLS-1$
- " <Item ItemID=\"003\">\r\n" + //$NON-NLS-1$
- " <Name>Goat</Name>\r\n" + //$NON-NLS-1$
- " <Quantity>4</Quantity>\r\n" + //$NON-NLS-1$
- " </Item>\r\n" + //$NON-NLS-1$
- " </Items>\r\n" + //$NON-NLS-1$
- " </Catalog>\r\n" + //$NON-NLS-1$
- "</Catalogs>\r\n\r\n"; //$NON-NLS-1$
-
- helpTestProcess("SELECT * FROM xmltest.doc1 WHERE EXISTS (SELECT itemNum FROM stock.items WHERE itemNum = '001')", expectedDoc, metadata, dataMgr); //$NON-NLS-1$
- }
-
@Test public void testSubqueryInXMLQueryCriteriaNestedSubquery() throws Exception {
QueryMetadataInterface metadata = exampleMetadataCached();
FakeDataManager dataMgr = exampleDataManager(metadata);
Modified: trunk/engine/src/test/java/org/teiid/query/rewriter/TestQueryRewriter.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/rewriter/TestQueryRewriter.java 2011-08-06 14:57:03 UTC (rev 3365)
+++ trunk/engine/src/test/java/org/teiid/query/rewriter/TestQueryRewriter.java 2011-08-10 18:01:12 UTC (rev 3366)
@@ -2069,7 +2069,7 @@
}
@Test public void testRewriteConcat2() {
- helpTestRewriteCriteria("concat2('a','b') = 'ab'", "1 = 1"); //$NON-NLS-1$ //$NON-NLS-2$
+ helpTestRewriteCriteria("sys.concat2('a','b') = 'ab'", "1 = 1"); //$NON-NLS-1$ //$NON-NLS-2$
}
@Test public void testRewriteConcat2_1() {
14 years, 8 months
teiid SVN: r3365 - in branches/7.4.x/engine/src: test/java/org/teiid/query/rewriter and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-08-06 10:57:03 -0400 (Sat, 06 Aug 2011)
New Revision: 3365
Modified:
branches/7.4.x/engine/src/main/java/org/teiid/query/resolver/util/ResolverVisitor.java
branches/7.4.x/engine/src/test/java/org/teiid/query/rewriter/TestQueryRewriter.java
Log:
TEIID-1696 fixing the issue with sys schema qualification
Modified: branches/7.4.x/engine/src/main/java/org/teiid/query/resolver/util/ResolverVisitor.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/query/resolver/util/ResolverVisitor.java 2011-08-05 18:33:39 UTC (rev 3364)
+++ branches/7.4.x/engine/src/main/java/org/teiid/query/resolver/util/ResolverVisitor.java 2011-08-06 14:57:03 UTC (rev 3365)
@@ -34,9 +34,11 @@
import org.teiid.api.exception.query.QueryMetadataException;
import org.teiid.api.exception.query.QueryResolverException;
import org.teiid.api.exception.query.UnresolvedSymbolDescription;
+import org.teiid.core.CoreConstants;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.types.DataTypeManager;
import org.teiid.core.types.DataTypeManager.DefaultDataClasses;
+import org.teiid.core.util.StringUtil;
import org.teiid.query.QueryPlugin;
import org.teiid.query.function.FunctionDescriptor;
import org.teiid.query.function.FunctionForm;
@@ -74,7 +76,9 @@
public class ResolverVisitor extends LanguageVisitor {
- private static class ElementMatch {
+ private static final String SYS_PREFIX = CoreConstants.SYSTEM_MODEL + '.';
+
+ private static class ElementMatch {
ElementSymbol element;
GroupSymbol group;
@@ -536,6 +540,9 @@
// Resolve the function
function.setFunctionDescriptor(fd);
function.setType(fd.getReturnType());
+ if (CoreConstants.SYSTEM_MODEL.equals(fd.getSchema()) && StringUtil.startsWithIgnoreCase(function.getName(), SYS_PREFIX)) {
+ function.setName(function.getName().substring(SYS_PREFIX.length()));
+ }
}
/**
Modified: branches/7.4.x/engine/src/test/java/org/teiid/query/rewriter/TestQueryRewriter.java
===================================================================
--- branches/7.4.x/engine/src/test/java/org/teiid/query/rewriter/TestQueryRewriter.java 2011-08-05 18:33:39 UTC (rev 3364)
+++ branches/7.4.x/engine/src/test/java/org/teiid/query/rewriter/TestQueryRewriter.java 2011-08-06 14:57:03 UTC (rev 3365)
@@ -2066,7 +2066,7 @@
}
@Test public void testRewriteConcat2() {
- helpTestRewriteCriteria("concat2('a','b') = 'ab'", "1 = 1"); //$NON-NLS-1$ //$NON-NLS-2$
+ helpTestRewriteCriteria("sys.concat2('a','b') = 'ab'", "1 = 1"); //$NON-NLS-1$ //$NON-NLS-2$
}
@Test public void testRewriteConcat2_1() {
14 years, 8 months