Skip to content

Bug in debug message line 2357, 2381, 2395 #1050

@jthyssenrocket

Description

@jthyssenrocket

The code to write the debug message in lines 2357, 2381, line 2395, are incorrect as "database" is a SQLWCHAR which cannot be printed by snprintf:

snprintf(messageStr, sizeof(messageStr), "SQLConnectW called with parameters: conn_res->hdbc=%p, database=%ls, databaseLen=%zd, uid=%ls, uidLen=%zd, password=%ls, passwordLen=%zd and returned rc=%d", (void *)conn_res->hdbc, database,

Python code to reproduce:

ibm_db.debug(True)
conn = ibm_db.connect('DSN=RS01PDS1;AUTOCOMMIT=1;BLA=47;', '', '')

This debug statement is printed correct:
[INFO] - Received arguments: ('DSN=RS01PDS1;AUTOCOMMIT=1;BLA=47;', '', '')

but this one is not:

[DEBUG] - SQLDriverConnectW called with parameters: conn_res->hdbc=1, SQLHWND=NULL, database=S=S1D1ATCMI=;L=7

Notice that "database" is printed incorrectly - it seems like only every second character is printed correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions