Skip to content

Commit 7dd9ae6

Browse files
duckdblabs-botgithub-actions[bot]
authored andcommitted
Update vendored DuckDB sources to 5a334c23da
1 parent 9a17fe8 commit 7dd9ae6

3 files changed

Lines changed: 25 additions & 23 deletions

File tree

src/duckdb/extension/icu/third_party/icu/stubdata/stubdata.cpp

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/duckdb/src/function/table/version/pragma_version.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#ifndef DUCKDB_PATCH_VERSION
2-
#define DUCKDB_PATCH_VERSION "4-dev55"
2+
#define DUCKDB_PATCH_VERSION "4-dev67"
33
#endif
44
#ifndef DUCKDB_MINOR_VERSION
55
#define DUCKDB_MINOR_VERSION 4
@@ -8,10 +8,10 @@
88
#define DUCKDB_MAJOR_VERSION 1
99
#endif
1010
#ifndef DUCKDB_VERSION
11-
#define DUCKDB_VERSION "v1.4.4-dev55"
11+
#define DUCKDB_VERSION "v1.4.4-dev67"
1212
#endif
1313
#ifndef DUCKDB_SOURCE_ID
14-
#define DUCKDB_SOURCE_ID "7f217607e4"
14+
#define DUCKDB_SOURCE_ID "5a334c23da"
1515
#endif
1616
#include "duckdb/function/table/system_functions.hpp"
1717
#include "duckdb/main/database.hpp"

src/duckdb/src/parser/parser.cpp

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -165,27 +165,29 @@ bool Parser::StripUnicodeSpaces(const string &query_str, string &new_query) {
165165
return ReplaceUnicodeSpaces(query_str, new_query, unicode_spaces);
166166
}
167167

168-
vector<string> SplitQueryStringIntoStatements(const string &query) {
169-
// Break sql string down into sql statements using the tokenizer
170-
vector<string> query_statements;
171-
auto tokens = Parser::Tokenize(query);
172-
idx_t next_statement_start = 0;
173-
for (idx_t i = 1; i < tokens.size(); ++i) {
174-
auto &t_prev = tokens[i - 1];
175-
auto &t = tokens[i];
176-
if (t_prev.type == SimplifiedTokenType::SIMPLIFIED_TOKEN_OPERATOR) {
177-
// LCOV_EXCL_START
178-
for (idx_t c = t_prev.start; c <= t.start; ++c) {
179-
if (query.c_str()[c] == ';') {
180-
query_statements.emplace_back(query.substr(next_statement_start, t.start - next_statement_start));
181-
next_statement_start = tokens[i].start;
182-
}
168+
vector<string> SplitQueries(const string &input_query) {
169+
vector<string> queries;
170+
auto tokenized_input = Parser::Tokenize(input_query);
171+
size_t last_split = 0;
172+
173+
for (const auto &token : tokenized_input) {
174+
if (token.type == SimplifiedTokenType::SIMPLIFIED_TOKEN_OPERATOR && input_query[token.start] == ';') {
175+
string segment = input_query.substr(last_split, token.start - last_split);
176+
StringUtil::Trim(segment);
177+
if (!segment.empty()) {
178+
segment.append(";");
179+
queries.push_back(std::move(segment));
183180
}
184-
// LCOV_EXCL_STOP
181+
last_split = token.start + 1;
185182
}
186183
}
187-
query_statements.emplace_back(query.substr(next_statement_start, query.size() - next_statement_start));
188-
return query_statements;
184+
string final_segment = input_query.substr(last_split);
185+
StringUtil::Trim(final_segment);
186+
if (!final_segment.empty()) {
187+
final_segment.append(";");
188+
queries.push_back(std::move(final_segment));
189+
}
190+
return queries;
189191
}
190192

191193
void Parser::ParseQuery(const string &query) {
@@ -236,7 +238,7 @@ void Parser::ParseQuery(const string &query) {
236238
throw ParserException::SyntaxError(query, parser_error, parser_error_location);
237239
} else {
238240
// split sql string into statements and re-parse using extension
239-
auto query_statements = SplitQueryStringIntoStatements(query);
241+
auto query_statements = SplitQueries(query);
240242
idx_t stmt_loc = 0;
241243
for (auto const &query_statement : query_statements) {
242244
ErrorData another_parser_error;

0 commit comments

Comments
 (0)