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 661655 - data doesn't display when a field is renamed to string with a hyphen
data doesn't display when a field is renamed to string with a hyphen
Status: RESOLVED FIXED
Product: glom
Classification: Other
Component: general
1.18.x
Other Linux
: Normal normal
: ---
Assigned To: Murray Cumming
Murray Cumming
Depends on: 661684
Blocks:
 
 
Reported: 2011-10-13 12:08 UTC by Ben Konrath
Modified: 2011-10-27 09:20 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ben Konrath 2011-10-13 12:08:19 UTC
If you rename a field to a string with a hyphen (-), the data for the table with the hyphenated field name will not display in the Glom list or details view.

Using psql, I can verify that the field name has been correctly renamed with the hyphen and the data is still present in the correct table.

I found this issue with the latest code from the 1.18 branch but the same problem might be found in master (the 1.19.x code).
Comment 1 Murray Cumming 2011-10-13 16:45:05 UTC
Confirmed. It's a problem in libgda: bug # 661684 . If necessary, we can prevent the user from using special characters, but I'd rather not have that complication.
Comment 2 Ben Konrath 2011-10-14 10:40:43 UTC
(In reply to comment #1)
> If necessary, we can
> prevent the user from using special characters, but I'd rather not have that
> complication.

I guess it was naive of me to put a hyphen in the field name. But I don't really see why an underscore, which didn't cause a problem, is different from a hyphen, which did cause a problem.

It was just confusing to see the data in the postgres table but not in the Glom UI. And with no error message, I didn't know why this was happening. Could this type of error be detected without checking for special characters? I would think that libgda should handle checking for special characters in field / table names if they're not supported by the underlying database but you know better than me about this stuff.
Comment 3 Murray Cumming 2011-10-14 10:53:44 UTC
(In reply to comment #2)
> But I don't
> really see why an underscore, which didn't cause a problem, is different from a
> hyphen, which did cause a problem.

I agree.

> It was just confusing to see the data in the postgres table but not in the Glom
> UI. And with no error message, I didn't know why this was happening.

Yes, at the moment some exceptions get caught and forgotten before they get high enough.

> Could this
> type of error be detected without checking for special characters? I would
> think that libgda should handle checking for special characters in field /
> table names if they're not supported by the underlying database but you know
> better than me about this stuff.

It just needs quoting properly. The libgda bug #661684 is about that.
Comment 4 Michael Hasselmann 2011-10-14 12:43:06 UTC
- is SQL's way of adding comments. Everything after an (unescaped) - is usually dropped.
Comment 5 Ben Konrath 2011-10-15 14:04:33 UTC
Ah ok, that explains it. It's weird the field rename operation succeeded then.
Comment 6 Murray Cumming 2011-10-15 19:36:18 UTC
Changes of table structure are done with SQL that Glom builds, because libgda does not have generic API for that, because the SQL is always different for different servers.
Comment 7 Murray Cumming 2011-10-17 20:55:42 UTC
It's fixed in libgda but I'll keep this open until there is a tarball version that Glom can depend on in configure.ac.
Comment 8 Murray Cumming 2011-10-27 09:20:22 UTC
Glom 1.19.x (git master) now depends on libgda 5.0.0, which fixes this problem.