List:MySQL ODBC« Previous MessageNext Message »
From:Dmitry Potapov Date:April 30 1999 7:50pm
Subject:Bug in myodbc driver
View as plain text  
I have discovered bug in myodbc 2.50.22.
When I have bind large number (>1e128) by using SQLBindParameter,
this cause Segmentation fault at execution query by using SQLExecute.

The reason of this bug is that size of buffer is not enought to print to
this buffer so large number by using %f format. 

The following patch solve this problem:

--- execute.c.orig      Thu Nov 12 22:26:00 1998
+++ execute.c   Thu Apr 29 22:08:10 1999
@@ -252,11 +252,11 @@
     data=buff;
     break;
   case SQL_C_FLOAT:
-    sprintf(buff,"%f",*((float*) data));
+    sprintf(buff,"%.17e",*((float*) data));
     length=strlen(data=buff);
     break;
   case SQL_C_DOUBLE:
-    sprintf(buff,"%f",*((double*) data));
+    sprintf(buff,"%.17e",*((double*) data));
     length=strlen(data=buff);
     break;
   case SQL_C_DATE:



Dmitry Potapov


Thread
Bug in myodbc driverDmitry Potapov30 Apr
  • Bug in myodbc driverMichael Widenius2 May