[teiid-commits] teiid SVN: r3392 - in branches/7.4.x: engine/src/main/java/org/teiid/query/processor/relational and 3 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Wed Aug 17 16:28:59 EDT 2011


Author: shawkins
Date: 2011-08-17 16:28:59 -0400 (Wed, 17 Aug 2011)
New Revision: 3392

Modified:
   branches/7.4.x/engine/src/main/java/org/teiid/query/function/aggregate/AggregateFunction.java
   branches/7.4.x/engine/src/main/java/org/teiid/query/function/aggregate/ArrayAgg.java
   branches/7.4.x/engine/src/main/java/org/teiid/query/function/aggregate/ConstantFunction.java
   branches/7.4.x/engine/src/main/java/org/teiid/query/processor/relational/SortingFilter.java
   branches/7.4.x/runtime/src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java
   branches/7.4.x/runtime/src/main/java/org/teiid/transport/PgBackendProtocol.java
   branches/7.4.x/test-integration/common/src/test/resources/TestODBCSchema/test_PG_ATTRIBUTE.expected
   branches/7.4.x/test-integration/common/src/test/resources/TestODBCSchema/test_PG_TYPE.expected
Log:
TEIID-1718 fix for ODBC object type handling

Modified: branches/7.4.x/engine/src/main/java/org/teiid/query/function/aggregate/AggregateFunction.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/query/function/aggregate/AggregateFunction.java	2011-08-17 20:24:17 UTC (rev 3391)
+++ branches/7.4.x/engine/src/main/java/org/teiid/query/function/aggregate/AggregateFunction.java	2011-08-17 20:28:59 UTC (rev 3392)
@@ -68,7 +68,7 @@
     	}
     }
     
-    boolean filter(Object value) {
+    public boolean filter(Object value) {
     	return value == null; 
     }
     

Modified: branches/7.4.x/engine/src/main/java/org/teiid/query/function/aggregate/ArrayAgg.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/query/function/aggregate/ArrayAgg.java	2011-08-17 20:24:17 UTC (rev 3391)
+++ branches/7.4.x/engine/src/main/java/org/teiid/query/function/aggregate/ArrayAgg.java	2011-08-17 20:28:59 UTC (rev 3392)
@@ -64,7 +64,7 @@
 	}
 
 	@Override
-    boolean filter(Object value) {
+    public boolean filter(Object value) {
 		// handle the null values too.
     	return false; 
     }	

Modified: branches/7.4.x/engine/src/main/java/org/teiid/query/function/aggregate/ConstantFunction.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/query/function/aggregate/ConstantFunction.java	2011-08-17 20:24:17 UTC (rev 3391)
+++ branches/7.4.x/engine/src/main/java/org/teiid/query/function/aggregate/ConstantFunction.java	2011-08-17 20:28:59 UTC (rev 3392)
@@ -40,7 +40,7 @@
     }
     
     @Override
-    boolean filter(Object input) {
+    public boolean filter(Object input) {
     	return false;
     }
 

Modified: branches/7.4.x/engine/src/main/java/org/teiid/query/processor/relational/SortingFilter.java
===================================================================
--- branches/7.4.x/engine/src/main/java/org/teiid/query/processor/relational/SortingFilter.java	2011-08-17 20:24:17 UTC (rev 3391)
+++ branches/7.4.x/engine/src/main/java/org/teiid/query/processor/relational/SortingFilter.java	2011-08-17 20:28:59 UTC (rev 3392)
@@ -158,4 +158,9 @@
         // Return
         return this.proxy.getResult();
     }
+    
+    @Override
+    public boolean filter(Object value) {
+    	return this.proxy.filter(value);
+    }
 }

Modified: branches/7.4.x/runtime/src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java
===================================================================
--- branches/7.4.x/runtime/src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java	2011-08-17 20:24:17 UTC (rev 3391)
+++ branches/7.4.x/runtime/src/main/java/org/teiid/deployers/PgCatalogMetadataStore.java	2011-08-17 20:28:59 UTC (rev 3392)
@@ -326,7 +326,7 @@
 	}
 	
 	private String paramTable(String notIn) {
-		return "SELECT dt.oid as oid, pp.Position as position, pp.Type as type FROM ProcedureParams pp LEFT JOIN matpg_datatype dt ON pp.DataType=dt.Name " + //$NON-NLS-1$
+		return "SELECT case when pp.Type <> 'ResultSet' AND pp.DataType = 'object' then 2283 else dt.oid end as oid, pp.Position as position, pp.Type as type FROM ProcedureParams pp LEFT JOIN matpg_datatype dt ON pp.DataType=dt.Name " + //$NON-NLS-1$
 				"WHERE pp.ProcedureName = t1.Name AND pp.SchemaName = t1.SchemaName AND pp.Type NOT IN ("+notIn+")"; //$NON-NLS-1$ //$NON-NLS-2$
 	}
 	
@@ -386,79 +386,45 @@
 		
 		addColumn("typrelid", DataTypeManager.DefaultDataTypes.INTEGER, t); //$NON-NLS-1$ 
 		addColumn("typelem", DataTypeManager.DefaultDataTypes.INTEGER, t); //$NON-NLS-1$
-		
 		String transformation =
-			"SELECT 16 as oid,  'boolean' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace,  convert(1, short) as typlen,  convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem FROM (SELECT 1) X" + //$NON-NLS-1$
-			"   union " + //$NON-NLS-1$
-			//"SELECT 17 as oid,  'blob' as typname,(SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace,  convert(1, short) as typlen,  convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem  FROM (SELECT 1) X" + //$NON-NLS-1$
-			//"   union " + //$NON-NLS-1$
-			"SELECT 1043 as oid,  'string' as typname,  (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace,  convert(-1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem  FROM (SELECT 1) X" + //$NON-NLS-1$
-			"   union " + //$NON-NLS-1$
-			"SELECT 25 as oid,  'text' as typname,  (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace,  convert(-1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem  FROM (SELECT 1) X" + //$NON-NLS-1$
-			"   union " + //$NON-NLS-1$
-			"SELECT 1042 as oid,  'char' as typname,  (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace,  convert(1, short) as typlen,  convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem  FROM (SELECT 1) X" + //$NON-NLS-1$
-			"   union " + //$NON-NLS-1$
-			"SELECT 21 as oid,  'short' as typname,  (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace,  convert(2, short) as typlen,  convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem  FROM (SELECT 1) X" + //$NON-NLS-1$
-			"   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, 0 as typelem  FROM (SELECT 1) X" + //$NON-NLS-1$
-			"   union " + //$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, 0 as typelem  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, 0 as typelem  FROM (SELECT 1) X" + //$NON-NLS-1$
-			"   union " + //$NON-NLS-1$
-			"SELECT 700 as oid,  'float' 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, 0 as typelem  FROM (SELECT 1) X" + //$NON-NLS-1$ 
-			"   union " + //$NON-NLS-1$
-			"SELECT 701 as oid,  'double' 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, 0 as typelem  FROM (SELECT 1) X" + //$NON-NLS-1$
-			"   union " + //$NON-NLS-1$
-			//"SELECT 1009 as oid,  'clob' as typname,(SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace,  convert(-1, short) as typlen, convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem  FROM (SELECT 1) X" + //$NON-NLS-1$
-			//"   union " + //$NON-NLS-1$
-			"SELECT 1082 as oid,  'date' 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, 0 as typelem  FROM (SELECT 1) X" + //$NON-NLS-1$
-			"   union " + //$NON-NLS-1$
-			"SELECT 1083 as oid,  'datetime' 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, 0 as typelem  FROM (SELECT 1) X" + //$NON-NLS-1$
-			"   union " + //$NON-NLS-1$
-			"SELECT 1114 as oid,  'timestamp' 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, 0 as typelem  FROM (SELECT 1) X" + //$NON-NLS-1$
-			"   union " + //$NON-NLS-1$
-			"SELECT 1700 as oid,  'decimal' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace,  convert(-1, short) as typlen,  convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem  FROM (SELECT 1) X"  + //$NON-NLS-1$
-			"   union " + //$NON-NLS-1$
-			"SELECT 142 as oid,  'xml' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace,  convert(-1, short) as typlen,  convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem  FROM (SELECT 1) X" + //$NON-NLS-1$
-			"   union " + //$NON-NLS-1$
-			"SELECT 14939 as oid,  'lo' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace,  convert(-1, short) as typlen,  convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem  FROM (SELECT 1) X"+//$NON-NLS-1$
-			"   union " + //$NON-NLS-1$
-			"SELECT 2278 as oid,  'void' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace,  convert(4, short) as typlen,  convert('p', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem  FROM (SELECT 1) X" + //$NON-NLS-1$
-			"   union " + //$NON-NLS-1$
-			"SELECT 2249 as oid,  'record' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace,  convert(-1, short) as typlen,  convert('p', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 0 as typelem  FROM (SELECT 1) X" + //$NON-NLS-1$		
-			"   union " + //$NON-NLS-1$
-			"SELECT 30 as oid,  'oidvector' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace,  convert(-1, short) as typlen,  convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 26 as typelem  FROM (SELECT 1) X" + //$NON-NLS-1$
-			"   union " + //$NON-NLS-1$
-			"SELECT 1000 as oid,  '_bool' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace,  convert(-1, short) as typlen,  convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 16 as typelem  FROM (SELECT 1) X" + //$NON-NLS-1$
-			"   union " + //$NON-NLS-1$
-			"SELECT 1002 as oid,  '_char' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace,  convert(-1, short) as typlen,  convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 18 as typelem  FROM (SELECT 1) X" + //$NON-NLS-1$
-			"   union " + //$NON-NLS-1$
-			"SELECT 1005 as oid,  '_int2' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace,  convert(-1, short) as typlen,  convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 21 as typelem  FROM (SELECT 1) X" + //$NON-NLS-1$
-			"   union " + //$NON-NLS-1$
-			"SELECT 1007 as oid,  '_int4' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace,  convert(-1, short) as typlen,  convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 23 as typelem  FROM (SELECT 1) X" + //$NON-NLS-1$
-			"   union " + //$NON-NLS-1$
-			"SELECT 1009 as oid,  '_text' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace,  convert(-1, short) as typlen,  convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 25 as typelem  FROM (SELECT 1) X" + //$NON-NLS-1$
-			"   union " + //$NON-NLS-1$
-			"SELECT 1028 as oid,  '_oid' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace,  convert(-1, short) as typlen,  convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 26 as typelem  FROM (SELECT 1) X" + //$NON-NLS-1$
-			"   union " + //$NON-NLS-1$
-			"SELECT 1014 as oid,  '_bpchar' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace,  convert(-1, short) as typlen,  convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 1042 as typelem  FROM (SELECT 1) X"+ //$NON-NLS-1$
-			"   union " + //$NON-NLS-1$
-			"SELECT 1015 as oid,  '_varchar' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace,  convert(-1, short) as typlen,  convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 1043 as typelem  FROM (SELECT 1) X"+ //$NON-NLS-1$
-			"   union " + //$NON-NLS-1$
-			"SELECT 1016 as oid,  '_int8' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace,  convert(-1, short) as typlen,  convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 20 as typelem  FROM (SELECT 1) X"+ //$NON-NLS-1$
-			"   union " + //$NON-NLS-1$
-			"SELECT 1021 as oid,  '_float4' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace,  convert(-1, short) as typlen,  convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 700 as typelem  FROM (SELECT 1) X"+ //$NON-NLS-1$
-			"   union " + //$NON-NLS-1$
-			"SELECT 1022 as oid,  '_float8' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace,  convert(-1, short) as typlen,  convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 701 as typelem  FROM (SELECT 1) X"+ //$NON-NLS-1$
-			"   union " + //$NON-NLS-1$
-			"SELECT 1115 as oid,  '_timestamp' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace,  convert(-1, short) as typlen,  convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 1114 as typelem  FROM (SELECT 1) X"+ //$NON-NLS-1$
-			"   union " + //$NON-NLS-1$
-			"SELECT 1182 as oid,  '_date' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace,  convert(-1, short) as typlen,  convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 1082 as typelem  FROM (SELECT 1) X"+ //$NON-NLS-1$
-			"   union " + //$NON-NLS-1$
-			"SELECT 1183 as oid,  '_time' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace,  convert(-1, short) as typlen,  convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 1083 as typelem  FROM (SELECT 1) X"+ //$NON-NLS-1$
-			"   union " + //$NON-NLS-1$
-			"SELECT 2287 as oid,  '_record' as typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace,  convert(-1, short) as typlen,  convert('b', char) as typtype, 0 as typbasetype, -1 as typtypmod, 0 as typrelid, 2249 as typelem  FROM (SELECT 1) X"; //$NON-NLS-1$
+			"select oid, typname, (SELECT OID FROM SYS.Schemas where Name = 'SYS') as typnamespace, typlen, typtype, typbasetype, typtypmod, typrelid, typelem from texttable('" + //$NON-NLS-1$
+			"16,boolean,1,b,0,-1,0,0\n" + //$NON-NLS-1$
+			"1043,string,-1,b,0,-1,0,0\n" + //$NON-NLS-1$
+			"25,text,-1,b,0,-1,0,0\n" + //$NON-NLS-1$
+			"1042,char,1,b,0,-1,0,0\n" + //$NON-NLS-1$
+			"21,short,2,b,0,-1,0,0\n" + //$NON-NLS-1$
+			"20,long,8,b,0,-1,0,0\n" + //$NON-NLS-1$
+			"23,integer,4,b,0,-1,0,0\n" + //$NON-NLS-1$
+			"26,oid,4,b,0,-1,0,0\n" + //$NON-NLS-1$
+			"700,float,4,b,0,-1,0,0\n" + //$NON-NLS-1$
+			"701,double,8,b,0,-1,0,0\n" + //$NON-NLS-1$
+			"705,unknown,-2,b,0,-1,0,0\n" + //$NON-NLS-1$
+			"1082,date,4,b,0,-1,0,0\n" + //$NON-NLS-1$
+			"1083,datetime,8,b,0,-1,0,0\n" + //$NON-NLS-1$
+			"1114,timestamp,8,b,0,-1,0,0\n" + //$NON-NLS-1$
+			"1700,decimal,-1,b,0,-1,0,0\n" + //$NON-NLS-1$
+			"142,xml,-1,b,0,-1,0,0\n" + //$NON-NLS-1$
+			"14939,lo,-1,b,0,-1,0,0\n" + //$NON-NLS-1$
+			"2278,void,4,p,0,-1,0,0\n" + //$NON-NLS-1$
+			"2249,record,-1,p,0,-1,0,0\n" + //$NON-NLS-1$
+			"30,oidvector,-1,b,0,-1,0,26\n" + //$NON-NLS-1$
+			"1000,_bool,-1,b,0,-1,0,16\n" + //$NON-NLS-1$
+			"1002,_char,-1,b,0,-1,0,18\n" + //$NON-NLS-1$
+			"1005,_int2,-1,b,0,-1,0,21\n" + //$NON-NLS-1$
+			"1007,_int4,-1,b,0,-1,0,23\n" + //$NON-NLS-1$
+			"1009,_text,-1,b,0,-1,0,25\n" + //$NON-NLS-1$
+			"1028,_oid,-1,b,0,-1,0,26\n" + //$NON-NLS-1$
+			"1014,_bpchar,-1,b,0,-1,0,1042\n" + //$NON-NLS-1$
+			"1015,_varchar,-1,b,0,-1,0,1043\n" + //$NON-NLS-1$
+			"1016,_int8,-1,b,0,-1,0,20\n" + //$NON-NLS-1$
+			"1021,_float4,-1,b,0,-1,0,700\n" + //$NON-NLS-1$
+			"1022,_float8,-1,b,0,-1,0,701\n" + //$NON-NLS-1$
+			"1115,_timestamp,-1,b,0,-1,0,1114\n" + //$NON-NLS-1$
+			"1182,_date,-1,b,0,-1,0,1082\n" + //$NON-NLS-1$
+			"1183,_time,-1,b,0,-1,0,1083\n" + //$NON-NLS-1$
+			"2287,_record,-1,b,0,-1,0,2249\n" + //$NON-NLS-1$
+			"2283,anyelement,4,p,0,-1,0,0" + //$NON-NLS-1$
+			"' columns oid integer, typname string, typlen short, typtype char, typbasetype integer, typtypmod integer, typrelid integer, typelem integer) AS t"; //$NON-NLS-1$
 		t.setSelectTransformation(transformation);			
 		return t;		
 	}
