Merge branch 'develop' into db-search-operator

This commit is contained in:
Min-Soo Kim 2020-12-27 21:24:02 +09:00 committed by GitHub
commit f8ed3b49f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 132 additions and 81 deletions

View file

@ -420,6 +420,11 @@ class DB
$output = $this->setError(-1, $e->getMessage());
return $output;
}
catch (\PDOException $e)
{
$output = $this->setError(-1, $e->getMessage());
return $output;
}
// Collect various counts used in the page calculation.
list($is_expression, $list_count) = $query->navigation->list_count->getValue($args);
@ -477,17 +482,24 @@ class DB
return $stmt;
}
$result = array();
$index = $last_index;
$step = $last_index !== 0 ? -1 : 1;
while ($row = $stmt->fetchObject())
try
{
$result[$index] = $row;
$index += $step;
$result = array();
$index = $last_index;
$step = $last_index !== 0 ? -1 : 1;
while ($row = $stmt->fetchObject())
{
$result[$index] = $row;
$index += $step;
}
$stmt->closeCursor();
}
catch (\PDOException $e)
{
throw new Exceptions\DBError($e->getMessage(), 0, $e);
}
$stmt->closeCursor();
if ($result_type === 'auto' && $last_index === 0 && count($result) === 1)
{

View file

@ -294,6 +294,11 @@ class VariableBase
{
list($is_expression, $value) = $this->getDefaultValue();
}
else
{
$is_expression = null;
$value = null;
}
return [$is_expression, $value];
}