diff --git a/include/dba.php b/include/dba.php index c7b598f2d6..0b5af341e5 100644 --- a/include/dba.php +++ b/include/dba.php @@ -143,7 +143,11 @@ class dba { $stamp1 = microtime(true); - $sql = "/*".$a->callstack()." */ ".$sql; + $orig_sql = $sql; + + if(x($a->config,'system') && x($a->config['system'],'db_callstack')) { + $sql = "/*".$a->callstack()." */ ".$sql; + } if($this->mysqli) $result = @$this->db->query($sql); @@ -155,7 +159,7 @@ class dba { $a->save_timestamp($stamp1, "database"); - if (strtolower(substr($sql, 0, 6)) != "select") + if (strtolower(substr($orig_sql, 0, 6)) != "select") $a->save_timestamp($stamp1, "database_write"); if(x($a->config,'system') && x($a->config['system'],'db_log')) { diff --git a/include/dbstructure.php b/include/dbstructure.php index b28e072f9e..b0f90ae245 100644 --- a/include/dbstructure.php +++ b/include/dbstructure.php @@ -557,6 +557,7 @@ function db_definition($charset) { "indexes" => array( "PRIMARY" => array("id"), "uid" => array("uid"), + "addr_uid" => array("addr", "uid"), "nurl" => array("nurl"), ) );