@@ -541,6 +507,7 @@
 		"WHEN (Name = 'time' ) THEN 'datetime' " + //$NON-NLS-1$
 		"WHEN (Name = 'biginteger' ) THEN 'decimal' " +//$NON-NLS-1$
 		"WHEN (Name = 'bigdecimal' ) THEN 'decimal' " +//$NON-NLS-1$
+		"WHEN (Name = 'object' ) THEN 'unknown' " +//$NON-NLS-1$
 		"ELSE Name END) as pg_name, Name, UID from SYS.DataTypes) as t ON t.pg_name = pt.typname";  //$NON-NLS-1$
 		t.setSelectTransformation(transformation);
 		t.setMaterialized(true);

Modified: branches/7.4.x/runtime/src/main/java/org/teiid/transport/PgBackendProtocol.java
===================================================================
--- branches/7.4.x/runtime/src/main/java/org/teiid/transport/PgBackendProtocol.java	2011-08-17 20:24:17 UTC (rev 3391)
+++ branches/7.4.x/runtime/src/main/java/org/teiid/transport/PgBackendProtocol.java	2011-08-17 20:28:59 UTC (rev 3392)
@@ -513,12 +513,14 @@
 			    		else {
 			    			first = false;
 			    		}
-			    		if (col.type == PG_TYPE_TEXTARRAY) {
-			    			escapeQuote(writer, o.toString());
+			    		if (o != null) {
+				    		if (col.type == PG_TYPE_TEXTARRAY) {
+				    			escapeQuote(writer, o.toString());
+				    		}
+				    		else {
+				    			writer.append(o.toString());
+				    		}
 			    		}
-			    		else {
-			    			writer.append(o.toString());
-			    		}
 			    	}
 			    	writer.append("}");
 		    	}
