>>>>> "Dmitry" == Dmitry Potapov <dpotapov@stripped> writes:
Dmitry> I have discovered bug in myodbc 2.50.22.
Dmitry> When I have bind large number (>1e128) by using SQLBindParameter,
Dmitry> this cause Segmentation fault at execution query by using SQLExecute.
Dmitry> The reason of this bug is that size of buffer is not enought to print to
Dmitry> this buffer so large number by using %f format.
Dmitry> The following patch solve this problem:
Dmitry> --- execute.c.orig Thu Nov 12 22:26:00 1998
Dmitry> +++ execute.c Thu Apr 29 22:08:10 1999
Dmitry> @@ -252,11 +252,11 @@
Dmitry> data=buff;
Dmitry> break;
Dmitry> case SQL_C_FLOAT:
Dmitry> - sprintf(buff,"%f",*((float*) data));
Dmitry> + sprintf(buff,"%.17e",*((float*) data));
Dmitry> length=strlen(data=buff);
Dmitry> break;
Dmitry> case SQL_C_DOUBLE:
Dmitry> - sprintf(buff,"%f",*((double*) data));
Dmitry> + sprintf(buff,"%.17e",*((double*) data));
Dmitry> length=strlen(data=buff);
Dmitry> break;
Dmitry> case SQL_C_DATE:
Applied; Thanks
Regards,
Monty