Repository: trafodion
Updated Branches:
  refs/heads/master 20724db55 -> 994e9eb03


when column is Numeric in the range of 1 to 18, the calculation of max value 
will skip


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

Branch: refs/heads/master
Commit: 4eb52c1387831da468aac2316b4bc7bef440b3b8
Parents: 6396326
Author: Weixin-Xu <[email protected]>
Authored: Thu Jul 5 14:58:36 2018 +0800
Committer: Weixin-Xu <[email protected]>
Committed: Mon Jul 16 11:53:48 2018 +0800

----------------------------------------------------------------------
 .../unixodbc/odbc/odbcclient/unixcli/cli/ctosqlconv.cpp   |  9 +++++----
 win-odbc64/odbcclient/drvr35/ctosqlconv.cpp               | 10 +++++-----
 2 files changed, 10 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafodion/blob/4eb52c13/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/ctosqlconv.cpp
----------------------------------------------------------------------
diff --git a/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/ctosqlconv.cpp 
b/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/ctosqlconv.cpp
index 9e7d328..8b1b1a7 100644
--- a/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/ctosqlconv.cpp
+++ b/core/conn/unixodbc/odbc/odbcclient/unixcli/cli/ctosqlconv.cpp
@@ -353,10 +353,6 @@ unsigned long ODBC::ConvertCToSQL(SQLINTEGER       
ODBCAppVersion,
 
        if (errorMsg)
                *errorMsg = '\0';
-       //if (targetPrecision < 19)
-    if(((SQLDataType == SQLTYPECODE_NUMERIC) && (targetPrecision <= 18)) ||
-       ((SQLDataType == SQLTYPECODE_NUMERIC_UNSIGNED) && (targetPrecision <= 
9)))
-       getMaxNum(targetPrecision, targetScale, integralMax, decimalMax);
 
        switch (ODBCDataType)
        {
@@ -850,6 +846,7 @@ unsigned long ODBC::ConvertCToSQL(SQLINTEGER        
ODBCAppVersion,
                                }
                                if(negative && targetUnsigned)
                                        return IDS_22_003_02;
+                getMaxNum(targetPrecision, targetScale, integralMax, 
decimalMax);
                                if ((integralPart < 0) || (integralPart > 
integralMax))
                                        return IDS_22_003;
                                decimalDigits = 0;
@@ -943,6 +940,7 @@ unsigned long ODBC::ConvertCToSQL(SQLINTEGER        
ODBCAppVersion,
                        }
                        if(negative && targetUnsigned)
                                return IDS_22_003_02;
+            getMaxNum(targetPrecision, targetScale, integralMax, decimalMax);
                        if ((integralPart < 0) || (integralPart > integralMax))
                                return IDS_22_003;
                        decimalDigits = 0;
@@ -1539,6 +1537,7 @@ unsigned long ODBC::ConvertCToSQL(SQLINTEGER      
ODBCAppVersion,
                                }
                                if(negative && targetUnsigned)
                                        return IDS_22_003_02;
+                getMaxNum(targetPrecision, targetScale, integralMax, 
decimalMax);
                                if ((integralPart < 0) || (integralPart > 
integralMax))
                                        return IDS_22_003;
                                decimalDigits = 0;
@@ -1595,6 +1594,7 @@ unsigned long ODBC::ConvertCToSQL(SQLINTEGER      
ODBCAppVersion,
                                }
                                        if(negative && targetUnsigned)
                                                return IDS_22_003_02;
+                getMaxNum(targetPrecision, targetScale, integralMax, 
decimalMax);
                                if ((integralPart < 0) || (integralPart > 
integralMax))
                                        return IDS_22_003;
                                decimalDigits = 0;
@@ -1704,6 +1704,7 @@ unsigned long ODBC::ConvertCToSQL(SQLINTEGER      
ODBCAppVersion,
                        integralPart = (integralPart < 0)? -integralPart: 
integralPart;
                        decimalPart = 0;
                        leadZeros = 0;
+            getMaxNum(targetPrecision, targetScale, integralMax, decimalMax);
                        if ( integralPart > integralMax )
                                return IDS_22_003;
 

http://git-wip-us.apache.org/repos/asf/trafodion/blob/4eb52c13/win-odbc64/odbcclient/drvr35/ctosqlconv.cpp
----------------------------------------------------------------------
diff --git a/win-odbc64/odbcclient/drvr35/ctosqlconv.cpp 
b/win-odbc64/odbcclient/drvr35/ctosqlconv.cpp
index 339368a..a6a5b7b 100644
--- a/win-odbc64/odbcclient/drvr35/ctosqlconv.cpp
+++ b/win-odbc64/odbcclient/drvr35/ctosqlconv.cpp
@@ -275,11 +275,6 @@ unsigned long ODBC::ConvertCToSQL(SQLINTEGER       
ODBCAppVersion,
 
        if (errorMsg)
                *errorMsg = '\0';
-       
-       //if (targetPrecision < 19)
-    if (((SQLDataType == SQLTYPECODE_NUMERIC) && (targetPrecision <= 18)) ||
-        ((SQLDataType == SQLTYPECODE_NUMERIC_UNSIGNED) && (targetPrecision <= 
9)))
-               getMaxNum(targetPrecision, targetScale, integralMax, 
decimalMax);
 
        switch (ODBCDataType)
        {
@@ -744,6 +739,7 @@ unsigned long ODBC::ConvertCToSQL(SQLINTEGER        
ODBCAppVersion,
                                }
                                if(negative && targetUnsigned)
                                        return IDS_22_003_02;
+                getMaxNum(targetPrecision, targetScale, integralMax, 
decimalMax);
                                if ((integralPart < 0) || (integralPart > 
integralMax))
                                        return IDS_22_003;
                                decimalDigits = 0;
@@ -836,6 +832,7 @@ unsigned long ODBC::ConvertCToSQL(SQLINTEGER        
ODBCAppVersion,
                        }
                        if(negative && targetUnsigned)
                                return IDS_22_003_02;
+            getMaxNum(targetPrecision, targetScale, integralMax, decimalMax);
                        if ((integralPart < 0) || (integralPart > integralMax)) 
                                return IDS_22_003;
                        decimalDigits = 0;
@@ -1423,6 +1420,7 @@ unsigned long ODBC::ConvertCToSQL(SQLINTEGER      
ODBCAppVersion,
                                }
                                if(negative && targetUnsigned)
                                        return IDS_22_003_02;
+                getMaxNum(targetPrecision, targetScale, integralMax, 
decimalMax);
                                if ((integralPart < 0) || (integralPart > 
integralMax))
                                        return IDS_22_003;
                                decimalDigits = 0;
@@ -1478,6 +1476,7 @@ unsigned long ODBC::ConvertCToSQL(SQLINTEGER      
ODBCAppVersion,
                                }
                                        if(negative && targetUnsigned)
                                                return IDS_22_003_02;
+                getMaxNum(targetPrecision, targetScale, integralMax, 
decimalMax);
                                if ((integralPart < 0) || (integralPart > 
integralMax)) 
                                        return IDS_22_003;
                                decimalDigits = 0;
@@ -1586,6 +1585,7 @@ unsigned long ODBC::ConvertCToSQL(SQLINTEGER      
ODBCAppVersion,
                        integralPart = (integralPart < 0)? -integralPart: 
integralPart;
                        decimalPart = 0;
                        leadZeros = 0;
+            getMaxNum(targetPrecision, targetScale, integralMax, decimalMax);
                        if ( integralPart > integralMax )
                                return IDS_22_003;
 

Reply via email to