@@ -537,7 +539,9 @@
 			    		else {
 			    			first = false;
 			    		}
-			    		writer.append(o.toString());
+			    		if (o != null) {
+			    			writer.append(o.toString());
+			    		}
 			    	}
 		    	}	
 		    	}

Modified: branches/7.4.x/test-integration/common/src/test/resources/TestODBCSchema/test_PG_ATTRIBUTE.expected
===================================================================
--- branches/7.4.x/test-integration/common/src/test/resources/TestODBCSchema/test_PG_ATTRIBUTE.expected	2011-08-17 20:24:17 UTC (rev 3391)
+++ branches/7.4.x/test-integration/common/src/test/resources/TestODBCSchema/test_PG_ATTRIBUTE.expected	2011-08-17 20:28:59 UTC (rev 3392)
@@ -209,10 +209,10 @@
 207          25           proretset                                                          16           1       3       4            false       false         false    
 208          25           prorettype                                                         23           4       4       4            false       false         false    
 209          25           pronargs                                                           21           2       5       4            false       false         false    
-210          25           proargtypes                                                        <null>       <null>  6       4            false       false         false    
-211          25           proargnames                                                        <null>       <null>  7       4            false       false         false    
-212          25           proargmodes                                                        <null>       <null>  8       4            false       false         false    
-213          25           proallargtypes                                                     <null>       <null>  9       4            false       false         false    
+210          25           proargtypes                                                        705          -2      6       4            false       false         false    
+211          25           proargnames                                                        705          -2      7       4            false       false         false    
+212          25           proargmodes                                                        705          -2      8       4            false       false         false    
+213          25           proallargtypes                                                     705          -2      9       4            false       false         false    
 214          25           pronamespace                                                       23           4       10      4            false       false         false    
 215          26           oid                                                                23           4       1       4            false       false         false    
 216          26           tgconstrrelid                                                      23           4       2       4            false       false         false    
@@ -232,8 +232,8 @@
 230          28           encoding                                                           23           4       3       4            false       false         false    
 231          28           datlastsysoid                                                      23           4       4       4            false       false         false    
 232          28           datallowconn                                                       1042         1       5       4            false       false         false    
-233          28           datconfig                                                          <null>       <null>  6       4            false       false         false    
-234          28           datacl                                                             <null>       <null>  7       4            false       false         false    
+233          28           datconfig                                                          705          -2      6       4            false       false         false    
+234          28           datacl                                                             705          -2      7       4            false       false         false    
 235          28           datdba                                                             23           4       8       4            false       false         false    
 236          28           dattablespace                                                      23           4       9       4            false       false         false    
 237          29           oid                                                                23           4       1       4            false       false         false    

Modified: branches/7.4.x/test-integration/common/src/test/resources/TestODBCSchema/test_PG_TYPE.expected
===================================================================
--- branches/7.4.x/test-integration/common/src/test/resources/TestODBCSchema/test_PG_TYPE.expected	2011-08-17 20:24:17 UTC (rev 3391)
+++ branches/7.4.x/test-integration/common/src/test/resources/TestODBCSchema/test_PG_TYPE.expected	2011-08-17 20:28:59 UTC (rev 3392)
@@ -1,40 +1,42 @@
 integer      string                                                             integer       short   char     integer      integer      integer      integer    
 oid          typname                                                            typnamespace  typlen  typtype  typbasetype  typtypmod    typrelid     typelem    
 16           boolean                                                            3             1       b        0            -1           0            0          
