Skip to content

Commit

Permalink
odbc: Wrap SQLNumParams in CHKR2 macro like most of other ODBC calls
Browse files Browse the repository at this point in the history
Just style change.

Signed-off-by: Frediano Ziglio <[email protected]>
  • Loading branch information
freddy77 committed Dec 27, 2024
1 parent 010cbfd commit 745eb66
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/odbc/unittests/array_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ main(void)

CHKPrepare(T("insert into #tester(id, name) values(?,?)"), SQL_NTS, "S");

CHKR(SQLNumParams, (odbc_stmt, &num_params), "S");
CHKNumParams(&num_params, "S");
assert(num_params == 2);

/* now this is going to fail as id is duplicated, causing statement to not be prepared */
Expand Down
2 changes: 2 additions & 0 deletions src/odbc/unittests/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ SQLRETURN SQLSetStmtOption_nowarning(SQLHSTMT hstmt, SQLSMALLINT option, SQLULEN
CHKR2(SQLSetDescField, ((desc),a,b,c,d), SQL_HANDLE_DESC, (desc), res)
#define CHKGetInfo(a,b,c,d,res) \
CHKR2(SQLGetInfo, (odbc_conn,a,b,c,d), SQL_HANDLE_DBC, odbc_conn, res)
#define CHKNumParams(a,res) \
CHKR2(SQLNumParams, (odbc_stmt,a), SQL_HANDLE_STMT, odbc_stmt, res)

int odbc_connect(void);
int odbc_disconnect(void);
Expand Down
2 changes: 1 addition & 1 deletion src/odbc/unittests/peter.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ main(void)

CHKPrepare(T("SELECT * FROM #tester WHERE id = ?"), SQL_NTS, "S");

CHKR(SQLNumParams, (odbc_stmt, &num_params), "S");
CHKNumParams(&num_params, "S");
assert(num_params == 1);

id = 1;
Expand Down

0 comments on commit 745eb66

Please sign in to comment.