X-Git-Url: http://git.cyclocoop.org/?p=ptitvelo%2Fweb%2Fwww.git;a=blobdiff_plain;f=www%2Fecrire%2Freq%2Fmysql.php;h=3bbd435f73bbfbe70bf0f1adefd25aed2699e826;hp=b485cd870d91c7efffc6c341ec3fa98ecad3aec1;hb=f489d45ae677afde12ba9c9f70f463ea34787b45;hpb=0dda6af18a04031b1ca8e217187966077e752fe3 diff --git a/www/ecrire/req/mysql.php b/www/ecrire/req/mysql.php index b485cd8..3bbd435 100644 --- a/www/ecrire/req/mysql.php +++ b/www/ecrire/req/mysql.php @@ -178,7 +178,17 @@ function spip_mysql_query($query, $serveur='',$requeter=true) { } 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 = (!defined('_DEBUG_SLOW_QUERIES') || !_DEBUG_SLOW_QUERIES) + ? '' + : ' /* ' + .str_replace('*/','@/', + $_SERVER['REQUEST_URI'].' + '.$GLOBALS['ip'] + ) + .' */'; + + $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