+1043         string                                                             3             -1      b        0            -1           0            0          
+25           text                                                               3             -1      b        0            -1           0            0          
+1042         char                                                               3             1       b        0            -1           0            0          
+21           short                                                              3             2       b        0            -1           0            0          
 20           long                                                               3             8       b        0            -1           0            0          
-21           short                                                              3             2       b        0            -1           0            0          
 23           integer                                                            3             4       b        0            -1           0            0          
-25           text                                                               3             -1      b        0            -1           0            0          
 26           oid                                                                3             4       b        0            -1           0            0          
-30           oidvector                                                          3             -1      b        0            -1           0            26         
-142          xml                                                                3             -1      b        0            -1           0            0          
 700          float                                                              3             4       b        0            -1           0            0          
 701          double                                                             3             8       b        0            -1           0            0          
+705          unknown                                                            3             -2      b        0            -1           0            0          
+1082         date                                                               3             4       b        0            -1           0            0          
+1083         datetime                                                           3             8       b        0            -1           0            0          
+1114         timestamp                                                          3             8       b        0            -1           0            0          
+1700         decimal                                                            3             -1      b        0            -1           0            0          
+142          xml                                                                3             -1      b        0            -1           0            0          
+14939        lo                                                                 3             -1      b        0            -1           0            0          
+2278         void                                                               3             4       p        0            -1           0            0          
+2249         record                                                             3             -1      p        0            -1           0            0          
+30           oidvector                                                          3             -1      b        0            -1           0            26         
 1000         _bool                                                              3             -1      b        0            -1           0            16         
 1002         _char                                                              3             -1      b        0            -1           0            18         
 1005         _int2                                                              3             -1      b        0            -1           0            21         
 1007         _int4                                                              3             -1      b        0            -1           0            23         
 1009         _text                                                              3             -1      b        0            -1           0            25         
+1028         _oid                                                               3             -1      b        0            -1           0            26         
 1014         _bpchar                                                            3             -1      b        0            -1           0            1042       
 1015         _varchar                                                           3             -1      b        0            -1           0            1043       
 1016         _int8                                                              3             -1      b        0            -1           0            20         
 1021         _float4                                                            3             -1      b        0            -1           0            700        
 1022         _float8                                                            3             -1      b        0            -1           0            701        
-1028         _oid                                                               3             -1      b        0            -1           0            26         
-1042         char                                                               3             1       b        0            -1           0            0          
-1043         string                                                             3             -1      b        0            -1           0            0          
-1082         date                                                               3             4       b        0            -1           0            0          
-1083         datetime                                                           3             8       b        0            -1           0            0          
-1114         timestamp                                                          3             8       b        0            -1           0            0          
 1115         _timestamp                                                         3             -1      b        0            -1           0            1114       
 1182         _date                                                              3             -1      b        0            -1           0            1082       
 1183         _time                                                              3             -1      b        0            -1           0            1083       
-1700         decimal                                                            3             -1      b        0            -1           0            0          
-2249         record                                                             3             -1      p        0            -1           0            0          
-2278         void                                                               3             4       p        0            -1           0            0          
 2287         _record                                                            3             -1      b        0            -1           0            2249       
-14939        lo                                                                 3             -1      b        0            -1           0            0          
-Row Count : 34
+2283         anyelement                                                         3             4       p        0            -1           0            0          
+Row Count : 36
 getColumnName  getColumnType  getCatalogName  getColumnClassName  getColumnLabel  getColumnTypeName  getSchemaName  getTableName  getColumnDisplaySize  getPrecision  getScale  isAutoIncrement  isCaseSensitive  isCurrency  isDefinitelyWritable  isNullable  isReadOnly  isSearchable  isSigned  isWritable  
 oid            4              PartsSupplier   java.lang.Integer   oid             integer            pg_catalog     pg_type       11                    10            0         false            false            false       false                 2           true        true          false     false       
 typname        12             PartsSupplier   java.lang.String    typname         string             pg_catalog     pg_type       4000                  4000          0         false            false            false       false                 2           true        true          false     false       



More information about the teiid-commits mailing list