<?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>First time login : error in sql query - single quote</title> 
  <pubDate>Fri, 10 Apr 2026 13:09:11 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/9090</link> 
  <atom:link rel="self" type="application/rss+xml" title="First time login : error in sql query - single quote" href="https://bugs.horde.org/ticket/9090/rss" /> 
  <description>First time login : error in sql query - single quote</description> 
 
   
   
  <item> 
   <title>we use mysql

First time a user logs in, I get the folowin</title> 
   <description>we use mysql

First time a user logs in, I get the folowing error :
MDB2 Error: unknown error

From /tmp/horde.log :
ERR: HORDE [turba] MDB2 Error: unknown error: _execute: [Error message: Unable to execute statement]
[Last executed query: INSERT INTO turba_shares (share_name, share_owner, attribute_name, attribute_params, perm_creator, perm_default, perm_guest, share_flags, share_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)]
[Native code: 0]
 [pid 13193 on line 157of &quot;/var/www/html/horde/libs/Horde/Share/Object/Sql.php&quot;]


From debuging :

$params = (
    [0] =&gt; ce4e0f4be99b33113ba0a0bf47bcf31b
    [1] =&gt; rsalmon
    [2] =&gt; Ronan SALMON&#039;s Address Book
    [3] =&gt; a:3:{s:6:&quot;source&quot;;s:8:&quot;localsql&quot;;s:7:&quot;default&quot;;b:1;s:4:&quot;name&quot;;s:7:&quot;rsalmon&quot;;}
    [4] =&gt; 0
    [5] =&gt; 0
    [6] =&gt; 0
    [7] =&gt; 0
    [8] =&gt; 32
)

