]> git.mxchange.org Git - friendica.git/commitdiff
Setting for the callstack in the database query added
authorMichael Vogel <ike@pirati.ca>
Fri, 21 Oct 2016 23:42:45 +0000 (23:42 +0000)
committerMichael Vogel <ike@pirati.ca>
Fri, 21 Oct 2016 23:42:45 +0000 (23:42 +0000)
include/dba.php
include/dbstructure.php

index c7b598f2d68e09ed2f3a9ead81d25d23f00d7265..0b5af341e52f7af9244519d643e9fd9b26b1adc0 100644 (file)
@@ -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')) {
index b28e072f9e23198b170f4e2955f4f540fe529cac..b0f90ae245a681c3cc6e4d457d0a71594190f51e 100644 (file)
@@ -557,6 +557,7 @@ function db_definition($charset) {
                        "indexes" => array(
                                        "PRIMARY" => array("id"),
                                        "uid" => array("uid"),
+                                       "addr_uid" => array("addr", "uid"),
                                        "nurl" => array("nurl"),
                                        )
                        );