phpgroupware-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-tracker] [bug #6557] Bug in Postgres Code


From: nobody
Subject: [Phpgroupware-tracker] [bug #6557] Bug in Postgres Code
Date: Mon, 17 Nov 2003 19:46:19 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20031106

=================== BUG #6557: LATEST MODIFICATIONS ==================
http://savannah.gnu.org/bugs/?func=detailbug&bug_id=6557&group_id=509

Changes by: Anonymous user        Date: Mon 11/17/2003 at 19:46

------------------ Additional Follow-up Comments ----------------------------
This did not work, here is my error:



Database error: Invalid SQL: SELECT * FROM phpgw_accounts WHERE account_id='0'

PostgreSQL Error: 1 (ERROR: pg_atoi: zero-length string )



File: 
/var/www/localhost/htdocs/phpgroupware/phpgwapi/inc/class.accounts_sql.inc.php

Line: 50



Session halted.







=================== BUG #6557: FULL BUG SNAPSHOT ===================


Submitted by: None                    Project: phpGroupWare                 
Submitted on: Fri 11/14/2003 at 08:04
Category:  API - phpGWapi             Bug Group:  None                      
Severity:  5 - Major                  Priority:  Normal                     
Resolution:  None                     Assigned to:  None                    
Status:  Open                         Component Version:  CVS               
Platform Version:  Linux - SuSE       Reproducibility:  Every Time          

Summary:  Bug in Postgres Code 

Original Submission:  PHPGroupware submits a lot of Queries in the Form

SELECT * FROM TABLE WHERE id=''

Postgres doesn't like this. (Because id is numerical. '' indicates a string, 
therefore Postgres is confused)

I fixed this with the Workaround below:





diff class.db_pgsql.inc.php class.db_pgsql.inc.php.orig

211,216d210

< /* Postgres chokes on  Queries like WHERE id='' */

< /* We only do the replacement if this is a Select */

< if (strpos(strtoupper($Query_String) , "SELECT" ) !== false )

< {

<    $Query_String = str_replace("''","'0'",$Query_String);

< }



This is not a permanent solution, it would be better to fix the problem itself.

Follow-up Comments
*******************

-------------------------------------------------------
Date: Mon 11/17/2003 at 19:46       By: None
This did not work, here is my error:



Database error: Invalid SQL: SELECT * FROM phpgw_accounts WHERE account_id='0'

PostgreSQL Error: 1 (ERROR: pg_atoi: zero-length string )



File: 
/var/www/localhost/htdocs/phpgroupware/phpgwapi/inc/class.accounts_sql.inc.php

Line: 50



Session halted.






CC list is empty


No files currently attached


For detailed info, follow this link:
http://savannah.gnu.org/bugs/?func=detailbug&bug_id=6557&group_id=509

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]