Skip to content

Comments

[mssql] Fix connection corruption after executing sq (ltr backport)#61152

Merged
nyalldawson merged 10 commits intoqgis:queued_ltr_backportsfrom
nyalldawson:backport_61118
Mar 25, 2025
Merged

[mssql] Fix connection corruption after executing sq (ltr backport)#61152
nyalldawson merged 10 commits intoqgis:queued_ltr_backportsfrom
nyalldawson:backport_61118

Conversation

@nyalldawson
Copy link
Collaborator

Manual backport of #61060

Executing any SQL on a SQL Server connection would result in the
connection being dropped while it was still in use, leaving
the provider in a interdeterminate state which would often
refuse to run futher queries.

The QSqlQuery class does NOT have a virtual destructor, so we
need to explicitly use the QgsMssqlQuery class for the results
iterator so that the QgsMssqlQuery destructor gets called and
the shared reference to the QgsMssqlDatabase instance gets
released correctly.

(cherry picked from commit 7457b1d)
(cherry picked from commit 117fff3)
(cherry picked from commit d4d5dda)
(cherry picked from commit 1cee417)
…ting new connection

We already have a connection here:

(cherry picked from commit c84926e)
(cherry picked from commit fff3362)
Don't create a new connection per table, when we can
just use one connection for all

(cherry picked from commit a773ce7)
(cherry picked from commit 9da9a56)
(cherry picked from commit e9f0f2d)
(cherry picked from commit 0189d95)
(cherry picked from commit 0831a60)
(cherry picked from commit e2226cd)
Probably a remnant of copy/paste from the original implementation
from the postgres provider

(cherry picked from commit 043a4e8)
(cherry picked from commit 28fdea1)
bigint should map to LongLong variant type

Add actual type names to display strings

(cherry picked from commit b3222aa)
(cherry picked from commit 33f746a)
(cherry picked from commit 31ade69)
(cherry picked from commit 9293b77)
@nyalldawson nyalldawson added the Backport Is a backport of another pull request label Mar 23, 2025
@github-actions github-actions bot added this to the 3.44.0 milestone Mar 23, 2025
@nyalldawson nyalldawson deleted the branch qgis:queued_ltr_backports March 24, 2025 01:52
@nyalldawson nyalldawson reopened this Mar 24, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Mar 25, 2025

🪟 Windows builds

Download Windows builds of this PR for testing.
Debug symbols for this build are available here.
(Built from commit 5bce8b6)

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit 5bce8b6)

@nyalldawson nyalldawson merged commit 4497803 into qgis:queued_ltr_backports Mar 25, 2025
30 of 31 checks passed
@nyalldawson nyalldawson deleted the backport_61118 branch March 25, 2025 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport Is a backport of another pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants