Skip to content

Conversation

iloveitaly
Copy link

Found this useful when debugging a handling SQLFreeStmt command on my driver (netsuite).

return false;
}

TRACE("ApplyPreconnAttrs.SQLSetConnectAttrW key=%d value=%p vallen=%d\n", ikey, ivalue);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested this locally, but it appears there are 3 placeholders and 2 values.

{
// Unbinds the parameters and frees the parameter buffer.

TRACE("FreeParameterData");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs newline?

const char* pch = PyBytes_AS_STRING(query.Get());
SQLINTEGER cch = (SQLINTEGER)(PyBytes_GET_SIZE(query.Get()) / (isWide ? sizeof(uint16_t) : 1));

TRACE("cursor.execute: isWide=%d query_len=%d\n", isWide, cch);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we build on so many platforms with different pointer & integer widths, I think we should cast anything that is not a plain integer when using %d. Most likely everything is 64 bits nowdays, but it would't hurt.

@mkleehammer
Copy link
Owner

Looks good, but I added 3 comments in the Files changed tab using the web UI. Can you take a look at those? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants