Pass "declare" statement.

@param array $statement
762928
public function declareVariables(array $statement)
    {
        if (isset($statement['data-type'])) {
            if ('variable' != $statement['data-type']) {
                return;
            }
        }

        foreach ($statement['variables'] as $variable) {
            if (isset($variable['expr'])) {
                if ('string' == $variable['expr']['type'] || 'empty-array' == $variable['expr']['type'] || 'array' == $variable['expr']['type']) {
                    continue;
                }
            }

            $this->increaseMutations($variable['variable']);
        }
    }
244461
protected function statementsContainReturn(array $statements)
    {
        foreach ($statements as $statement) {
            if ($statement instanceof Stmt\Return_) {
                return true;
            }

            if (empty($statement->stmts)) {
                continue;
            }

            if ($this->statementsContainReturn($statement->stmts)) {
                return true;
            }
        }

        return false;
    }
229840
protected function _decorateStatement($statement)
    {
        $typeMap = $this->getSelectTypeMap();
        $driver = $this->getConnection()->getDriver();

        if ($this->typeCastEnabled && $typeMap->toArray()) {
            $statement = new CallbackStatement($statement, $driver, new FieldTypeConverter($typeMap, $driver));
        }

        foreach ($this->_resultDecorators as $f) {
            $statement = new CallbackStatement($statement, $driver, $f);
        }

        return $statement;
    }
401211
private static function isEndQuote($statement)
    {
        $trimmed = Multibyte::trim($statement);
        $first = mb_substr($statement, 0, 1);

        return in_array($trimmed, ['"', '\''])
            || (
                in_array($first, ['"', '\''])
                && mb_substr($statement, 1, 1) === ' '
                && ctype_lower(mb_substr($statement, 2, 1)) === true
            );
    }
300634
public function prepare($statement, $driverOpts = null) {
		if ($driverOpts === null) {
			$driverOpts = [];
		}

		try {
			$stmt = $this->pdo->prepare($statement, $driverOpts);
			return new PreparedStatement($stmt, $this->pdo, $this->exceptionAdapter);
		} catch (PDOException $e) {
			throw $this->exceptionAdapter->adapt($e, $statement);
		}
	}
1027671
protected static function makeStatement($statement)
    {
        $self  = self::getInstance();

        $optionWhere = (!empty($self->optionWhere)) ? " WHERE ". substr(implode("", $self->optionWhere), 4) : null;
        $optionJoin  = implode("", $self->optionJoin);
        $optionOrder = $self->optionOrder;
        $optionLimit = $self->optionLimit;

        return $statement.$optionJoin.$optionWhere.$optionOrder.$optionLimit;
    }
110191
function exec($statement) {

		if (self::$logQueries) {
			$start = microtime(true);
			$result = parent::exec($statement);
			$time = microtime(true) - $start;
			$this->logQuery((string) $statement, $time);
			return $result;
		}
		if (self::$printQueries) {
			$this->printQuery((string) $statement);
		}

		return parent::exec($statement);
	}
808859
private function doBind(Statement $stmt)
    {
        foreach ($this->boundValues as $key => $value) {
            $stmt->bindValue($key, $value, $this->boundValuesType[$key]);
        }
        foreach ($this->boundParameters as $key => &$value) {
            $stmt->bindParam($key, $value, $this->boundParametersType[$key]);
        }
    }
356071
function prepare($statement = null, array $placeholders = null) {
		$this->dbh !== null or $this->setup();

		if ($placeholders !== null) {
			$consts = [];
			foreach ($placeholders as $key => $val) {
				$consts["[$key]"] = $val;
			}

			return \fenrir\MysqlStatement::instance($this->dbh, strtr($statement, $consts));
		}
		else { // placeholders === null
			return \fenrir\MysqlStatement::instance($this->dbh, $statement);
		}
	}
215795
public function bind($array) {
        foreach ($array as $fieldname => $value) {
            if ($this->getField($fieldname) != "")
                $this->getField($fieldname)->setValue($value);
        }
    }
337239
protected function write(array $record): void
    {
        $this->hub->withScope(
            function (Scope $scope) use ($record) {
                if (!empty($record['context']['extra'])) {
                    foreach ($record['context']['extra'] as $key => $tag) {
                        $scope->setExtra($key, $tag);
                    }
                    unset($record['context']['extra']);
                }

                if (!empty($record['context']['tags'])) {
                    foreach ($record['context']['tags'] as $key => $tag) {
                        $scope->setTag($key, $tag);
                    }
                    unset($record['context']['tags']);
                }

                if (!empty($record['extra'])) {
                    foreach ($record['extra'] as $key => $extra) {
                        $scope->setExtra($key, $extra);
                    }
                }

                if (!empty($record['context']['fingerprint'])) {
                    $scope->setFingerprint($record['context']['fingerprint']);
                    unset($record['context']['fingerprint']);
                }

                if (!empty($record['context']['user'])) {
                    $scope->setUser($record['context']['user']);
                    unset($record['context']['user']);
                }

                $scope->addEventProcessor(
                    function (Event $event) use ($record) {
                        if (!empty($record['context']['logger'])) {
                            $event->setLogger($record['context']['logger']);
                            unset($record['context']['logger']);
                        } else {
                            $event->setLogger($record['channel']);
                        }

                        if (!empty($this->environment) && !$event->getEnvironment()) {
                            $event->setEnvironment($this->environment);
                        }

                        if (!empty($this->release) && !$event->getRelease()) {
                            $event->setRelease($this->release);
                        }

                        if (isset($record['context']['exception']) && $record['context']['exception'] instanceof \Throwable) {
                            $event->setMessage($record['formatted']);
                        }

                        return $event;
                    }
                );

                if (isset($record['context']['exception']) && $record['context']['exception'] instanceof \Throwable) {
                    $this->hub->captureException($record['context']['exception']);
                } else {
                    $this->hub->captureMessage($record['formatted'], $this->getLogLevel($record['level']));
                }
            }
        );
    }
849256
public function exec($statement, $params) 
    {
        $this->count++;
        try {
            return $this->persistence->exec($statement, $params);
        } catch (\PDOException $e) {
            \common_Logger::w('Failed: '.$statement);
            throw $e;
        }
    }
948288
public function addWhere(array $where): void
    {
        if (empty($where)) {
            return;
        }

        $firstClause = true;
        $this->statement .= ' WHERE ';
        foreach ($where as $clause) {
            if ($firstClause === false) {
                $this->statement .= ' ' . $clause['concatenator'] . ' ';
            }
            switch ($clause['operator']) {
                case 'IN':
                    $this->addWhereIn($clause['key'], $clause['value'], false);
                    break;
                case 'NOT IN':
                    $this->addWhereIn($clause['key'], $clause['value'], true);
                    break;
                case 'BETWEEN':
                    $this->addWhereBetween($clause['key'], $clause['value']['min'], $clause['value']['max']);
                    break;
                case 'NULL':
                    $this->addWhereNull($clause['key'], false);
                    break;
                case 'NOT NULL':
                    $this->addWhereNull($clause['key'], true);
                    break;
                default:
                    $this->addSimpleWhere($clause['key'], $clause['operator'], $clause['value']);
                    break;
            }

            $firstClause = false;
        }
    }
455064
public function bindValues($statement, $bindings)
    {
        foreach ($bindings as $key => $value) {
            $statement->bindValue(
                is_string($key) ? $key : $key + 1, $value,
                is_int($value) ? PDO::PARAM_INT : PDO::PARAM_STR
            );
        }
    }
171995
public function copyFromArray(array &$array)
    {
        // key
        $this->setKey(
            LanguageUtility::getFromArray('key', $array));

        // value
        $this->setValue(
            LanguageUtility::getFromArray('value', $array));

        // hidden
        $this->setHidden(
            LanguageUtility::getFromArrayAsBoolean('hidden', $array));
    }
496334
protected function handleVariable(array $token)
    {

        $node = $this->createNode('variable');
        $node->name = $token['name'];
        $node->attributes = [];
        $this->current = $node;
    }
726149
protected function replaceTokens($statement)
    {
        $replaces = $this->getTokenReplaces();

        return str_replace(array_keys($replaces), $replaces, $statement);
    }