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

QGIS 3.10.2 replace 0 to NULL #34118

Closed
kadarivan opened this issue Jan 29, 2020 · 6 comments · Fixed by #34152
Closed

QGIS 3.10.2 replace 0 to NULL #34118

kadarivan opened this issue Jan 29, 2020 · 6 comments · Fixed by #34152
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Feedback Waiting on the submitter for answers High Priority Regression Something which used to work, but doesn't anymore

Comments

@kadarivan
Copy link

I have a PostGIS table with numeric(9,0) field.
In QGIS 3.10.2 in Feature attributes window NULL appears instead of 0.
The attribute table show the correct value, but when I edit a record, and place 0 to the field it saves NULL to the database.

QGIS 3.10.1 and 3.4.15 are working fine.

client:
QGIS 3.10.2 Windows 10

server:
PostgreSQL 9.6.5, compiled by Visual C++ build 1800, 64-bit
PostGIS 2.4

0toNULL

@kadarivan kadarivan added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Jan 29, 2020
@elpaso
Copy link
Contributor

elpaso commented Jan 29, 2020

@kadarivan can you please share a test project and a minimal DB SQL dump to reproduce the issue?

@elpaso elpaso added the Feedback Waiting on the submitter for answers label Jan 29, 2020
@kadarivan
Copy link
Author

pkod_dump.zip

@elpaso elpaso self-assigned this Jan 30, 2020
@elpaso elpaso added Regression Something which used to work, but doesn't anymore High Priority labels Jan 30, 2020
@elpaso
Copy link
Contributor

elpaso commented Jan 30, 2020

Broken by #33660

Fun facts:

QVariant(0.0) == QVariant(QVariant.Double)
True

@gioman
Copy link
Contributor

gioman commented Jan 30, 2020

@troopa81 fyi

@elpaso
Copy link
Contributor

elpaso commented Jan 30, 2020

@troopa81 don't worry, I've found a fix and I am currently working on a test.

... which will takes much longer than the fix itself :)

elpaso added a commit to elpaso/QGIS that referenced this issue Jan 30, 2020
Fixes qgis#34118

Because:

QVariant(0.0) == QVariant(QVariant.Double) -> True

but:

QVariant(0.0).isNull() == QVariant(QVariant.Double).isNull() -> False
@troopa81
Copy link
Contributor

@troopa81 don't worry, I've found a fix and I am currently working on a test.

Thanks!

elpaso added a commit to elpaso/QGIS that referenced this issue Feb 5, 2020
Fixes qgis#34118

Because:

QVariant(0.0) == QVariant(QVariant.Double) -> True

but:

QVariant(0.0).isNull() == QVariant(QVariant.Double).isNull() -> False
nyalldawson pushed a commit that referenced this issue Feb 5, 2020
Fixes #34118

Because:

QVariant(0.0) == QVariant(QVariant.Double) -> True

but:

QVariant(0.0).isNull() == QVariant(QVariant.Double).isNull() -> False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Feedback Waiting on the submitter for answers High Priority Regression Something which used to work, but doesn't anymore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants