Skip to content

Backport: Fix SQL_IsNull() returning 0 for NULL columns in threaded queries - #1167

Open
JohanCorn wants to merge 1 commit into
alliedmodders:1.9-devfrom
JohanCorn:backport-fix-threaded-sql-isnull
Open

JohanCorn wants to merge 1 commit into
alliedmodders:1.9-devfrom
JohanCorn:backport-fix-threaded-sql-isnull

Conversation

@JohanCorn

Copy link
Copy Markdown
Contributor

Backport of #1166 from master.

SQL_IsNull() returns 0 for NULL columns in SQL_ThreadQuery() callbacks in 1.9 too: AtomicResult::CopyFrom() turns NULL cells into empty strings. This stores NULL cells as empty slots instead, and GetString() returns NULL for them. Same change in mysqlx and sqlite.

The commit from master applies cleanly to 1.9-dev.

Tested with the 1.9-dev modules and core as baseline vs. a build with this change, on both MySQL and SQLite: the threaded NULL cells report IsNull() == 1 with the change, and 0 without it. The non-threaded checks and the other threaded checks are the same in both.

…liedmodders#1166)

Threaded query results are copied into an AtomicResult, which stored NULL cells as empty strings, so IsNull() could never report NULL. Store NULL cells as empty slots and make GetString() return NULL for them.

Backport of alliedmodders#1166
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