After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 652702 - COUNT() query returns a gchararray GValue
COUNT() query returns a gchararray GValue
Status: RESOLVED FIXED
Product: libgda
Classification: Other
Component: Client library
4.99.x
Other Linux
: Normal normal
: ---
Assigned To: malerba
gnome-db Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-06-16 09:24 UTC by Murray Cumming
Modified: 2011-06-16 17:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test_value_count.c (1.43 KB, text/plain)
2011-06-16 09:24 UTC, Murray Cumming
Details

Description Murray Cumming 2011-06-16 09:24:13 UTC
Created attachment 190020 [details]
test_value_count.c

With previous versions of libgda, this COUNT() query returned a gint64 GValue, but now it returns a gvaluearray GValue, which is obviously wrong for a number value. See the attached test case.

This is happening with both libgda-5.0 and recent versions of libgda-4.0 (at least 4.2.4 on Ubuntu Natty. It seems to work with libgda 4.99.0

I guess it could be a change in PostgreSQL, but that seems unlikely. It's documented as returning a "bigint":
http://www.postgresql.org/docs/9.0/static/functions-aggregate.html
Comment 1 Murray Cumming 2011-06-16 10:36:46 UTC
(In reply to comment #0)
> Created an attachment (id=190020) [details]
> test_value_count.c
> 
> With previous versions of libgda, this COUNT() query returned a gint64 GValue,
> but now it returns a gvaluearray GValue, which is obviously wrong for a number
> value. See the attached test case.
> 
> This is happening with both libgda-5.0 and recent versions of libgda-4.0 (at
> least 4.2.4 on Ubuntu Natty. It seems to work with libgda 4.99.0

Actually, no, there doesn't seem to be the same problem with libgda 4.

It does seem to be caused by the GdaNull change in bug #647633.
Comment 2 malerba 2011-06-16 17:34:52 UTC
Corrected in git/master, see http://git.gnome.org/browse/libgda/commit/?id=59d355dd023a2ef328b8d5f53bc0b519c6e7eef7
Thanks!