6.0.0-git
2019-03-18

[#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 2005-10-09 (4908 days ago)
Due
Updated 2005-10-15 (4902 days ago)
Assigned 2005-10-11 (4906 days ago)
Resolved 2005-10-12 (4905 days ago)
Milestone
Patch No

History
2005-10-15 03:30:47 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 ' .


2005-10-12 17:53:30 Chuck Hagenbuch Comment #5
State ⇒ Resolved
Reply to this comment
Committed, thanks.
2005-10-12 15:23:17 Chuck Hagenbuch Deleted Original Message
 
2005-10-12 07:50:18 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.
2005-10-11 22:00:21 Chuck Hagenbuch Taken from Horde DevelopersHorde Developers
Taken from Chuck Hagenbuch
 
2005-10-11 22:00:05 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.
2005-10-10 19:06:51 Chuck Hagenbuch Deleted Original Message
 
2005-10-09 22:21:36 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
2005-10-09 22:10:26 Chuck Hagenbuch Assigned to Chuck Hagenbuch
Assigned to Horde DevelopersHorde Developers
State ⇒ Assigned
 
2005-10-09 10:36:31 cbs (at) cts (dot) ucla (dot) edu Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Summary ⇒ bugfix (and whitespace fixes) for lib/Horde/SessionHandler/pgsql.php
Queue ⇒ Horde Framework Packages
New Attachment: pgsql.php.diff Download
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