mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-09 20:12:14 +09:00
Fix handling of empty string arguments in write queries
This commit is contained in:
parent
5dc1eb0762
commit
5496180b47
2 changed files with 19 additions and 2 deletions
|
|
@ -344,6 +344,7 @@ class DB
|
||||||
{
|
{
|
||||||
$output = $this->setError(-1, $e->getMessage());
|
$output = $this->setError(-1, $e->getMessage());
|
||||||
$output->add('_query', $query_string);
|
$output->add('_query', $query_string);
|
||||||
|
$output->add('_args', $query_params);
|
||||||
$output->add('_elapsed_time', '0.00000');
|
$output->add('_elapsed_time', '0.00000');
|
||||||
$output->page_navigation = new \PageHandler(0, 0, 0);
|
$output->page_navigation = new \PageHandler(0, 0, 0);
|
||||||
$this->_query_id = '';
|
$this->_query_id = '';
|
||||||
|
|
|
||||||
|
|
@ -50,8 +50,16 @@ class VariableBase
|
||||||
elseif ($args[$this->var] === '')
|
elseif ($args[$this->var] === '')
|
||||||
{
|
{
|
||||||
$this->filterValue($args[$this->var]);
|
$this->filterValue($args[$this->var]);
|
||||||
|
if ($this instanceof ColumnWrite)
|
||||||
|
{
|
||||||
|
$value = $args[$this->var];
|
||||||
|
$is_expression = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
list($is_expression, $value) = $this->getDefaultValue();
|
list($is_expression, $value) = $this->getDefaultValue();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->filterValue($args[$this->var]);
|
$this->filterValue($args[$this->var]);
|
||||||
|
|
@ -280,9 +288,17 @@ class VariableBase
|
||||||
if ($this->var && Query::isValidVariable($args[$this->var], $this instanceof ColumnWrite))
|
if ($this->var && Query::isValidVariable($args[$this->var], $this instanceof ColumnWrite))
|
||||||
{
|
{
|
||||||
if ($args[$this->var] === '')
|
if ($args[$this->var] === '')
|
||||||
|
{
|
||||||
|
if ($this instanceof ColumnWrite)
|
||||||
|
{
|
||||||
|
$value = $args[$this->var];
|
||||||
|
$is_expression = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
list($is_expression, $value) = $this->getDefaultValue();
|
list($is_expression, $value) = $this->getDefaultValue();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$is_expression = false;
|
$is_expression = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue