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

fix double lock #194

Closed
wants to merge 1 commit into from
Closed

fix double lock #194

wants to merge 1 commit into from

Conversation

chipitsine
Copy link
Contributor

found by coverity

754
2. lock: SQLFetch locks hStmt->mutex.[show details]
3. Condition (ret = SQLFetch(hStmt)) == 0, taking false branch.
CID 442426:(#2 of 4):Double lock (LOCK) [ "select issue" ]
755 while ( (ret = SQLFetch( hStmt )) == SQL_SUCCESS ) /* ROWS */

@chipitsine
Copy link
Contributor Author

@lurcher , can you please review this ?

coverity yells loudly that thread_protect is met without thread_release.

also, do we have to put thread_protect in the very beginning ?

@lurcher
Copy link
Owner

lurcher commented Oct 17, 2024

From my reading of the current code, the thread_protect at SQLFetch.c line 172 is matched by the thread_release in function_return_nodrv and function_return

@lurcher
Copy link
Owner

lurcher commented Oct 19, 2024

Sorry, but that doesn't make any sense. Both SQL_HANDLE_STMT and IGNORE_THREAD are preprocessor defines. You are saying "if ( 3 != (-1))" which will always be true. Am I missing something.

@chipitsine
Copy link
Contributor Author

please ignore, I'm experimenting with coverity.

comparing two constants does not make sense indeed

@chipitsine
Copy link
Contributor Author

ok, seems we just have to mark it as intentional and ignore

@chipitsine chipitsine closed this Oct 19, 2024
@chipitsine chipitsine deleted the f2 branch October 19, 2024 12:50
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