GNOME Bugzilla – Bug 661655
data doesn't display when a field is renamed to string with a hyphen
Last modified: 2011-10-27 09:20:22 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).
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.
(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.
(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.
- is SQL's way of adding comments. Everything after an (unescaped) - is usually dropped.
Ah ok, that explains it. It's weird the field rename operation succeeded then.
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.
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.
Glom 1.19.x (git master) now depends on libgda 5.0.0, which fixes this problem.