Description:
Attempting to bind a parameter with a SQL_DECIMAL type results in a failure when the statement is executed.
Failure message from ODBC trace log:
MSACCESS eb0-ac4 ENTER SQLBindParameter
HSTMT 07A12690
UWORD 3
SWORD 1 <SQL_PARAM_INPUT>
SWORD -8 <SQL_C_WCHAR>
SWORD 3 <SQL_DECIMAL>
SQLULEN 10
SWORD 2
PTR 0x09442B94
SQLLEN 0
SQLLEN * 0x09442B90
MSACCESS eb0-ac4 EXIT SQLBindParameter with return code 0 (SQL_SUCCESS)
HSTMT 07A12690
UWORD 3
SWORD 1 <SQL_PARAM_INPUT>
SWORD -8 <SQL_C_WCHAR>
SWORD 3 <SQL_DECIMAL>
SQLULEN 10
SWORD 2
PTR 0x09442B94
SQLLEN 0
SQLLEN * 0x09442B90 (6)
MSACCESS eb0-ac4 ENTER SQLExecDirectW
HSTMT 07A12690
WCHAR * 0x09442388 [ -3] "UPDATE `newbug` SET `x`=? WHERE `x` = ? AND `y` = ?\ 0"
SDWORD -3
MSACCESS eb0-ac4 EXIT SQLExecDirectW with return code -1 (SQL_ERROR)
HSTMT 07A12690
WCHAR * 0x09442388 [ -3] "UPDATE `newbug` SET `x`=? WHERE `x` = ? AND `y` = ?\ 0"
SDWORD -3
DIAG [07006] [MySQL][MyODBC 5.00.09] Restricted data type attribute violation (0)
MSACCESS eb0-ac4 ENTER SQLErrorW
HENV 07A11540
HDBC 07A115E8
HSTMT 07A12690
WCHAR * 0x0013EB9C (NYI)
SDWORD * 0x0013EBE8
WCHAR * 0x025319E8
SWORD 4095
SWORD * 0x0013EBD4
MSACCESS eb0-ac4 EXIT SQLErrorW with return code 0 (SQL_SUCCESS)
HENV 07A11540
HDBC 07A115E8
HSTMT 07A12690
WCHAR * 0x0013EB9C (NYI)
SDWORD * 0x0013EBE8 (0)
WCHAR * 0x025319E8 [ 64] "[MySQL][MyODBC 5.00.09] Restricted data type attribute violation"
SWORD 4095
SWORD * 0x0013EBD4 (64)
How to repeat:
-- create a test table with some data
create table newbug ( x int not null, y decimal(10,2) not null, primary key (x) );
insert into newbug values (1, 1.2),(2, 2.3),(3, 3.4);
Link this table with Access and try to update the data. It will fail.
Suggested fix:
Allow binding a to a decimal field.