|
|
@ -147,7 +147,7 @@ class Database { |
|
|
|
$params = []; |
|
|
|
$count = 0; |
|
|
|
$convType = Db\AbstractStatement::TYPE_NORM_MAP[Statement::TYPES[$type]]; |
|
|
|
foreach($values as $v) { |
|
|
|
foreach ($values as $v) { |
|
|
|
$v = ValueInfo::normalize($v, $convType, null, "sql"); |
|
|
|
if (is_null($v)) { |
|
|
|
// nulls are pointless to have |
|
|
@ -194,7 +194,7 @@ class Database { |
|
|
|
$values = []; |
|
|
|
$like = $this->db->sqlToken("like"); |
|
|
|
$embedSet = sizeof($terms) > ((int) (self::LIMIT_SET_SIZE / sizeof($cols))); |
|
|
|
foreach($terms as $term) { |
|
|
|
foreach ($terms as $term) { |
|
|
|
$embedTerm = ($embedSet && strlen($term) <= self::LIMIT_SET_STRING_LENGTH); |
|
|
|
$term = str_replace(["%", "_", "^"], ["^%", "^_", "^^"], $term); |
|
|
|
$term = "%$term%"; |
|
|
@ -1356,7 +1356,7 @@ class Database { |
|
|
|
} elseif ($pair && $context->$pair()) { |
|
|
|
// option is paired with another which is also being used |
|
|
|
if ($op === ">=") { |
|
|
|
$q->setWhere("{$colDefs[$col]} BETWEEN ? AND ?", [$type, $type], [$context->$m, $context->$pair]); |
|
|
|
$q->setWhere("{$colDefs[$col]} BETWEEN ? AND ?", [$type, $type], [$context->$m, $context->$pair]); |
|
|
|
} else { |
|
|
|
// option has already been paired |
|
|
|
continue; |
|
|
@ -1380,7 +1380,7 @@ class Database { |
|
|
|
} elseif ($pair && $context->not->$pair()) { |
|
|
|
// option is paired with another which is also being used |
|
|
|
if ($op === ">=") { |
|
|
|
$q->setWhereNot("{$colDefs[$col]} BETWEEN ? AND ?", [$type, $type], [$context->not->$m, $context->not->$pair]); |
|
|
|
$q->setWhereNot("{$colDefs[$col]} BETWEEN ? AND ?", [$type, $type], [$context->not->$m, $context->not->$pair]); |
|
|
|
} else { |
|
|
|
// option has already been paired |
|
|
|
continue; |
|
|
@ -1458,7 +1458,7 @@ class Database { |
|
|
|
} |
|
|
|
} |
|
|
|
if ($seen) { |
|
|
|
$spec = $opt['cte_name']."(".implode(",",$opt['cte_cols']).")"; |
|
|
|
$spec = $opt['cte_name']."(".implode(",", $opt['cte_cols']).")"; |
|
|
|
$q->setCTE($spec, $opt['cte_body'], $opt['cte_types'], $opt['cte_values']); |
|
|
|
} |
|
|
|
} |
|
|
|