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 515306 - Implement /FIELDS_A/@COLUMN_AUTOINC/
Implement /FIELDS_A/@COLUMN_AUTOINC/
Status: RESOLVED FIXED
Product: libgda
Classification: Other
Component: PostgreSQL provider
unspecified
Other All
: Normal normal
: ---
Assigned To: malerba
gnome-db Maintainers
: 515528 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-02-08 22:49 UTC by Daniel Espinosa
Modified: 2008-03-24 22:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to add AUTOINC to PostgreSQL provider (1.99 KB, patch)
2008-02-08 22:56 UTC, Daniel Espinosa
none Details | Review
Patch to add AUTOINC support in PostgreSQL and improve gda_create_table convenient function (20.78 KB, patch)
2008-02-19 18:10 UTC, Daniel Espinosa
none Details | Review

Description Daniel Espinosa 2008-02-08 22:49:56 UTC
Please describe the problem:
Using 3.99.1:
Its necesary to implement /FIELDS_A/@COLUMN_AUTOINC/ in order to allow create 'SERIAL' type fields for PKEYs like in SQLite and MySQL.


Steps to reproduce:
1. Set to true /FIELDS_A/@COLUMN_AUTOINC/ at a field
2. Execute ServerOperation


Actual results:
The rendered operation ignores /FIELDS_A/@COLUMN_AUTOINC/ and just sets the PKEY

Expected results:
The field must be created as a SERIAL type and a PKey

Does this happen every time?
Yes

Other information:
I've modified the code, see PATCH, to see if /FIELDS_A/@COLUMN_AUTOINC/ is setted to TRUE to set the type to SERIAL automaticaly, but when I get the value fails to check for holds boolean.

See the next code:


if (gda_server_operation_set_value_at (op, "TRUE", error, "/FIELDS_A/@COLUMN_PKEY/%d", i))
        g_printf ("SETTED VALUE AT PKEY\n");

if (gda_server_operation_set_value_at (op, "TRUE", error, "/FIELDS_A/@COLUMN_AUTOINC/%d", i))
	g_printf ("SETTED VALUE AT PKEY\n");
					
/* The last allways return TRUE to confir the value is setted */

/* This lines get the values for AUTOINC and PKEY nodes to print then to stdout*/

g_printf ("SETTED PKEY AND AUTOINC- Value at AutoInc: %s AT PKEY: %s\n",
							  gda_value_stringify (g_value_get_boolean (gda_server_operation_get_value_at (op, "/FIELDS_A/@COLUMN_AUTOINC/%d", i))),gda_value_stringify (g_value_get_boolean (gda_server_operation_get_value_at (op, "/FIELDS_A/@COLUMN_AUTOINC/%d", i))));

/* g_value_get_boolean allways return NULL becouse value doesn't holds a BOOLEAN */
Comment 1 Daniel Espinosa 2008-02-08 22:56:33 UTC
Created attachment 104747 [details] [review]
Patch to add AUTOINC to PostgreSQL provider

This patch does't work becouse a problem with gda_server_operation_get_value allways return NULL
Comment 2 Daniel Espinosa 2008-02-19 18:10:13 UTC
Created attachment 105590 [details] [review]
Patch to add AUTOINC support in PostgreSQL and improve gda_create_table convenient function
Comment 3 malerba 2008-02-21 17:21:14 UTC
*** Bug 515528 has been marked as a duplicate of this bug. ***
Comment 4 malerba 2008-02-21 17:23:48 UTC
I've applied the parts regarding the auto increment in V4 branch, but could you post another patch againts that latest V4 branch for the rest?
Comment 5 malerba 2008-03-06 07:56:15 UTC
The V4 branch has now been merged into trunk