Fix handling of empty string arguments in write queries

This commit is contained in:
Kijin Sung 2020-07-07 14:03:06 +09:00
parent 5dc1eb0762
commit 5496180b47
2 changed files with 19 additions and 2 deletions

View file

@ -344,6 +344,7 @@ class DB
{
$output = $this->setError(-1, $e->getMessage());
$output->add('_query', $query_string);
$output->add('_args', $query_params);
$output->add('_elapsed_time', '0.00000');
$output->page_navigation = new \PageHandler(0, 0, 0);
$this->_query_id = '';

View file

@ -50,7 +50,15 @@ class VariableBase
elseif ($args[$this->var] === '')
{
$this->filterValue($args[$this->var]);
list($is_expression, $value) = $this->getDefaultValue();
if ($this instanceof ColumnWrite)
{
$value = $args[$this->var];
$is_expression = false;
}
else
{
list($is_expression, $value) = $this->getDefaultValue();
}
}
else
{
@ -281,7 +289,15 @@ class VariableBase
{
if ($args[$this->var] === '')
{
list($is_expression, $value) = $this->getDefaultValue();
if ($this instanceof ColumnWrite)
{
$value = $args[$this->var];
$is_expression = false;
}
else
{
list($is_expression, $value) = $this->getDefaultValue();
}
}
else
{