List:Commits« Previous MessageNext Message »
From:bdegtyariov Date:February 23 2006 6:17pm
Subject:Connector/ODBC 3.51 commit: r35 - myodbc3
View as plain text  
Modified:
   myodbc3/execute.c
Log:
Fixed the problem with numeric/decimal types. Performed more robust (15 digits instead of
17) rounding for the data types with string comparison operations (numeric/decimal).

Modified: myodbc3/execute.c
===================================================================
--- myodbc3/execute.c	2006-02-23 18:00:48 UTC (rev 34)
+++ myodbc3/execute.c	2006-02-23 18:17:44 UTC (rev 35)
@@ -397,11 +397,19 @@
             data= buff;
             break;
         case SQL_C_FLOAT:
-            sprintf(buff,"%.17e",*((float*) data));
+            if( param->SqlType != SQL_NUMERIC && param->SqlType !=
SQL_DECIMAL )
+                sprintf(buff,"%.17e",*((float*) data));
+			else
+                // We should perpare this data for string comparison
+                sprintf(buff,"%.15e",*((float*) data));
             length= strlen(data= buff);
             break;
         case SQL_C_DOUBLE:
-            sprintf(buff,"%.17e",*((double*) data));
+            if( param->SqlType != SQL_NUMERIC && param->SqlType !=
SQL_DECIMAL )
+                sprintf(buff,"%.17e",*((double*) data));
+			else
+                // We should perpare this data for string comparison
+                sprintf(buff,"%.15e",*((double*) data));
             length= strlen(data= buff);
             break;
         case SQL_C_DATE:

Thread
Connector/ODBC 3.51 commit: r35 - myodbc3bdegtyariov23 Feb