teiid SVN: r2649 - branches/7.1.x/console/src/main/resources/META-INF.
by teiid-commits@lists.jboss.org
Author: tejones
Date: 2010-10-14 11:17:20 -0400 (Thu, 14 Oct 2010)
New Revision: 2649
Modified:
branches/7.1.x/console/src/main/resources/META-INF/rhq-plugin.xml
Log:
TEIID-982: Text changes to Mat view operation names and parameter descriptions
Modified: branches/7.1.x/console/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- branches/7.1.x/console/src/main/resources/META-INF/rhq-plugin.xml 2010-10-14 14:29:39 UTC (rev 2648)
…
[View More]+++ branches/7.1.x/console/src/main/resources/META-INF/rhq-plugin.xml 2010-10-14 15:17:20 UTC (rev 2649)
@@ -469,13 +469,13 @@
</results>
</operation>
- <operation name="getMaterializedViews" displayName="Get Materialized View Info"
- description="Get any Materialized Views for this VDB">
+ <operation name="getMaterializedViews" displayName="List Materialized View Info"
+ description="List any Materialized Views for this VDB">
<results>
- <c:list-property name="list" displayName=" Materialized Views"
- description="Get information related to Materialized Views, if any, for this VDB"
+ <c:list-property name="list" displayName="Materialized Views"
+ description="List information related to Materialized Views, if any, for this VDB"
required="false">
<c:map-property name="map">
<c:simple-property displayName="Schema Name"
@@ -486,7 +486,7 @@
name="targetSchemaName" type="string" description="Name of the materialized schema" />
<c:simple-property displayName="Target Name"
name="targetName" type="string" description="Name of target table" />
- <c:simple-property displayName="Is Valid"
+ <c:simple-property displayName="Valid"
name="valid" type="string" description="Indicates if data in table is valid for use" />
<c:simple-property displayName="Current State"
name="loadState" type="string" description="Processing time for the request" />
@@ -510,7 +510,7 @@
description="The name of the Materialized View to refresh" />
<c:simple-property displayName="Invalidate Current Materialized View Table"
name="invalidate" type="boolean" required="true" default="false"
- description="If yes, will block all queries against the current Materialized View table until refreshed." />
+ description="If yes, will block all queries against the current Materialized View table until data is refreshed." />
</parameters>
<results>
[View Less]
14 years, 2 months
teiid SVN: r2648 - branches/7.1.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-10-14 10:29:39 -0400 (Thu, 14 Oct 2010)
New Revision: 2648
Modified:
branches/7.1.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleConvertModifier.java
Log:
TEIID-1303 fix for sybase timestamp to string and full outer join handling. also updated literal handling to work with JTDS
Modified: branches/7.1.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleConvertModifier.java
==================…
[View More]=================================================
--- branches/7.1.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleConvertModifier.java 2010-10-13 22:00:11 UTC (rev 2647)
+++ branches/7.1.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleConvertModifier.java 2010-10-14 14:29:39 UTC (rev 2648)
@@ -487,11 +487,11 @@
// Source = TIME
@Test public void testTimeToString() throws Exception {
- helpTest(LANG_FACTORY.createLiteral(TimestampUtil.createTime(23, 59, 59), java.sql.Time.class), "string", "to_char({ts '1970-01-01 23:59:59'}, 'HH24:MI:SS')"); //$NON-NLS-1$ //$NON-NLS-2$
+ helpTest(LANG_FACTORY.createLiteral(TimestampUtil.createTime(23, 59, 59), java.sql.Time.class), "string", "to_char(to_date('1970-01-01 23:59:59', 'YYYY-MM-DD HH24:MI:SS'), 'HH24:MI:SS')"); //$NON-NLS-1$ //$NON-NLS-2$
}
@Test public void testTimeToTimestamp() throws Exception {
- helpTest(LANG_FACTORY.createLiteral(TimestampUtil.createTime(23, 59, 59), java.sql.Time.class), "timestamp", "cast({ts '1970-01-01 23:59:59'} AS timestamp)"); //$NON-NLS-1$ //$NON-NLS-2$
+ helpTest(LANG_FACTORY.createLiteral(TimestampUtil.createTime(23, 59, 59), java.sql.Time.class), "timestamp", "cast(to_date('1970-01-01 23:59:59', 'YYYY-MM-DD HH24:MI:SS') AS timestamp)"); //$NON-NLS-1$ //$NON-NLS-2$
}
// Source = TIMESTAMP
[View Less]
14 years, 2 months
teiid SVN: r2647 - branches/7.1.x/console/src/main/resources/META-INF.
by teiid-commits@lists.jboss.org
Author: tejones
Date: 2010-10-13 18:00:11 -0400 (Wed, 13 Oct 2010)
New Revision: 2647
Modified:
branches/7.1.x/console/src/main/resources/META-INF/rhq-plugin.xml
Log:
TEIID-982: Changed verbiage and column heading
Modified: branches/7.1.x/console/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- branches/7.1.x/console/src/main/resources/META-INF/rhq-plugin.xml 2010-10-13 16:42:50 UTC (rev 2646)
+++ branches/7.1.x/console/src/…
[View More]main/resources/META-INF/rhq-plugin.xml 2010-10-13 22:00:11 UTC (rev 2647)
@@ -486,7 +486,7 @@
name="targetSchemaName" type="string" description="Name of the materialized schema" />
<c:simple-property displayName="Target Name"
name="targetName" type="string" description="Name of target table" />
- <c:simple-property displayName="Created Time"
+ <c:simple-property displayName="Is Valid"
name="valid" type="string" description="Indicates if data in table is valid for use" />
<c:simple-property displayName="Current State"
name="loadState" type="string" description="Processing time for the request" />
@@ -505,12 +505,12 @@
<c:simple-property displayName="Materialized View Schema"
name="schema" type="string" required="true"
description="The schema name of the Materialized View to refresh" />
- <c:simple-property displayName="Materialized View Table"
+ <c:simple-property displayName="Materialized View Name"
name="table" type="string" required="true"
- description="The table name of the Materialized View to refresh" />
- <c:simple-property displayName="Invalidate Current Materialized View"
- name="invalidate" type="boolean" required="true"
- description="If true, will invalidate the current Materialized View" />
+ description="The name of the Materialized View to refresh" />
+ <c:simple-property displayName="Invalidate Current Materialized View Table"
+ name="invalidate" type="boolean" required="true" default="false"
+ description="If yes, will block all queries against the current Materialized View table until refreshed." />
</parameters>
<results>
[View Less]
14 years, 2 months
teiid SVN: r2646 - in branches/7.1.x: connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/access and 5 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-10-13 12:42:50 -0400 (Wed, 13 Oct 2010)
New Revision: 2646
Modified:
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/access/AccessExecutionFactory.java
branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerExecutionFactory.java
branches/7.1.x/connectors/translator-jdbc/…
[View More]src/main/java/org/teiid/translator/jdbc/sybase/SybaseExecutionFactory.java
branches/7.1.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java
branches/7.1.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseConvertModifier.java
branches/7.1.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseSQLConversionVisitor.java
branches/7.1.x/documentation/reference/src/main/docbook/en-US/content/sql_support.xml
Log:
TEIID-1303 fix for sybase timestamp to string and full outer join handling. also updated literal handling to work with JTDS
Modified: branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java
===================================================================
--- branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java 2010-10-13 15:46:43 UTC (rev 2645)
+++ branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/JDBCExecutionFactory.java 2010-10-13 16:42:50 UTC (rev 2646)
@@ -603,7 +603,7 @@
*/
public String translateLiteralTime(Time timeValue) {
if (!hasTimeType()) {
- return "{ts '1970-01-01 " + formatDateValue(timeValue) + "'}"; //$NON-NLS-1$ //$NON-NLS-2$
+ return translateLiteralTimestamp(new Timestamp(timeValue.getTime()));
}
return "{t '" + formatDateValue(timeValue) + "'}"; //$NON-NLS-1$ //$NON-NLS-2$
}
Modified: branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/access/AccessExecutionFactory.java
===================================================================
--- branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/access/AccessExecutionFactory.java 2010-10-13 15:46:43 UTC (rev 2645)
+++ branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/access/AccessExecutionFactory.java 2010-10-13 16:42:50 UTC (rev 2646)
@@ -38,6 +38,7 @@
public AccessExecutionFactory() {
setSupportsOrderBy(false);
+ setDatabaseVersion("2003"); //$NON-NLS-1$
}
@Override
Modified: branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerExecutionFactory.java
===================================================================
--- branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerExecutionFactory.java 2010-10-13 15:46:43 UTC (rev 2645)
+++ branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sqlserver/SQLServerExecutionFactory.java 2010-10-13 16:42:50 UTC (rev 2646)
@@ -24,6 +24,7 @@
*/
package org.teiid.translator.jdbc.sqlserver;
+import java.sql.Time;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -204,5 +205,9 @@
public boolean booleanNullable() {
return true;
}
-
+
+ public boolean hasTimeType() {
+ return getDatabaseVersion().compareTo(V_2005) >= 0;
+ }
+
}
Modified: branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseExecutionFactory.java
===================================================================
--- branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseExecutionFactory.java 2010-10-13 15:46:43 UTC (rev 2645)
+++ branches/7.1.x/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/sybase/SybaseExecutionFactory.java 2010-10-13 16:42:50 UTC (rev 2646)
@@ -25,11 +25,14 @@
package org.teiid.translator.jdbc.sybase;
import java.sql.CallableStatement;
+import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
+import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.LinkedList;
import java.util.List;
import org.teiid.language.Command;
@@ -37,10 +40,10 @@
import org.teiid.language.Limit;
import org.teiid.language.OrderBy;
import org.teiid.language.SetQuery;
+import org.teiid.translator.ExecutionContext;
+import org.teiid.translator.SourceSystemFunctions;
import org.teiid.translator.Translator;
import org.teiid.translator.TranslatorException;
-import org.teiid.translator.ExecutionContext;
-import org.teiid.translator.SourceSystemFunctions;
import org.teiid.translator.TypeFacility;
import org.teiid.translator.jdbc.AliasModifier;
import org.teiid.translator.jdbc.ConvertModifier;
@@ -60,6 +63,7 @@
public SybaseExecutionFactory() {
setDatabaseVersion(TWELVE_5);
+ setSupportsFullOuterJoins(false);
}
public void start() throws TranslatorException {
@@ -173,13 +177,13 @@
return Arrays.asList("stuff(stuff(convert(varchar, ", function.getParameters().get(0), ", 102), 5, 1, '-'), 8, 1, '-')"); //$NON-NLS-1$ //$NON-NLS-2$
}
- /**
- * Written to only support version 15
- * @param function
- * @return
- */
+ //TODO: this looses the milliseconds
protected List<?> convertTimestampToString(Function function) {
- return Arrays.asList("stuff(convert(varchar, ", function.getParameters().get(0), ", 123), 11, 1, ' ')"); //$NON-NLS-1$ //$NON-NLS-2$
+ LinkedList<Object> result = new LinkedList<Object>();
+ result.addAll(convertDateToString(function));
+ result.add(' ');
+ result.addAll(convertTimeToString(function));
+ return result;
}
@Override
@@ -365,4 +369,15 @@
}
super.bindValue(stmt, param, paramType, i);
}
+
+ @Override
+ public String translateLiteralTimestamp(Timestamp timestampValue) {
+ return "CAST('" + formatDateValue(timestampValue) +"' AS DATETIME)"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ @Override
+ public String translateLiteralDate(Date dateValue) {
+ return "CAST('" + formatDateValue(dateValue) +"' AS DATE)"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
}
Modified: branches/7.1.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java
===================================================================
--- branches/7.1.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java 2010-10-13 15:46:43 UTC (rev 2645)
+++ branches/7.1.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java 2010-10-13 16:42:50 UTC (rev 2646)
@@ -559,7 +559,7 @@
helpTestVisitor(getTestVDB(),
"select {t '13:59:59'} FROM parts", //$NON-NLS-1$
null,
- "SELECT {ts '1970-01-01 13:59:59'} FROM PARTS"); //$NON-NLS-1$
+ "SELECT to_date('1970-01-01 13:59:59', 'YYYY-MM-DD HH24:MI:SS') FROM PARTS"); //$NON-NLS-1$
}
@Test public void testTimestampLiteral() throws Exception {
Modified: branches/7.1.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseConvertModifier.java
===================================================================
--- branches/7.1.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseConvertModifier.java 2010-10-13 15:46:43 UTC (rev 2645)
+++ branches/7.1.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseConvertModifier.java 2010-10-13 16:42:50 UTC (rev 2646)
@@ -105,7 +105,7 @@
LANG_FACTORY.createLiteral("date", String.class)}, //$NON-NLS-1$
java.sql.Date.class);
- helpGetString1(func, "cast(stuff(stuff(convert(varchar, {ts '1989-03-03 07:08:12.0'}, 102), 5, 1, '-'), 8, 1, '-') AS datetime)"); //$NON-NLS-1$
+ helpGetString1(func, "cast(stuff(stuff(convert(varchar, CAST('1989-03-03 07:08:12.0' AS DATETIME), 102), 5, 1, '-'), 8, 1, '-') AS datetime)"); //$NON-NLS-1$
}
/********************END of cast(date AS INPUT) ******************/
@@ -129,7 +129,7 @@
LANG_FACTORY.createLiteral("time", String.class)}, //$NON-NLS-1$
java.sql.Time.class);
- helpGetString1(func, "cast('1970-01-01 ' + convert(varchar, {ts '1989-03-03 07:08:12.0'}, 8) AS datetime)"); //$NON-NLS-1$
+ helpGetString1(func, "cast('1970-01-01 ' + convert(varchar, CAST('1989-03-03 07:08:12.0' AS DATETIME), 8) AS datetime)"); //$NON-NLS-1$
}
/********************END of cast(time AS INPUT) ******************/
@@ -152,7 +152,7 @@
LANG_FACTORY.createLiteral("timestamp", String.class)}, //$NON-NLS-1$
java.sql.Timestamp.class);
- helpGetString1(func, "{ts '1970-01-01 12:02:03'}"); //$NON-NLS-1$
+ helpGetString1(func, "CAST('1970-01-01 12:02:03.0' AS DATETIME)"); //$NON-NLS-1$
}
@Test public void testDateToTimestamp() throws Exception {
@@ -162,7 +162,7 @@
LANG_FACTORY.createLiteral("timestamp", String.class)}, //$NON-NLS-1$
java.sql.Timestamp.class);
- helpGetString1(func, "{d '1989-03-03'}"); //$NON-NLS-1$
+ helpGetString1(func, "CAST('1989-03-03' AS DATE)"); //$NON-NLS-1$
}
/********************END of cast(timestamp AS INPUT) ******************/
@@ -185,7 +185,7 @@
LANG_FACTORY.createLiteral("string", String.class)}, //$NON-NLS-1$
String.class);
- helpGetString1(func, "stuff(convert(varchar, {ts '2003-11-01 12:05:02.0'}, 123), 11, 1, ' ')"); //$NON-NLS-1$
+ helpGetString1(func, "stuff(stuff(convert(varchar, CAST('2003-11-01 12:05:02.0' AS DATETIME), 102), 5, 1, '-'), 8, 1, '-') convert(varchar, CAST('2003-11-01 12:05:02.0' AS DATETIME), 8)"); //$NON-NLS-1$
}
@Test public void testDateToString() throws Exception {
@@ -196,7 +196,7 @@
LANG_FACTORY.createLiteral("string", String.class)}, //$NON-NLS-1$
String.class);
- helpGetString1(func, "stuff(stuff(convert(varchar, {d '2003-11-01'}, 102), 5, 1, '-'), 8, 1, '-')"); //$NON-NLS-1$
+ helpGetString1(func, "stuff(stuff(convert(varchar, CAST('2003-11-01' AS DATE), 102), 5, 1, '-'), 8, 1, '-')"); //$NON-NLS-1$
}
@Test public void testTimeToString() throws Exception {
@@ -207,7 +207,7 @@
LANG_FACTORY.createLiteral("string", String.class)}, //$NON-NLS-1$
String.class);
- helpGetString1(func, "convert(varchar, {ts '1970-01-01 03:10:01'}, 8)"); //$NON-NLS-1$
+ helpGetString1(func, "convert(varchar, CAST('1970-01-01 03:10:01.0' AS DATETIME), 8)"); //$NON-NLS-1$
}
@Test public void testBigDecimalToString() throws Exception {
Modified: branches/7.1.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseSQLConversionVisitor.java
===================================================================
--- branches/7.1.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseSQLConversionVisitor.java 2010-10-13 15:46:43 UTC (rev 2645)
+++ branches/7.1.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sybase/TestSybaseSQLConversionVisitor.java 2010-10-13 16:42:50 UTC (rev 2646)
@@ -189,21 +189,21 @@
public void testDateLiteral() {
helpTestVisitor(getTestVDB(),
"select {d '2002-12-31'} FROM parts", //$NON-NLS-1$
- "SELECT {d '2002-12-31'} FROM PARTS"); //$NON-NLS-1$
+ "SELECT CAST('2002-12-31' AS DATE) FROM PARTS"); //$NON-NLS-1$
}
@Test
public void testTimeLiteral() {
helpTestVisitor(getTestVDB(),
"select {t '13:59:59'} FROM parts", //$NON-NLS-1$
- "SELECT {ts '1970-01-01 13:59:59'} FROM PARTS"); //$NON-NLS-1$
+ "SELECT CAST('1970-01-01 13:59:59.0' AS DATETIME) FROM PARTS"); //$NON-NLS-1$
}
@Test
public void testTimestampLiteral() {
helpTestVisitor(getTestVDB(),
"select {ts '2002-12-31 13:59:59'} FROM parts", //$NON-NLS-1$
- "SELECT {ts '2002-12-31 13:59:59.0'} FROM PARTS"); //$NON-NLS-1$
+ "SELECT CAST('2002-12-31 13:59:59.0' AS DATETIME) FROM PARTS"); //$NON-NLS-1$
}
@Test
Modified: branches/7.1.x/documentation/reference/src/main/docbook/en-US/content/sql_support.xml
===================================================================
--- branches/7.1.x/documentation/reference/src/main/docbook/en-US/content/sql_support.xml 2010-10-13 15:46:43 UTC (rev 2645)
+++ branches/7.1.x/documentation/reference/src/main/docbook/en-US/content/sql_support.xml 2010-10-13 16:42:50 UTC (rev 2646)
@@ -1206,8 +1206,9 @@
<para>Subqueries supported in the criteria of the outer query include subqueries in an IN clause, subqueries using the ANY/SOME or ALL predicate quantifier, and subqueries using the EXISTS predicate. </para>
<example>
<title>Example Subquery in WHERE Using EXISTS</title>
- <programlisting>SELECT a FROM X WHERE EXISTS (SELECT b, c FROM Y WHERE c=3)</programlisting>
+ <programlisting>SELECT a FROM X WHERE EXISTS (SELECT 1 FROM Y WHERE c=X.a)</programlisting>
</example>
+ <note><para>EXISTS subqueries should typically follow the convention "SELECT 1 FROM ..." to prevent unnecessary evaluation of select expressions.</para></note>
<para>
The following usages of subqueries must each select only one column, but can return any number of rows.
</para>
[View Less]
14 years, 2 months
teiid SVN: r2645 - in trunk/engine/src/test/java/org/teiid: query/validator and 1 other directory.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2010-10-13 11:46:43 -0400 (Wed, 13 Oct 2010)
New Revision: 2645
Modified:
trunk/engine/src/test/java/org/teiid/dqp/internal/process/multisource/TestMultiSourceElementReplacementVisitor.java
trunk/engine/src/test/java/org/teiid/query/validator/TestValidator.java
Log:
TEIID-1273, TEIID-1295, TEIID-1296:fixing the tests
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/multisource/TestMultiSourceElementReplacementVisitor.java
=========================…
[View More]==========================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/multisource/TestMultiSourceElementReplacementVisitor.java 2010-10-12 20:23:14 UTC (rev 2644)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/multisource/TestMultiSourceElementReplacementVisitor.java 2010-10-13 15:46:43 UTC (rev 2645)
@@ -123,15 +123,15 @@
}
public void testInsertMatching() throws Exception {
- helpTest("INSERT INTO MultiModel.Phys(a, SOURCE_NAME) VALUES('a', 'x')", //$NON-NLS-1$
+ helpTest("INSERT INTO MultiModel.Phys(a, SOURCE_NAME) VALUES ('a', 'x')", //$NON-NLS-1$
getMetadata(),
- "INSERT INTO MultiModel.Phys (a, SOURCE_NAME) SELECT a WHERE '1' = '2'"); //$NON-NLS-1$
+ "INSERT INTO MultiModel.Phys (a) VALUES ('a')"); //$NON-NLS-1$
}
public void testInsertNotMatching() throws Exception {
- helpTest("INSERT INTO MultiModel.Phys(a, SOURCE_NAME) VALUES('a', 'y')", //$NON-NLS-1$
+ helpTest("INSERT INTO MultiModel.Phys(a, SOURCE_NAME) VALUES ('a', 'y')", //$NON-NLS-1$
getMetadata(),
- "INSERT INTO MultiModel.Phys (a, SOURCE_NAME) SELECT a WHERE '1' = '2'"); //$NON-NLS-1$
+ "INSERT INTO MultiModel.Phys (a) SELECT a FROM MultiModel.Phys WHERE 1 = 0"); //$NON-NLS-1$
}
public void testInsertAll() throws Exception {
Modified: trunk/engine/src/test/java/org/teiid/query/validator/TestValidator.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/validator/TestValidator.java 2010-10-12 20:23:14 UTC (rev 2644)
+++ trunk/engine/src/test/java/org/teiid/query/validator/TestValidator.java 2010-10-13 15:46:43 UTC (rev 2645)
@@ -2036,7 +2036,7 @@
@Test public void testDisallowUpdateOnMultisourceElement() throws Exception {
Set<String> models = new HashSet<String>();
models.add("pm1");
- ValidatorReport report = helpValidateInModeler("pm1.vsp36", "UPDATE PM1.G1 set SOURCE_NAME='blah'", new MultiSourceMetadataWrapper(FakeMetadataFactory.example1Cached(), models)); //$NON-NLS-1$
+ ValidatorReport report = helpValidateInModeler("pm1.vsp36", "UPDATE PM1.G1 set SOURCE_NAME='blah'", new MultiSourceMetadataWrapper(FakeMetadataFactory.example1(), models)); //$NON-NLS-1$
assertEquals(report.toString(), 1, report.getItems().size());
}
}
[View Less]
14 years, 2 months
teiid SVN: r2644 - in trunk: engine/src/main/java/org/teiid/dqp/internal/process/multisource and 5 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2010-10-12 16:23:14 -0400 (Tue, 12 Oct 2010)
New Revision: 2644
Modified:
trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml
trunk/engine/src/main/java/org/teiid/dqp/internal/process/multisource/MultiSourceElementReplacementVisitor.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/multisource/MultiSourceMetadataWrapper.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/multisource/…
[View More]MultiSourcePlanToProcessConverter.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalNodeUtil.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalPlan.java
trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java
trunk/engine/src/main/resources/org/teiid/query/i18n.properties
trunk/engine/src/test/java/org/teiid/dqp/internal/process/multisource/TestMultiSourceElementReplacementVisitor.java
trunk/engine/src/test/java/org/teiid/query/validator/TestValidator.java
Log:
TEIID-1273, TEIID-1295, TEIID-1296: multi-source insert capability is added. Also corrected update count and mark them as transactional when more than single source is involved.
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml 2010-10-12 18:04:46 UTC (rev 2643)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml 2010-10-12 20:23:14 UTC (rev 2644)
@@ -1229,7 +1229,7 @@
<para>
To mark a model as multi-source, the user needs to supply property called
<property>supports-multi-source-bindings</property>, in the "vdb.xml" file.
- Also, the user needs to define multiple sources. Here is code example showing single model with
+ Also, the user needs to define multiple sources. Here is code example showing dynamic vdb with single model with
multiple sources defined.
</para>
@@ -1258,12 +1258,13 @@
<programlisting language="SQL"><![CDATA[select * from table where SOURCE_NAME = 'newyork'
update table column=value where SOURCE_NAME='chicago'
-delete from table where column = x and SOURCE_NAME='la']]></programlisting>
+delete from table where column = x and SOURCE_NAME='la'
+insert into table (column, SOURCE_NAME) VALUES ('value', 'newyork')]]></programlisting>
<para>
- Note that when user do not supply the "SOURCE_NAME" in the criteria, it applies
- to all the sources. Unfortunately Teiid currently does not support INSERT, this
- planned for future releases. Another useful feature along with this feature is
+ Note that when user do not supply the "SOURCE_NAME" in the criteria, the command applies
+ to all the sources. If SOURCE_NAME supplied, the query is executed only aginst the source specified.
+ Another useful feature along with this feature is
"partial results" to skip unavailable sources if they are down.
</para>
@@ -1273,7 +1274,7 @@
limited, so if you need to use this feature build the VDB as usual in
the Teiid Designer and then edit the "vdb.xml" file in the VDB archive
using a Text editor to add the additional sources as defined above.
- You must deploy a data source for each source defined.
+ You must deploy a separate data source for each source defined in the xml file.
</para>
</note>
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/multisource/MultiSourceElementReplacementVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/multisource/MultiSourceElementReplacementVisitor.java 2010-10-12 18:04:46 UTC (rev 2643)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/multisource/MultiSourceElementReplacementVisitor.java 2010-10-12 20:23:14 UTC (rev 2644)
@@ -23,6 +23,11 @@
package org.teiid.dqp.internal.process.multisource;
import org.teiid.core.types.DataTypeManager;
+import org.teiid.query.rewriter.QueryRewriter;
+import org.teiid.query.sql.lang.From;
+import org.teiid.query.sql.lang.Insert;
+import org.teiid.query.sql.lang.Query;
+import org.teiid.query.sql.lang.Select;
import org.teiid.query.sql.symbol.Constant;
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.Expression;
@@ -50,4 +55,29 @@
return expr;
}
+
+ public void visit(Insert obj) {
+ for (int i = 0; i < obj.getVariables().size(); i++) {
+ Expression expr = (Expression)obj.getVariables().get(i);
+ if(expr instanceof ElementSymbol) {
+ ElementSymbol elem = (ElementSymbol) expr;
+ Object metadataID = elem.getMetadataID();
+ if(metadataID instanceof MultiSourceElement) {
+ Constant source = (Constant)obj.getValues().get(i);
+ obj.getVariables().remove(i);
+ obj.getValues().remove(i);
+ if (!source.getValue().equals(this.bindingName)) {
+ Select select = new Select(obj.getVariables());
+ From from = new From();
+ from.addGroup(obj.getGroup());
+ Query query = new Query();
+ query.setSelect(select);
+ query.setFrom(from);
+ query.setCriteria(QueryRewriter.FALSE_CRITERIA);
+ obj.setQueryExpression(query);
+ }
+ }
+ }
+ }
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/multisource/MultiSourceMetadataWrapper.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/multisource/MultiSourceMetadataWrapper.java 2010-10-12 18:04:46 UTC (rev 2643)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/multisource/MultiSourceMetadataWrapper.java 2010-10-12 20:23:14 UTC (rev 2644)
@@ -271,7 +271,7 @@
case SupportConstants.Element.SELECT:
return true;
case SupportConstants.Element.UPDATE:
- return false;
+ return true;
case SupportConstants.Element.DEFAULT_VALUE:
return false;
case SupportConstants.Element.AUTO_INCREMENT:
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/multisource/MultiSourcePlanToProcessConverter.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/multisource/MultiSourcePlanToProcessConverter.java 2010-10-12 18:04:46 UTC (rev 2643)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/multisource/MultiSourcePlanToProcessConverter.java 2010-10-12 20:23:14 UTC (rev 2644)
@@ -33,20 +33,31 @@
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
import org.teiid.core.id.IDGenerator;
+import org.teiid.core.types.DataTypeManager;
import org.teiid.dqp.internal.process.DQPWorkContext;
+import org.teiid.language.SQLConstants.NonReserved;
import org.teiid.query.analysis.AnalysisRecord;
+import org.teiid.query.function.FunctionLibrary;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.optimizer.capabilities.CapabilitiesFinder;
import org.teiid.query.optimizer.relational.PlanToProcessConverter;
import org.teiid.query.optimizer.relational.plantree.PlanNode;
import org.teiid.query.processor.relational.AccessNode;
+import org.teiid.query.processor.relational.GroupingNode;
import org.teiid.query.processor.relational.NullNode;
+import org.teiid.query.processor.relational.ProjectNode;
import org.teiid.query.processor.relational.RelationalNode;
import org.teiid.query.processor.relational.RelationalNodeUtil;
import org.teiid.query.processor.relational.UnionAllNode;
+import org.teiid.query.resolver.util.ResolverVisitor;
import org.teiid.query.rewriter.QueryRewriter;
import org.teiid.query.sql.lang.Command;
import org.teiid.query.sql.navigator.DeepPreOrderNavigator;
+import org.teiid.query.sql.symbol.AggregateSymbol;
+import org.teiid.query.sql.symbol.Constant;
+import org.teiid.query.sql.symbol.Expression;
+import org.teiid.query.sql.symbol.ExpressionSymbol;
+import org.teiid.query.sql.symbol.Function;
import org.teiid.query.util.CommandContext;
@@ -102,6 +113,10 @@
// Replace all multi-source elements with the source name
DeepPreOrderNavigator.doVisit(command, new MultiSourceElementReplacementVisitor(sourceName));
+ if (!RelationalNodeUtil.shouldExecute(command, false)) {
+ continue;
+ }
+
// Rewrite the command now that criteria may have been simplified
try {
command = QueryRewriter.rewrite(command, metadata, null);
@@ -133,17 +148,44 @@
}
default:
{
- // More than 1 access node - replace with a union
+
+ UnionAllNode unionNode = new UnionAllNode(getID());
+ unionNode.setElements(accessNode.getElements());
- UnionAllNode unionNode = new UnionAllNode(getID());
- unionNode.setElements(accessNode.getElements());
-
- RelationalNode parent = unionNode;
-
for (AccessNode newNode : accessNodes) {
- unionNode.addChild(newNode);
+ unionNode.addChild(newNode);
}
+
+ RelationalNode parent = unionNode;
+
+ // More than 1 access node - replace with a union
+ if (RelationalNodeUtil.isUpdate(accessNode.getCommand())) {
+
+ GroupingNode groupNode = new GroupingNode(getID());
+ AggregateSymbol sumCount = new AggregateSymbol("SumCount", NonReserved.SUM, false, (Expression)accessNode.getElements().get(0)); //$NON-NLS-1$
+ List outputElements = new ArrayList();
+ outputElements.add(sumCount);
+ groupNode.setElements(outputElements);
+ groupNode.addChild(unionNode);
+
+ ProjectNode projectNode = new ProjectNode(getID());
+ // two converts because, the 2nd one does not resolve because of no metadata about the expression.
+ Function convertFunc = new Function(FunctionLibrary.CONVERT, new Expression[] {new Constant(new Long(0)), new Constant(DataTypeManager.DefaultDataTypes.INTEGER)});
+ ResolverVisitor.resolveLanguageObject(convertFunc, metadata);
+ Function convertFunc2 = new Function(FunctionLibrary.CONVERT, new Expression[] {sumCount, new Constant(DataTypeManager.DefaultDataTypes.INTEGER)});
+ convertFunc2.setFunctionDescriptor(convertFunc.getFunctionDescriptor());
+
+ Expression rowCount = new ExpressionSymbol("RowCount", convertFunc2); //$NON-NLS-1$
+ outputElements = new ArrayList();
+ outputElements.add(rowCount);
+ projectNode.setElements(outputElements);
+ projectNode.setSelectSymbols(outputElements);
+ projectNode.addChild(groupNode);
+
+ parent = projectNode;
+ }
+ parent.setMultiSource(true);
return parent;
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalNode.java 2010-10-12 18:04:46 UTC (rev 2643)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalNode.java 2010-10-12 20:23:14 UTC (rev 2644)
@@ -87,6 +87,8 @@
/** Child nodes, usually just 1 or 2 */
private RelationalNode[] children = new RelationalNode[2];
+
+ private boolean multiSource;
protected RelationalNode() {
@@ -596,4 +598,12 @@
}
return processingState;
}
+
+ public boolean isMultiSource() {
+ return multiSource;
+ }
+
+ public void setMultiSource(boolean multiSource) {
+ this.multiSource = multiSource;
+ }
}
\ No newline at end of file
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalNodeUtil.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalNodeUtil.java 2010-10-12 18:04:46 UTC (rev 2643)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalNodeUtil.java 2010-10-12 20:23:14 UTC (rev 2644)
@@ -29,6 +29,7 @@
import org.teiid.query.sql.lang.Command;
import org.teiid.query.sql.lang.Criteria;
import org.teiid.query.sql.lang.Delete;
+import org.teiid.query.sql.lang.Insert;
import org.teiid.query.sql.lang.Limit;
import org.teiid.query.sql.lang.Query;
import org.teiid.query.sql.lang.QueryCommand;
@@ -123,6 +124,13 @@
return true;
}
break;
+ case Command.TYPE_INSERT:
+ Insert insert = (Insert) command;
+ QueryCommand expr = insert.getQueryExpression();
+ if (expr != null) {
+ return shouldExecute(expr, simplifyCriteria);
+ }
+ return true;
case Command.TYPE_UPDATE:
Update update = (Update) command;
@@ -174,7 +182,7 @@
* @return
* @since 4.2
*/
- static boolean isUpdate(Command command) {
+ public static boolean isUpdate(Command command) {
int commandType = command.getType();
return commandType == Command.TYPE_INSERT ||
commandType == Command.TYPE_UPDATE ||
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalPlan.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalPlan.java 2010-10-12 18:04:46 UTC (rev 2643)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/RelationalPlan.java 2010-10-12 20:23:14 UTC (rev 2644)
@@ -239,6 +239,9 @@
}
}
}
+ if (this.root.isMultiSource()) {
+ return true;
+ }
return requiresTransaction(transactionalReads, root);
}
Modified: trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java 2010-10-12 18:04:46 UTC (rev 2643)
+++ trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java 2010-10-12 20:23:14 UTC (rev 2644)
@@ -42,6 +42,7 @@
import org.teiid.core.TeiidProcessingException;
import org.teiid.core.types.DataTypeManager;
import org.teiid.core.util.EquivalenceUtil;
+import org.teiid.dqp.internal.process.multisource.MultiSourceElement;
import org.teiid.query.QueryPlugin;
import org.teiid.query.eval.Evaluator;
import org.teiid.query.function.FunctionLibrary;
@@ -788,7 +789,8 @@
ElementSymbol nextElmnt = (ElementSymbol) ignoreIter.next();
if(!getMetadata().elementSupports(nextElmnt.getMetadataID(), SupportConstants.Element.DEFAULT_VALUE) &&
!getMetadata().elementSupports(nextElmnt.getMetadataID(), SupportConstants.Element.NULL) &&
- !getMetadata().elementSupports(nextElmnt.getMetadataID(), SupportConstants.Element.AUTO_INCREMENT)) {
+ !getMetadata().elementSupports(nextElmnt.getMetadataID(), SupportConstants.Element.AUTO_INCREMENT) &&
+ !(nextElmnt.getMetadataID() instanceof MultiSourceElement)) {
handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0053", new Object[] {insertGroup, nextElmnt}), nextElmnt); //$NON-NLS-1$
}
}
@@ -843,6 +845,11 @@
if(! getMetadata().elementSupports(elementID.getMetadataID(), SupportConstants.Element.UPDATE)) {
handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0059", elementID), elementID); //$NON-NLS-1$
}
+
+ Object metadataID = elementID.getMetadataID();
+ if (metadataID instanceof MultiSourceElement){
+ handleValidationError(QueryPlugin.Util.getString("multi_source_update_not_allowed", elementID), elementID); //$NON-NLS-1$
+ }
// Check that right expression is a constant and is non-null
Expression value = entry.getValue();
Modified: trunk/engine/src/main/resources/org/teiid/query/i18n.properties
===================================================================
--- trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2010-10-12 18:04:46 UTC (rev 2643)
+++ trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2010-10-12 20:23:14 UTC (rev 2644)
@@ -860,4 +860,5 @@
RequestWorkItem.cache_nondeterministic=Caching command '{0}'' at a session level, but less deterministic functions were evaluated.
not_found_cache=Results not found in cache
failed_to_unwrap_connection=Failed to unwrap the source connection.
-connection_factory_not_found=Failed to the Connection Factory with JNDI name {0}. Please check the name for spelling or deploy the Connection Factory with specified name.
\ No newline at end of file
+connection_factory_not_found=Failed to the Connection Factory with JNDI name {0}. Please check the name for spelling or deploy the Connection Factory with specified name.
+multi_source_update_not_allowed=Update of the column {0} is not allowed.
\ No newline at end of file
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/multisource/TestMultiSourceElementReplacementVisitor.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/multisource/TestMultiSourceElementReplacementVisitor.java 2010-10-12 18:04:46 UTC (rev 2643)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/multisource/TestMultiSourceElementReplacementVisitor.java 2010-10-12 20:23:14 UTC (rev 2644)
@@ -45,7 +45,7 @@
QueryMetadataInterface metadata = FakeMetadataFactory.exampleMultiBinding();
Set<String> multiSourceModels = new HashSet<String>();
- multiSourceModels.add("MultiModel");
+ multiSourceModels.add("MultiModel"); //$NON-NLS-1$
MultiSourceMetadataWrapper wrapper = new MultiSourceMetadataWrapper(metadata, multiSourceModels);
return wrapper;
@@ -121,5 +121,23 @@
getMetadata(),
"SELECT a FROM MultiModel.Phys WHERE 'x' = (SELECT b FROM MultiModel.Phys WHERE 'x' IN ('x'))"); //$NON-NLS-1$
}
+
+ public void testInsertMatching() throws Exception {
+ helpTest("INSERT INTO MultiModel.Phys(a, SOURCE_NAME) VALUES('a', 'x')", //$NON-NLS-1$
+ getMetadata(),
+ "INSERT INTO MultiModel.Phys (a, SOURCE_NAME) SELECT a WHERE '1' = '2'"); //$NON-NLS-1$
+ }
+
+ public void testInsertNotMatching() throws Exception {
+ helpTest("INSERT INTO MultiModel.Phys(a, SOURCE_NAME) VALUES('a', 'y')", //$NON-NLS-1$
+ getMetadata(),
+ "INSERT INTO MultiModel.Phys (a, SOURCE_NAME) SELECT a WHERE '1' = '2'"); //$NON-NLS-1$
+ }
+
+ public void testInsertAll() throws Exception {
+ helpTest("INSERT INTO MultiModel.Phys(a) VALUES('a')", //$NON-NLS-1$
+ getMetadata(),
+ "INSERT INTO MultiModel.Phys (a) VALUES ('a')"); //$NON-NLS-1$
+ }
}
Modified: trunk/engine/src/test/java/org/teiid/query/validator/TestValidator.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/validator/TestValidator.java 2010-10-12 18:04:46 UTC (rev 2643)
+++ trunk/engine/src/test/java/org/teiid/query/validator/TestValidator.java 2010-10-12 20:23:14 UTC (rev 2644)
@@ -22,7 +22,9 @@
package org.teiid.query.validator;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
import java.util.ArrayList;
import java.util.Arrays;
@@ -44,6 +46,7 @@
import org.teiid.core.TeiidException;
import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.types.DataTypeManager;
+import org.teiid.dqp.internal.process.multisource.MultiSourceMetadataWrapper;
import org.teiid.query.analysis.AnalysisRecord;
import org.teiid.query.mapping.relational.QueryNode;
import org.teiid.query.mapping.xml.MappingDocument;
@@ -2030,4 +2033,10 @@
helpValidate("SELECT e2, (SELECT e1, e2 FROM pm1.g1 WHERE e2 = '3') FROM pm1.g2", new String[] {"SELECT e1, e2 FROM pm1.g1 WHERE e2 = '3'"}, FakeMetadataFactory.example1Cached()); //$NON-NLS-1$ //$NON-NLS-2$
}
+ @Test public void testDisallowUpdateOnMultisourceElement() throws Exception {
+ Set<String> models = new HashSet<String>();
+ models.add("pm1");
+ ValidatorReport report = helpValidateInModeler("pm1.vsp36", "UPDATE PM1.G1 set SOURCE_NAME='blah'", new MultiSourceMetadataWrapper(FakeMetadataFactory.example1Cached(), models)); //$NON-NLS-1$
+ assertEquals(report.toString(), 1, report.getItems().size());
+ }
}
[View Less]
14 years, 3 months
teiid SVN: r2643 - in branches/7.1.x: engine/src/main/java/org/teiid/query/function and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2010-10-12 14:04:46 -0400 (Tue, 12 Oct 2010)
New Revision: 2643
Modified:
branches/7.1.x/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml
branches/7.1.x/engine/src/main/java/org/teiid/query/function/FunctionMethods.java
Log:
TEIID-950 merging ENV function changes.
Modified: branches/7.1.x/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml
===================================================================
--- …
[View More]branches/7.1.x/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml 2010-10-12 16:39:25 UTC (rev 2642)
+++ branches/7.1.x/documentation/reference/src/main/docbook/en-US/content/scalar_functions.xml 2010-10-12 18:04:46 UTC (rev 2643)
@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
+<!ENTITY % CustomDTD SYSTEM "../../../../../../docbook/custom.dtd">
+%CustomDTD;
+]>
<chapter id="scalar_functions">
<title>Scalar Functions</title>
<para>
@@ -1862,9 +1865,10 @@
<para><code>ENV(key)</code></para>
</entry>
<entry>
- <para>Retrieve an environment property. The only key
- currently allowed is ‘sessionid’, although this will expand
- in the future.</para>
+ <para>Retrieve a system environment property. The only key specific to the current session is ‘sessionid’.
+ However the preferred mechanism for getting the session id is with the session_id() function.
+ To prevent untrusted access to system properties, the use of this function must be specifically enabled in the &jboss-beans; file.
+ </para>
</entry>
<entry>
<para>key in {string}, return is string</para>
@@ -1872,6 +1876,17 @@
</row>
<row>
<entry>
+ <para><code>SESSION_ID()</code></para>
+ </entry>
+ <entry>
+ <para>Retrieve the string form of the current session id.</para>
+ </entry>
+ <entry>
+ <para>return is string</para>
+ </entry>
+ </row>
+ <row>
+ <entry>
<para><code>USER()</code></para>
</entry>
<entry>
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/function/FunctionMethods.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/function/FunctionMethods.java 2010-10-12 16:39:25 UTC (rev 2642)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/function/FunctionMethods.java 2010-10-12 18:04:46 UTC (rev 2643)
@@ -56,7 +56,6 @@
import org.teiid.language.SQLConstants.NonReserved;
import org.teiid.query.QueryPlugin;
import org.teiid.query.util.CommandContext;
-import org.teiid.query.util.ContextProperties;
/**
* Static method hooks for most of the function library.
@@ -1242,11 +1241,7 @@
}
public static Object session_id(CommandContext context) {
- Properties envProps = context.getEnvironmentProperties();
- if(envProps != null && envProps.containsKey(ContextProperties.SESSION_ID)) {
- return envProps.getProperty(ContextProperties.SESSION_ID);
- }
- return null;
+ return context.getConnectionID();
}
// ================= Function - MODIFYTIMEZONE ========================
[View Less]
14 years, 3 months
teiid SVN: r2642 - in branches/7.1.x: build/kits/jboss-container/deployers/teiid.deployer and 21 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2010-10-12 12:39:25 -0400 (Tue, 12 Oct 2010)
New Revision: 2642
Modified:
branches/7.1.x/build/kits/jboss-container/deployers/teiid.deployer/teiid-deployer-jboss-beans.xml
branches/7.1.x/build/kits/jboss-container/teiid-releasenotes.html
branches/7.1.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java
branches/7.1.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sqlserver/…
[View More]TestSqlServerConversionVisitor.java
branches/7.1.x/connectors/translator-ldap/src/test/java/org/teiid/translator/ldap/TestIQueryToLdapSearchParser.java
branches/7.1.x/connectors/translator-salesforce/src/test/java/org/teiid/translator/salesforce/execution/visitors/TestVisitors.java
branches/7.1.x/engine/src/main/java/org/teiid/query/function/FunctionLibrary.java
branches/7.1.x/engine/src/main/java/org/teiid/query/function/FunctionMethods.java
branches/7.1.x/engine/src/main/java/org/teiid/query/function/SystemFunctionManager.java
branches/7.1.x/engine/src/main/java/org/teiid/query/function/source/SystemSource.java
branches/7.1.x/engine/src/main/java/org/teiid/query/metadata/TransformationMetadata.java
branches/7.1.x/engine/src/main/resources/org/teiid/query/i18n.properties
branches/7.1.x/engine/src/test/java/org/teiid/query/function/TestFunctionLibrary.java
branches/7.1.x/engine/src/test/java/org/teiid/query/function/TestFunctionTree.java
branches/7.1.x/engine/src/test/java/org/teiid/query/function/metadata/TestSystemSource.java
branches/7.1.x/engine/src/test/java/org/teiid/query/metadata/TestTransformationMetadata.java
branches/7.1.x/engine/src/test/java/org/teiid/query/optimizer/TestOptimizer.java
branches/7.1.x/engine/src/test/java/org/teiid/query/processor/TestProcessor.java
branches/7.1.x/engine/src/test/java/org/teiid/query/processor/eval/TestExpressionEvaluator.java
branches/7.1.x/engine/src/test/java/org/teiid/query/processor/relational/TestGroupingNode.java
branches/7.1.x/engine/src/test/java/org/teiid/query/processor/relational/TestJoinNode.java
branches/7.1.x/engine/src/test/java/org/teiid/query/processor/relational/TestProjectNode.java
branches/7.1.x/engine/src/test/java/org/teiid/query/processor/relational/TestSelectNode.java
branches/7.1.x/engine/src/test/java/org/teiid/query/resolver/TestResolver.java
branches/7.1.x/engine/src/test/java/org/teiid/query/unittest/FakeMetadataFacade.java
branches/7.1.x/engine/src/test/java/org/teiid/query/unittest/FakeMetadataFactory.java
branches/7.1.x/engine/src/test/java/org/teiid/query/unittest/RealMetadataFactory.java
branches/7.1.x/metadata/src/test/java/org/teiid/cdk/api/TranslationUtility.java
branches/7.1.x/metadata/src/test/java/org/teiid/metadata/index/VDBMetadataFactory.java
branches/7.1.x/runtime/src/main/java/org/teiid/deployers/CompositeVDB.java
branches/7.1.x/runtime/src/main/java/org/teiid/deployers/VDBRepository.java
branches/7.1.x/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java
Log:
TEIID-950: By default disabled the "ENV" system function. Added new "SESSION_ID" system function to retrieve the session information of the executing user. Removed the static nature of loading the system functions to enable the configuration.
Modified: branches/7.1.x/build/kits/jboss-container/deployers/teiid.deployer/teiid-deployer-jboss-beans.xml
===================================================================
--- branches/7.1.x/build/kits/jboss-container/deployers/teiid.deployer/teiid-deployer-jboss-beans.xml 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/build/kits/jboss-container/deployers/teiid.deployer/teiid-deployer-jboss-beans.xml 2010-10-12 16:39:25 UTC (rev 2642)
@@ -4,7 +4,15 @@
<!-- Deployer specific Stuff -->
<bean name="VDBStructure" class="org.teiid.deployers.VDBStructure" />
- <bean name="VDBRepository" class="org.teiid.deployers.VDBRepository"/>
+
+ <bean name="SystemFunctionManager" class="org.teiid.query.function.SystemFunctionManager">
+ <property name="allowEnvFunction">false</property>
+ </bean>
+
+ <bean name="VDBRepository" class="org.teiid.deployers.VDBRepository">
+ <property name="systemFunctionManager"><inject bean="SystemFunctionManager"/></property>
+ </bean>
+
<bean name="SecurityHelper" class="org.teiid.jboss.JBossSecurityHelper"/>
<bean name="JBossLifeCycleListener" class="org.teiid.jboss.JBossLifeCycleListener"/>
Modified: branches/7.1.x/build/kits/jboss-container/teiid-releasenotes.html
===================================================================
--- branches/7.1.x/build/kits/jboss-container/teiid-releasenotes.html 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/build/kits/jboss-container/teiid-releasenotes.html 2010-10-12 16:39:25 UTC (rev 2642)
@@ -51,6 +51,7 @@
<li>The jdbc:metamatrix JDBC URL prefix is no longer accepted. Use jdbc:teiid instead.
<li>Model visibility no longer restricts access to tables and procedures. Setting visible to false will only hide entries from system tables. Data roles should be used to restrict data access.
<li>On Admin API "getWorkManagerStats" methods renamed to "getWorkerPoolStats". Also, "setRuntimeProperty" and "getProcesses" methods are not supported.
+ <li>A new system function "session_id" is added to the system function library. By default "ENV" system function is now turned off. To enable it edit Teiid configuration file.
</ul>
<h4>from 7.0</h4>
<ul>
Modified: branches/7.1.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java
===================================================================
--- branches/7.1.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/oracle/TestOracleTranslator.java 2010-10-12 16:39:25 UTC (rev 2642)
@@ -722,7 +722,7 @@
RealMetadataFactory.createElements(dual, new String[] {"something"}, new String[] {DataTypeManager.DefaultDataTypes.STRING}); //$NON-NLS-1$
CompositeMetadataStore store = new CompositeMetadataStore(metadataStore);
- return new TransformationMetadata(null, store, null, null);
+ return new TransformationMetadata(null, store, null, null, FakeMetadataFactory.SFM.getSystemFunctions());
}
public void helpTestVisitor(String vdb, String input, String expectedOutput) throws TranslatorException {
Modified: branches/7.1.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sqlserver/TestSqlServerConversionVisitor.java
===================================================================
--- branches/7.1.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sqlserver/TestSqlServerConversionVisitor.java 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/sqlserver/TestSqlServerConversionVisitor.java 2010-10-12 16:39:25 UTC (rev 2642)
@@ -36,6 +36,7 @@
import org.teiid.query.metadata.CompositeMetadataStore;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.metadata.TransformationMetadata;
+import org.teiid.query.unittest.FakeMetadataFactory;
import org.teiid.query.unittest.RealMetadataFactory;
import org.teiid.translator.TranslatorException;
import org.teiid.translator.jdbc.TranslationHelper;
@@ -158,7 +159,7 @@
obj.setNativeType("uniqueidentifier"); //$NON-NLS-1$
CompositeMetadataStore store = new CompositeMetadataStore(metadataStore);
- QueryMetadataInterface metadata = new TransformationMetadata(null, store, null, null);
+ QueryMetadataInterface metadata = new TransformationMetadata(null, store, null, null, FakeMetadataFactory.SFM.getSystemFunctions());
TranslationUtility tu = new TranslationUtility(metadata);
Command command = tu.parseCommand("select max(x) from bar"); //$NON-NLS-1$
Modified: branches/7.1.x/connectors/translator-ldap/src/test/java/org/teiid/translator/ldap/TestIQueryToLdapSearchParser.java
===================================================================
--- branches/7.1.x/connectors/translator-ldap/src/test/java/org/teiid/translator/ldap/TestIQueryToLdapSearchParser.java 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/connectors/translator-ldap/src/test/java/org/teiid/translator/ldap/TestIQueryToLdapSearchParser.java 2010-10-12 16:39:25 UTC (rev 2642)
@@ -47,6 +47,7 @@
import org.teiid.query.metadata.CompositeMetadataStore;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.metadata.TransformationMetadata;
+import org.teiid.query.unittest.FakeMetadataFactory;
import org.teiid.query.unittest.RealMetadataFactory;
import org.teiid.translator.TranslatorException;
import org.teiid.translator.ldap.IQueryToLdapSearchParser;
@@ -303,7 +304,7 @@
}
// Create the facade from the store
- return new TransformationMetadata(null, new CompositeMetadataStore(metadataStore), null, null);
+ return new TransformationMetadata(null, new CompositeMetadataStore(metadataStore), null, null, FakeMetadataFactory.SFM.getSystemFunctions());
}
}
Modified: branches/7.1.x/connectors/translator-salesforce/src/test/java/org/teiid/translator/salesforce/execution/visitors/TestVisitors.java
===================================================================
--- branches/7.1.x/connectors/translator-salesforce/src/test/java/org/teiid/translator/salesforce/execution/visitors/TestVisitors.java 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/connectors/translator-salesforce/src/test/java/org/teiid/translator/salesforce/execution/visitors/TestVisitors.java 2010-10-12 16:39:25 UTC (rev 2642)
@@ -38,6 +38,7 @@
import org.teiid.query.metadata.CompositeMetadataStore;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.metadata.TransformationMetadata;
+import org.teiid.query.unittest.FakeMetadataFactory;
import org.teiid.query.unittest.RealMetadataFactory;
import org.teiid.translator.salesforce.execution.visitors.JoinQueryVisitor;
import org.teiid.translator.salesforce.execution.visitors.SelectVisitor;
@@ -95,7 +96,7 @@
Column obj = contactCols.get(i);
obj.setNameInSource(contactNameInSource[i]);
}
- return new TransformationMetadata(null, new CompositeMetadataStore(store), null, null);
+ return new TransformationMetadata(null, new CompositeMetadataStore(store), null, null, FakeMetadataFactory.SFM.getSystemFunctions());
}
private static TranslationUtility translationUtility = new TranslationUtility(exampleSalesforce());
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/function/FunctionLibrary.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/function/FunctionLibrary.java 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/function/FunctionLibrary.java 2010-10-12 16:39:25 UTC (rev 2642)
@@ -56,7 +56,8 @@
// Special user function
public static final String USER = "user"; //$NON-NLS-1$
// Special environment variable lookup function
- public static final String ENV = "env"; //$NON-NLS-1$
+ public static final String ENV = "env"; //$NON-NLS-1$
+ public static final String SESSION_ID = "session_id"; //$NON-NLS-1$
// Special pseudo-functions only for XML queries
public static final String CONTEXT = "context"; //$NON-NLS-1$
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/function/FunctionMethods.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/function/FunctionMethods.java 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/function/FunctionMethods.java 2010-10-12 16:39:25 UTC (rev 2642)
@@ -56,6 +56,7 @@
import org.teiid.language.SQLConstants.NonReserved;
import org.teiid.query.QueryPlugin;
import org.teiid.query.util.CommandContext;
+import org.teiid.query.util.ContextProperties;
/**
* Static method hooks for most of the function library.
@@ -1240,6 +1241,14 @@
return value;
}
+ public static Object session_id(CommandContext context) {
+ Properties envProps = context.getEnvironmentProperties();
+ if(envProps != null && envProps.containsKey(ContextProperties.SESSION_ID)) {
+ return envProps.getProperty(ContextProperties.SESSION_ID);
+ }
+ return null;
+ }
+
// ================= Function - MODIFYTIMEZONE ========================
public static Object modifyTimeZone(Timestamp value, String originalTimezoneString, String targetTimezoneString) {
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/function/SystemFunctionManager.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/function/SystemFunctionManager.java 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/function/SystemFunctionManager.java 2010-10-12 16:39:25 UTC (rev 2642)
@@ -32,30 +32,28 @@
public class SystemFunctionManager {
- private static FunctionTree systemFunctionTree;
+ private FunctionTree systemFunctionTree;
+ private boolean allowEnvFunction = true;
- static {
- // Create the system source and add it to the source list
- SystemSource systemSource = new SystemSource();
-
- // Validate the system source - should never fail
- ActivityReport report = new ActivityReport("Function Validation"); //$NON-NLS-1$
- validateSource(systemSource, report);
- if(report.hasItems()) {
- // Should never happen as SystemSource doesn't change
- System.err.println(QueryPlugin.Util.getString("ERR.015.001.0005", report)); //$NON-NLS-1$
- }
-
- systemFunctionTree = new FunctionTree(systemSource, true);
- }
+ public FunctionTree getSystemFunctions() {
+ if(systemFunctionTree == null) {
+ // Create the system source and add it to the source list
+ SystemSource systemSource = new SystemSource(this.allowEnvFunction);
-
- public static FunctionTree getSystemFunctions() {
+ // Validate the system source - should never fail
+ ActivityReport report = new ActivityReport("Function Validation"); //$NON-NLS-1$
+ validateSource(systemSource, report);
+ if(report.hasItems()) {
+ // Should never happen as SystemSourcTe doesn't change
+ System.err.println(QueryPlugin.Util.getString("ERR.015.001.0005", report)); //$NON-NLS-1$
+ }
+ systemFunctionTree = new FunctionTree(systemSource, true);
+ }
return systemFunctionTree;
}
- public static FunctionLibrary getSystemFunctionLibrary() {
- return new FunctionLibrary(systemFunctionTree, new FunctionTree(new UDFSource(Collections.EMPTY_LIST)));
+ public FunctionLibrary getSystemFunctionLibrary() {
+ return new FunctionLibrary(getSystemFunctions(), new FunctionTree(new UDFSource(Collections.EMPTY_LIST)));
}
/**
@@ -64,8 +62,16 @@
* @param source Source of function metadata
* @param report Report to update with any problems
*/
- private static void validateSource(FunctionMetadataSource source, ActivityReport report) {
+ private void validateSource(FunctionMetadataSource source, ActivityReport report) {
Collection functionMethods = source.getFunctionMethods();
FunctionMetadataValidator.validateFunctionMethods(functionMethods,report);
}
+
+ public boolean isAllowEnvFunction() {
+ return allowEnvFunction;
+ }
+
+ public void setAllowEnvFunction(boolean allowEnvFunction) {
+ this.allowEnvFunction = allowEnvFunction;
+ }
}
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/function/source/SystemSource.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/function/source/SystemSource.java 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/function/source/SystemSource.java 2010-10-12 16:39:25 UTC (rev 2642)
@@ -55,7 +55,7 @@
/**
* Construct a source of system metadata.
*/
- public SystemSource() {
+ public SystemSource(boolean allowEnvFunction) {
// +, -, *, /
addArithmeticFunction(SourceSystemFunctions.ADD_OP, QueryPlugin.Util.getString("SystemSource.Add_desc"), "plus", QueryPlugin.Util.getString("SystemSource.Add_result_desc")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
addArithmeticFunction(SourceSystemFunctions.SUBTRACT_OP, QueryPlugin.Util.getString("SystemSource.Subtract_desc"), "minus", QueryPlugin.Util.getString("SystemSource.Subtract_result_desc")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@@ -158,7 +158,10 @@
addLookupFunctions();
addUserFunction();
addCurrentDatabaseFunction();
- addEnvFunction();
+ if (allowEnvFunction) {
+ addEnvFunction();
+ }
+ addSessionIdFunction();
addCommandPayloadFunctions();
addIfNullFunctions();
@@ -787,6 +790,12 @@
new FunctionParameter("result", DataTypeManager.DefaultDataTypes.STRING, QueryPlugin.Util.getString("SystemSource.Env_result")), false, FunctionMethod.SESSION_DETERMINISTIC ) ); //$NON-NLS-1$ //$NON-NLS-2$
}
+ private void addSessionIdFunction() {
+ functions.add(
+ new FunctionMethod(FunctionLibrary.SESSION_ID, QueryPlugin.Util.getString("SystemSource.session_id_desc"), MISCELLANEOUS, FunctionMethod.CANNOT_PUSHDOWN, FUNCTION_CLASS, "session_id", null, //$NON-NLS-1$ //$NON-NLS-2$
+ new FunctionParameter("result", DataTypeManager.DefaultDataTypes.STRING, QueryPlugin.Util.getString("SystemSource.session_id_result")), false, FunctionMethod.SESSION_DETERMINISTIC) ); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
private void addCommandPayloadFunctions() {
functions.add(
new FunctionMethod("commandpayload", QueryPlugin.Util.getString("SystemSource.CommandPayload_desc0"), MISCELLANEOUS, FunctionMethod.CANNOT_PUSHDOWN, FUNCTION_CLASS, "commandPayload", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
Modified: branches/7.1.x/engine/src/main/java/org/teiid/query/metadata/TransformationMetadata.java
===================================================================
--- branches/7.1.x/engine/src/main/java/org/teiid/query/metadata/TransformationMetadata.java 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/engine/src/main/java/org/teiid/query/metadata/TransformationMetadata.java 2010-10-12 16:39:25 UTC (rev 2642)
@@ -65,7 +65,6 @@
import org.teiid.query.QueryPlugin;
import org.teiid.query.function.FunctionLibrary;
import org.teiid.query.function.FunctionTree;
-import org.teiid.query.function.SystemFunctionManager;
import org.teiid.query.function.UDFSource;
import org.teiid.query.function.metadata.FunctionMethod;
import org.teiid.query.mapping.relational.QueryNode;
@@ -145,7 +144,7 @@
* TransformationMetadata constructor
* @param context Object containing the info needed to lookup metadta.
*/
- public TransformationMetadata(VDBMetaData vdbMetadata, final CompositeMetadataStore store, Map<String, Resource> vdbEntries, Collection <FunctionMethod> udfMethods) {
+ public TransformationMetadata(VDBMetaData vdbMetadata, final CompositeMetadataStore store, Map<String, Resource> vdbEntries, Collection <FunctionMethod> udfMethods, FunctionTree systemFunctions) {
ArgCheck.isNotNull(store);
this.vdbMetaData = vdbMetadata;
this.store = store;
@@ -157,7 +156,7 @@
if (udfMethods == null) {
udfMethods = Collections.emptyList();
}
- this.functionLibrary = new FunctionLibrary(SystemFunctionManager.getSystemFunctions(), new FunctionTree(new UDFSource(udfMethods), true));
+ this.functionLibrary = new FunctionLibrary(systemFunctions, new FunctionTree(new UDFSource(udfMethods), true));
}
//==================================================================================
Modified: branches/7.1.x/engine/src/main/resources/org/teiid/query/i18n.properties
===================================================================
--- branches/7.1.x/engine/src/main/resources/org/teiid/query/i18n.properties 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/engine/src/main/resources/org/teiid/query/i18n.properties 2010-10-12 16:39:25 UTC (rev 2642)
@@ -622,6 +622,8 @@
SystemSource.decode_arg1=Clob
SystemSource.decode_arg2=The encoding
SystemSource.decode_result=byte representation Blob
+SystemSource.session_id_desc=Returns the session id of the currently logged in user
+SystemSource.session_id_result=Returns the session id of the currently logged in user
TempMetadataAdapter.Element_____{0}_____not_found._1=Element ''{0}'' not found.
TempMetadataAdapter.Group_____{0}_____not_found._1=Group ''{0}'' not found.
ExpressionEvaluator.Must_push=Function {0} is marked in the function metadata as a function that must be evaluated at the source.
Modified: branches/7.1.x/engine/src/test/java/org/teiid/query/function/TestFunctionLibrary.java
===================================================================
--- branches/7.1.x/engine/src/test/java/org/teiid/query/function/TestFunctionLibrary.java 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/engine/src/test/java/org/teiid/query/function/TestFunctionLibrary.java 2010-10-12 16:39:25 UTC (rev 2642)
@@ -57,6 +57,7 @@
import org.teiid.core.util.TimestampWithTimezone;
import org.teiid.language.SQLConstants.NonReserved;
import org.teiid.query.function.metadata.FunctionMethod;
+import org.teiid.query.unittest.FakeMetadataFactory;
import org.teiid.query.unittest.TimestampUtil;
import org.teiid.query.util.CommandContext;
import org.teiid.translator.SourceSystemFunctions;
@@ -78,7 +79,7 @@
private static final Class<Date> T_DATE = DataTypeManager.DefaultDataClasses.DATE;
private static final Class<Timestamp> T_TIMESTAMP = DataTypeManager.DefaultDataClasses.TIMESTAMP;
- private FunctionLibrary library = new FunctionLibrary(SystemFunctionManager.getSystemFunctions(), new FunctionTree(new UDFSource(Collections.EMPTY_LIST)));
+ private FunctionLibrary library = new FunctionLibrary(FakeMetadataFactory.SFM.getSystemFunctions(), new FunctionTree(new UDFSource(Collections.EMPTY_LIST)));
@Before public void setUp() {
TimestampWithTimezone.resetCalendar(TimeZone.getTimeZone("GMT-06:00")); //$NON-NLS-1$
Modified: branches/7.1.x/engine/src/test/java/org/teiid/query/function/TestFunctionTree.java
===================================================================
--- branches/7.1.x/engine/src/test/java/org/teiid/query/function/TestFunctionTree.java 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/engine/src/test/java/org/teiid/query/function/TestFunctionTree.java 2010-10-12 16:39:25 UTC (rev 2642)
@@ -22,7 +22,9 @@
package org.teiid.query.function;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
import java.util.Arrays;
import java.util.Collection;
@@ -35,6 +37,7 @@
import org.teiid.query.function.metadata.FunctionMethod;
import org.teiid.query.function.metadata.FunctionParameter;
import org.teiid.query.function.source.SystemSource;
+import org.teiid.query.unittest.FakeMetadataFactory;
@SuppressWarnings("nls")
public class TestFunctionTree {
@@ -44,7 +47,7 @@
* each one up by signature
*/
@Test public void testWalkTree() {
- SystemSource source = new SystemSource();
+ SystemSource source = new SystemSource(false);
FunctionTree ft = new FunctionTree(source);
Collection<String> categories = ft.getCategories();
@@ -73,11 +76,11 @@
new FunctionParameter("output", DataTypeManager.DefaultDataTypes.STRING)); //$NON-NLS-1$
//allowed, since we're not validating the class
- new FunctionLibrary(SystemFunctionManager.getSystemFunctions(), new FunctionTree(new UDFSource(Arrays.asList(method))));
+ new FunctionLibrary(FakeMetadataFactory.SFM.getSystemFunctions(), new FunctionTree(new UDFSource(Arrays.asList(method))));
//should fail, no class
try {
- new FunctionLibrary(SystemFunctionManager.getSystemFunctions(), new FunctionTree(new UDFSource(Arrays.asList(method)), true));
+ new FunctionLibrary(FakeMetadataFactory.SFM.getSystemFunctions(), new FunctionTree(new UDFSource(Arrays.asList(method)), true));
fail();
} catch (TeiidRuntimeException e) {
@@ -87,7 +90,7 @@
//should fail, no method
try {
- new FunctionLibrary(SystemFunctionManager.getSystemFunctions(), new FunctionTree(new UDFSource(Arrays.asList(method)), true));
+ new FunctionLibrary(FakeMetadataFactory.SFM.getSystemFunctions(), new FunctionTree(new UDFSource(Arrays.asList(method)), true));
fail();
} catch (TeiidRuntimeException e) {
@@ -97,7 +100,7 @@
//should fail, not void
try {
- new FunctionLibrary(SystemFunctionManager.getSystemFunctions(), new FunctionTree(new UDFSource(Arrays.asList(method)), true));
+ new FunctionLibrary(FakeMetadataFactory.SFM.getSystemFunctions(), new FunctionTree(new UDFSource(Arrays.asList(method)), true));
fail();
} catch (TeiidRuntimeException e) {
@@ -107,7 +110,7 @@
//should fail, not public
try {
- new FunctionLibrary(SystemFunctionManager.getSystemFunctions(), new FunctionTree(new UDFSource(Arrays.asList(method)), true));
+ new FunctionLibrary(FakeMetadataFactory.SFM.getSystemFunctions(), new FunctionTree(new UDFSource(Arrays.asList(method)), true));
fail();
} catch (TeiidRuntimeException e) {
@@ -117,7 +120,7 @@
//should fail, not static
try {
- new FunctionLibrary(SystemFunctionManager.getSystemFunctions(), new FunctionTree(new UDFSource(Arrays.asList(method)), true));
+ new FunctionLibrary(FakeMetadataFactory.SFM.getSystemFunctions(), new FunctionTree(new UDFSource(Arrays.asList(method)), true));
fail();
} catch (TeiidRuntimeException e) {
@@ -126,7 +129,7 @@
method.setInvocationMethod("y");
//valid!
- new FunctionLibrary(SystemFunctionManager.getSystemFunctions(), new FunctionTree(new UDFSource(Arrays.asList(method)), true));
+ new FunctionLibrary(FakeMetadataFactory.SFM.getSystemFunctions(), new FunctionTree(new UDFSource(Arrays.asList(method)), true));
}
@Test public void testNullCategory() {
Modified: branches/7.1.x/engine/src/test/java/org/teiid/query/function/metadata/TestSystemSource.java
===================================================================
--- branches/7.1.x/engine/src/test/java/org/teiid/query/function/metadata/TestSystemSource.java 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/engine/src/test/java/org/teiid/query/function/metadata/TestSystemSource.java 2010-10-12 16:39:25 UTC (rev 2642)
@@ -43,7 +43,7 @@
// ################################## ACTUAL TESTS ################################
public void testValidate() {
- SystemSource source = new SystemSource();
+ SystemSource source = new SystemSource(false);
ActivityReport report = new ActivityReport("Test Report"); //$NON-NLS-1$
FunctionMetadataValidator.validateFunctionMethods(source.getFunctionMethods(), report);
Modified: branches/7.1.x/engine/src/test/java/org/teiid/query/metadata/TestTransformationMetadata.java
===================================================================
--- branches/7.1.x/engine/src/test/java/org/teiid/query/metadata/TestTransformationMetadata.java 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/engine/src/test/java/org/teiid/query/metadata/TestTransformationMetadata.java 2010-10-12 16:39:25 UTC (rev 2642)
@@ -80,7 +80,7 @@
vdb.addModel(buildModel("x"));
vdb.addModel(buildModel("x1"));
- return new TransformationMetadata(vdb, cms, null, null);
+ return new TransformationMetadata(vdb, cms, null, null, FakeMetadataFactory.SFM.getSystemFunctions());
}
ModelMetaData buildModel(String name) {
@@ -113,7 +113,7 @@
model2.setVisible(true);
vdb.addModel(model2);
- TransformationMetadata tm = new TransformationMetadata(vdb, cms, null, null);
+ TransformationMetadata tm = new TransformationMetadata(vdb, cms, null, null, FakeMetadataFactory.SFM.getSystemFunctions());
Collection result = tm.getGroupsForPartialName("y"); //$NON-NLS-1$
assertEquals(2, result.size());
@@ -121,7 +121,7 @@
model.setVisible(false);
- tm = new TransformationMetadata(vdb, cms, null, null);
+ tm = new TransformationMetadata(vdb, cms, null, null, FakeMetadataFactory.SFM.getSystemFunctions());
result = tm.getGroupsForPartialName("y"); //$NON-NLS-1$
assertEquals(1, result.size());
}
Modified: branches/7.1.x/engine/src/test/java/org/teiid/query/optimizer/TestOptimizer.java
===================================================================
--- branches/7.1.x/engine/src/test/java/org/teiid/query/optimizer/TestOptimizer.java 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/engine/src/test/java/org/teiid/query/optimizer/TestOptimizer.java 2010-10-12 16:39:25 UTC (rev 2642)
@@ -22,7 +22,11 @@
package org.teiid.query.optimizer;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
import java.util.ArrayList;
import java.util.Arrays;
@@ -35,18 +39,16 @@
import org.teiid.api.exception.query.QueryPlannerException;
import org.teiid.common.buffer.BufferManager;
import org.teiid.core.TeiidComponentException;
+import org.teiid.core.TeiidException;
import org.teiid.core.TeiidProcessingException;
-import org.teiid.core.TeiidException;
import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.types.DataTypeManager;
import org.teiid.query.analysis.AnalysisRecord;
import org.teiid.query.function.FunctionLibrary;
import org.teiid.query.function.FunctionTree;
-import org.teiid.query.function.SystemFunctionManager;
import org.teiid.query.function.UDFSource;
import org.teiid.query.mapping.relational.QueryNode;
import org.teiid.query.metadata.QueryMetadataInterface;
-import org.teiid.query.optimizer.QueryOptimizer;
import org.teiid.query.optimizer.capabilities.BasicSourceCapabilities;
import org.teiid.query.optimizer.capabilities.CapabilitiesFinder;
import org.teiid.query.optimizer.capabilities.DefaultCapabilitiesFinder;
@@ -4253,7 +4255,7 @@
caps.setFunctionSupport("xyz", true); //$NON-NLS-1$
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
- FunctionLibrary funcLibrary = new FunctionLibrary(SystemFunctionManager.getSystemFunctions(), new FunctionTree(new UDFSource(new FakeFunctionMetadataSource().getFunctionMethods())));
+ FunctionLibrary funcLibrary = new FunctionLibrary(FakeMetadataFactory.SFM.getSystemFunctions(), new FunctionTree(new UDFSource(new FakeFunctionMetadataSource().getFunctionMethods())));
FakeMetadataFacade metadata = new FakeMetadataFacade(FakeMetadataFactory.example1Cached().getStore(), funcLibrary);
Modified: branches/7.1.x/engine/src/test/java/org/teiid/query/processor/TestProcessor.java
===================================================================
--- branches/7.1.x/engine/src/test/java/org/teiid/query/processor/TestProcessor.java 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/engine/src/test/java/org/teiid/query/processor/TestProcessor.java 2010-10-12 16:39:25 UTC (rev 2642)
@@ -22,8 +22,14 @@
package org.teiid.query.processor;
-import static org.junit.Assert.*;
-import static org.teiid.query.optimizer.TestOptimizer.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.teiid.query.optimizer.TestOptimizer.FULL_PUSHDOWN;
+import static org.teiid.query.optimizer.TestOptimizer.checkNodeTypes;
+import static org.teiid.query.optimizer.TestOptimizer.getTypicalCapabilities;
+import static org.teiid.query.optimizer.TestOptimizer.helpPlan;
import java.math.BigDecimal;
import java.math.BigInteger;
@@ -5272,7 +5278,7 @@
caps.setFunctionSupport("myrtrim", true); //$NON-NLS-1$
capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
- FunctionLibrary funcLibrary = new FunctionLibrary(SystemFunctionManager.getSystemFunctions(), new FunctionTree(new UDFSource(new FakeFunctionMetadataSource().getFunctionMethods())));
+ FunctionLibrary funcLibrary = new FunctionLibrary(FakeMetadataFactory.SFM.getSystemFunctions(), new FunctionTree(new UDFSource(new FakeFunctionMetadataSource().getFunctionMethods())));
FakeMetadataFacade metadata = new FakeMetadataFacade(FakeMetadataFactory.example1Cached().getStore(), funcLibrary);
processPreparedStatement(sql, expected, dataManager, capFinder,
@@ -5320,7 +5326,7 @@
caps.setFunctionSupport("concat", true); //$NON-NLS-1$
capFinder.addCapabilities("pm4", caps); //$NON-NLS-1$
- FunctionLibrary funcLibrary = new FunctionLibrary(SystemFunctionManager.getSystemFunctions(), new FunctionTree(new UDFSource(new FakeFunctionMetadataSource().getFunctionMethods())));
+ FunctionLibrary funcLibrary = new FunctionLibrary(FakeMetadataFactory.SFM.getSystemFunctions(), new FunctionTree(new UDFSource(new FakeFunctionMetadataSource().getFunctionMethods())));
FakeMetadataFacade metadata = new FakeMetadataFacade(FakeMetadataFactory.example1Cached().getStore(), funcLibrary);
processPreparedStatement(sql, expected, dataManager, capFinder,
Modified: branches/7.1.x/engine/src/test/java/org/teiid/query/processor/eval/TestExpressionEvaluator.java
===================================================================
--- branches/7.1.x/engine/src/test/java/org/teiid/query/processor/eval/TestExpressionEvaluator.java 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/engine/src/test/java/org/teiid/query/processor/eval/TestExpressionEvaluator.java 2010-10-12 16:39:25 UTC (rev 2642)
@@ -22,7 +22,8 @@
package org.teiid.query.processor.eval;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
import java.io.Serializable;
import java.math.BigDecimal;
@@ -59,6 +60,7 @@
import org.teiid.query.sql.symbol.TestCaseExpression;
import org.teiid.query.sql.symbol.TestSearchedCaseExpression;
import org.teiid.query.sql.util.ValueIterator;
+import org.teiid.query.unittest.FakeMetadataFactory;
import org.teiid.query.util.CommandContext;
@SuppressWarnings("nls")
@@ -192,7 +194,7 @@
e2.setType(String.class);
Function func = new Function("concat", new Expression[] { e1, e2 }); //$NON-NLS-1$
- FunctionDescriptor desc = SystemFunctionManager.getSystemFunctionLibrary().findFunction("concat", new Class[] { String.class, String.class } ); //$NON-NLS-1$
+ FunctionDescriptor desc = FakeMetadataFactory.SFM.getSystemFunctionLibrary().findFunction("concat", new Class[] { String.class, String.class } ); //$NON-NLS-1$
func.setFunctionDescriptor(desc);
SingleElementSymbol[] elements = new SingleElementSymbol[] {
@@ -214,7 +216,7 @@
e2.setType(String.class);
Function func = new Function("concat", new Expression[] { e2, e1 }); //$NON-NLS-1$
- FunctionDescriptor desc = SystemFunctionManager.getSystemFunctionLibrary().findFunction("concat", new Class[] { String.class, String.class } ); //$NON-NLS-1$
+ FunctionDescriptor desc = FakeMetadataFactory.SFM.getSystemFunctionLibrary().findFunction("concat", new Class[] { String.class, String.class } ); //$NON-NLS-1$
func.setFunctionDescriptor(desc);
SingleElementSymbol[] elements = new SingleElementSymbol[] {
@@ -235,7 +237,7 @@
e1.setType(Integer.class);
Function func = new Function("lookup", new Expression[] { new Constant("pm1.g1"), new Constant("e2"), new Constant("e1"), e1 }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- FunctionDescriptor desc = SystemFunctionManager.getSystemFunctionLibrary().findFunction("lookup", new Class[] { String.class, String.class, String.class, String.class } ); //$NON-NLS-1$
+ FunctionDescriptor desc = FakeMetadataFactory.SFM.getSystemFunctionLibrary().findFunction("lookup", new Class[] { String.class, String.class, String.class, String.class } ); //$NON-NLS-1$
func.setFunctionDescriptor(desc);
SingleElementSymbol[] elements = new SingleElementSymbol[] {
@@ -307,7 +309,7 @@
@Test public void testUser() throws Exception {
Function func = new Function("user", new Expression[] {}); //$NON-NLS-1$
- FunctionDescriptor desc = SystemFunctionManager.getSystemFunctionLibrary().findFunction("user", new Class[] {} ); //$NON-NLS-1$
+ FunctionDescriptor desc = FakeMetadataFactory.SFM.getSystemFunctionLibrary().findFunction("user", new Class[] {} ); //$NON-NLS-1$
func.setFunctionDescriptor(desc);
FakeDataManager dataMgr = new FakeDataManager();
@@ -324,7 +326,7 @@
*/
@Test public void testEnv() throws Exception {
Function func = new Function("env", new Expression[] {}); //$NON-NLS-1$
- FunctionDescriptor desc = SystemFunctionManager.getSystemFunctionLibrary().findFunction("env", new Class[] {String.class} ); //$NON-NLS-1$
+ FunctionDescriptor desc = FakeMetadataFactory.SFM.getSystemFunctionLibrary().findFunction("env", new Class[] {String.class} ); //$NON-NLS-1$
func.setFunctionDescriptor(desc);
FakeDataManager dataMgr = new FakeDataManager();
@@ -350,7 +352,7 @@
} else {
parameterSignature = new Class[] { String.class };
}
- FunctionDescriptor desc = SystemFunctionManager.getSystemFunctionLibrary().findFunction("commandpayload", parameterSignature ); //$NON-NLS-1$
+ FunctionDescriptor desc = FakeMetadataFactory.SFM.getSystemFunctionLibrary().findFunction("commandpayload", parameterSignature ); //$NON-NLS-1$
func.setFunctionDescriptor(desc);
FakeDataManager dataMgr = new FakeDataManager();
Modified: branches/7.1.x/engine/src/test/java/org/teiid/query/processor/relational/TestGroupingNode.java
===================================================================
--- branches/7.1.x/engine/src/test/java/org/teiid/query/processor/relational/TestGroupingNode.java 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/engine/src/test/java/org/teiid/query/processor/relational/TestGroupingNode.java 2010-10-12 16:39:25 UTC (rev 2642)
@@ -22,7 +22,7 @@
package org.teiid.query.processor.relational;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
import java.math.BigDecimal;
import java.util.ArrayList;
@@ -36,13 +36,11 @@
import org.teiid.common.buffer.BufferManager;
import org.teiid.common.buffer.BufferManagerFactory;
import org.teiid.common.buffer.TupleBatch;
-import org.teiid.common.buffer.TupleSource;
import org.teiid.common.buffer.impl.BufferManagerImpl;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
import org.teiid.core.types.DataTypeManager;
import org.teiid.query.function.FunctionDescriptor;
-import org.teiid.query.function.SystemFunctionManager;
import org.teiid.query.function.aggregate.AggregateFunction;
import org.teiid.query.processor.FakeDataManager;
import org.teiid.query.processor.FakeTupleSource;
@@ -52,6 +50,7 @@
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.Expression;
import org.teiid.query.sql.symbol.Function;
+import org.teiid.query.unittest.FakeMetadataFactory;
import org.teiid.query.util.CommandContext;
@@ -272,7 +271,7 @@
// Set grouping elements to null
List groupingElements = new ArrayList();
- groupingElements.add(col1); //$NON-NLS-1$
+ groupingElements.add(col1);
node.setGroupingElements(groupingElements);
CommandContext context = new CommandContext("pid", "test", null, null, 1); //$NON-NLS-1$ //$NON-NLS-2$
@@ -309,7 +308,7 @@
col2.setType(Integer.class);
Function func = new Function("lookup", new Expression[] { new Constant("pm1.g1"), new Constant("e2"), new Constant("e1"), col2 }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- FunctionDescriptor desc = SystemFunctionManager.getSystemFunctionLibrary().findFunction("lookup", new Class[] { String.class, String.class, String.class, Integer.class } ); //$NON-NLS-1$
+ FunctionDescriptor desc = FakeMetadataFactory.SFM.getSystemFunctionLibrary().findFunction("lookup", new Class[] { String.class, String.class, String.class, Integer.class } ); //$NON-NLS-1$
func.setFunctionDescriptor(desc);
func.setType(DataTypeManager.DefaultDataClasses.INTEGER);
@@ -320,7 +319,7 @@
node.setElements(outputElements);
List groupingElements = new ArrayList();
- groupingElements.add(col1); //$NON-NLS-1$
+ groupingElements.add(col1);
node.setGroupingElements(groupingElements);
CommandContext context = new CommandContext("pid", "test", null, null, 1); //$NON-NLS-1$ //$NON-NLS-2$
@@ -434,7 +433,7 @@
node.setElements(outputElements);
List groupingElements = new ArrayList();
- groupingElements.add(col1); //$NON-NLS-1$
+ groupingElements.add(col1);
node.setGroupingElements(groupingElements);
return node;
}
Modified: branches/7.1.x/engine/src/test/java/org/teiid/query/processor/relational/TestJoinNode.java
===================================================================
--- branches/7.1.x/engine/src/test/java/org/teiid/query/processor/relational/TestJoinNode.java 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/engine/src/test/java/org/teiid/query/processor/relational/TestJoinNode.java 2010-10-12 16:39:25 UTC (rev 2642)
@@ -39,14 +39,7 @@
import org.teiid.core.TeiidProcessingException;
import org.teiid.core.types.DataTypeManager;
import org.teiid.query.function.FunctionDescriptor;
-import org.teiid.query.function.SystemFunctionManager;
import org.teiid.query.processor.FakeDataManager;
-import org.teiid.query.processor.relational.JoinNode;
-import org.teiid.query.processor.relational.JoinStrategy;
-import org.teiid.query.processor.relational.MergeJoinStrategy;
-import org.teiid.query.processor.relational.NestedLoopJoinStrategy;
-import org.teiid.query.processor.relational.PartitionedSortJoin;
-import org.teiid.query.processor.relational.RelationalNode;
import org.teiid.query.processor.relational.MergeJoinStrategy.SortOption;
import org.teiid.query.sql.lang.CompareCriteria;
import org.teiid.query.sql.lang.JoinType;
@@ -54,6 +47,7 @@
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.Expression;
import org.teiid.query.sql.symbol.Function;
+import org.teiid.query.unittest.FakeMetadataFactory;
import org.teiid.query.util.CommandContext;
@@ -209,7 +203,7 @@
case FUNCTION_CRITERIA :
Function func = new Function("lookup", new Expression[] { new Constant("pm1.g1"), new Constant("e2"), new Constant("e1"), es1 }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- FunctionDescriptor desc = SystemFunctionManager.getSystemFunctionLibrary().findFunction("lookup", new Class[] { String.class, String.class, String.class, Integer.class }); //$NON-NLS-1$
+ FunctionDescriptor desc = FakeMetadataFactory.SFM.getSystemFunctionLibrary().findFunction("lookup", new Class[] { String.class, String.class, String.class, Integer.class }); //$NON-NLS-1$
func.setFunctionDescriptor(desc);
func.setType(DataTypeManager.DefaultDataClasses.INTEGER);
CompareCriteria joinCriteria = new CompareCriteria(es2, CompareCriteria.EQ, func);
Modified: branches/7.1.x/engine/src/test/java/org/teiid/query/processor/relational/TestProjectNode.java
===================================================================
--- branches/7.1.x/engine/src/test/java/org/teiid/query/processor/relational/TestProjectNode.java 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/engine/src/test/java/org/teiid/query/processor/relational/TestProjectNode.java 2010-10-12 16:39:25 UTC (rev 2642)
@@ -28,6 +28,8 @@
import java.util.List;
import java.util.Map;
+import junit.framework.TestCase;
+
import org.teiid.api.exception.query.ExpressionEvaluationException;
import org.teiid.common.buffer.BlockedException;
import org.teiid.common.buffer.BufferManager;
@@ -37,20 +39,17 @@
import org.teiid.core.TeiidProcessingException;
import org.teiid.core.types.DataTypeManager;
import org.teiid.query.function.FunctionDescriptor;
-import org.teiid.query.function.SystemFunctionManager;
import org.teiid.query.processor.FakeDataManager;
import org.teiid.query.processor.ProcessorDataManager;
-import org.teiid.query.processor.relational.ProjectNode;
import org.teiid.query.sql.symbol.Constant;
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.Expression;
import org.teiid.query.sql.symbol.ExpressionSymbol;
import org.teiid.query.sql.symbol.Function;
+import org.teiid.query.unittest.FakeMetadataFactory;
import org.teiid.query.util.CommandContext;
-import junit.framework.TestCase;
-
/**
*/
public class TestProjectNode extends TestCase {
@@ -213,7 +212,7 @@
elements.add(es1);
Function func = new Function("concat", new Expression[] { es1, new Constant("abc")}); //$NON-NLS-1$ //$NON-NLS-2$
- FunctionDescriptor fd = SystemFunctionManager.getSystemFunctionLibrary().findFunction("concat", new Class[] { DataTypeManager.DefaultDataClasses.STRING, DataTypeManager.DefaultDataClasses.STRING }); //$NON-NLS-1$
+ FunctionDescriptor fd = FakeMetadataFactory.SFM.getSystemFunctionLibrary().findFunction("concat", new Class[] { DataTypeManager.DefaultDataClasses.STRING, DataTypeManager.DefaultDataClasses.STRING }); //$NON-NLS-1$
func.setFunctionDescriptor(fd);
func.setType(DataTypeManager.DefaultDataClasses.STRING);
ExpressionSymbol expr = new ExpressionSymbol("expr", func); //$NON-NLS-1$
@@ -237,7 +236,7 @@
elements.add(es1);
Function func = new Function("convert", new Expression[] { es1, new Constant("integer")}); //$NON-NLS-1$ //$NON-NLS-2$
- FunctionDescriptor fd = SystemFunctionManager.getSystemFunctionLibrary().findFunction("convert", new Class[] { DataTypeManager.DefaultDataClasses.STRING, DataTypeManager.DefaultDataClasses.STRING }); //$NON-NLS-1$
+ FunctionDescriptor fd = FakeMetadataFactory.SFM.getSystemFunctionLibrary().findFunction("convert", new Class[] { DataTypeManager.DefaultDataClasses.STRING, DataTypeManager.DefaultDataClasses.STRING }); //$NON-NLS-1$
func.setFunctionDescriptor(fd);
func.setType(DataTypeManager.DefaultDataClasses.INTEGER);
ExpressionSymbol expr = new ExpressionSymbol("expr", func); //$NON-NLS-1$
@@ -260,7 +259,7 @@
elements.add(es1);
Function func = new Function("lookup", new Expression[] { new Constant("pm1.g1"), new Constant("e2"), new Constant("e1"), es1 }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- FunctionDescriptor desc = SystemFunctionManager.getSystemFunctionLibrary().findFunction("lookup", new Class[] { String.class, String.class, String.class, String.class } ); //$NON-NLS-1$
+ FunctionDescriptor desc = FakeMetadataFactory.SFM.getSystemFunctionLibrary().findFunction("lookup", new Class[] { String.class, String.class, String.class, String.class } ); //$NON-NLS-1$
func.setFunctionDescriptor(desc);
func.setType(DataTypeManager.DefaultDataClasses.STRING);
Modified: branches/7.1.x/engine/src/test/java/org/teiid/query/processor/relational/TestSelectNode.java
===================================================================
--- branches/7.1.x/engine/src/test/java/org/teiid/query/processor/relational/TestSelectNode.java 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/engine/src/test/java/org/teiid/query/processor/relational/TestSelectNode.java 2010-10-12 16:39:25 UTC (rev 2642)
@@ -22,7 +22,8 @@
package org.teiid.query.processor.relational;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import java.util.ArrayList;
import java.util.Arrays;
@@ -40,7 +41,6 @@
import org.teiid.core.types.DataTypeManager;
import org.teiid.query.eval.Evaluator;
import org.teiid.query.function.FunctionDescriptor;
-import org.teiid.query.function.SystemFunctionManager;
import org.teiid.query.processor.BatchIterator;
import org.teiid.query.processor.FakeDataManager;
import org.teiid.query.processor.ProcessorDataManager;
@@ -51,6 +51,7 @@
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.Expression;
import org.teiid.query.sql.symbol.Function;
+import org.teiid.query.unittest.FakeMetadataFactory;
import org.teiid.query.util.CommandContext;
public class TestSelectNode {
@@ -236,7 +237,7 @@
elements.add(es1);
Function func = new Function("lookup", new Expression[] { new Constant("pm1.g1"), new Constant("e2"), new Constant("e1"), es1 }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- FunctionDescriptor desc = SystemFunctionManager.getSystemFunctionLibrary().findFunction("lookup", new Class[] { String.class, String.class, String.class, Integer.class } ); //$NON-NLS-1$
+ FunctionDescriptor desc = FakeMetadataFactory.SFM.getSystemFunctionLibrary().findFunction("lookup", new Class[] { String.class, String.class, String.class, Integer.class } ); //$NON-NLS-1$
func.setFunctionDescriptor(desc);
func.setType(DataTypeManager.DefaultDataClasses.INTEGER);
CompareCriteria crit = new CompareCriteria(func, CompareCriteria.EQ, new Constant(new Integer(1)));
Modified: branches/7.1.x/engine/src/test/java/org/teiid/query/resolver/TestResolver.java
===================================================================
--- branches/7.1.x/engine/src/test/java/org/teiid/query/resolver/TestResolver.java 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/engine/src/test/java/org/teiid/query/resolver/TestResolver.java 2010-10-12 16:39:25 UTC (rev 2642)
@@ -22,7 +22,13 @@
package org.teiid.query.resolver;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
import java.math.BigDecimal;
import java.math.BigInteger;
@@ -50,13 +56,11 @@
import org.teiid.query.analysis.AnalysisRecord;
import org.teiid.query.function.FunctionDescriptor;
import org.teiid.query.function.FunctionLibrary;
-import org.teiid.query.function.SystemFunctionManager;
import org.teiid.query.mapping.relational.QueryNode;
import org.teiid.query.metadata.QueryMetadataInterface;
import org.teiid.query.metadata.TempMetadataID;
import org.teiid.query.metadata.TempMetadataStore;
import org.teiid.query.parser.QueryParser;
-import org.teiid.query.resolver.QueryResolver;
import org.teiid.query.resolver.util.BindVariableVisitor;
import org.teiid.query.sql.LanguageObject;
import org.teiid.query.sql.ProcedureReservedWords;
@@ -1400,7 +1404,7 @@
String tgtTypeName = DataTypeManager.DefaultDataTypes.DATE;
Expression expression = new Constant("2003-02-27"); //$NON-NLS-1$
- FunctionLibrary library = SystemFunctionManager.getSystemFunctionLibrary();
+ FunctionLibrary library = FakeMetadataFactory.SFM.getSystemFunctionLibrary();
FunctionDescriptor fd = library.findFunction(FunctionLibrary.CONVERT, new Class[] { srcType, DataTypeManager.DefaultDataClasses.STRING });
Function conversion = new Function(fd.getName(), new Expression[] { expression, new Constant(tgtTypeName) });
@@ -1436,7 +1440,7 @@
String tgtTypeName = DataTypeManager.DefaultDataTypes.DATE;
Expression expression = new Constant("2003-02-27"); //$NON-NLS-1$
- FunctionLibrary library = SystemFunctionManager.getSystemFunctionLibrary();
+ FunctionLibrary library = FakeMetadataFactory.SFM.getSystemFunctionLibrary();
FunctionDescriptor fd = library.findFunction(FunctionLibrary.CONVERT, new Class[] { srcType, DataTypeManager.DefaultDataClasses.STRING });
Function conversion = new Function(fd.getName(), new Expression[] { expression, new Constant(tgtTypeName) });
@@ -1886,7 +1890,7 @@
//String sql = "select intkey from SmallA where user() = 'bqt2'";
// Expected left expression
- FunctionLibrary library = SystemFunctionManager.getSystemFunctionLibrary();
+ FunctionLibrary library = FakeMetadataFactory.SFM.getSystemFunctionLibrary();
FunctionDescriptor fd = library.findFunction(FunctionLibrary.USER, new Class[] { });
Function user = new Function(fd.getName(), new Expression[] {});
user.setFunctionDescriptor(fd);
Modified: branches/7.1.x/engine/src/test/java/org/teiid/query/unittest/FakeMetadataFacade.java
===================================================================
--- branches/7.1.x/engine/src/test/java/org/teiid/query/unittest/FakeMetadataFacade.java 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/engine/src/test/java/org/teiid/query/unittest/FakeMetadataFacade.java 2010-10-12 16:39:25 UTC (rev 2642)
@@ -36,7 +36,6 @@
import org.teiid.core.util.ArgCheck;
import org.teiid.core.util.Assertion;
import org.teiid.query.function.FunctionLibrary;
-import org.teiid.query.function.SystemFunctionManager;
import org.teiid.query.mapping.relational.QueryNode;
import org.teiid.query.mapping.xml.MappingBaseNode;
import org.teiid.query.mapping.xml.MappingDocument;
@@ -58,7 +57,7 @@
public FakeMetadataFacade(FakeMetadataStore store) {
this.store = store;
- this.functionLibrary = SystemFunctionManager.getSystemFunctionLibrary();
+ this.functionLibrary = FakeMetadataFactory.SFM.getSystemFunctionLibrary();
}
public FakeMetadataFacade(FakeMetadataStore store, FunctionLibrary funcLibrary) {
@@ -204,7 +203,7 @@
FakeMetadataObject group = (FakeMetadataObject) groupID;
QueryNode queryNode = (QueryNode) group.getProperty(FakeMetadataObject.Props.PLAN);
if (queryNode.getQuery() == null) {
- throw new QueryMetadataException("no query");
+ throw new QueryMetadataException("no query");//$NON-NLS-1$
}
return queryNode;
}
Modified: branches/7.1.x/engine/src/test/java/org/teiid/query/unittest/FakeMetadataFactory.java
===================================================================
--- branches/7.1.x/engine/src/test/java/org/teiid/query/unittest/FakeMetadataFactory.java 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/engine/src/test/java/org/teiid/query/unittest/FakeMetadataFactory.java 2010-10-12 16:39:25 UTC (rev 2642)
@@ -39,6 +39,7 @@
import org.teiid.core.types.DataTypeManager;
import org.teiid.dqp.internal.process.DQPWorkContext;
import org.teiid.metadata.Table;
+import org.teiid.query.function.SystemFunctionManager;
import org.teiid.query.mapping.relational.QueryNode;
import org.teiid.query.mapping.xml.MappingAttribute;
import org.teiid.query.mapping.xml.MappingDocument;
@@ -51,6 +52,7 @@
@SuppressWarnings("nls")
public class FakeMetadataFactory {
+ public static SystemFunctionManager SFM = new SystemFunctionManager();
private static FakeMetadataFacade CACHED_EXAMPLE1 = example1();
private static FakeMetadataFacade CACHED_AGGREGATES = exampleAggregates();
Modified: branches/7.1.x/engine/src/test/java/org/teiid/query/unittest/RealMetadataFactory.java
===================================================================
--- branches/7.1.x/engine/src/test/java/org/teiid/query/unittest/RealMetadataFactory.java 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/engine/src/test/java/org/teiid/query/unittest/RealMetadataFactory.java 2010-10-12 16:39:25 UTC (rev 2642)
@@ -269,7 +269,7 @@
for (Schema schema : metadataStore.getSchemas().values()) {
vdbMetaData.addModel(FakeMetadataFactory.createModel(schema.getName(), schema.isPhysical()));
}
- return new TransformationMetadata(vdbMetaData, store, null, null);
+ return new TransformationMetadata(vdbMetaData, store, null, null, FakeMetadataFactory.SFM.getSystemFunctions());
}
/**
Modified: branches/7.1.x/metadata/src/test/java/org/teiid/cdk/api/TranslationUtility.java
===================================================================
--- branches/7.1.x/metadata/src/test/java/org/teiid/cdk/api/TranslationUtility.java 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/metadata/src/test/java/org/teiid/cdk/api/TranslationUtility.java 2010-10-12 16:39:25 UTC (rev 2642)
@@ -103,7 +103,8 @@
this.metadata = new BasicQueryMetadataWrapper(this.metadata) {
@Override
public FunctionLibrary getFunctionLibrary() {
- return new FunctionLibrary(SystemFunctionManager.getSystemFunctions(), new FunctionTree(new UDFSource(methods)));
+ SystemFunctionManager sfm = new SystemFunctionManager();
+ return new FunctionLibrary(sfm.getSystemFunctions(), new FunctionTree(new UDFSource(methods)));
}
};
}
Modified: branches/7.1.x/metadata/src/test/java/org/teiid/metadata/index/VDBMetadataFactory.java
===================================================================
--- branches/7.1.x/metadata/src/test/java/org/teiid/metadata/index/VDBMetadataFactory.java 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/metadata/src/test/java/org/teiid/metadata/index/VDBMetadataFactory.java 2010-10-12 16:39:25 UTC (rev 2642)
@@ -39,6 +39,7 @@
import org.teiid.core.util.LRUCache;
import org.teiid.core.util.UnitTestUtil;
import org.teiid.metadata.MetadataStore;
+import org.teiid.query.function.SystemFunctionManager;
import org.teiid.query.function.metadata.FunctionMetadataReader;
import org.teiid.query.function.metadata.FunctionMethod;
import org.teiid.query.metadata.CompositeMetadataStore;
@@ -83,8 +84,8 @@
if (udfFile != null) {
methods = FunctionMetadataReader.loadFunctionMethods(udfFile.openStream());
}
-
- vdbmetadata = new TransformationMetadata(null, new CompositeMetadataStore(Arrays.asList(getSystem(), imf.getMetadataStore(getSystem().getDatatypes()))), imf.getEntriesPlusVisibilities(), methods);
+ SystemFunctionManager sfm = new SystemFunctionManager();
+ vdbmetadata = new TransformationMetadata(null, new CompositeMetadataStore(Arrays.asList(getSystem(), imf.getMetadataStore(getSystem().getDatatypes()))), imf.getEntriesPlusVisibilities(), methods, sfm.getSystemFunctions());
VDB_CACHE.put(vdbURL, vdbmetadata);
return vdbmetadata;
} catch (URISyntaxException e) {
Modified: branches/7.1.x/runtime/src/main/java/org/teiid/deployers/CompositeVDB.java
===================================================================
--- branches/7.1.x/runtime/src/main/java/org/teiid/deployers/CompositeVDB.java 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/runtime/src/main/java/org/teiid/deployers/CompositeVDB.java 2010-10-12 16:39:25 UTC (rev 2642)
@@ -31,6 +31,7 @@
import org.teiid.adminapi.impl.VDBMetaData;
import org.teiid.dqp.internal.datamgr.ConnectorManagerRepository;
import org.teiid.metadata.MetadataStore;
+import org.teiid.query.function.FunctionTree;
import org.teiid.query.function.metadata.FunctionMethod;
import org.teiid.query.metadata.CompositeMetadataStore;
import org.teiid.query.metadata.QueryMetadataInterface;
@@ -49,19 +50,21 @@
private LinkedHashMap<VDBKey, CompositeVDB> children;
private MetadataStore[] additionalStores;
private ConnectorManagerRepository cmr;
+ private FunctionTree systemFunctions;
// used as cached item to avoid rebuilding
private VDBMetaData mergedVDB;
- public CompositeVDB(VDBMetaData vdb, MetadataStoreGroup stores, LinkedHashMap<String, Resource> visibilityMap, UDFMetaData udf, ConnectorManagerRepository cmr, MetadataStore... additionalStores) {
+ public CompositeVDB(VDBMetaData vdb, MetadataStoreGroup stores, LinkedHashMap<String, Resource> visibilityMap, UDFMetaData udf, FunctionTree systemFunctions, ConnectorManagerRepository cmr, MetadataStore... additionalStores) {
this.vdb = vdb;
this.stores = stores;
this.visibilityMap = visibilityMap;
this.udf = udf;
+ this.systemFunctions = systemFunctions;
this.cmr = cmr;
this.additionalStores = additionalStores;
this.vdb.addAttchment(ConnectorManagerRepository.class, cmr);
- update(this.vdb);
+ update(this.vdb, this.systemFunctions);
}
public void addChild(CompositeVDB child) {
@@ -80,15 +83,15 @@
this.mergedVDB = null;
}
- void update(VDBMetaData vdbMetadata) {
- TransformationMetadata metadata = buildTransformationMetaData(vdbMetadata, getVisibilityMap(), getMetadataStores(), getUDF());
+ void update(VDBMetaData vdbMetadata, FunctionTree systemFunctions) {
+ TransformationMetadata metadata = buildTransformationMetaData(vdbMetadata, getVisibilityMap(), getMetadataStores(), getUDF(), systemFunctions);
vdbMetadata.addAttchment(QueryMetadataInterface.class, metadata);
vdbMetadata.addAttchment(TransformationMetadata.class, metadata);
TempTableStore globalTables = new TempTableStore("SYSTEM"); //$NON-NLS-1$
vdbMetadata.addAttchment(TempTableStore.class, globalTables);
}
- private TransformationMetadata buildTransformationMetaData(VDBMetaData vdb, LinkedHashMap<String, Resource> visibilityMap, MetadataStoreGroup stores, UDFMetaData udf) {
+ private TransformationMetadata buildTransformationMetaData(VDBMetaData vdb, LinkedHashMap<String, Resource> visibilityMap, MetadataStoreGroup stores, UDFMetaData udf, FunctionTree systemFunctions) {
Collection <FunctionMethod> methods = null;
if (udf != null) {
methods = udf.getFunctions();
@@ -99,7 +102,7 @@
compositeStore.addMetadataStore(s);
}
- TransformationMetadata metadata = new TransformationMetadata(vdb, compositeStore, visibilityMap, methods);
+ TransformationMetadata metadata = new TransformationMetadata(vdb, compositeStore, visibilityMap, methods, systemFunctions);
return metadata;
}
@@ -110,7 +113,7 @@
}
if (this.mergedVDB == null) {
this.mergedVDB = buildVDB();
- update(mergedVDB);
+ update(mergedVDB, this.systemFunctions);
}
return this.mergedVDB;
}
Modified: branches/7.1.x/runtime/src/main/java/org/teiid/deployers/VDBRepository.java
===================================================================
--- branches/7.1.x/runtime/src/main/java/org/teiid/deployers/VDBRepository.java 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/runtime/src/main/java/org/teiid/deployers/VDBRepository.java 2010-10-12 16:39:25 UTC (rev 2642)
@@ -43,6 +43,7 @@
import org.teiid.logging.LogManager;
import org.teiid.metadata.Datatype;
import org.teiid.metadata.MetadataStore;
+import org.teiid.query.function.SystemFunctionManager;
import org.teiid.query.metadata.TransformationMetadata.Resource;
import org.teiid.runtime.RuntimePlugin;
import org.teiid.translator.TranslatorException;
@@ -60,6 +61,7 @@
private MetadataStore odbcStore;
private boolean odbcEnabled = false;
private List<VDBLifeCycleListener> listeners = new ArrayList<VDBLifeCycleListener>();
+ private SystemFunctionManager systemFunctionManager;
public void addVDB(VDBMetaData vdb, MetadataStoreGroup stores, LinkedHashMap<String, Resource> visibilityMap, UDFMetaData udf, ConnectorManagerRepository cmr) throws DeploymentException {
if (getVDB(vdb.getName(), vdb.getVersion()) != null) {
@@ -76,10 +78,10 @@
}
if (this.odbcStore == null) {
- this.vdbRepo.put(vdbId(vdb), new CompositeVDB(vdb, stores, visibilityMap, udf, cmr, this.systemStore));
+ this.vdbRepo.put(vdbId(vdb), new CompositeVDB(vdb, stores, visibilityMap, udf, this.systemFunctionManager.getSystemFunctions(), cmr, this.systemStore));
}
else {
- this.vdbRepo.put(vdbId(vdb), new CompositeVDB(vdb, stores, visibilityMap, udf, cmr, this.systemStore, odbcStore));
+ this.vdbRepo.put(vdbId(vdb), new CompositeVDB(vdb, stores, visibilityMap, udf, this.systemFunctionManager.getSystemFunctions(), cmr, this.systemStore, odbcStore));
}
notifyAdd(vdb.getName(), vdb.getVersion());
}
@@ -208,7 +210,7 @@
void updateVDB(String name, int version) {
CompositeVDB v = this.vdbRepo.get(new VDBKey(name, version));
if (v!= null) {
- v.update(v.getVDB());
+ v.update(v.getVDB(), systemFunctionManager.getSystemFunctions());
}
}
@@ -231,4 +233,8 @@
l.removed(name, version);
}
}
+
+ public void setSystemFunctionManager(SystemFunctionManager mgr) {
+ this.systemFunctionManager = mgr;
+ }
}
Modified: branches/7.1.x/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java
===================================================================
--- branches/7.1.x/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java 2010-10-11 16:42:47 UTC (rev 2641)
+++ branches/7.1.x/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java 2010-10-12 16:39:25 UTC (rev 2642)
@@ -47,6 +47,7 @@
import org.teiid.metadata.Schema;
import org.teiid.metadata.index.IndexMetadataFactory;
import org.teiid.metadata.index.VDBMetadataFactory;
+import org.teiid.query.function.SystemFunctionManager;
import org.teiid.query.optimizer.capabilities.BasicSourceCapabilities;
import org.teiid.query.optimizer.capabilities.SourceCapabilities;
import org.teiid.services.SessionServiceImpl;
@@ -68,6 +69,7 @@
this.logon = new LogonImpl(sessionService, null);
this.repo.setSystemStore(VDBMetadataFactory.getSystem());
+ this.repo.setSystemFunctionManager(new SystemFunctionManager());
this.repo.odbcEnabled();
this.repo.start();
[View Less]
14 years, 3 months