Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add more TRACE calls for easier debugging #1317

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

iloveitaly
Copy link

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

@@ -154,6 +154,8 @@ static bool ApplyPreconnAttrs(HDBC hdbc, SQLINTEGER ikey, PyObject *value, char
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.

@@ -1310,6 +1310,8 @@ void FreeParameterData(Cursor* cur)
{
// 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?

@@ -750,12 +758,16 @@ static PyObject* execute(Cursor* cur, PyObject* pSql, PyObject* params, bool ski
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