[gnome-db] libgda-1.0.3/libgnomedb-1.0.3 - some observations and a question
- From: Denis Loginov <dloginov crl NMSU Edu>
- To: gnome-db-list gnome org
- Subject: [gnome-db] libgda-1.0.3/libgnomedb-1.0.3 - some observations and a question
- Date: Mon, 12 Apr 2004 02:02:31 -0600 (MDT)
Hi,
1. As I reported before, the Postgres provider seems to have an error in
get_postgres_fill_md_data (used for
gda_connection_get_schema/GDA_CONNECTION_SCHEMA_FIELDS) - it returns TRUE
in that column if the field IS NULL, not NOT NULL. I don't know whether
this was taken care of in the later versions as nobody answered, so here's
the diff that is supposed to fix it:
=== (gda-postgres-provider.c.diff)
1659c1659
< "(SELECT a.attname, b.typname, a.atttypmod, b.typlen, not a.attnotnull, d.adsrc, "
---
> "(SELECT a.attname, b.typname, a.atttypmod, b.typlen, a.attnotnull, d.adsrc, "
1664c1664
< "UNION (SELECT a.attname, b.typname, a.atttypmod, b.typlen, not a.attnotnull, NULL, "
---
> "UNION (SELECT a.attname, b.typname, a.atttypmod, b.typlen, a.attnotnull, NULL, "
1671c1671
< "SELECT a.attname, t.typname, a.atttypmod, t.typlen, not a.attnotnull, d.adsrc, a.attnum "
---
> "SELECT a.attname, t.typname, a.atttypmod, t.typlen, a.attnotnull, d.adsrc, a.attnum "
===
The MySQL provider doesn't have such reversal, so I suppose this is a bug
rather than a feature.
2. If I create a command out of a query that ends with ';', it works fine
with Postgres provider, but returns an error "Error 1065: Query was empty"
with MySQL provider, which seems to be the result of sending an empty
string after splitting the original SQL command in
gda-mysql-provider.c:318 . Seems like the same empty command is being sent
to Postgres in Postgres provider, but Postgres does not return an error in
response. So the whole thing seems a bit unclear and I wonder if something
should be done to prevent sending the empty strings to the RDBMS rather
than memorizing that there must be no ';'s at the end of the requests.
3. Is there or should there be a way to find out whether a field is
serial/auto_increment? Right now, I'm simply looking for the "Default
value" column in gda_connection_get_schema/GDA_CONNECTION_SCHEMA_FIELDS
having the prefix "nextval" for Postgres and the "References" column
having the prefix "auto_" for MySQL. But it looks like there should be
some more universal way of doing this.
Thanks.
--
With respect, Denis Loginov
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]