6.0.0-beta1
7/8/25

[#7542] MDB2 error on changing share permissions with SQL Driver
Summary MDB2 error on changing share permissions with SQL Driver
Queue Horde Framework Packages
Queue Version FRAMEWORK_3
Type Bug
State Resolved
Priority 2. Medium
Owners chuck (at) horde (dot) org
Requester michael.menge (at) zdv (dot) uni-tuebingen (dot) de
Created 10/23/2008 (6102 days ago)
Due
Updated 01/29/2009 (6004 days ago)
Assigned 01/29/2009 (6004 days ago)
Resolved 01/29/2009 (6004 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
01/29/2009 03:53:44 PM Chuck Hagenbuch Comment #9
State ⇒ Resolved
Reply to this comment
executeMultiple is just doing the same thing we do, maybe *slightly* 
more efficiently depending on the actual db handling of prepared 
statements, etc. Anyways this code will be ported to Horde_Db for 
horde 4, so I don't see a need to mess with it if it's working.
01/29/2009 10:53:36 AM Jan Schneider State ⇒ Assigned
 
01/27/2009 03:45:46 PM michael (dot) menge (at) zdv (dot) uni-tuebingen (dot) de Comment #8 Reply to this comment
The changes done for http://bugs.horde.org/ticket/?id=7825 obsolate 
the changes for this Bug

so executeMultiple can be used again.




11/07/2008 05:02:37 PM Chuck Hagenbuch Comment #7 Reply to this comment
This is only on updates; of course it's not ideal, but if there are 
enough updates going on for load to be an issue, you'll run into 
bottlenecks in other places far sooner.



It's not an issue for groups; the debug handler isn't used there (so 
hopefully isn't necessary).
11/07/2008 08:06:17 AM michael (dot) menge (at) zdv (dot) uni-tuebingen (dot) de Comment #6 Reply to this comment
This seems inefficent to me as the connection is resetted and the 
prepare-statement

is executed for every user and group that has permissions on a share. 
I think it would be better

to reset the databaseconnection only if there is a need to do so.



We don't use Groups, but grep -R -F executeMultiple *

showed that there is also lib/Horde/Group/sql.php which uses executeMultiple.

Is there the same problem?




11/07/2008 04:32:09 AM Chuck Hagenbuch Comment #5
Assigned to Chuck Hagenbuch
State ⇒ Resolved
Reply to this comment
The difference isn't in connected_database_name, it's that the 
postgres driver uses real prepared statements while the mysql driver 
emulates them. I think the fix is to just not use executeMultiple. 
Done for 3.3.1.
10/24/2008 10:29:00 AM Jan Schneider Comment #3 Reply to this comment
I updated bug #6997 with the irc discussion that led to the current solution.
10/24/2008 10:20:37 AM Jan Schneider Comment #2
State ⇒ Feedback
Reply to this comment
Even though this patch was a workaround only, it works fine for MySQL. 
Someone who has better knowledge of PostgreSQL's connection handling 
and the details of MDB2 has take a look at it.

My first guess is, that the pgsql driver handles unsetting of 
connected_database_name differently than the mysql driver.
10/23/2008 07:44:12 AM michael (dot) menge (at) zdv (dot) uni-tuebingen (dot) de Comment #1
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒
Queue ⇒ Horde Framework Packages
Summary ⇒ MDB2 error on changing share permissions with SQL Driver
Type ⇒ Bug
Priority ⇒ 2. Medium
Reply to this comment
Horde                      3.3 with (sql shares driver)

MDB2                       2.4.1

MDB2_Driver_pgsql          1.4.1

MDB2_Driver_querysim       0.6.0

MDB2_Schema                0.8.2

PostgreSQL                 8.1.11



Changing permissions for shares ersults in an MDB2 error



prepared statement 
"mdb2_statement_pgsql_0e0c6cd9ec2d2223511d9bc21134714a" does not exist





The executeMultiple() tries to execute the prepared statement for each user,

which has permissions on the share. The databese log shows that the execute

inserts the permissions for the first user (normaly the owner of the share).

Than the databaseconnection is reset. After a reconnect the

next execute fails as the prepared statement does not exist anymore.



The reset of the databaseconnection is caused by the function _selectDB

in lib/Horde/Share/sql.php



The function was introduced with the patch

http://cvs.horde.org/diff.php/framework/Share/Share/sql.php?r1=1.47&r2=1.48&ty=u

which was done to solve the BUG http://bugs.horde.org/ticket/6997




Saved Queries