Skip to content

Commit da0a1e4

Browse files
committed
ODBC-475 Driver did not support SQL_POSITIONED_STATEMENTS info type
The type is deprecated in ODBC3.0, but drivers still have to support it. We support(and return for this info type) SQL_PS_POSITIONED_DELETE | SQL_PS_POSITIONED_UPDATE The testcase has been added.
1 parent 413342a commit da0a1e4

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

ma_connection.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2052,6 +2052,9 @@ SQLRETURN MADB_DbcGetInfo(MADB_Dbc *Dbc, SQLUSMALLINT InfoType, SQLPOINTER InfoV
20522052
case SQL_SCROLL_CONCURRENCY:
20532053
MADB_SET_NUM_VAL(SQLINTEGER, InfoValuePtr, SQL_SCCO_READ_ONLY | SQL_SCCO_OPT_VALUES, StringLengthPtr);
20542054
break;
2055+
case SQL_POSITIONED_STATEMENTS:
2056+
MADB_SET_NUM_VAL(SQLINTEGER, InfoValuePtr, SQL_PS_POSITIONED_DELETE | SQL_PS_POSITIONED_UPDATE, StringLengthPtr);
2057+
break;
20552058
default:
20562059
MADB_SetError(&Dbc->Error, MADB_ERR_HY096, NULL, 0);
20572060
return Dbc->Error.ReturnValue;

test/info.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,7 @@ ODBC_TEST(odbc313)
860860
return OK;
861861
}
862862

863+
/* We returned incorrect max size for SQL_VARCHAR/SQL_VARBINARY */
863864
ODBC_TEST(odbc430)
864865
{
865866
CHECK_STMT_RC(Stmt, SQLGetTypeInfo(Stmt, SQL_VARCHAR));
@@ -887,6 +888,16 @@ ODBC_TEST(driver_ver)
887888
}
888889

889890

891+
ODBC_TEST(odbc475)
892+
{
893+
SQLINTEGER info= 0;
894+
CHECK_DBC_RC(Connection, SQLGetInfo(Connection, SQL_POSITIONED_STATEMENTS, &info, 0, NULL));
895+
is_num(SQL_PS_POSITIONED_DELETE | SQL_PS_POSITIONED_UPDATE, info);
896+
897+
return OK;
898+
}
899+
900+
890901
MA_ODBC_TESTS my_tests[]=
891902
{
892903
{ t_gettypeinfo, "t_gettypeinfo", NORMAL },
@@ -914,6 +925,7 @@ MA_ODBC_TESTS my_tests[]=
914925
{ odbc313, "odbc313", NORMAL },
915926
{ odbc430, "odbc430", NORMAL },
916927
{ driver_ver, "driver_ver_not_trimmed", NORMAL },
928+
{ odbc475, "odbc476_SQL_POSITIONED_STATEMENTS", NORMAL },
917929
{ NULL, NULL }
918930
};
919931

0 commit comments

Comments
 (0)