mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 02:31:40 +09:00
PROPERLY fix null value handling in both read and write queries
This commit is contained in:
parent
7f5f67992d
commit
7f6e020d97
6 changed files with 158 additions and 0 deletions
|
|
@ -51,6 +51,17 @@ class VariableBase
|
|||
$this->filterValue('');
|
||||
$value = strval($args[$this->var]);
|
||||
$is_expression = true;
|
||||
if ($args[$this->var] instanceof NullValue)
|
||||
{
|
||||
if ($this->not_null)
|
||||
{
|
||||
throw new \Rhymix\Framework\Exceptions\QueryError('Variable ' . $this->var . ' for column ' . $this->column . ' must not be null');
|
||||
}
|
||||
if ($this instanceof Condition && in_array($this->operation, ['equal', 'notequal', 'not_equal']))
|
||||
{
|
||||
$this->operation = ($this->operation === 'equal') ? 'null' : 'notnull';
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($args[$this->var] === '')
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue