Setting for the callstack in the database query added

This commit is contained in:
Michael Vogel 2016-10-21 23:42:45 +00:00
parent fd3cf1cd02
commit bc324c3ef4
2 changed files with 7 additions and 2 deletions

View file

@ -143,7 +143,11 @@ class dba {
$stamp1 = microtime(true);
$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')) {

View 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"),
)
);