Skip to content

Commit

Permalink
Update vendored DuckDB sources to f7ae8cb
Browse files Browse the repository at this point in the history
  • Loading branch information
duckdblabs-bot committed Sep 14, 2024
1 parent f7ae8cb commit 966fb56
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/duckdb/src/common/types/bit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ void Bit::BitToBlob(string_t bit, string_t &output_blob) {
idx_t size = output_blob.GetSize();

output[0] = UnsafeNumericCast<char>(GetFirstByte(bit));
if (size > 2) {
if (size >= 2) {
++output;
// First byte in bitstring contains amount of padded bits,
// second byte in bitstring is the padded byte,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "duckdb/common/vector_operations/vector_operations.hpp"
#include "duckdb/common/operator/comparison_operators.hpp"
#include "duckdb/common/types/null_value.hpp"
#include "duckdb/main/config.hpp"
#include "duckdb/planner/expression.hpp"
#include "duckdb/planner/expression/bound_comparison_expression.hpp"
#include "duckdb/planner/expression_binder.hpp"
Expand Down Expand Up @@ -330,7 +331,7 @@ unique_ptr<FunctionData> BindMinMax(ClientContext &context, AggregateFunction &f
vector<unique_ptr<Expression>> &arguments) {
if (arguments[0]->return_type.id() == LogicalTypeId::VARCHAR) {
auto str_collation = StringType::GetCollation(arguments[0]->return_type);
if (!str_collation.empty()) {
if (!str_collation.empty() || !DBConfig::GetConfig(context).options.collation.empty()) {
// If aggr function is min/max and uses collations, replace bound_function with arg_min/arg_max
// to make sure the result's correctness.
string function_name = function.name == "min" ? "arg_min" : "arg_max";
Expand Down
6 changes: 3 additions & 3 deletions src/duckdb/src/function/table/version/pragma_version.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef DUCKDB_PATCH_VERSION
#define DUCKDB_PATCH_VERSION "1-dev100"
#define DUCKDB_PATCH_VERSION "1-dev122"
#endif
#ifndef DUCKDB_MINOR_VERSION
#define DUCKDB_MINOR_VERSION 1
Expand All @@ -8,10 +8,10 @@
#define DUCKDB_MAJOR_VERSION 1
#endif
#ifndef DUCKDB_VERSION
#define DUCKDB_VERSION "v1.1.1-dev100"
#define DUCKDB_VERSION "v1.1.1-dev122"
#endif
#ifndef DUCKDB_SOURCE_ID
#define DUCKDB_SOURCE_ID "9af117f0e6"
#define DUCKDB_SOURCE_ID "b369bcb4e0"
#endif
#include "duckdb/function/table/system_functions.hpp"
#include "duckdb/main/database.hpp"
Expand Down
17 changes: 12 additions & 5 deletions src/duckdb/src/include/duckdb/main/extension_entries.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,11 +511,18 @@ static constexpr ExtensionEntry EXTENSION_SECRET_TYPES[] = {
// Note: these are currently hardcoded in scripts/generate_extensions_function.py
// TODO: automate by passing though to script via duckdb
static constexpr ExtensionEntry EXTENSION_SECRET_PROVIDERS[] = {
{"s3/config", "httpfs"}, {"gcs/config", "httpfs"},
{"r2/config", "httpfs"}, {"s3/credential_chain", "aws"},
{"gcs/credential_chain", "aws"}, {"r2/credential_chain", "aws"},
{"azure/config", "azure"}, {"azure/credential_chain", "azure"},
{"huggingface/config", "httfps"}, {"huggingface/credential_chain", "httpfs"},
{"s3/config", "httpfs"},
{"gcs/config", "httpfs"},
{"r2/config", "httpfs"},
{"s3/credential_chain", "aws"},
{"gcs/credential_chain", "aws"},
{"r2/credential_chain", "aws"},
{"azure/access_token", "azure"},
{"azure/config", "azure"},
{"azure/credential_chain", "azure"},
{"azure/service_principal", "azure"},
{"huggingface/config", "httfps"},
{"huggingface/credential_chain", "httpfs"},
{"bearer/config", "httpfs"}}; // EXTENSION_SECRET_PROVIDERS

static constexpr const char *AUTOLOADABLE_EXTENSIONS[] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ class ExpressionBinder {
const optional_ptr<bind_lambda_function_t> bind_lambda_function,
const LogicalType &list_child_type);

static unique_ptr<ParsedExpression> GetSQLValueFunction(const string &column_name);
virtual unique_ptr<ParsedExpression> GetSQLValueFunction(const string &column_name);

LogicalType ResolveOperatorType(OperatorExpression &op, vector<unique_ptr<Expression>> &children);
LogicalType ResolveCoalesceType(OperatorExpression &op, vector<unique_ptr<Expression>> &children);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class SelectBinder : public BaseSelectBinder {
BindResult BindColumnRef(unique_ptr<ParsedExpression> &expr_ptr, idx_t depth, bool root_expression) override;

bool QualifyColumnAlias(const ColumnRefExpression &colref) override;
unique_ptr<ParsedExpression> GetSQLValueFunction(const string &column_name) override;

protected:
idx_t unnest_level = 0;
Expand Down
9 changes: 9 additions & 0 deletions src/duckdb/src/planner/expression_binder/select_binder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ SelectBinder::SelectBinder(Binder &binder, ClientContext &context, BoundSelectNo
: BaseSelectBinder(binder, context, node, info) {
}

unique_ptr<ParsedExpression> SelectBinder::GetSQLValueFunction(const string &column_name) {
auto alias_entry = node.bind_state.alias_map.find(column_name);
if (alias_entry != node.bind_state.alias_map.end()) {
// don't replace SQL value functions if they are in the alias map
return nullptr;
}
return ExpressionBinder::GetSQLValueFunction(column_name);
}

BindResult SelectBinder::BindColumnRef(unique_ptr<ParsedExpression> &expr_ptr, idx_t depth, bool root_expression) {
// first try to bind the column reference regularly
auto result = BaseSelectBinder::BindColumnRef(expr_ptr, depth, root_expression);
Expand Down

0 comments on commit 966fb56

Please sign in to comment.