Fix warnings when executing unusual queries

This commit is contained in:
Kijin Sung 2022-11-22 13:34:17 +09:00
parent e94146b490
commit 4926a44ecc
2 changed files with 11 additions and 3 deletions

View file

@ -1193,8 +1193,16 @@ class DB
$result['called_file'] = $backtrace[$no]['file']; $result['called_file'] = $backtrace[$no]['file'];
$result['called_line'] = $backtrace[$no]['line']; $result['called_line'] = $backtrace[$no]['line'];
$no++; $no++;
$result['called_method'] = $backtrace[$no]['class'] . $backtrace[$no]['type'] . $backtrace[$no]['function']; if (isset($backtrace[$no]))
$result['backtrace'] = array_slice($backtrace, $no, 1); {
$result['called_method'] = $backtrace[$no]['class'] . $backtrace[$no]['type'] . $backtrace[$no]['function'];
$result['backtrace'] = array_slice($backtrace, $no, 1);
}
else
{
$result['called_method'] = '';
$result['backtrace'] = [];
}
break; break;
} }
} }

View file

@ -89,7 +89,7 @@ class VariableBase
} }
elseif ($this->not_null) elseif ($this->not_null)
{ {
throw new \Rhymix\Framework\Exceptions\QueryError('Variable ' . $this->var . ' for column ' . $this->column . ' is not set'); throw new \Rhymix\Framework\Exceptions\QueryError('Variable ' . $this->var . ' for column ' . ($this->column ?? 'unknown') . ' is not set');
} }
elseif (!in_array($this->operation, ['null', 'notnull', 'not_null'])) elseif (!in_array($this->operation, ['null', 'notnull', 'not_null']))
{ {