From ae66957dbe5557b6c94c4a5e61dec6fa315a2a36 Mon Sep 17 00:00:00 2001 From: Tigrov Date: Wed, 6 Sep 2023 10:01:06 +0700 Subject: [PATCH] Change order of checks --- src/QueryBuilder/AbstractDMLQueryBuilder.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/QueryBuilder/AbstractDMLQueryBuilder.php b/src/QueryBuilder/AbstractDMLQueryBuilder.php index 62016aabe..8a17d86ba 100644 --- a/src/QueryBuilder/AbstractDMLQueryBuilder.php +++ b/src/QueryBuilder/AbstractDMLQueryBuilder.php @@ -198,15 +198,15 @@ protected function prepareInsertSelectSubQuery(QueryInterface $columns, array $p */ protected function prepareInsertValues(string $table, array|QueryInterface $columns, array $params = []): array { + if (empty($columns)) { + return [[], [], 'DEFAULT VALUES', []]; + } + if ($columns instanceof QueryInterface) { [$names, $values, $params] = $this->prepareInsertSelectSubQuery($columns, $params); return [$names, [], $values, $params]; } - if (empty($columns)) { - return [[], [], 'DEFAULT VALUES', []]; - } - $names = []; $placeholders = []; $columns = $this->normalizeColumnNames($columns);