Commit b1bdd4ac authored by Dries's avatar Dries

- Patch #41870 by fgm: improved debugging support.

parent 68820e23
......@@ -101,6 +101,8 @@ function _db_query($query, $debug = 0) {
$result = mysql_query($query, $active_db);
if (variable_get('dev_query', 0)) {
$bt = debug_backtrace();
$query = $bt[2]['function'] . "\n" . $query;
list($usec, $sec) = explode(' ', microtime());
$stop = (float)$usec + (float)$sec;
$diff = $stop - $timer;
......
......@@ -102,6 +102,8 @@ function _db_query($query, $debug = 0) {
$result = mysqli_query($active_db, $query);
if (variable_get('dev_query', 0)) {
$bt = debug_backtrace();
$query = $bt[2]['function'] . "\n" . $query;
list($usec, $sec) = explode(' ', microtime());
$stop = (float)$usec + (float)$sec;
$diff = $stop - $timer;
......
......@@ -84,6 +84,8 @@ function _db_query($query, $debug = 0) {
$last_result = pg_query($active_db, $query);
if (variable_get('dev_query', 0)) {
$bt = debug_backtrace();
$query = $bt[2]['function'] . "\n" . $query;
list($usec, $sec) = explode(' ', microtime());
$stop = (float)$usec + (float)$sec;
$diff = $stop - $timer;
......
......@@ -53,8 +53,8 @@ function sess_write($key, $value) {
$result = db_query("SELECT sid FROM {sessions} WHERE sid = '%s'", $key);
if (!db_num_rows($result)) {
// Only save session data when when the browser sends a cookie. This keeps
// crawlers out of session table. This improves speed up queries, reduces
// Only save session data when when the browser sends a cookie. This keeps
// crawlers out of session table. This improves speed up queries, reduces
// memory, and gives more useful statistics. We can't eliminate anonymous
// session table rows without breaking throttle modulee and "Who's Online"
// block.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment