[Tickets #9090] Re: First time login : error in sql query - single quote

bugs at horde.org bugs at horde.org
Tue Jun 15 10:13:29 UTC 2010


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/9090
------------------------------------------------------------------------------
  Ticket             | 9090
  Updated By         | rsalmon at mbpgroup.com
  Summary            | First time login : error in sql query - single quote
  Queue              | Turba
  Version            | Git master
  Type               | Bug
  State              | Feedback
  Priority           | 1. Low
  Milestone          |
  Patch              |
  Owners             |
------------------------------------------------------------------------------


rsalmon at mbpgroup.com (2010-06-15 06:13) wrote:

> 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't correctly set.

If I manually run the query 'INSERT INTO turba_shares...', everything  
then is working fine.


> Do you see anything in the mysql logs that you didn't tell us?
No, I don't see anything wrong but here is the log.
100615 12:40:29	  273 Connect	horde at localhost on horde
		  273 Query	SHOW CHARACTER SET
		  273 Query	SET NAMES 'utf8'
		  274 Connect	horde at localhost on horde
		  274 Query	SHOW CHARACTER SET
		  274 Query	SET NAMES 'utf8'
		  274 Query	SELECT pref_scope, pref_name, pref_value FROM  
horde_prefs WHERE pref_uid = 'ronan' AND pref_scope = 'horde'
		  274 Query	SELECT pref_scope, pref_name, pref_value FROM  
horde_prefs WHERE pref_uid = 'ronan' AND pref_scope = 'imp'
		  275 Connect	horde at localhost on horde
		  275 Query	SHOW CHARACTER SET
		  275 Query	SET NAMES 'utf8'
		  275 Query	SELECT COUNT(*) FROM horde_perms WHERE perm_name = 'turba'
		  274 Query	SELECT pref_scope, pref_name, pref_value FROM  
horde_prefs WHERE pref_uid = 'ronan' AND pref_scope = 'turba'
		  276 Connect	horde at localhost on horde
		  277 Connect	horde at localhost on horde
		  277 Query	SHOW CHARACTER SET
		  277 Query	SET NAMES 'utf8'
		  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 = 'ronan' 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 =  
'ronan' OR (s.perm_creator & 4) OR (s.perm_default & 4) OR (  
u.user_uid = 'ronan' AND (u.perm & 4)) ORDER BY s.share_name ASC
		  278 Connect	horde at 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 < 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



> What do you get in the Horde log, if you log $result->toString()  
> instead of $result in that line?
[mdb2_error: message="MDB2 Error: unknown error" code=-1 mode=return  
level=notice prefix="" info="_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 13247 on line 158 of  
"/var/www/html/horde/libs/Horde/Share/Object/Sql.php"]






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 = 'rsalmon' AND pref_scope = 'turba' [pid 14812 on line  
749 of "/var/www/html/horde/libs/Horde/Db/Adapter/Base.php"]
2010-06-15T12:53:35+02:00 DEBUG: HORDE [turba] Hook pushapp in  
application turba not called. [pid 14812 on line 1716 of  
"/var/www/html/horde/libs/Horde.php"]
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  
"/usr/share/pear/MDB2.php"]
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  
"/usr/share/pear/MDB2.php"]
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  
"/usr/share/pear/MDB2.php"]
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  
"/usr/share/pear/MDB2.php"]
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  
"/usr/share/pear/MDB2.php"]
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  
"/usr/share/pear/MDB2/Driver/mysqli.php"]
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  
"/usr/share/pear/MDB2/Driver/mysqli.php"]
2010-06-15T12:53:35+02:00 DEBUG: HORDE [turba] Hook share_init in  
application horde not called. [pid 14812 on line 1716 of  
"/var/www/html/horde/libs/Horde.php"]
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 = 'rsalmon'
	  AND g.group_uid = m.group_uid ORDER BY g.group_name [pid 14812 on  
line 749 of "/var/www/html/horde/libs/Horde/Db/Adapter/Base.php"]
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 = 'rsalmon' OR (s.perm_creator & 4) OR (s.perm_default &  
4) OR ( u.user_uid = 'rsalmon' AND (u.perm & 4)) ORDER BY s.share_name  
ASC [pid 14812 on line 477 of  
"/var/www/html/horde/libs/Horde/Share/Sql.php"]
2010-06-15T12:53:35+02:00 DEBUG: HORDE [turba] Hook share_list in  
application horde not called. [pid 14812 on line 1716 of  
"/var/www/html/horde/libs/Horde.php"]
2010-06-15T12:53:35+02:00 DEBUG: HORDE [turba] Hook share_add in  
application horde not called. [pid 14812 on line 1716 of  
"/var/www/html/horde/libs/Horde.php"]
2010-06-15T12:53:35+02:00 DEBUG: HORDE [turba] Hook share_modify in  
application horde not called. [pid 14812 on line 1716 of  
"/var/www/html/horde/libs/Horde.php"]
2010-06-15T12:53:35+02:00 INFO: HORDE [turba] 1 [pid 14812 on line 158  
of "/var/www/html/horde/libs/Horde/Share/Object/Sql.php"]
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  
"/var/www/html/horde/libs/Horde/Share/Object/Sql.php"]
2010-06-15T12:53:35+02:00 ERR: HORDE [turba] MDB2 Error: unknown error  
[pid 14812 on line 161 of  
"/var/www/html/horde/libs/Horde/Share/Object/Sql.php"]
2010-06-15T12:53:35+02:00 ERR: HORDE [imp] MDB2 Error: unknown error  
[pid 14812 on line 575 of "/var/www/html/horde/turba/lib/Turba.php"]
2010-06-15T12:53:35+02:00 EMERG: HORDE [imp] MDB2 Error: unknown error  
[pid 14812 on line 575 of "/var/www/html/horde/turba/lib/Turba.php"]







More information about the bugs mailing list