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

postgresql bigint column value doesn't show up in attribute table on master #36011

Closed
tudorbarascu opened this issue Apr 26, 2020 · 5 comments · Fixed by #36040
Closed

postgresql bigint column value doesn't show up in attribute table on master #36011

tudorbarascu opened this issue Apr 26, 2020 · 5 comments · Fixed by #36040
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter!

Comments

@tudorbarascu
Copy link
Member

Describe the bug

On Debian Bullseye, the PostgreSQL bigint columns values don't show up in the attribute table.

How to Reproduce

  • Create this table in PostGIS
CREATE TABLE public.bad_points (
    id integer PRIMARY KEY,
    geom public.geometry(Point,3844),
    bigint_column bigint
);

INSERT INTO public.bad_points VALUES (22524, '0101000020040F00007C60A53E0D181841CD60462FDBEE2141', 9);
  • add the table in QGIS and open the attribute table
  • The attribute table doesn't show value 9 under the bigint_column column
QGIS version 3.13.0-Master QGIS code revision 3145353
Compiled against Qt 5.12.5 Running against Qt 5.12.5
Compiled against GDAL/OGR 3.0.4 Running against GDAL/OGR 3.0.4
Compiled against GEOS 3.8.1-CAPI-1.13.3 Running against GEOS 3.8.1-CAPI-1.13.3
Compiled against SQLite 3.31.1 Running against SQLite 3.31.1
PostgreSQL Client Version 12.2 (Debian 12.2-4) SpatiaLite Version 4.3.0a
QWT Version 6.1.4 QScintilla2 Version 2.11.2
Compiled against PROJ 7.0.0 Running against PROJ Rel. 7.0.0, March 1st, 2020
OS Version Debian GNU/Linux bullseye/sid
Active python plugins db_manager; MetaSearch; processing

Additional context
I can replicate on Master from packages and build from source.
I tested on the same system with QGIS 3.10.5 and 3.12.2 (from packages) and I cannot replicate.
I tested with Master from packages (sid) and I cannot replicate:

QGIS version | 3.13.0-Master | QGIS code revision | b73bd58cfb
-- | -- | -- | --
Compiled against Qt | 5.12.5 | Running against Qt | 5.12.5
Compiled against GDAL/OGR | 3.0.4 | Running against GDAL/OGR | 3.0.4
Compiled against GEOS | 3.8.1-CAPI-1.13.3 | Running against GEOS | 3.8.1-CAPI-1.13.3
Compiled against SQLite | 3.31.1 | Running against SQLite | 3.31.1
PostgreSQL Client Version | 12.2 (Debian 12.2-4) | SpatiaLite Version | 4.3.0a
QWT Version | 6.1.4 | QScintilla2 Version | 2.11.2
Compiled against PROJ | 7.0.0 | Running against PROJ | Rel. 7.0.0, March 1st, 2020
OS Version | Debian GNU/Linux bullseye/sid | This copy of QGIS writes debugging output.
Active python plugins | db_manager; MetaSearch; processing

Will try to bisect tomorrow.

@uclaros As you have the same system (more or less) could you please test if you can also replicate (should take only a minute).

@tudorbarascu tudorbarascu added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Apr 26, 2020
@uclaros
Copy link
Contributor

uclaros commented Apr 27, 2020

Sure! Can replicate on 81911c1, cannot replicate on 29adf2e, if that's any help!

@tudorbarascu
Copy link
Member Author

Thanks @uclaros I just bisected and found the introducing commit to be 0d0fe48 ping @espinafre

@espinafre
Copy link
Contributor

@uclaros , @tudorbarascu , thanks for pinging me, I'm looking into it.

@espinafre
Copy link
Contributor

Hi, @uclaros , @tudorbarascu , I've submitted a new PR (#36040) that will solve this issue; hopefully @m-kuhn will take a look at it. Thanks for reporting.

@tudorbarascu
Copy link
Member Author

tudorbarascu commented Apr 30, 2020

@espinafre Well.. the first issue is now gone but now for bigint fields that have NULL value I get 0 or others like 2115154 in the attribute table.

@gioman This needs to be reopened.

If I create the following table, on master I see 0 instead of NULL.

CREATE TABLE public.bad_points (
    id integer NOT NULL,
    geom public.geometry(Point,3844),
    fk_strada bigint
);

INSERT INTO public.bad_points VALUES (17074, '0101000020040F00007D6A4D566D001841B7EE11A999F22141', NULL);

ALTER TABLE ONLY public.bad_points
    ADD CONSTRAINT bad_points_pkey PRIMARY KEY (id);

On a much bigger table, I also see values like 2115154 instead of NULL.

@gioman gioman reopened this May 1, 2020
@m-kuhn m-kuhn closed this as completed in 5202d08 May 1, 2020
m-kuhn added a commit that referenced this issue May 1, 2020
Fixed fetching NULL bigint pgsql attributes. Fixes #36011
qgis-bot pushed a commit to qgis-bot/QGIS that referenced this issue May 1, 2020
m-kuhn added a commit that referenced this issue May 1, 2020
[Backport release-3_12] Fixed fetching NULL bigint pgsql attributes. Fixes #36011
espinafre pushed a commit to espinafre/QGIS that referenced this issue May 1, 2020
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!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants