Opened 13 years ago

Last modified 13 years ago

#817 assigned defect

ODBC Access: decimal values change when German locale

Reported by: brentrobinson Owned by: brentrobinson
Priority: major Milestone: 3.7.0
Component: GenericRdbms API Version:
Severity: 2 Keywords: ODBC FdoIInsert decimal value local comma
Cc: External ID:

Description

Steps:

  • set machine locale to German (Germany)
  • Create an MS Access database with table with columns:

id - integer (primary key) x - double y - double value - double

  • Create an ODBC DSN for the database
  • Using ODBC Provider

connect to the DSN create and execute an FdoIInsert, where value = 5.55. The other properties can have any valid value

  • Check the database in Access. value for the inserted row is 555.

Change History (2)

comment:1 by brentrobinson, 13 years ago

Status: newassigned

Revision: 6393 Author: brentrobinson Date: 11:05:05 AM, Thursday, February 16, 2012 Message: Ticket#817: GenericRdbms: modified inserts and updates to bind columns by their column type. Previously these column values were bound as strings. Binding by string was problematic for numeric columns, when the values had fractional parts. If an insert statement sets the value for a double column to 5.55, then the provider does a locale-independent ('.' decimal point) conversion to string ("5.55") and then binds the string. The RDBMS server then converts it back to a number. However, some servers (e.g. Microsoft Access) convert using the current locale. The decimal point is lost, if the locale specifies a ',' decimal point, and the value ends up as 555.


Modified : /trunk/Providers/GenericRdbms/Src/Fdo/Pvc/FdoRdbmsPvcHandler.cpp Modified : /trunk/Providers/GenericRdbms/Src/Fdo/Pvc/FdoRdbmsPvcHandler.h Modified : /trunk/Providers/GenericRdbms/Src/Fdo/Pvc/FdoRdbmsPvcInsertHandler.cpp Modified : /trunk/Providers/GenericRdbms/Src/Fdo/Pvc/FdoRdbmsPvcInsertHandler.h Modified : /trunk/Providers/GenericRdbms/Src/Fdo/Pvc/FdoRdbmsPvcUpdateHandler.cpp Modified : /trunk/Providers/GenericRdbms/Src/Fdo/Pvc/FdoRdbmsPvcUpdateHandler.h Modified : /trunk/Providers/GenericRdbms/Src/MySQL/Driver/bind.cpp Modified : /trunk/Providers/GenericRdbms/Src/MySQL/Driver/bind.h Modified : /trunk/Providers/GenericRdbms/Src/MySQL/Driver/geom_srid.cpp Modified : /trunk/Providers/GenericRdbms/Src/ODBCDriver/bind.c Modified : /trunk/Providers/GenericRdbms/Src/ODBCDriver/geom.c Modified : /trunk/Providers/GenericRdbms/Src/ODBCDriver/proto_p.h Modified : /trunk/Providers/GenericRdbms/Src/ODBCDriver/rdbi_init.c Modified : /trunk/Providers/GenericRdbms/Src/PostGis/Driver/bind.c Modified : /trunk/Providers/GenericRdbms/Src/PostGis/Driver/bind.h Modified : /trunk/Providers/GenericRdbms/Src/PostGis/Driver/geom_srid.c Modified : /trunk/Providers/GenericRdbms/Src/UnitTest/MySql/MySqlFdoExpressionFunctionTest.cpp Modified : /trunk/Providers/GenericRdbms/Src/UnitTest/SQLServerSpatial/SqlServerFdoFilterTest.cpp

comment:2 by brentrobinson, 13 years ago

Revision: 6394 Author: brentrobinson Date: 12:55:51 PM, Thursday, February 16, 2012 Message: Ticket#817: fixed build


Modified : /trunk/Providers/GenericRdbms/Src/Fdo/Pvc/FdoRdbmsPropBindHelper.h

Revision: 6395 Author: brentrobinson Date: 2:47:07 PM, Thursday, February 16, 2012 Message: Ticket#817: prevent memset from clobbering bind vector


Modified : /trunk/Providers/GenericRdbms/Src/Fdo/Pvc/FdoRdbmsPvcInsertHandler.cpp Modified : /trunk/Providers/GenericRdbms/Src/Fdo/Pvc/FdoRdbmsPvcInsertHandler.h

Note: See TracTickets for help on using tickets.