<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>MDB2 error on changing share permissions with SQL Driver</title> 
  <pubDate>Fri, 10 Apr 2026 06:34:47 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/7542</link> 
  <atom:link rel="self" type="application/rss+xml" title="MDB2 error on changing share permissions with SQL Driver" href="https://bugs.horde.org/ticket/7542/rss" /> 
  <description>MDB2 error on changing share permissions with SQL Driver</description> 
 
   
   
  <item> 
   <title>Horde                      3.3 with (sql shares driver)

MDB</title> 
   <description>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 &quot;mdb2_statement_pgsql_0e0c6cd9ec2d2223511d9bc21134714a&quot; 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&amp;r2=1.48&amp;ty=u

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



</description> 
   <pubDate>Thu, 23 Oct 2008 07:44:12 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7542#t49895</link> 
  </item> 
   
  <item> 
   <title>Even though this patch was a workaround only, it works fine </title> 
   <description>Even though this patch was a workaround only, it works fine for MySQL. Someone who has better knowledge of PostgreSQL&#039;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.</description> 
   <pubDate>Fri, 24 Oct 2008 10:20:37 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7542#t49946</link> 
  </item> 
   
  <item> 
   <title>I updated bug #6997 with the irc discussion that led to the </title> 
   <description>I updated bug #6997 with the irc discussion that led to the current solution.</description> 
   <pubDate>Fri, 24 Oct 2008 10:29:00 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7542#t49949</link> 
  </item> 
   
  <item> 
   <title>Changes have been made in CVS for this ticket:

http://cvs.h</title> 
   <description>Changes have been made in CVS for this ticket:

http://cvs.horde.org/diff.php/framework/Share/Share/sql.php?r1=1.58&amp;r2=1.59&amp;ty=u
http://cvs.horde.org/diff.php/horde/docs/CHANGES?r1=1.1176&amp;r2=1.1177&amp;ty=u</description> 
   <pubDate>Fri, 07 Nov 2008 04:32:06 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7542#t50434</link> 
  </item> 
   
  <item> 
   <title>The difference isn&#039;t in connected_database_name, it&#039;s that t</title> 
   <description>The difference isn&#039;t in connected_database_name, it&#039;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.</description> 
   <pubDate>Fri, 07 Nov 2008 04:32:09 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7542#t50435</link> 
  </item> 
   
  <item> 
   <title>This seems inefficent to me as the connection is resetted an</title> 
   <description>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&#039;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?



</description> 
   <pubDate>Fri, 07 Nov 2008 08:06:17 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7542#t50441</link> 
  </item> 
   
  <item> 
   <title>This is only on updates; of course it&#039;s not ideal, but if th</title> 
   <description>This is only on updates; of course it&#039;s not ideal, but if there are enough updates going on for load to be an issue, you&#039;ll run into bottlenecks in other places far sooner.



It&#039;s not an issue for groups; the debug handler isn&#039;t used there (so hopefully isn&#039;t necessary).</description> 
   <pubDate>Fri, 07 Nov 2008 17:02:37 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7542#t50450</link> 
  </item> 
   
  <item> 
   <title>The changes done for http://bugs.horde.org/ticket/?id=7825 o</title> 
   <description>The changes done for http://bugs.horde.org/ticket/?id=7825 obsolate the changes for this Bug

so executeMultiple can be used again.



</description> 
   <pubDate>Tue, 27 Jan 2009 15:45:46 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7542#t51992</link> 
  </item> 
   
  <item> 
   <title>executeMultiple is just doing the same thing we do, maybe *s</title> 
   <description>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&#039;t see a need to mess with it if it&#039;s working.</description> 
   <pubDate>Thu, 29 Jan 2009 15:53:44 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7542#t52090</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