If I run the following query from mysql command line (with double quotes in attribute_name), I then can log in :
 INSERT INTO turba_shares (share_name, share_owner, attribute_name, attribute_params, perm_creator, perm_default, perm_guest, share_flags, share_id) VALUES ( &#039;ce4e0f4be99b33113ba0a0bf47bcf31b&#039;,&#039;rsalmon&#039;,&#039;Ronan SALMON&#039;&#039;s Address Book&#039;,&#039;a:3:{s:6:&quot;source&quot;;s:8:&quot;localsql&quot;;s:7:&quot;default&quot;;b:1;s:4:&quot;name&quot;;s:7:&quot;rsalmon&quot;;}&#039;,0,0,0,0,32);



</description> 
   <pubDate>Thu, 10 Jun 2010 15:15:57 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9090#t59096</link> 
  </item> 
   
  <item> 
   <title>What makes you think this has anything to do with single quo</title> 
   <description>What makes you think this has anything to do with single quotes? Do you see anything in the mysql logs that you didn&#039;t tell us?
What do you get in the Horde log, if you log $result-&gt;toString() instead of $result in that line?</description> 
   <pubDate>Tue, 15 Jun 2010 09:19:58 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9090#t59115</link> 
  </item> 
   
  <item> 
   <title>&gt; What makes you think this has anything to do with single q</title> 
   <description>&gt; What makes you think this has anything to do with single quotes? 
You are probably right, at first I though it was the value for attribute_name that wasn&#039;t correctly set.

If I manually run the query &#039;INSERT INTO turba_shares...&#039;, everything then is working fine. 


&gt; Do you see anything in the mysql logs that you didn&#039;t tell us?
No, I don&#039;t see anything wrong but here is the log.
100615 12:40:29	  273 Connect	horde@localhost on horde
		  273 Query	SHOW CHARACTER SET
		  273 Query	SET NAMES &#039;utf8&#039;
		  274 Connect	horde@localhost on horde
		  274 Query	SHOW CHARACTER SET
		  274 Query	SET NAMES &#039;utf8&#039;
		  274 Query	SELECT pref_scope, pref_name, pref_value FROM horde_prefs WHERE pref_uid = &#039;ronan&#039; AND pref_scope = &#039;horde&#039;
		  274 Query	SELECT pref_scope, pref_name, pref_value FROM horde_prefs WHERE pref_uid = &#039;ronan&#039; AND pref_scope = &#039;imp&#039;
		  275 Connect	horde@localhost on horde
		  275 Query	SHOW CHARACTER SET
		  275 Query	SET NAMES &#039;utf8&#039;
		  275 Query	SELECT COUNT(*) FROM horde_perms WHERE perm_name = &#039;turba&#039;
		  274 Query	SELECT pref_scope, pref_name, pref_value FROM horde_prefs WHERE pref_uid = &#039;ronan&#039; AND pref_scope = &#039;turba&#039;
		  276 Connect	horde@localhost on horde
		  277 Connect	horde@localhost on horde
		  277 Query	SHOW CHARACTER SET
		  277 Query	SET NAMES &#039;utf8&#039;
		  277 Query	SELECT g.group_uid AS group_uid, g.group_name AS group_name FROM horde_groups g, horde_groups_members m  WHERE m.user_uid = &#039;ronan&#039; AND g.group_uid = m.group_uid ORDER BY g.group_name
		  276 Init DB	horde
		  276 Query	SELECT DISTINCT s.*  FROM turba_shares s  LEFT JOIN turba_shares_users u ON u.share_id = s.share_id WHERE s.share_owner = &#039;ronan&#039; OR (s.perm_creator &amp; 4) OR (s.perm_default &amp; 4) OR ( u.user_uid = &#039;ronan&#039; AND (u.perm &amp; 4)) ORDER BY s.share_name ASC
		  278 Connect	horde@localhost on horde
		  276 Init DB	horde
		  276 Query	INSERT INTO turba_shares_seq (id) VALUES (NULL)
		  276 Init DB	horde
		  276 Query	SELECT LAST_INSERT_ID()
		  276 Init DB	horde
		  276 Query	DELETE FROM turba_shares_seq WHERE id &lt; 41
		  276 Prepare	INSERT INTO turba_shares (share_name, share_owner, attribute_name, attribute_params, perm_creator, perm_default, perm_guest, share_flags, share_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
		  273 Quit	
		  274 Quit	
		  275 Quit	
		  277 Quit	
		  278 Quit	
		  276 Quit	



&gt; What do you get in the Horde log, if you log $result-&gt;toString() 
&gt; instead of $result in that line?
[mdb2_error: message=&quot;MDB2 Error: unknown error&quot; code=-1 mode=return level=notice prefix=&quot;&quot; info=&quot;_execute: [Error message: Unable to execute statement]
[Last executed query: INSERT INTO turba_shares (share_name, share_owner, attribute_name, attribute_params, perm_creator, perm_default, perm_guest, share_flags, share_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)]
[Native code: 0]
&quot;] [pid 13247 on line 158 of &quot;/var/www/html/horde/libs/Horde/Share/Object/Sql.php&quot;]






Here is horde.log. 
I have pear/MDB2 version 2.4.1 installed
PHP Version: 5.3.2
PEAR Version: 1.9.0


2010-06-15T12:53:35+02:00 DEBUG: HORDE [turba] SQL  (0,0007s)  
	SELECT pref_scope, pref_name, pref_value FROM horde_prefs WHERE
	  pref_uid = &#039;rsalmon&#039; AND pref_scope = &#039;turba&#039; [pid 14812 on line 749 of &quot;/var/www/html/horde/libs/Horde/Db/Adapter/Base.php&quot;]
2010-06-15T12:53:35+02:00 DEBUG: HORDE [turba] Hook pushapp in application turba not called. [pid 14812 on line 1716 of &quot;/var/www/html/horde/libs/Horde.php&quot;]
2010-06-15T12:53:35+02:00 DEBUG: HORDE [turba] Assigning the return value of new by reference is deprecated [pid 14812 on line 390 of &quot;/usr/share/pear/MDB2.php&quot;]
2010-06-15T12:53:35+02:00 DEBUG: HORDE [turba] Assigning the return value of new by reference is deprecated [pid 14812 on line 1885 of &quot;/usr/share/pear/MDB2.php&quot;]
2010-06-15T12:53:35+02:00 DEBUG: HORDE [turba] Assigning the return value of new by reference is deprecated [pid 14812 on line 2572 of &quot;/usr/share/pear/MDB2.php&quot;]
2010-06-15T12:53:35+02:00 DEBUG: HORDE [turba] Assigning the return value of new by reference is deprecated [pid 14812 on line 2595 of &quot;/usr/share/pear/MDB2.php&quot;]
2010-06-15T12:53:35+02:00 DEBUG: HORDE [turba] Assigning the return value of new by reference is deprecated [pid 14812 on line 2940 of &quot;/usr/share/pear/MDB2.php&quot;]
2010-06-15T12:53:35+02:00 DEBUG: HORDE [turba] Assigning the return value of new by reference is deprecated [pid 14812 on line 940 of &quot;/usr/share/pear/MDB2/Driver/mysqli.php&quot;]
2010-06-15T12:53:35+02:00 DEBUG: HORDE [turba] Assigning the return value of new by reference is deprecated [pid 14812 on line 1206 of &quot;/usr/share/pear/MDB2/Driver/mysqli.php&quot;]
2010-06-15T12:53:35+02:00 DEBUG: HORDE [turba] Hook share_init in application horde not called. [pid 14812 on line 1716 of &quot;/var/www/html/horde/libs/Horde.php&quot;]
2010-06-15T12:53:35+02:00 DEBUG: HORDE [turba] SQL  (0,0003s)  
	SELECT g.group_uid AS group_uid, g.group_name AS group_name FROM
	  horde_groups g, horde_groups_members m WHERE m.user_uid = &#039;rsalmon&#039;
	  AND g.group_uid = m.group_uid ORDER BY g.group_name [pid 14812 on line 749 of &quot;/var/www/html/horde/libs/Horde/Db/Adapter/Base.php&quot;]
2010-06-15T12:53:35+02:00 DEBUG: HORDE [turba] SQL Query by Horde_Share_sql::listShares: SELECT DISTINCT s.*  FROM turba_shares s  LEFT JOIN turba_shares_users u ON u.share_id = s.share_id WHERE s.share_owner = &#039;rsalmon&#039; OR (s.perm_creator &amp; 4) OR (s.perm_default &amp; 4) OR ( u.user_uid = &#039;rsalmon&#039; AND (u.perm &amp; 4)) ORDER BY s.share_name ASC [pid 14812 on line 477 of &quot;/var/www/html/horde/libs/Horde/Share/Sql.php&quot;]
2010-06-15T12:53:35+02:00 DEBUG: HORDE [turba] Hook share_list in application horde not called. [pid 14812 on line 1716 of &quot;/var/www/html/horde/libs/Horde.php&quot;]
2010-06-15T12:53:35+02:00 DEBUG: HORDE [turba] Hook share_add in application horde not called. [pid 14812 on line 1716 of &quot;/var/www/html/horde/libs/Horde.php&quot;]
2010-06-15T12:53:35+02:00 DEBUG: HORDE [turba] Hook share_modify in application horde not called. [pid 14812 on line 1716 of &quot;/var/www/html/horde/libs/Horde.php&quot;]
2010-06-15T12:53:35+02:00 INFO: HORDE [turba] 1 [pid 14812 on line 158 of &quot;/var/www/html/horde/libs/Horde/Share/Object/Sql.php&quot;]
2010-06-15T12:53:35+02:00 ERR: HORDE [turba] MDB2 Error: unknown error: _execute: [Error message: Unable to execute statement]
[Last executed query: INSERT INTO turba_shares (share_name, share_owner, attribute_name, attribute_params, perm_creator, perm_default, perm_guest, share_flags, share_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)]
[Native code: 0]
 [pid 14812 on line 160 of &quot;/var/www/html/horde/libs/Horde/Share/Object/Sql.php&quot;]
2010-06-15T12:53:35+02:00 ERR: HORDE [turba] MDB2 Error: unknown error [pid 14812 on line 161 of &quot;/var/www/html/horde/libs/Horde/Share/Object/Sql.php&quot;]
2010-06-15T12:53:35+02:00 ERR: HORDE [imp] MDB2 Error: unknown error [pid 14812 on line 575 of &quot;/var/www/html/horde/turba/lib/Turba.php&quot;]
2010-06-15T12:53:35+02:00 EMERG: HORDE [imp] MDB2 Error: unknown error [pid 14812 on line 575 of &quot;/var/www/html/horde/turba/lib/Turba.php&quot;]
</description> 
   <pubDate>Tue, 15 Jun 2010 10:13:29 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9090#t59122</link> 
  </item> 
   
  <item> 
   <title>That&#039;s not very helpful either. Without a better error messa</title> 
   <description>That&#039;s not very helpful either. Without a better error message, I&#039;m not sure how to proceed.</description> 
   <pubDate>Tue, 15 Jun 2010 12:05:47 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9090#t59131</link> 
  </item> 
   
  <item> 
   <title>I have MySQL 5.1.45 installed.

If found out that (horde/c</title> 
   <description>I have MySQL 5.1.45 installed.

If found out that (horde/config/conf.php) :
- $conf[&#039;sql&#039;][&#039;phptype&#039;] = &#039;mysqli&#039;; -&gt; Fatal error

- $conf[&#039;sql&#039;][&#039;phptype&#039;] = &#039;mysql&#039;; -&gt; Everything OK!

Can this be a MDB2 bug ?
</description> 
   <pubDate>Mon, 28 Jun 2010 09:12:55 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9090#t59232</link> 
  </item> 
   
  <item> 
   <title>This is well possible.</title> 
   <description>This is well possible.</description> 
   <pubDate>Mon, 28 Jun 2010 12:34:04 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9090#t59233</link> 
  </item> 
   
  <item> 
   <title>&gt; This is well possible.

I don&#039;t get this error any more.</title> 
   <description>&gt; This is well possible.

I don&#039;t get this error any more. 
I haven&#039;t updated anything but horde.
</description> 
   <pubDate>Mon, 05 Jul 2010 14:41:50 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/9090#t59322</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
