/* *************************************************************************\
* SPIP, Systeme de publication pour l'internet *
* *
- * Copyright (c) 2001-2012 *
+ * Copyright (c) 2001-2014 *
* Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
* *
* Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
} else $t = 0 ;
$connexion['last'] = $query;
- $r = $link ? mysql_query($query, $link) : mysql_query($query);
+
+ // ajouter un debug utile dans log/mysql-slow.log ?
+ $debug = '';
+ if (defined('_DEBUG_SLOW_QUERIES') AND _DEBUG_SLOW_QUERIES){
+ if($GLOBALS['debug']['aucasou']){
+ list(,$id,, $infos) = $GLOBALS['debug']['aucasou'];
+ $debug .= " BOUCLE$id @ ".$infos[0] ." | ";
+ }
+ $debug .= " " . $_SERVER['REQUEST_URI'].' + '.$GLOBALS['ip'];
+ $debug = ' /*'.str_replace('*/','@/',$debug).' */';
+ }
+
+ $r = $link ? mysql_query($query.$debug, $link) : mysql_query($query.$debug);
if ($e = spip_mysql_errno($serveur)) // Log de l'erreur eventuelle
$e .= spip_mysql_error($query, $serveur); // et du fautif