teiid SVN: r2935 - branches/7.1.x/test-integration/common/src/test/resources/TestODBCSchema.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2011-02-23 16:50:25 -0500 (Wed, 23 Feb 2011)
New Revision: 2935
Modified:
branches/7.1.x/test-integration/common/src/test/resources/TestODBCSchema/test_PG_ATTRIBUTE.expected
branches/7.1.x/test-integration/common/src/test/resources/TestODBCSchema/test_PG_TYPE.expected
Log:
TEIID-1477: Fixing the unit tests that failed because of the odbc type bug fix
Modified: branches/7.1.x/test-integration/common/src/test/resources/TestODBCSchema/test_PG_ATTRIBUTE.expected
===================================================================
--- branches/7.1.x/test-integration/common/src/test/resources/TestODBCSchema/test_PG_ATTRIBUTE.expected 2011-02-23 18:51:19 UTC (rev 2934)
+++ branches/7.1.x/test-integration/common/src/test/resources/TestODBCSchema/test_PG_ATTRIBUTE.expected 2011-02-23 21:50:25 UTC (rev 2935)
@@ -25,18 +25,18 @@
22 5 Valid 16 0 6 0 false false false
23 5 LoadState 1043 255 7 255 false false false
24 5 Updated 1114 0 8 0 false false false
-25 5 Cardinality <null> 10 9 10 false false false
+25 5 Cardinality 23 10 9 10 false false false
26 6 resourcePath 1043 255 1 255 false false false
27 6 contents 14939 0 2 0 false false false
28 7 VDBName 1043 255 1 255 false false false
29 7 SchemaName 1043 255 2 255 false false false
30 7 TableName 1043 255 3 255 false false false
31 7 Name 1043 255 4 255 false false false
-32 7 Position <null> 10 5 10 false false false
+32 7 Position 23 10 5 10 false false false
33 7 NameInSource 1043 255 6 255 false false false
34 7 DataType 1043 100 7 100 false false false
-35 7 Scale <null> 10 8 10 false false false
-36 7 Length <null> 10 9 10 false false false
+35 7 Scale 23 10 8 10 false false false
+36 7 Length 23 10 9 10 false false false
37 7 IsLengthFixed 16 1 10 1 false false false
38 7 SupportsSelect 16 1 11 1 false false false
39 7 SupportsUpdates 16 1 12 1 false false false
@@ -51,31 +51,31 @@
48 7 Format 1043 255 21 255 false false false
49 7 DefaultValue 1043 255 22 255 false false false
50 7 JavaClass 1043 500 23 500 false false false
-51 7 Precision <null> 10 24 10 false false false
-52 7 CharOctetLength <null> 10 25 10 false false false
-53 7 Radix <null> 10 26 10 false false false
+51 7 Precision 23 10 24 10 false false false
+52 7 CharOctetLength 23 10 25 10 false false false
+53 7 Radix 23 10 26 10 false false false
54 7 UID 1043 50 27 50 false false false
55 7 Description 1043 255 28 255 false false false
-56 7 OID <null> 10 29 10 false false false
+56 7 OID 23 10 29 10 false false false
57 8 Name 1043 100 1 100 false false false
58 8 IsStandard 16 1 2 1 false false false
59 8 IsPhysical 16 1 3 1 false false false
60 8 TypeName 1043 100 4 100 false false false
61 8 JavaClass 1043 500 5 500 false false false
-62 8 Scale <null> 10 6 10 false false false
-63 8 TypeLength <null> 10 7 10 false false false
+62 8 Scale 23 10 6 10 false false false
+63 8 TypeLength 23 10 7 10 false false false
64 8 NullType 1043 20 8 20 false false false
65 8 IsSigned 16 1 9 1 false false false
66 8 IsAutoIncremented 16 1 10 1 false false false
67 8 IsCaseSensitive 16 1 11 1 false false false
-68 8 Precision <null> 10 12 10 false false false
-69 8 Radix <null> 10 13 10 false false false
+68 8 Precision 23 10 12 10 false false false
+69 8 Radix 23 10 13 10 false false false
70 8 SearchType 1043 20 14 20 false false false
71 8 UID 1043 50 15 50 false false false
72 8 RuntimeType 1043 64 16 64 false false false
73 8 BaseType 1043 64 17 64 false false false
74 8 Description 1043 255 18 255 false false false
-75 8 OID <null> 10 19 10 false false false
+75 8 OID 23 10 19 10 false false false
76 9 VDBName 1043 255 1 255 false false false
77 9 SchemaName 1043 255 2 255 false false false
78 9 TableName 1043 2048 3 2048 false false false
@@ -84,8 +84,8 @@
81 9 KeyType 1043 20 6 20 false false false
82 9 RefKeyUID 1043 50 7 50 false false false
83 9 UID 1043 50 8 50 false false false
-84 9 Position <null> 10 9 10 false false false
-85 9 OID <null> 10 10 10 false false false
+84 9 Position 23 10 9 10 false false false
+85 9 OID 23 10 10 10 false false false
86 10 VDBName 1043 255 1 255 false false false
87 10 SchemaName 1043 255 2 255 false false false
88 10 TableName 1043 2048 3 2048 false false false
@@ -96,23 +96,23 @@
93 10 IsIndexed 16 1 8 1 false false false
94 10 RefKeyUID 1043 50 9 50 false false false
95 10 UID 1043 50 10 50 false false false
-96 10 OID <null> 10 11 10 false false false
+96 10 OID 23 10 11 10 false false false
97 11 VDBName 1043 255 1 255 false false false
98 11 SchemaName 1043 255 2 255 false false false
99 11 ProcedureName 1043 255 3 255 false false false
100 11 Name 1043 255 4 255 false false false
101 11 DataType 1043 25 5 25 false false false
-102 11 Position <null> 10 6 10 false false false
+102 11 Position 23 10 6 10 false false false
103 11 Type 1043 100 7 100 false false false
104 11 Optional 16 1 8 1 false false false
-105 11 Precision <null> 10 9 10 false false false
-106 11 TypeLength <null> 10 10 10 false false false
-107 11 Scale <null> 10 11 10 false false false
-108 11 Radix <null> 10 12 10 false false false
+105 11 Precision 23 10 9 10 false false false
+106 11 TypeLength 23 10 10 10 false false false
+107 11 Scale 23 10 11 10 false false false
+108 11 Radix 23 10 12 10 false false false
109 11 NullType 1043 10 13 10 false false false
110 11 UID 1043 50 14 50 false false false
111 11 Description 1043 255 15 255 false false false
-112 11 OID <null> 10 16 10 false false false
+112 11 OID 23 10 16 10 false false false
113 12 VDBName 1043 255 1 255 false false false
114 12 SchemaName 1043 255 2 255 false false false
115 12 Name 1043 255 3 255 false false false
@@ -120,11 +120,11 @@
117 12 ReturnsResults 16 1 5 1 false false false
118 12 UID 1043 50 6 50 false false false
119 12 Description 1043 255 7 255 false false false
-120 12 OID <null> 10 8 10 false false false
+120 12 OID 23 10 8 10 false false false
121 13 Name 1043 255 1 255 false false false
122 13 Value 1043 255 2 255 false false false
123 13 UID 1043 50 3 50 false false false
-124 13 OID <null> 10 4 10 false false false
+124 13 OID 23 10 4 10 false false false
125 14 PKTABLE_CAT 1043 255 1 255 false false false
126 14 PKTABLE_SCHEM 1043 255 2 255 false false false
127 14 PKTABLE_NAME 1043 255 3 255 false false false
@@ -134,18 +134,18 @@
131 14 FKTABLE_NAME 1043 255 7 255 false false false
132 14 FKCOLUMN_NAME 1043 255 8 255 false false false
133 14 KEY_SEQ 21 5 9 5 false false false
-134 14 UPDATE_RULE <null> 10 10 10 false false false
-135 14 DELETE_RULE <null> 10 11 10 false false false
+134 14 UPDATE_RULE 23 10 10 10 false false false
+135 14 DELETE_RULE 23 10 11 10 false false false
136 14 FK_NAME 1043 255 12 255 false false false
137 14 PK_NAME 1043 255 13 255 false false false
-138 14 DEFERRABILITY <null> 10 14 10 false false false
+138 14 DEFERRABILITY 23 10 14 10 false false false
139 15 VDBName 1043 255 1 255 false false false
140 15 Name 1043 255 2 255 false false false
141 15 IsPhysical 16 1 3 1 false false false
142 15 UID 1043 50 4 50 false false false
143 15 Description 1043 255 5 255 false false false
144 15 PrimaryMetamodelURI 1043 255 6 255 false false false
-145 15 OID <null> 10 7 10 false false false
+145 15 OID 23 10 7 10 false false false
146 16 VDBName 1043 255 1 255 false false false
147 16 SchemaName 1043 255 2 255 false false false
148 16 Name 1043 255 3 255 false false false
@@ -154,85 +154,85 @@
151 16 IsPhysical 16 1 6 1 false false false
152 16 SupportsUpdates 16 1 7 1 false false false
153 16 UID 1043 50 8 50 false false false
-154 16 Cardinality <null> 10 9 10 false false false
+154 16 Cardinality 23 10 9 10 false false false
155 16 Description 1043 255 10 255 false false false
156 16 IsSystem 16 1 11 1 false false false
157 16 IsMaterialized 16 0 12 0 false false false
-158 16 OID <null> 10 13 10 false false false
+158 16 OID 23 10 13 10 false false false
159 17 Name 1043 255 1 255 false false false
160 17 Version 1043 50 2 50 false false false
-161 18 oid <null> 0 1 0 false false false
+161 18 oid 23 0 1 0 false false false
162 18 nspname 1043 0 2 0 false false false
-163 19 oid <null> 0 1 0 false false false
+163 19 oid 23 0 1 0 false false false
164 19 relname 1043 0 2 0 false false false
-165 19 relnamespace <null> 0 3 0 false false false
+165 19 relnamespace 23 0 3 0 false false false
166 19 relkind 1042 0 4 0 false false false
-167 19 relam <null> 0 5 0 false false false
+167 19 relam 23 0 5 0 false false false
168 19 reltuples 700 0 6 0 false false false
-169 19 relpages <null> 0 7 0 false false false
+169 19 relpages 23 0 7 0 false false false
170 19 relhasrules 16 0 8 0 false false false
171 19 relhasoids 1043 0 9 0 false false false
-172 20 oid <null> 0 1 0 false false false
-173 20 attrelid <null> 0 2 0 false false false
+172 20 oid 23 0 1 0 false false false
+173 20 attrelid 23 0 2 0 false false false
174 20 attname 1043 0 3 0 false false false
-175 20 atttypid <null> 0 4 0 false false false
+175 20 atttypid 23 0 4 0 false false false
176 20 attlen 21 0 5 0 false false false
177 20 attnum 21 0 6 0 false false false
-178 20 atttypmod <null> 0 7 0 false false false
+178 20 atttypmod 23 0 7 0 false false false
179 20 attnotnull 16 0 8 0 false false false
180 20 attisdropped 16 0 9 0 false false false
181 20 atthasdef 16 0 10 0 false false false
-182 21 oid <null> 0 1 0 false false false
+182 21 oid 23 0 1 0 false false false
183 21 typname 1043 0 2 0 false false false
-184 21 typnamespace <null> 0 3 0 false false false
+184 21 typnamespace 23 0 3 0 false false false
185 21 typlen 21 0 4 0 false false false
186 21 typtype 1042 0 5 0 false false false
-187 21 typbasetype <null> 0 6 0 false false false
-188 21 typtypmod <null> 0 7 0 false false false
-189 21 typrelid <null> 0 8 0 false false false
-190 22 oid <null> 0 1 0 false false false
-191 22 indexrelid <null> 0 2 0 false false false
-192 22 indrelid <null> 0 3 0 false false false
+187 21 typbasetype 23 0 6 0 false false false
+188 21 typtypmod 23 0 7 0 false false false
+189 21 typrelid 23 0 8 0 false false false
+190 22 oid 23 0 1 0 false false false
+191 22 indexrelid 23 0 2 0 false false false
+192 22 indrelid 23 0 3 0 false false false
193 22 indisclustered 16 0 4 0 false false false
194 22 indisunique 16 0 5 0 false false false
195 22 indisprimary 16 0 6 0 false false false
196 22 indexprs 1043 0 7 0 false false false
197 22 indkey 1043 0 8 0 false false false
-198 23 oid <null> 0 1 0 false false false
+198 23 oid 23 0 1 0 false false false
199 23 amname 1043 0 2 0 false false false
-200 24 oid <null> 0 1 0 false false false
+200 24 oid 23 0 1 0 false false false
201 24 proname 1043 0 2 0 false false false
202 24 proretset 16 0 3 0 false false false
-203 24 prorettype <null> 0 4 0 false false false
+203 24 prorettype 23 0 4 0 false false false
204 24 pronargs 21 0 5 0 false false false
205 24 proargtypes <null> 0 6 0 false false false
206 24 proargnames <null> 0 7 0 false false false
207 24 proargmodes <null> 0 8 0 false false false
208 24 proallargtypes <null> 0 9 0 false false false
-209 24 pronamespace <null> 0 10 0 false false false
-210 25 oid <null> 0 1 0 false false false
-211 25 tgconstrrelid <null> 0 2 0 false false false
-212 25 tgfoid <null> 0 3 0 false false false
-213 25 tgargs <null> 0 4 0 false false false
-214 25 tgnargs <null> 0 5 0 false false false
+209 24 pronamespace 23 0 10 0 false false false
+210 25 oid 23 0 1 0 false false false
+211 25 tgconstrrelid 23 0 2 0 false false false
+212 25 tgfoid 23 0 3 0 false false false
+213 25 tgargs 23 0 4 0 false false false
+214 25 tgnargs 23 0 5 0 false false false
215 25 tgdeferrable 16 0 6 0 false false false
216 25 tginitdeferred 16 0 7 0 false false false
217 25 tgconstrname 1043 0 8 0 false false false
-218 25 tgrelid <null> 0 9 0 false false false
-219 26 oid <null> 0 1 0 false false false
-220 26 adsrc <null> 0 2 0 false false false
-221 26 adrelid <null> 0 3 0 false false false
-222 26 adnum <null> 0 4 0 false false false
-223 27 oid <null> 0 1 0 false false false
+218 25 tgrelid 23 0 9 0 false false false
+219 26 oid 23 0 1 0 false false false
+220 26 adsrc 23 0 2 0 false false false
+221 26 adrelid 23 0 3 0 false false false
+222 26 adnum 23 0 4 0 false false false
+223 27 oid 23 0 1 0 false false false
224 27 datname 1043 0 2 0 false false false
-225 27 encoding <null> 0 3 0 false false false
-226 27 datlastsysoid <null> 0 4 0 false false false
+225 27 encoding 23 0 3 0 false false false
+226 27 datlastsysoid 23 0 4 0 false false false
227 27 datallowconn 1042 0 5 0 false false false
228 27 datconfig <null> 0 6 0 false false false
229 27 datacl <null> 0 7 0 false false false
-230 27 datdba <null> 0 8 0 false false false
-231 27 dattablespace <null> 0 9 0 false false false
-232 28 oid <null> 0 1 0 false false false
+230 27 datdba 23 0 8 0 false false false
+231 27 dattablespace 23 0 9 0 false false false
+232 28 oid 23 0 1 0 false false false
233 28 usename 1043 0 2 0 false false false
234 28 usecreatedb 16 0 3 0 false false false
235 28 usesuper 16 0 4 0 false false false
Modified: branches/7.1.x/test-integration/common/src/test/resources/TestODBCSchema/test_PG_TYPE.expected
===================================================================
--- branches/7.1.x/test-integration/common/src/test/resources/TestODBCSchema/test_PG_TYPE.expected 2011-02-23 18:51:19 UTC (rev 2934)
+++ branches/7.1.x/test-integration/common/src/test/resources/TestODBCSchema/test_PG_TYPE.expected 2011-02-23 21:50:25 UTC (rev 2935)
@@ -3,7 +3,7 @@
16 boolean 2 1 b 0 -1 0
20 long 2 8 b 0 -1 0
21 short 2 2 b 0 -1 0
-23 int 2 4 b 0 -1 0
+23 integer 2 4 b 0 -1 0
25 text 2 -1 b 0 -1 0
26 oid 2 4 b 0 -1 0
142 xml 2 -1 b 0 -1 0
14 years, 10 months
teiid SVN: r2934 - trunk/runtime/src/main/java/org/teiid/deployers.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2011-02-23 13:51:19 -0500 (Wed, 23 Feb 2011)
New Revision: 2934
Modified:
trunk/runtime/src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java
Log:
TEIID-1480: Teiid was projecting the length of the columns as the attribute lengths; however pg expects them to be the size defined in the pg_type table for that type.
Modified: trunk/runtime/src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java 2011-02-23 18:23:31 UTC (rev 2933)
+++ trunk/runtime/src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java 2011-02-23 18:51:19 UTC (rev 2934)
@@ -145,7 +145,7 @@
"st.oid as attrelid, " + //$NON-NLS-1$
"t1.Name as attname, " + //$NON-NLS-1$
"pt.oid as atttypid," + //$NON-NLS-1$
- "convert(t1.Length, short) as attlen, " + //$NON-NLS-1$
+ "pt.typlen as attlen, " + //$NON-NLS-1$
"convert(t1.Position, short) as attnum, " + //$NON-NLS-1$
"t1.Length as atttypmod, " + //$NON-NLS-1$
"false as attnotnull, " + //$NON-NLS-1$
14 years, 10 months
teiid SVN: r2933 - trunk/engine/src/main/java/org/teiid/query/processor/relational.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-02-23 13:23:31 -0500 (Wed, 23 Feb 2011)
New Revision: 2933
Modified:
trunk/engine/src/main/java/org/teiid/query/processor/relational/TextTableNode.java
Log:
TEIID-1475 updating the header parsing logic
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/TextTableNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/TextTableNode.java 2011-02-23 18:12:02 UTC (rev 2932)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/TextTableNode.java 2011-02-23 18:23:31 UTC (rev 2933)
@@ -293,7 +293,7 @@
while (textLine < skip) {
boolean isHeader = textLine == header;
if (isHeader) {
- String line = readLine(lineWidth, false);
+ String line = readLine(DataTypeManager.MAX_STRING_LENGTH * 16, false);
if (line == null) { //just return an empty batch
reset();
return;
@@ -309,6 +309,7 @@
private void processHeader(List<String> line) throws TeiidProcessingException {
nameIndexes = new HashMap<String, Integer>();
+ this.lineWidth = DataTypeManager.MAX_STRING_LENGTH * line.size();
for (String string : line) {
if (string == null) {
continue;
14 years, 10 months
teiid SVN: r2932 - in trunk: connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/ingres and 6 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-02-23 13:12:02 -0500 (Wed, 23 Feb 2011)
New Revision: 2932
Added:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/ingres/Ingres93ExecutionFactory.java
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/ingres/
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/ingres/TestIngresConvertModifier.java
Modified:
trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/ingres/IngresExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mm/MetaMatrixExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teiid/TeiidExecutionFactory.java
trunk/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml
trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml
Log:
TEIID-1059: refining ingres support and making minor updates to the teiidexecutionfactory
Modified: trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java
===================================================================
--- trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java 2011-02-23 18:08:23 UTC (rev 2931)
+++ trunk/api/src/main/java/org/teiid/translator/ExecutionFactory.java 2011-02-23 18:12:02 UTC (rev 2932)
@@ -787,11 +787,16 @@
/**
* Indicates if LOBs are usable after the execution is closed.
* @return true if LOBs can be used after close
+ * @since 7.2
*/
public boolean areLobsUsableAfterClose() {
return false;
}
+ /**
+ * @return true if the WITH clause is supported
+ * @since 7.2
+ */
public boolean supportsCommonTableExpressions() {
return false;
}
Added: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/ingres/Ingres93ExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/ingres/Ingres93ExecutionFactory.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/ingres/Ingres93ExecutionFactory.java 2011-02-23 18:12:02 UTC (rev 2932)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+package org.teiid.translator.jdbc.ingres;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.teiid.language.Limit;
+import org.teiid.translator.ExecutionContext;
+import org.teiid.translator.Translator;
+import org.teiid.translator.TranslatorException;
+import org.teiid.translator.jdbc.FunctionModifier;
+
+@Translator(name="ingres93", description="A translator for Ingres 9.3 or later Database")
+public class Ingres93ExecutionFactory extends IngresExecutionFactory {
+
+ @Override
+ public void start() throws TranslatorException {
+ super.start();
+ convert.addTypeMapping("ansidate", FunctionModifier.DATE); //$NON-NLS-1$
+ convert.addTypeMapping("timestamp(9) with time zone", FunctionModifier.TIMESTAMP); //$NON-NLS-1$
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public List<?> translateLimit(Limit limit, ExecutionContext context) {
+ if (limit.getRowOffset() > 0) {
+ return Arrays.asList("OFFSET ", limit.getRowOffset(), " FETCH FIRST ", limit.getRowLimit(), " ROWS ONLY"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+ return super.translateLimit(limit, context);
+ }
+
+ @Override
+ public boolean supportsRowOffset() {
+ return true;
+ }
+
+}
Property changes on: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/ingres/Ingres93ExecutionFactory.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/ingres/IngresExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/ingres/IngresExecutionFactory.java 2011-02-23 18:08:23 UTC (rev 2931)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/ingres/IngresExecutionFactory.java 2011-02-23 18:12:02 UTC (rev 2932)
@@ -41,38 +41,31 @@
import org.teiid.translator.jdbc.FunctionModifier;
import org.teiid.translator.jdbc.JDBCExecutionFactory;
-@Translator(name="ingres", description="A translator for Ingres Database")
+@Translator(name="ingres", description="A translator for Ingres Databases")
public class IngresExecutionFactory extends JDBCExecutionFactory {
-
- private static final String INGRES = "ingres"; //$NON-NLS-1$
+ private static final String INGRES = "ingres"; //$NON-NLS-1$
+ protected ConvertModifier convert = new ConvertModifier();
+
@Override
public void start() throws TranslatorException {
super.start();
- ConvertModifier convert = new ConvertModifier();
- convert.addTypeMapping("bit", FunctionModifier.BYTE); //$NON-NLS-1$
- convert.addTypeMapping("boolean", FunctionModifier.BOOLEAN); //$NON-NLS-1$
- convert.addTypeMapping("tinyint", FunctionModifier.BYTE); //$NON-NLS-1$
+ convert.addTypeMapping("tinyint", FunctionModifier.BOOLEAN, FunctionModifier.BYTE); //$NON-NLS-1$
convert.addTypeMapping("smallint", FunctionModifier.SHORT); //$NON-NLS-1$
convert.addTypeMapping("integer", FunctionModifier.INTEGER); //$NON-NLS-1$
convert.addTypeMapping("bigint", FunctionModifier.LONG); //$NON-NLS-1$
convert.addTypeMapping("real", FunctionModifier.FLOAT); //$NON-NLS-1$
convert.addTypeMapping("float", FunctionModifier.DOUBLE); //$NON-NLS-1$
- convert.addTypeMapping("decimal(15,0)", FunctionModifier.BIGDECIMAL); //$NON-NLS-1$
- convert.addTypeMapping("decimal(38,0)", FunctionModifier.BIGINTEGER); //$NON-NLS-1$
+ convert.addTypeMapping("decimal(38,19)", FunctionModifier.BIGDECIMAL); //$NON-NLS-1$
+ convert.addTypeMapping("decimal(15,0)", FunctionModifier.BIGINTEGER); //$NON-NLS-1$
convert.addTypeMapping("date", FunctionModifier.DATE); //$NON-NLS-1$
convert.addTypeMapping("time with time zone", FunctionModifier.TIME); //$NON-NLS-1$
convert.addTypeMapping("timestamp with time zone", FunctionModifier.TIMESTAMP); //$NON-NLS-1$
convert.addTypeMapping("char(1)", FunctionModifier.CHAR); //$NON-NLS-1$
- convert.addTypeMapping("varchar($1)", FunctionModifier.STRING); //$NON-NLS-1$
- convert.addTypeMapping("long varchar", FunctionModifier.STRING); //$NON-NLS-1$
+ convert.addTypeMapping("varchar(4000)", FunctionModifier.STRING); //$NON-NLS-1$
convert.addTypeMapping("blob", FunctionModifier.BLOB); //$NON-NLS-1$
convert.addTypeMapping("clob", FunctionModifier.CLOB); //$NON-NLS-1$
- convert.addTypeMapping("byte($1)", FunctionModifier.OBJECT); //$NON-NLS-1$
- convert.addTypeMapping("long byte", FunctionModifier.OBJECT); //$NON-NLS-1$
- convert.addTypeMapping("varbyte($1)", FunctionModifier.OBJECT); //$NON-NLS-1$
- convert.addTypeMapping("ansidate", FunctionModifier.DATE); //$NON-NLS-1$
- convert.addTypeMapping("timestamp(9) with time zone", FunctionModifier.TIMESTAMP); //$NON-NLS-1$
+ convert.addNumericBooleanConversions();
registerFunctionModifier(SourceSystemFunctions.CONVERT, convert);
}
@@ -272,4 +265,5 @@
public boolean supportsInlineViews() {
return true;
}
+
}
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mm/MetaMatrixExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mm/MetaMatrixExecutionFactory.java 2011-02-23 18:08:23 UTC (rev 2931)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/mm/MetaMatrixExecutionFactory.java 2011-02-23 18:12:02 UTC (rev 2932)
@@ -14,7 +14,7 @@
/**
* Capabilities compatible with MM 5.5.x
*/
-@Translator(name="metamatrix", description="A translator for MetaMatrix Virtual Database")
+@Translator(name="metamatrix", description="A translator for MetaMatrix 5.5 or later")
public class MetaMatrixExecutionFactory extends JDBCExecutionFactory {
public List<String> getSupportedFunctions() {
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teiid/TeiidExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teiid/TeiidExecutionFactory.java 2011-02-23 18:08:23 UTC (rev 2931)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/teiid/TeiidExecutionFactory.java 2011-02-23 18:12:02 UTC (rev 2932)
@@ -27,19 +27,21 @@
import java.util.ArrayList;
import java.util.List;
+import org.teiid.translator.SourceSystemFunctions;
import org.teiid.translator.Translator;
-import org.teiid.translator.ExecutionFactory.NullOrder;
import org.teiid.translator.jdbc.JDBCExecutionFactory;
-
/**
* @since 4.3
*/
-@Translator(name="teiid", description="A translator for Teiid Virtual Database")
+@Translator(name="teiid", description="A translator for Teiid 7.0 or later")
public class TeiidExecutionFactory extends JDBCExecutionFactory {
public static final String SEVEN_0 = "7.0"; //$NON-NLS-1$
public static final String SEVEN_1 = "7.1"; //$NON-NLS-1$
+ public static final String SEVEN_2 = "7.2"; //$NON-NLS-1$
+ public static final String SEVEN_3 = "7.3"; //$NON-NLS-1$
+ public static final String SEVEN_4 = "7.4"; //$NON-NLS-1$
public TeiidExecutionFactory() {
setDatabaseVersion(SEVEN_0);
@@ -139,6 +141,17 @@
supportedFunctions.add("FROM_UNIXTIME"); //$NON-NLS-1$
supportedFunctions.add("NULLIF"); //$NON-NLS-1$
supportedFunctions.add("COALESCE"); //$NON-NLS-1$
+
+ if (getDatabaseVersion().compareTo(SEVEN_3) >= 0) {
+ supportedFunctions.add(SourceSystemFunctions.UNESCAPE);
+
+ if (getDatabaseVersion().compareTo(SEVEN_4) >= 0) {
+ supportedFunctions.add(SourceSystemFunctions.UUID);
+ supportedFunctions.add(SourceSystemFunctions.ARRAY_GET);
+ supportedFunctions.add(SourceSystemFunctions.ARRAY_LENGTH);
+ }
+ }
+
return supportedFunctions;
}
@@ -178,4 +191,14 @@
public NullOrder getDefaultNullOrder() {
return NullOrder.UNKNOWN;
}
+
+ @Override
+ public boolean supportsBulkUpdate() {
+ return true;
+ }
+
+ @Override
+ public boolean supportsCommonTableExpressions() {
+ return getDatabaseVersion().compareTo(SEVEN_2) >= 0;
+ }
}
Added: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/ingres/TestIngresConvertModifier.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/ingres/TestIngresConvertModifier.java (rev 0)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/ingres/TestIngresConvertModifier.java 2011-02-23 18:12:02 UTC (rev 2932)
@@ -0,0 +1,126 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.translator.jdbc.ingres;
+
+import static org.junit.Assert.*;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.sql.Timestamp;
+import java.util.Arrays;
+
+import org.junit.Test;
+import org.teiid.language.Expression;
+import org.teiid.language.Function;
+import org.teiid.language.LanguageFactory;
+import org.teiid.query.unittest.TimestampUtil;
+import org.teiid.translator.TypeFacility;
+import org.teiid.translator.jdbc.SQLConversionVisitor;
+/**
+ */
+public class TestIngresConvertModifier {
+
+ private static final LanguageFactory LANG_FACTORY = new LanguageFactory();
+
+ public String helpGetString(Expression expr) throws Exception {
+ IngresExecutionFactory trans = new IngresExecutionFactory();
+ trans.start();
+ SQLConversionVisitor sqlVisitor = trans.getSQLConversionVisitor();
+ sqlVisitor.append(expr);
+
+ return sqlVisitor.toString();
+ }
+
+ public void helpTest(Expression srcExpression, String tgtType, String expectedExpression) throws Exception {
+ Function func = LANG_FACTORY.createFunction("convert", //$NON-NLS-1$
+ Arrays.asList(
+ srcExpression,
+ LANG_FACTORY.createLiteral(tgtType, String.class)),
+ TypeFacility.getDataTypeClass(tgtType));
+
+ assertEquals("Error converting from " + srcExpression.getType() + " to " + tgtType, //$NON-NLS-1$ //$NON-NLS-2$
+ expectedExpression, helpGetString(func));
+ }
+
+ // Source = STRING
+ @Test public void testStringToChar() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral("5", String.class), "char", "cast('5' AS char(1))"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+
+ @Test public void testBooleanToBigDecimal() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(Boolean.TRUE, Boolean.class), "bigdecimal", "cast(1 AS decimal(38,19))"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ // Source = BYTE
+
+ @Test public void testByteToString() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(new Byte((byte)1), Byte.class), "string", "cast(1 AS varchar(4000))"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ @Test public void testByteToBoolean() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(new Byte((byte)1), Byte.class), "boolean", "CASE WHEN 1 = 0 THEN 0 WHEN 1 IS NOT NULL THEN 1 END"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ @Test public void testBigIntegerToDouble() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(new BigInteger("1"), BigInteger.class), "double", "cast(1 AS float)"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+
+ // Source = FLOAT
+
+ @Test public void testFloatToLong() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(new Float(1.2f), Float.class), "long", "cast(1.2 AS bigint)"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ // Source = DOUBLE
+
+ @Test public void testDoubleToShort() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(new Double(1.2), Double.class), "short", "cast(1.2 AS smallint)"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ // Source = BIGDECIMAL
+
+ @Test public void testBigDecimalToByte() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(new BigDecimal("1.0"), BigDecimal.class), "byte", "cast(1.0 AS tinyint)"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ }
+
+ // Source = DATE
+
+ @Test public void testDateToTimestamp() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(TimestampUtil.createDate(103, 10, 1), java.sql.Date.class), "timestamp", "cast(DATE '2003-11-01' AS timestamp with time zone)"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ // Source = TIME
+
+ @Test public void testTimeToString() throws Exception {
+ helpTest(LANG_FACTORY.createLiteral(TimestampUtil.createTime(23, 59, 59), java.sql.Time.class), "string", "cast(TIME '23:59:59' AS varchar(4000))"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+
+ // Source = TIMESTAMP
+
+ @Test public void testTimestampToString() throws Exception {
+ Timestamp ts = TimestampUtil.createTimestamp(103, 10, 1, 12, 5, 2, 0);
+ helpTest(LANG_FACTORY.createLiteral(ts, Timestamp.class), "string", "cast(TIMESTAMP '2003-11-01 12:05:02.0' AS varchar(4000))"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+}
Property changes on: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/ingres/TestIngresConvertModifier.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml
===================================================================
--- trunk/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml 2011-02-23 18:08:23 UTC (rev 2931)
+++ trunk/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml 2011-02-23 18:12:02 UTC (rev 2932)
@@ -268,7 +268,7 @@
<section>
<title>Bulk Execution</title>
- <para> Non batched <code>Insert, Update, Delete</code>
+ <para>Non batched <code>Insert, Update, Delete</code>
commands may have <code>Literal</code> values marked as multiValued if the
capabilities shows support for BulkUpdate. Commands with
multiValued <code>Literal</code>s represent multiple executions of the same
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml 2011-02-23 18:08:23 UTC (rev 2931)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml 2011-02-23 18:12:02 UTC (rev 2932)
@@ -237,6 +237,16 @@
</listitem>
<listitem>
<para>
+ <emphasis>ingres</emphasis> - for use with Ingres 2006 or later.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>ingres93</emphasis> - for use with Ingres 9.3 or later.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
<emphasis>informix</emphasis> - for use with any version.
</para>
</listitem>
@@ -303,12 +313,7 @@
<para>
<emphasis>teradata</emphasis> - for use with Teradata V2R5.1 or later.
</para>
- </listitem>
- <listitem>
- <para>
- <emphasis>ingres</emphasis> - for use with Ingres Database 9.2 or later.
- </para>
- </listitem>
+ </listitem>
</itemizedlist>
<table>
14 years, 10 months
teiid SVN: r2931 - in branches/7.1.x/runtime/src/main/java/org/teiid: odbc and 1 other directory.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2011-02-23 13:08:23 -0500 (Wed, 23 Feb 2011)
New Revision: 2931
Modified:
branches/7.1.x/runtime/src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java
branches/7.1.x/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java
Log:
TEIID-1477: Adding support to handle "select version()" call, and couple other 'select' call I have seen with the other tools. Also fixed bug in specifying the pg_type so that pg_attribute transformation returns correct type for the table columns
Modified: branches/7.1.x/runtime/src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java
===================================================================
--- branches/7.1.x/runtime/src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java 2011-02-23 17:57:40 UTC (rev 2930)
+++ branches/7.1.x/runtime/src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java 2011-02-23 18:08:23 UTC (rev 2931)
@@ -369,7 +369,7 @@
" union " + //$NON-NLS-1$
"SELECT 20 as oid, 'long' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(8, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid FROM (SELECT 1) X" + //$NON-NLS-1$
" union " + //$NON-NLS-1$
- "SELECT 23 as oid, 'int' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(4, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid FROM (SELECT 1) X" + //$NON-NLS-1$
+ "SELECT 23 as oid, 'integer' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, convert(4, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid FROM (SELECT 1) X" + //$NON-NLS-1$
" union " + //$NON-NLS-1$
"SELECT 26 as oid, 'oid' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typname, convert(4, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid FROM (SELECT 1) X" + //$NON-NLS-1$
" union " + //$NON-NLS-1$
Modified: branches/7.1.x/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java
===================================================================
--- branches/7.1.x/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java 2011-02-23 17:57:40 UTC (rev 2930)
+++ branches/7.1.x/runtime/src/main/java/org/teiid/odbc/ODBCServerRemoteImpl.java 2011-02-23 18:08:23 UTC (rev 2931)
@@ -34,6 +34,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.teiid.core.util.ApplicationInfo;
import org.teiid.jdbc.ConnectionImpl;
import org.teiid.jdbc.TeiidDriver;
import org.teiid.logging.LogConstants;
@@ -300,7 +301,8 @@
// set client_encoding to 'WIN1252'
if (sql != null) {
// selects are coming with "select\t" so using a space after "select" does not always work
- if (sql.startsWith("select") || sql.startsWith("SELECT")) { //$NON-NLS-1$ //$NON-NLS-2$
+ String sqlLower = sql.toLowerCase();
+ if (sqlLower.startsWith("select")) { //$NON-NLS-1$
modified = sql.replace('\n', ' ');
Matcher m = null;
@@ -321,6 +323,15 @@
"FKTABLE_NAME, FKCOLUMN_NAME, KEY_SEQ, UPDATE_RULE, DELETE_RULE, FK_NAME, PK_NAME, DEFERRABILITY "+//$NON-NLS-1$
"FROM SYS.ReferenceKeyColumns WHERE PKTABLE_NAME LIKE '"+m.group(14)+"' and PKTABLE_SCHEM LIKE '"+m.group(15)+"'";//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
+ else if (modified.equalsIgnoreCase("select version()")) { //$NON-NLS-1$
+ modified = "SELECT 'Teiid "+ApplicationInfo.getInstance().getReleaseNumber()+"'"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ else if (modified.startsWith("SELECT name FROM master..sysdatabases")) { //$NON-NLS-1$
+ modified = "SELECT 'Teiid'"; //$NON-NLS-1$
+ }
+ else if (modified.equalsIgnoreCase("select db_name() dbname")) { //$NON-NLS-1$
+ modified = "SELECT current_database()"; //$NON-NLS-1$
+ }
else {
modified = modified.replaceAll("E'", "'"); //$NON-NLS-1$ //$NON-NLS-2$
modified = modified.replaceAll("::[A-Za-z0-9]*", " "); //$NON-NLS-1$ //$NON-NLS-2$
@@ -342,8 +353,11 @@
if (m.matches()) {
if (m.group(2).equalsIgnoreCase("client_encoding")) { //$NON-NLS-1$
this.client.setEncoding(PGCharsetConverter.getCharset(m.group(4)));
- modified = "SELECT 'SET'"; //$NON-NLS-1$
}
+ else {
+ this.props.setProperty(m.group(2), m.group(4));
+ }
+ modified = "SELECT 'SET'"; //$NON-NLS-1$
}
else if (modified.equalsIgnoreCase("BEGIN")) { //$NON-NLS-1$
try {
14 years, 10 months
teiid SVN: r2930 - in trunk: runtime/src/main/java/org/teiid/deployers and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-02-23 12:57:40 -0500 (Wed, 23 Feb 2011)
New Revision: 2930
Modified:
trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java
trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java
trunk/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java
Log:
TEIID-1470 updating dynamic vdb deployment logic
Modified: trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java 2011-02-23 16:03:16 UTC (rev 2929)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java 2011-02-23 17:57:40 UTC (rev 2930)
@@ -25,6 +25,7 @@
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
+import java.util.LinkedList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
@@ -52,6 +53,7 @@
@ManagementObject(properties=ManagementProperties.EXPLICIT)
public class ModelMetaData extends AdminObjectImpl implements Model {
+ private static final int DEFAULT_ERROR_HISTORY = 10;
private static final String SUPPORTS_MULTI_SOURCE_BINDINGS_KEY = "supports-multi-source-bindings"; //$NON-NLS-1$
private static final long serialVersionUID = 3714234763056162230L;
@@ -229,10 +231,13 @@
public synchronized ValidationError addError(String severity, String message) {
if (this.errors == null) {
- this.errors = new ArrayList<ValidationError>();
+ this.errors = new LinkedList<ValidationError>();
}
ValidationError ve = new ValidationError(severity, message);
this.errors.add(ve);
+ if (this.errors.size() > DEFAULT_ERROR_HISTORY) {
+ this.errors.remove(0);
+ }
return ve;
}
Modified: trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java 2011-02-23 16:03:16 UTC (rev 2929)
+++ trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java 2011-02-23 17:57:40 UTC (rev 2930)
@@ -43,7 +43,6 @@
import org.teiid.adminapi.impl.SourceMappingMetadata;
import org.teiid.adminapi.impl.VDBMetaData;
import org.teiid.adminapi.impl.VDBTranslatorMetaData;
-import org.teiid.adminapi.impl.ModelMetaData.ValidationError;
import org.teiid.dqp.internal.datamgr.ConnectorManager;
import org.teiid.dqp.internal.datamgr.ConnectorManagerRepository;
import org.teiid.dqp.internal.datamgr.TranslatorRepository;
@@ -323,7 +322,7 @@
*/
private Boolean loadMetadata(VDBMetaData vdb, ModelMetaData model, boolean cache, File cacheFile, MetadataStoreGroup vdbStore, ConnectorManagerRepository cmr) {
String msg = RuntimePlugin.Util.getString("model_metadata_loading", vdb.getName()+"-"+vdb.getVersion(), model.getName(), SimpleDateFormat.getInstance().format(new Date())); //$NON-NLS-1$ //$NON-NLS-2$
- final ValidationError addedError = model.addError(ModelMetaData.ValidationError.Severity.ERROR.toString(), msg);
+ model.addError(ModelMetaData.ValidationError.Severity.ERROR.toString(), msg);
LogManager.logInfo(LogConstants.CTX_RUNTIME, msg);
String exceptionMessage = null;
@@ -342,7 +341,6 @@
this.serializer.saveAttachment(cacheFile, store);
}
vdbStore.addStore(store);
- model.removeError(addedError);
loaded = true;
break;
} catch (TranslatorException e) {
@@ -366,10 +364,13 @@
model.addError(ModelMetaData.ValidationError.Severity.ERROR.toString(), exceptionMessage);
}
LogManager.logWarning(LogConstants.CTX_RUNTIME, failed_msg);
- } else if (vdb.isValid()) {
- this.vdbRepository.updateVDB(vdb.getName(), vdb.getVersion());
- vdb.setStatus(VDB.Status.ACTIVE);
- LogManager.logInfo(LogConstants.CTX_RUNTIME, RuntimePlugin.Util.getString("vdb_activated",vdb.getName(), vdb.getVersion())); //$NON-NLS-1$
+ } else {
+ model.clearErrors();
+ if (vdb.isValid()) {
+ this.vdbRepository.updateVDB(vdb.getName(), vdb.getVersion());
+ vdb.setStatus(VDB.Status.ACTIVE);
+ LogManager.logInfo(LogConstants.CTX_RUNTIME, RuntimePlugin.Util.getString("vdb_activated",vdb.getName(), vdb.getVersion())); //$NON-NLS-1$
+ }
}
}
Modified: trunk/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java 2011-02-23 16:03:16 UTC (rev 2929)
+++ trunk/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java 2011-02-23 17:57:40 UTC (rev 2930)
@@ -84,7 +84,6 @@
String sourceName = getSourceName(resourceName, model, translator);
if (sourceName != null) {
ConnectorManager cm = cmr.getConnectorManager(sourceName);
- model.clearErrors();
String status = cm.getStausMessage();
if (status != null && status.length() > 0) {
model.addError(ModelMetaData.ValidationError.Severity.ERROR.name(), status);
@@ -94,6 +93,8 @@
Runnable r = model.removeAttachment(Runnable.class);
if (r != null) {
runnables.add(r);
+ } else {
+ model.clearErrors();
}
}
}
14 years, 10 months
teiid SVN: r2929 - trunk/build/kits/jboss-container.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2011-02-23 11:03:16 -0500 (Wed, 23 Feb 2011)
New Revision: 2929
Modified:
trunk/build/kits/jboss-container/teiid-releasenotes.html
Log:
TEIID-1059: Adding translator for Ingres database.
Modified: trunk/build/kits/jboss-container/teiid-releasenotes.html
===================================================================
--- trunk/build/kits/jboss-container/teiid-releasenotes.html 2011-02-23 16:00:02 UTC (rev 2928)
+++ trunk/build/kits/jboss-container/teiid-releasenotes.html 2011-02-23 16:03:16 UTC (rev 2929)
@@ -36,6 +36,7 @@
<LI><B>array_length</B> was added to get the length of java.sql.Array or java array values.
</UL>
<LI><B>ARRAYTABLE</B> - the ARRAYTABLE table function was added to simplify array value extraction into a tabular format.
+ <LI><B>Ingres</B> - Ingres database translator is now available to use as supported source under Teiid.
</UL>
<h2><a name="Compatibility">Compatibility Issues</a></h2>
14 years, 10 months
teiid SVN: r2928 - trunk/documentation/reference/src/main/docbook/en-US/content.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2011-02-23 11:00:02 -0500 (Wed, 23 Feb 2011)
New Revision: 2928
Modified:
trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml
Log:
TEIID-1059: Adding translator for Ingres database.
Modified: trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml
===================================================================
--- trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml 2011-02-23 15:30:48 UTC (rev 2927)
+++ trunk/documentation/reference/src/main/docbook/en-US/content/translators.xml 2011-02-23 16:00:02 UTC (rev 2928)
@@ -304,6 +304,11 @@
<emphasis>teradata</emphasis> - for use with Teradata V2R5.1 or later.
</para>
</listitem>
+ <listitem>
+ <para>
+ <emphasis>ingres</emphasis> - for use with Ingres Database 9.2 or later.
+ </para>
+ </listitem>
</itemizedlist>
<table>
14 years, 10 months
teiid SVN: r2927 - trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/postgresql.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-02-23 10:30:48 -0500 (Wed, 23 Feb 2011)
New Revision: 2927
Modified:
trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/postgresql/TestPostgreSQLTranslator.java
Log:
TEIID-247 adding h2 and postgres pushdown support for array functions
Modified: trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/postgresql/TestPostgreSQLTranslator.java
===================================================================
--- trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/postgresql/TestPostgreSQLTranslator.java 2011-02-23 15:30:32 UTC (rev 2926)
+++ trunk/connectors/translator-jdbc/src/test/java/org/teiid/translator/jdbc/postgresql/TestPostgreSQLTranslator.java 2011-02-23 15:30:48 UTC (rev 2927)
@@ -535,5 +535,14 @@
input, output,
TRANSLATOR);
}
+
+ @Test public void testArrayFunctions() throws Exception {
+ String input = "SELECT array_get(objectvalue, 3), array_length(objectvalue) FROM BQT1.SMALLA"; //$NON-NLS-1$
+ String output = "SELECT SmallA.ObjectValue[3], array_length(SmallA.ObjectValue, 1) FROM SmallA"; //$NON-NLS-1$
+
+ TranslationHelper.helpTestVisitor(TranslationHelper.BQT_VDB,
+ input, output,
+ TRANSLATOR);
+ }
}
14 years, 10 months
teiid SVN: r2926 - in trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc: postgresql and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2011-02-23 10:30:32 -0500 (Wed, 23 Feb 2011)
New Revision: 2926
Modified:
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2ExecutionFactory.java
trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java
Log:
TEIID-247 adding h2 and postgres pushdown support for array functions
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2ExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2ExecutionFactory.java 2011-02-23 01:53:08 UTC (rev 2925)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/h2/H2ExecutionFactory.java 2011-02-23 15:30:32 UTC (rev 2926)
@@ -165,6 +165,8 @@
supportedFunctions.add(SourceSystemFunctions.CONVERT);
supportedFunctions.add(SourceSystemFunctions.IFNULL);
supportedFunctions.add(SourceSystemFunctions.COALESCE);
+ supportedFunctions.add(SourceSystemFunctions.ARRAY_GET);
+ supportedFunctions.add(SourceSystemFunctions.ARRAY_LENGTH);
return supportedFunctions;
}
Modified: trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java
===================================================================
--- trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java 2011-02-23 01:53:08 UTC (rev 2925)
+++ trunk/connectors/translator-jdbc/src/main/java/org/teiid/translator/jdbc/postgresql/PostgreSQLExecutionFactory.java 2011-02-23 15:30:32 UTC (rev 2926)
@@ -110,6 +110,24 @@
//specific to 8.2 client or later
registerFunctionModifier(SourceSystemFunctions.TIMESTAMPADD, new EscapeSyntaxModifier());
registerFunctionModifier(SourceSystemFunctions.TIMESTAMPDIFF, new EscapeSyntaxModifier());
+
+ registerFunctionModifier(SourceSystemFunctions.ARRAY_GET, new FunctionModifier() {
+
+ @Override
+ public List<?> translate(Function function) {
+ return Arrays.asList(function.getParameters().get(0), '[', function.getParameters().get(1), ']');
+ }
+ });
+ registerFunctionModifier(SourceSystemFunctions.ARRAY_LENGTH, new FunctionModifier() {
+
+ @Override
+ public List<?> translate(Function function) {
+ if (function.getParameters().size() == 1) {
+ function.getParameters().add(new Literal(1, TypeFacility.RUNTIME_TYPES.INTEGER));
+ }
+ return null;
+ }
+ });
//add in type conversion
ConvertModifier convertModifier = new ConvertModifier();
@@ -427,6 +445,8 @@
// supportedFunctions.add("USER"); //$NON-NLS-1$ // no ()
// supportedFunctions.add("VERSION"); //$NON-NLS-1$
//
+ supportedFunctions.add(SourceSystemFunctions.ARRAY_GET);
+ supportedFunctions.add(SourceSystemFunctions.ARRAY_LENGTH);
return supportedFunctions;
}
14 years, 10 months