trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sand...@apache.org
Subject [1/2] incubator-trafodion git commit: Fix JIRA306
Date Thu, 07 Jul 2016 18:09:37 GMT
Repository: incubator-trafodion
Updated Branches:
  refs/heads/master cc511501a -> 6a1de931e


Fix JIRA306


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/a06dfd8f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/a06dfd8f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/a06dfd8f

Branch: refs/heads/master
Commit: a06dfd8f1fda1a25d9300e3efb215bb06dc59015
Parents: cc51150
Author: ryzuo <joshuamurdoc@gmail.com>
Authored: Tue Jul 5 07:38:31 2016 +0000
Committer: ryzuo <joshuamurdoc@gmail.com>
Committed: Thu Jul 7 07:53:26 2016 +0000

----------------------------------------------------------------------
 .../trafodion/jdbc/t4/T4DatabaseMetaData.java   |   2 +-
 .../odbc/src/odbc/nsksrvrcore/srvrothers.cpp    | 168 +++++++++++--------
 2 files changed, 100 insertions(+), 70 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a06dfd8f/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4DatabaseMetaData.java
----------------------------------------------------------------------
diff --git a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4DatabaseMetaData.java
b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4DatabaseMetaData.java
index c8b4677..4a12447 100644
--- a/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4DatabaseMetaData.java
+++ b/core/conn/jdbcT4/src/main/java/org/trafodion/jdbc/t4/T4DatabaseMetaData.java
@@ -4613,7 +4613,7 @@ public class T4DatabaseMetaData extends TrafT4Handle implements java.sql.Databas
 		connection_.isConnectionOpen();
 
 		getSQLCatalogsInfo(connection_.getServerHandle(), // Server Handle
-				SQL_API_SQLGETTYPEINFO, // catalogAPI
+				SQL_API_SQLGETTYPEINFO_JDBC, // catalogAPI
 				"", // catalog
 				"", // schema
 				"", // table name

http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/a06dfd8f/core/conn/odbc/src/odbc/nsksrvrcore/srvrothers.cpp
----------------------------------------------------------------------
diff --git a/core/conn/odbc/src/odbc/nsksrvrcore/srvrothers.cpp b/core/conn/odbc/src/odbc/nsksrvrcore/srvrothers.cpp
index e365ddc..3458251 100644
--- a/core/conn/odbc/src/odbc/nsksrvrcore/srvrothers.cpp
+++ b/core/conn/odbc/src/odbc/nsksrvrcore/srvrothers.cpp
@@ -142,6 +142,7 @@ SMD_QUERY_TABLE tranQueryTable[] = {
 
 #define SQL_API_JDBC					9999
 #define SQL_API_SQLTABLES_JDBC			SQL_API_SQLTABLES + SQL_API_JDBC
+#define SQL_API_SQLGETTYPEINFO_JDBC		SQL_API_SQLGETTYPEINFO + SQL_API_JDBC
 #define SQL_API_SQLCOLUMNS_JDBC			SQL_API_SQLCOLUMNS + SQL_API_JDBC
 #define SQL_API_SQLSPECIALCOLUMNS_JDBC	SQL_API_SQLSPECIALCOLUMNS + SQL_API_JDBC
 // The value represents SQL version, MXCS module major version and MXCS module minor version.
@@ -4503,78 +4504,107 @@ odbc_SQLSvc_GetSQLCatalogs_sme_(
                        }
                        break;
                 case SQL_API_SQLGETTYPEINFO :
-                        // strcpy((char *)catStmtLabel, "SQL_GETTYPEINFO_UNICODE_Q1");
-                       snprintf(CatalogQuery,sizeof(CatalogQuery),
-                               "select distinct TYPE_NAME TYPE_NAME,"
-                               "DATA_TYPE DATA_TYPE,PREC COLUMN_SIZE,"
-                               "LITERAL_PREFIX LITERAL_PREFIX,"
-                               "LITERAL_SUFFIX LITERAL_SUFFIX,"
-                               "CREATE_PARAMS CREATE_PARAMS,"
-                               "IS_NULLABLE NULLABLE,"
-                               "CASE_SENSITIVE CASE_SENSITIVE,"
-                               "SEARCHABLE SEARCHABLE,"
-                               "UNSIGNED_ATTRIBUTE UNSIGNED_ATTRIBUTE,"
-                               "FIXED_PREC_SCALE FIXED_PREC_SCALE,"
-                               "AUTO_UNIQUE_VALUE AUTO_UNIQUE_VALUE,"
-                               "LOCAL_TYPE_NAME LOCAL_TYPE_NAME,"
-                               "MINIMUM_SCALE MINIMUM_SCALE,"
-                               "MAXIMUM_SCALE MAXIMUM_SCALE,"
-                               "SQL_DATA_TYPE SQL_DATA_TYPE,"
-                               "SQL_DATETIME_SUB SQL_DATETIME_SUB,"
-                               "NUM_PREC_RADIX NUM_PREC_RADIX,"
-                               "INTERVAL_PRECISION INTERVAL_PRECISION "
-                               " from "
-                               " (VALUES "
-                               "(cast('BIGINT' as varchar(128)),cast(-5 as smallint), cast(19
as integer), cast (NULL as varchar(128)), cast (NULL as varchar(128)),"
-                               "cast (NULL as varchar(128)), cast(1 as smallint), cast(0
as smallint), cast(2 as smallint) , cast(0 as smallint), cast(0 as smallint),"
-                               "cast(0 as smallint), cast('LARGEINT' as varchar(128)), cast(NULL
as smallint), cast(NULL as smallint), cast('LARGEINT' as varchar(128)),"
-                               "cast(10 as smallint), cast(19 as integer), cast(20 as integer),
cast(-402 as smallint), cast(NULL as smallint), cast(NULL as smallint),"
-                               "cast(0 as smallint), cast(0 as smallint), cast(3 as smallint),
cast(0 as smallint)),"
-                               "('BIGINT SIGNED', -5, 19, NULL, NULL, NULL, 1, 0, 2, 0, 0,
0, 'LARGEINT', NULL, NULL, 'SIGNED LARGEINT', 10, 19, 20, -402, NULL, NULL, 0, 0, 3, 0),"
-                               "('CHAR', 1, 32000, '''', '''', 'max length', 1, 1, 3, NULL,
0, NULL, 'CHARACTER', NULL, NULL, 'CHARACTER', NULL, -1, -1, 1, NULL, NULL, 0, 0, 3, 0),"
-                               "('DATE', 9, 10, '{d ''', '''}', NULL, 1, 0, 2, NULL, 0, NULL,
'DATE', NULL, NULL, 'DATE', NULL, 10, 6, 9, 1, NULL, 1, 3, 3, 0),"
-                               "('DECIMAL', 3, 18, NULL, NULL, 'precision,scale', 1, 0, 2,
0, 0, 0, 'DECIMAL', 0, 18, 'DECIMAL', 10, -2, -3, 3, NULL, NULL, 0, 0, 3, 0),"
-                               "('DECIMAL UNSIGNED', 3, 18, NULL, NULL, 'precision,scale',
1, 0, 2, 1, 0, 0, 'DECIMAL', 0, 18, 'UNSIGNED DECIMAL', 10, -2, -3, -301, NULL, NULL, 0, 0,
3, 0),"
-                               "('DOUBLE PRECISION', 8, 15, NULL, NULL, NULL, 1, 0, 2, 0,
0, 0, 'DOUBLE', NULL, NULL, 'DOUBLE PRECISION', 2, 54, -1, 8, NULL, NULL, 0, 0, 3, 0),"
-                               "('DOUBLE PRECISION', 8, 15, NULL, NULL, NULL, 1, 0, 2, 0,
0, 0, 'DOUBLE', NULL, NULL, 'DOUBLE', 2, 54, -1, 8, NULL, NULL, 0, 0, 3, 0),"
-                               "('FLOAT', 6, 15, NULL, NULL, NULL, 1, 0, 2, 0, 0, 0, 'FLOAT',
NULL, NULL, 'FLOAT', 2, -2, -1, 6, NULL, NULL, 0, 0, 3, 0),"
-                               "('INTEGER', 4, 10, NULL, NULL, NULL, 1, 0, 2, 0, 0, 0, 'INTEGER',
NULL, NULL, 'INTEGER', 10, 10, -1, 4, NULL, NULL, 0, 0, 3, 0),"
-                               "('INTEGER UNSIGNED', 4, 10, NULL, NULL, NULL, 1, 0, 2, 1,
0, 0, 'INTEGER', NULL, NULL, 'UNSIGNED INTEGER', 10, 10, -1, -401, NULL, NULL, 0, 0, 3, 0),"
-                               "('INTERVAL', 113, 0, '{INTERVAL ''', ''' MINUTE TO SECOND}',
NULL, 1, 0, 2, 0, 0, NULL, 'INTERVAL', 0, 0, 'INTERVAL', NULL, 3, 34, 100, 13, 2, 5, 6, 3,
0),"
-                               "('INTERVAL', 105, 0, '{INTERVAL ''', ''' MINUTE}', NULL,
1, 0, 2, 0, 0, NULL, 'INTERVAL', 0, 0, 'INTERVAL', NULL, 0, 34, 100, 5, 2, 5, 5, 3, 0),"
-                               "('INTERVAL', 101, 0, '{INTERVAL ''', ''' YEAR}', NULL, 1,
0, 2, 0, 0, NULL, 'INTERVAL', 0, 0, 'INTERVAL', NULL, 0, 34, 100, 1, 2, 1, 1, 3, 0),"
-                               "('INTERVAL', 106, 0, '{INTERVAL ''', ''' SECOND}', NULL,
1, 0, 2, 0, 0, NULL, 'INTERVAL', 0, 0, 'INTERVAL', NULL, 0, 34, 100, 6, 2, 6, 6, 3, 0),"
-                               "('INTERVAL', 104, 0, '{INTERVAL ''', ''' HOUR}', NULL, 1,
0, 2, 0, 0, NULL, 'INTERVAL', 0, 0, 'INTERVAL', NULL, 0, 34, 100, 4, 2, 4, 4, 3, 0),"
-                               "('INTERVAL', 107, 0, '{INTERVAL ''', ''' YEAR TO MONTH}',
NULL, 1, 0, 2, 0, 0, NULL, 'INTERVAL', 0, 0, 'INTERVAL', NULL, 3, 34, 100, 7, 2, 1, 2, 3,
0),"
-                               "('INTERVAL', 108, 0, '{INTERVAL ''', ''' DAY TO HOUR}', NULL,
1, 0, 2, 0, 0, NULL, 'INTERVAL', 0, 0, 'INTERVAL', NULL, 3, 34, 100, 8, 2, 3, 4, 3, 0),"
-                               "('INTERVAL', 102, 0, '{INTERVAL ''', ''' MONTH}', NULL, 1,
0, 2, 0, 0, NULL, 'INTERVAL', 0, 0, 'INTERVAL', NULL, 0, 34, 100, 2, 2, 2, 2, 3, 0),"
-                               "('INTERVAL', 111, 0, '{INTERVAL ''', ''' HOUR TO MINUTE}',
NULL, 1, 0, 2, 0, 0, NULL, 'INTERVAL', 0, 0, 'INTERVAL', NULL, 3, 34, 100, 11, 2, 4, 5, 3,
0),"
-                               "('INTERVAL', 112, 0, '{INTERVAL ''', ''' HOUR TO SECOND}',
NULL, 1, 0, 2, 0, 0, NULL, 'INTERVAL', 0, 0, 'INTERVAL', NULL, 6, 34, 100, 12, 2, 4, 6, 3,
0),"
-                               "('INTERVAL', 110, 0, '{INTERVAL ''', ''' DAY TO SECOND}',
NULL, 1, 0, 2, 0, 0, NULL, 'INTERVAL', 0, 0, 'INTERVAL', NULL, 9, 34, 100, 10, 2, 3, 6, 3,
0),"
-                               "('INTERVAL', 109, 0, '{INTERVAL ''', ''' DAY TO MINUTE}',
NULL, 1, 0, 2, 0, 0, NULL, 'INTERVAL', 0, 0, 'INTERVAL', NULL, 6, 34, 100, 9, 2, 3, 5, 3,
0),"
-                               "('INTERVAL', 103, 0, '{INTERVAL ''', ''' DAY}', NULL, 1,
0, 2, 0, 0, NULL, 'INTERVAL', 0, 0, 'INTERVAL', NULL, 0, 34, 100, 3, 2, 3, 3, 3, 0),"
-                               "('NUMERIC', 2, 128, NULL, NULL, 'precision,scale', 1, 0,
2, 0, 0, 0, 'NUMERIC', 0, 128, 'NUMERIC', 10, -2, -3, 2, NULL, NULL, 0, 0, 3, 0),"
-                               "('NUMERIC UNSIGNED', 2, 128, NULL, NULL, 'precision,scale',
1, 0, 2, 1, 0, 0, 'NUMERIC', 0, 128, 'UNSIGNED NUMERIC', 10, -2, -3, 2, NULL, NULL, 0, 0,
3, 0),"
-                               "('REAL', 7, 7, NULL, NULL, NULL, 1, 0, 2, 0, 0, 0, 'REAL',
NULL, NULL, 'REAL', 2, 22, -1, 7, NULL, NULL, 0, 0, 3, 0),"
-                               "('SMALLINT', 5, 5, NULL, NULL, NULL, 1, 0, 2, 0, 0, 0, 'SMALLINT',
NULL, NULL, 'SMALLINT', 10, 5, -1, 5, NULL, NULL, 0, 0, 3, 0),"
-                               "('SMALLINT UNSIGNED', 5, 5, NULL, NULL, NULL, 1, 0, 2, 1,
0, 0, 'SMALLINT', NULL, NULL, 'UNSIGNED SMALLINT', 10, 5, -1, -502, NULL, NULL, 0, 0, 3, 0),"
-                               "('TIME', 10, 8, '{t ''', '''}', NULL, 1, 0, 2, NULL, 0, NULL,
'TIME', NULL, NULL, 'TIME', NULL, 8, 6, 9, 2, NULL, 4, 6, 3, 0),"
-                               "('TIMESTAMP', 11, 26, '{ts ''', '''}', NULL, 1, 0, 2, NULL,
0, NULL, 'TIMESTAMP', 0, 6, 'TIMESTAMP', NULL, 19, 16, 9, 3, NULL, 1, 6, 3, 0),"
-                               "('VARCHAR', 12, 32000, '''', '''', 'max length', 1, 1, 3,
NULL, 0, NULL, 'VARCHAR', NULL, NULL, 'VARCHAR', NULL, -1, -1, 12, NULL, NULL, 0, 0, 3, 0)"
-                               " ) "
-                               " dt(\"TYPE_NAME\", \"DATA_TYPE\", \"PREC\", \"LITERAL_PREFIX\",
\"LITERAL_SUFFIX\", \"CREATE_PARAMS\", \"IS_NULLABLE\", \"CASE_SENSITIVE\", \"SEARCHABLE\","
-                               "\"UNSIGNED_ATTRIBUTE\", \"FIXED_PREC_SCALE\", \"AUTO_UNIQUE_VALUE\",
\"LOCAL_TYPE_NAME\", \"MINIMUM_SCALE\", \"MAXIMUM_SCALE\", \"SQL_TYPE_NAME\","
-                               "\"NUM_PREC_RADIX\", \"USEPRECISION\", \"USELENGTH\", \"SQL_DATA_TYPE\",
\"SQL_DATETIME_SUB\", \"INTERVAL_PRECISION\", \"DATETIMESTARTFIELD\","
+                case SQL_API_SQLGETTYPEINFO_JDBC :
+                     {
+                         SQLSMALLINT SqlTypeCode_Date;
+                         SQLSMALLINT SqlTypeCode_Time;
+                         SQLSMALLINT SqlTypeCode_TimeStamp;
+                         char condExpression[20] = {0};
+                        
+                         if(APIType == SQL_API_SQLGETTYPEINFO_JDBC)
+                         {
+                             SqlTypeCode_Date = 91;
+                             SqlTypeCode_Time = 92;
+                             SqlTypeCode_TimeStamp = 93;
+                         }
+                         else
+                         {
+                             SqlTypeCode_Date = SQL_DATE;
+                             SqlTypeCode_Time = SQL_TIME;
+                             SqlTypeCode_TimeStamp = SQL_TIMESTAMP;
+                         }
+
+                         if(sqlType == SQL_ALL_TYPES)
+                             sprintf(condExpression, "1=1");
+                         else
+                             sprintf(condExpression, "DATA_TYPE=%d", sqlType);
+
+                         snprintf(CatalogQuery,sizeof(CatalogQuery),
+                                 "select distinct TYPE_NAME TYPE_NAME,"
+                                 "DATA_TYPE DATA_TYPE,PREC COLUMN_SIZE,"
+                                 "LITERAL_PREFIX LITERAL_PREFIX,"
+                                 "LITERAL_SUFFIX LITERAL_SUFFIX,"
+                                 "CREATE_PARAMS CREATE_PARAMS,"
+                                 "IS_NULLABLE NULLABLE,"
+                                 "CASE_SENSITIVE CASE_SENSITIVE,"
+                                 "SEARCHABLE SEARCHABLE,"
+                                 "UNSIGNED_ATTRIBUTE UNSIGNED_ATTRIBUTE,"
+                                 "FIXED_PREC_SCALE FIXED_PREC_SCALE,"
+                                 "AUTO_UNIQUE_VALUE AUTO_UNIQUE_VALUE,"
+                                 "LOCAL_TYPE_NAME LOCAL_TYPE_NAME,"
+                                 "MINIMUM_SCALE MINIMUM_SCALE,"
+                                 "MAXIMUM_SCALE MAXIMUM_SCALE,"
+                                 "SQL_DATA_TYPE SQL_DATA_TYPE,"
+                                 "SQL_DATETIME_SUB SQL_DATETIME_SUB,"
+                                 "NUM_PREC_RADIX NUM_PREC_RADIX,"
+                                 "INTERVAL_PRECISION INTERVAL_PRECISION "
+                                 " from "
+                                 " (VALUES "
+                                 "(cast('BIGINT' as varchar(128)),cast(-5 as smallint), cast(19
as integer), cast (NULL as varchar(128)), cast (NULL as varchar(128)),"
+                                 "cast (NULL as varchar(128)), cast(1 as smallint), cast(0
as smallint), cast(2 as smallint) , cast(0 as smallint), cast(0 as smallint),"
+                                 "cast(0 as smallint), cast('LARGEINT' as varchar(128)),
cast(NULL as smallint), cast(NULL as smallint), cast('LARGEINT' as varchar(128)),"
+                                 "cast(10 as smallint), cast(19 as integer), cast(20 as integer),
cast(-402 as smallint), cast(NULL as smallint), cast(NULL as smallint),"
+                                 "cast(0 as smallint), cast(0 as smallint), cast(3 as smallint),
cast(0 as smallint)),"
+                                 "('BIGINT SIGNED', -5, 19, NULL, NULL, NULL, 1, 0, 2, 0,
0, 0, 'LARGEINT', NULL, NULL, 'SIGNED LARGEINT', 10, 19, 20, -402, NULL, NULL, 0, 0, 3, 0),"
+                                 "('CHAR', 1, 32000, '''', '''', 'max length', 1, 1, 3, NULL,
0, NULL, 'CHARACTER', NULL, NULL, 'CHARACTER', NULL, -1, -1, 1, NULL, NULL, 0, 0, 3, 0),"
+                                 "('DATE', %d, 10, '{d ''', '''}', NULL, 1, 0, 2, NULL, 0,
NULL, 'DATE', NULL, NULL, 'DATE', NULL, 10, 6, 9, 1, NULL, 1, 3, 3, 0),"
+                                 "('DECIMAL', 3, 18, NULL, NULL, 'precision,scale', 1, 0,
2, 0, 0, 0, 'DECIMAL', 0, 18, 'DECIMAL', 10, -2, -3, 3, NULL, NULL, 0, 0, 3, 0),"
+                                 "('DECIMAL SIGNED', 3, 18, NULL, NULL, 'precision,scale',
1, 0, 2, 0, 0, 0, 'DECIMAL', 0, 18, 'SIGNED DECIMAL', 10, -2, -3, 3, NULL, NULL, 0, 0, 3,
0),"
+                                 "('DECIMAL UNSIGNED', 3, 18, NULL, NULL, 'precision,scale',
1, 0, 2, 1, 0, 0, 'DECIMAL', 0, 18, 'UNSIGNED DECIMAL', 10, -2, -3, -301, NULL, NULL, 0, 0,
3, 0),"
+                                 "('DOUBLE PRECISION', 8, 15, NULL, NULL, NULL, 1, 0, 2,
0, 0, 0, 'DOUBLE', NULL, NULL, 'DOUBLE PRECISION', 2, 54, -1, 8, NULL, NULL, 0, 0, 3, 0),"
+                                 "('DOUBLE PRECISION', 8, 15, NULL, NULL, NULL, 1, 0, 2,
0, 0, 0, 'DOUBLE', NULL, NULL, 'DOUBLE', 2, 54, -1, 8, NULL, NULL, 0, 0, 3, 0),"
+                                 "('FLOAT', 6, 15, NULL, NULL, NULL, 1, 0, 2, 0, 0, 0, 'FLOAT',
NULL, NULL, 'FLOAT', 2, -2, -1, 6, NULL, NULL, 0, 0, 3, 0),"
+                                 "('INTEGER', 4, 10, NULL, NULL, NULL, 1, 0, 2, 0, 0, 0,
'INTEGER', NULL, NULL, 'INTEGER', 10, 10, -1, 4, NULL, NULL, 0, 0, 3, 0),"
+                                 "('INTEGER SIGNED', 4, 10, NULL, NULL, NULL, 1, 0, 2, 0,
0, 0, 'INTEGER', NULL, NULL, 'SIGNED INTEGER', 10, 10, -1, 4, NULL, NULL, 0, 0, 3, 0),"
+                                 "('INTEGER UNSIGNED', 4, 10, NULL, NULL, NULL, 1, 0, 2,
1, 0, 0, 'INTEGER', NULL, NULL, 'UNSIGNED INTEGER', 10, 10, -1, -401, NULL, NULL, 0, 0, 3,
0),"
+                                 "('INTERVAL', 113, 0, '{INTERVAL ''', ''' MINUTE TO SECOND}',
NULL, 1, 0, 2, 0, 0, NULL, 'INTERVAL', 0, 0, 'INTERVAL', NULL, 3, 34, 100, 13, 2, 5, 6, 3,
0),"
+                                 "('INTERVAL', 105, 0, '{INTERVAL ''', ''' MINUTE}', NULL,
1, 0, 2, 0, 0, NULL, 'INTERVAL', 0, 0, 'INTERVAL', NULL, 0, 34, 100, 5, 2, 5, 5, 3, 0),"
+                                 "('INTERVAL', 101, 0, '{INTERVAL ''', ''' YEAR}', NULL,
1, 0, 2, 0, 0, NULL, 'INTERVAL', 0, 0, 'INTERVAL', NULL, 0, 34, 100, 1, 2, 1, 1, 3, 0),"
+                                 "('INTERVAL', 106, 0, '{INTERVAL ''', ''' SECOND}', NULL,
1, 0, 2, 0, 0, NULL, 'INTERVAL', 0, 0, 'INTERVAL', NULL, 0, 34, 100, 6, 2, 6, 6, 3, 0),"
+                                 "('INTERVAL', 104, 0, '{INTERVAL ''', ''' HOUR}', NULL,
1, 0, 2, 0, 0, NULL, 'INTERVAL', 0, 0, 'INTERVAL', NULL, 0, 34, 100, 4, 2, 4, 4, 3, 0),"
+                                 "('INTERVAL', 107, 0, '{INTERVAL ''', ''' YEAR TO MONTH}',
NULL, 1, 0, 2, 0, 0, NULL, 'INTERVAL', 0, 0, 'INTERVAL', NULL, 3, 34, 100, 7, 2, 1, 2, 3,
0),"
+                                 "('INTERVAL', 108, 0, '{INTERVAL ''', ''' DAY TO HOUR}',
NULL, 1, 0, 2, 0, 0, NULL, 'INTERVAL', 0, 0, 'INTERVAL', NULL, 3, 34, 100, 8, 2, 3, 4, 3,
0),"
+                                 "('INTERVAL', 102, 0, '{INTERVAL ''', ''' MONTH}', NULL,
1, 0, 2, 0, 0, NULL, 'INTERVAL', 0, 0, 'INTERVAL', NULL, 0, 34, 100, 2, 2, 2, 2, 3, 0),"
+                                 "('INTERVAL', 111, 0, '{INTERVAL ''', ''' HOUR TO MINUTE}',
NULL, 1, 0, 2, 0, 0, NULL, 'INTERVAL', 0, 0, 'INTERVAL', NULL, 3, 34, 100, 11, 2, 4, 5, 3,
0),"
+                                 "('INTERVAL', 112, 0, '{INTERVAL ''', ''' HOUR TO SECOND}',
NULL, 1, 0, 2, 0, 0, NULL, 'INTERVAL', 0, 0, 'INTERVAL', NULL, 6, 34, 100, 12, 2, 4, 6, 3,
0),"
+                                 "('INTERVAL', 110, 0, '{INTERVAL ''', ''' DAY TO SECOND}',
NULL, 1, 0, 2, 0, 0, NULL, 'INTERVAL', 0, 0, 'INTERVAL', NULL, 9, 34, 100, 10, 2, 3, 6, 3,
0),"
+                                 "('INTERVAL', 109, 0, '{INTERVAL ''', ''' DAY TO MINUTE}',
NULL, 1, 0, 2, 0, 0, NULL, 'INTERVAL', 0, 0, 'INTERVAL', NULL, 6, 34, 100, 9, 2, 3, 5, 3,
0),"
+                                 "('INTERVAL', 103, 0, '{INTERVAL ''', ''' DAY}', NULL, 1,
0, 2, 0, 0, NULL, 'INTERVAL', 0, 0, 'INTERVAL', NULL, 0, 34, 100, 3, 2, 3, 3, 3, 0),"
+                                 "('NUMERIC', 2, 128, NULL, NULL, 'precision,scale', 1, 0,
2, 0, 0, 0, 'NUMERIC', 0, 128, 'NUMERIC', 10, -2, -3, 2, NULL, NULL, 0, 0, 3, 0),"
+                                 "('NUMERIC SIGNED', 2, 128, NULL, NULL, 'precision,scale',
1, 0, 2, 0, 0, 0, 'NUMERIC', 0, 128, 'SIGNED NUMERIC', 10, -2, -3, 2, NULL, NULL, 0, 0, 3,
0),"
+                                 "('NUMERIC UNSIGNED', 2, 128, NULL, NULL, 'precision,scale',
1, 0, 2, 1, 0, 0, 'NUMERIC', 0, 128, 'UNSIGNED NUMERIC', 10, -2, -3, 2, NULL, NULL, 0, 0,
3, 0),"
+                                 "('REAL', 7, 7, NULL, NULL, NULL, 1, 0, 2, 0, 0, 0, 'REAL',
NULL, NULL, 'REAL', 2, 22, -1, 7, NULL, NULL, 0, 0, 3, 0),"
+                                 "('SMALLINT', 5, 5, NULL, NULL, NULL, 1, 0, 2, 0, 0, 0,
'SMALLINT', NULL, NULL, 'SMALLINT', 10, 5, -1, 5, NULL, NULL, 0, 0, 3, 0),"
+                                 "('SMALLINT SIGNED', 5, 5, NULL, NULL, NULL, 1, 0, 2, 0,
0, 0, 'SMALLINT', NULL, NULL, 'SIGNED SMALLINT', 10, 5, -1, 5, NULL, NULL, 0, 0, 3, 0),"
+                                 "('SMALLINT UNSIGNED', 5, 5, NULL, NULL, NULL, 1, 0, 2,
1, 0, 0, 'SMALLINT', NULL, NULL, 'UNSIGNED SMALLINT', 10, 5, -1, -502, NULL, NULL, 0, 0, 3,
0),"
+                                 "('TIME', %d, 8, '{t ''', '''}', NULL, 1, 0, 2, NULL, 0,
NULL, 'TIME', NULL, NULL, 'TIME', NULL, 8, 6, 9, 2, NULL, 4, 6, 3, 0),"
+                                 "('TIMESTAMP', %d, 26, '{ts ''', '''}', NULL, 1, 0, 2, NULL,
0, NULL, 'TIMESTAMP', 0, 6, 'TIMESTAMP', NULL, 19, 16, 9, 3, NULL, 1, 6, 3, 0),"
+                                 "('VARCHAR', 12, 32000, '''', '''', 'max length', 1, 1,
3, NULL, 0, NULL, 'VARCHAR', NULL, NULL, 'VARCHAR', NULL, -1, -1, 12, NULL, NULL, 0, 0, 3,
0)"
+                                 " ) "
+                                 " dt(\"TYPE_NAME\", \"DATA_TYPE\", \"PREC\", \"LITERAL_PREFIX\",
\"LITERAL_SUFFIX\", \"CREATE_PARAMS\", \"IS_NULLABLE\", \"CASE_SENSITIVE\", \"SEARCHABLE\","
+                                 "\"UNSIGNED_ATTRIBUTE\", \"FIXED_PREC_SCALE\", \"AUTO_UNIQUE_VALUE\",
\"LOCAL_TYPE_NAME\", \"MINIMUM_SCALE\", \"MAXIMUM_SCALE\", \"SQL_TYPE_NAME\","
+                                 "\"NUM_PREC_RADIX\", \"USEPRECISION\", \"USELENGTH\", \"SQL_DATA_TYPE\",
\"SQL_DATETIME_SUB\", \"INTERVAL_PRECISION\", \"DATETIMESTARTFIELD\","
                                "\"DATETIMEENDFIELD\", \"APPLICATION_VERSION\", \"TRANSLATION_ID\")"
-                               " WHERE DATA_TYPE=%d" 
-                               " ORDER BY 2,1 FOR READ UNCOMMITTED ACCESS ;", sqlType);
-                       break;
+                               " WHERE %s" 
+                               " ORDER BY 2,1 FOR READ UNCOMMITTED ACCESS ;", SqlTypeCode_Date,
SqlTypeCode_Time, SqlTypeCode_TimeStamp, condExpression);
+                           break;
+                     }
 
-                case SQL_API_SQLPROCEDURES :
-                       //	strcpy((char *)catStmtLabel, "SQL_PROCEDURES_ANSI_Q4");
+		case SQL_API_SQLPROCEDURES :
+		//	strcpy((char *)catStmtLabel, "SQL_PROCEDURES_ANSI_Q4");
 
-                       if (!checkIfWildCard(catalogNm, expCatalogNm) && !metadataId)
-                       {
+			if (!checkIfWildCard(catalogNm, expCatalogNm) && !metadataId)
+			{
 				exception_->exception_nr = odbc_SQLSvc_GetSQLCatalogs_ParamError_exn_;
 				exception_->u.ParamError.ParamDesc = SQLSVC_EXCEPTION_WILDCARD_NOT_SUPPORTED;
 				goto MapException;


Mime
View raw message