[drupal-devel] [bug] [PGSQL] node_save, design flaw

Thomas Ilsche drupal-devel at drupal.org
Sat Aug 27 18:42:25 UTC 2005


Issue status update for 
http://drupal.org/node/29818
Post a follow up: 
http://drupal.org/project/comments/add/29818

 Project:      Drupal
 Version:      cvs
 Component:    node.module
 Category:     bug reports
 Priority:     critical
 Assigned to:  Anonymous
 Reported by:  Thomas Ilsche
 Updated by:   Thomas Ilsche
 Status:       patch (code needs work)
 Attachment:   http://drupal.org/files/issues/pgsql_node_save.patch (764 bytes)

on pgsql node_save produces errors when saving certain fields like the
boolean sticky. FALSE as string returns as '' instead of 0 as it should
be in db - resulting in this error:


warning: pg_query() [<a
href='/manual/en/function.pg-query.html'>function.pg-query.html</a>]:
Query failed: ERROR:  invalid input syntax for integer: &quot;&quot; in
D:\amp\htdocs\projekte\drupal_head\includes\database.pgsql.inc on line
76.
user error:
query:
INSERT INTO node (title, body, format, uid, type, teaser, status,
moderate, promote, sticky, comment, created, changed, nid)
VALUES('!SimpleTest test node! simpletest_xwn9wlV2_S', '!SimpleTest
test body! simpletest_oiZZeQw0LqeHVhfrk0twJ_RYNOQbbB5p
simpletest_WU5E8tu0dmtvwg_1RN7B9byh5OuFw02u', '1', '12', 'page',
'!SimpleTest test body! simpletest_oiZZeQw0LqeHVhfrk0twJ_RYNOQbbB5p
simpletest_WU5E8tu0dmtvwg_1RN7B9byh5OuFw02u', '1', '', '1', '', '2',
'1125165026', '1125165026', '5') in
D:\amp\htdocs\projekte\drupal_head\includes\database.pgsql.inc on line
93.


I consider this a quite major design flaw as the looped general
mixed->string conversion strongly relies on the forgiving string->mixed
conversions of MySQL.


However I have crafted a fix that solves the issue for me when creating
pages, maybe needs more work or even redesign.
Thats the curse of dynamic typing!




Thomas Ilsche




More information about the drupal-devel mailing list