Index: driver/prepare.c =================================================================== --- driver/prepare.c (revision 795) +++ driver/prepare.c (working copy) @@ -262,6 +262,26 @@ /* + @type : ODBC 1.0 API + @purpose : deprecated function, for more details see SQLBindParamater. +*/ + +SQLRETURN SQL_API SQLSetParam( SQLHSTMT hstmt, + SQLUSMALLINT ipar, + SQLSMALLINT fCType, + SQLSMALLINT fSqlType, + SQLULEN cbColDef, + SQLSMALLINT ibScale, + SQLPOINTER rgbValue, + SQLLEN * pcbValue ) +{ + return my_SQLBindParameter(hstmt, ipar, SQL_PARAM_INPUT_OUTPUT, fCType, + fSqlType, cbColDef, ibScale, rgbValue, + SQL_SETPARAM_VALUE_MAX, pcbValue); +} + + +/* @type : ODBC 2.0 API @purpose : binds a buffer to a parameter marker in an SQL statement. */ Index: driver/execute.c =================================================================== --- driver/execute.c (revision 795) +++ driver/execute.c (working copy) @@ -268,8 +268,11 @@ The negative length can be passed through the deprecated function SQLSetParam */ - if (length != SQL_SETPARAM_VALUE_MAX && length > param->ValueMax) + if ( param->ValueMax != SQL_SETPARAM_VALUE_MAX && + length > param->ValueMax ) + { length= param->ValueMax; + } #else length=strnlen(data,param->ValueMax); #endif Index: driver/info.c =================================================================== --- driver/info.c (revision 795) +++ driver/info.c (working copy) @@ -1181,7 +1181,7 @@ /* SQL_API_SQLSETDESCFIELD */ /* SQL_API_SQLSETDESCREC */ SQL_API_SQLSETENVATTR, - /* SQL_API_SQLSETPARAM */ + SQL_API_SQLSETPARAM, SQL_API_SQLSETSTMTATTR, SQL_API_SQLSETSTMTOPTION, SQL_API_SQLSPECIALCOLUMNS, Index: test/my_prepare.c =================================================================== --- test/my_prepare.c (revision 795) +++ test/my_prepare.c (working copy) @@ -1034,7 +1034,6 @@ } -#ifdef SQL_SET_PARAM_FIXED DECLARE_TEST(t_bug29871) { SQLCHAR *param= "1"; @@ -1056,7 +1055,6 @@ ok_sql(hstmt, "DROP TABLE t_bug29871"); return OK; } -#endif BEGIN_TESTS @@ -1073,9 +1071,7 @@ ADD_TEST(tmysql_bindcol) ADD_TEST(tmysql_bindparam) ADD_TEST(t_acc_update) -#ifdef SQL_SET_PARAM_FIXED ADD_TEST(t_bug29871) -#endif END_TESTS