6.0.0-beta1
7/16/25

[#2749] bugfix (and whitespace fixes) for lib/Horde/SessionHandler/pgsql.php
Summary bugfix (and whitespace fixes) for lib/Horde/SessionHandler/pgsql.php
Queue Horde Framework Packages
Queue Version FRAMEWORK_3
Type Bug
State Resolved
Priority 2. Medium
Owners
Requester cbs (at) cts (dot) ucla (dot) edu
Created 10/09/2005 (7220 days ago)
Due
Updated 10/15/2005 (7214 days ago)
Assigned 10/11/2005 (7218 days ago)
Resolved 10/12/2005 (7217 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
10/15/2005 03:30:47 AM cbs (at) cts (dot) ucla (dot) edu Comment #6 Reply to this comment
Committed, thanks.
An extra BEGIN crept into my last diff.  Line 106 currently reads



          $query = sprintf('BEGIN; SELECT session_data FROM %s WHERE ' .



but should read



          $query = sprintf('SELECT session_data FROM %s WHERE ' .


10/12/2005 05:53:30 PM Chuck Hagenbuch Comment #5
State ⇒ Resolved
Reply to this comment
Committed, thanks.
10/12/2005 03:23:17 PM Chuck Hagenbuch Deleted Original Message
 
10/12/2005 07:50:18 AM cbs (at) cts (dot) ucla (dot) edu Comment #4
New Attachment: pgsql.php.diff Download
Reply to this comment
The attached diff is against the latest framework HEAD snapshot.
10/11/2005 10:00:21 PM Chuck Hagenbuch Taken from Horde DevelopersHorde Developers
Taken from Chuck Hagenbuch
 
10/11/2005 10:00:05 PM Chuck Hagenbuch Comment #3
State ⇒ Feedback
Reply to this comment
This patch does not apply cleanly to either HEAD or FRAMEWORK_3 CVS. 
Please re-do the patch against HEAD and we'll get it backported once 
it's tested.
10/10/2005 07:06:51 PM Chuck Hagenbuch Deleted Original Message
 
10/09/2005 10:21:36 PM cbs (at) cts (dot) ucla (dot) edu Comment #2
New Attachment: pgsql.php[1].diff
Reply to this comment
I have a better patch that more closely approximates what mysql.php is doing.



This patch modified read() to only do a SELECT FOR UPDATE on the 
session id.  If the row exists, this will lock it for the duration of 
the transaction.



It changes write() to do a SELECT on the session id to determine if 
there are any rows with that id.  If there aren't any, it does an 
INSERT.  If there is a row it does an UPDATE.  This is more closely 
akin to the MySQL REPLACE INTO from mysql.php.



I am now able to authenticate and get a session.  Turba, Gollem, 
Kronolith, and Nag are all functioning normally as far as I can tell.



I am having problems with Imp -- trying to select a message or change 
folders (anything that involves imp/message.php, imp/mailbox.php, 
imp/search.php) returns me to 
imp/mailbox.php?mailbox=INBOX&actionID=login
10/09/2005 10:10:26 PM Chuck Hagenbuch Assigned to Chuck Hagenbuch
Assigned to Horde DevelopersHorde Developers
State ⇒ Assigned
 
10/09/2005 10:36:31 AM cbs (at) cts (dot) ucla (dot) edu Comment #1
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ bugfix (and whitespace fixes) for lib/Horde/SessionHandler/pgsql.php
Queue ⇒ Horde Framework Packages
New Attachment: pgsql.php.diff Download
State ⇒ Unconfirmed
Reply to this comment
The write() handler in pgsql.php is checking the result of the COMMIT, 
not the result of the UPDATE.  The current check tests 
pg_rows_affected(), which is 0, and always results in true.  The test 
should (I think) be checking result of the UPDATE to ensure that 1 row 
was updated.  See the thread on horde@lists with the subject "horde 
3.0.5, postgresql session handler fails" from Oct. 8 for more details.

Saved Queries