duckdb 0.3.3-dev1293.0 → 0.3.3-dev1302.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/duckdb.cpp +110 -134
- package/src/duckdb.hpp +8 -11
- package/src/parquet-amalgamation.cpp +29948 -29948
package/package.json
CHANGED
package/src/duckdb.cpp
CHANGED
|
@@ -46749,9 +46749,7 @@ void AdaptiveFilter::AdaptRuntimeStatistics(double duration) {
|
|
|
46749
46749
|
|
|
46750
46750
|
|
|
46751
46751
|
|
|
46752
|
-
|
|
46753
46752
|
#include <cmath>
|
|
46754
|
-
#include <map>
|
|
46755
46753
|
|
|
46756
46754
|
namespace duckdb {
|
|
46757
46755
|
|
|
@@ -47966,7 +47964,6 @@ idx_t ExpressionExecutor::Select(const BoundBetweenExpression &expr, ExpressionS
|
|
|
47966
47964
|
|
|
47967
47965
|
|
|
47968
47966
|
|
|
47969
|
-
|
|
47970
47967
|
namespace duckdb {
|
|
47971
47968
|
|
|
47972
47969
|
struct CaseExpressionState : public ExpressionState {
|
|
@@ -50968,9 +50965,6 @@ private:
|
|
|
50968
50965
|
|
|
50969
50966
|
|
|
50970
50967
|
|
|
50971
|
-
|
|
50972
|
-
|
|
50973
|
-
|
|
50974
50968
|
namespace duckdb {
|
|
50975
50969
|
|
|
50976
50970
|
using ValidityBytes = JoinHashTable::ValidityBytes;
|
|
@@ -67004,7 +66998,6 @@ void PartitionableHashTable::Finalize() {
|
|
|
67004
66998
|
|
|
67005
66999
|
|
|
67006
67000
|
|
|
67007
|
-
|
|
67008
67001
|
namespace duckdb {
|
|
67009
67002
|
|
|
67010
67003
|
PerfectAggregateHashTable::PerfectAggregateHashTable(BufferManager &buffer_manager,
|
|
@@ -71876,8 +71869,6 @@ void BaseReservoirSampling::ReplaceElement() {
|
|
|
71876
71869
|
|
|
71877
71870
|
|
|
71878
71871
|
|
|
71879
|
-
#include <cmath>
|
|
71880
|
-
|
|
71881
71872
|
namespace duckdb {
|
|
71882
71873
|
|
|
71883
71874
|
WindowSegmentTree::WindowSegmentTree(AggregateFunction &aggregate, FunctionData *bind_info,
|
|
@@ -78652,6 +78643,9 @@ void HistogramFun::RegisterFunction(BuiltinFunctions &set) {
|
|
|
78652
78643
|
fun.AddFunction(GetHistogramFunction(PhysicalType::VARCHAR));
|
|
78653
78644
|
fun.AddFunction(GetHistogramFunction<int64_t>(LogicalType::TIMESTAMP));
|
|
78654
78645
|
fun.AddFunction(GetHistogramFunction<int64_t>(LogicalType::TIMESTAMP_TZ));
|
|
78646
|
+
fun.AddFunction(GetHistogramFunction<int64_t>(LogicalType::TIMESTAMP_S));
|
|
78647
|
+
fun.AddFunction(GetHistogramFunction<int64_t>(LogicalType::TIMESTAMP_MS));
|
|
78648
|
+
fun.AddFunction(GetHistogramFunction<int64_t>(LogicalType::TIMESTAMP_NS));
|
|
78655
78649
|
set.AddFunction(fun);
|
|
78656
78650
|
}
|
|
78657
78651
|
|
|
@@ -96609,11 +96603,6 @@ void ScalarFunction::NopFunction(DataChunk &input, ExpressionState &state, Vecto
|
|
|
96609
96603
|
|
|
96610
96604
|
|
|
96611
96605
|
|
|
96612
|
-
|
|
96613
|
-
|
|
96614
|
-
|
|
96615
|
-
|
|
96616
|
-
|
|
96617
96606
|
namespace duckdb {
|
|
96618
96607
|
|
|
96619
96608
|
ScalarMacroFunction::ScalarMacroFunction(unique_ptr<ParsedExpression> expression)
|
|
@@ -96640,8 +96629,6 @@ unique_ptr<MacroFunction> ScalarMacroFunction::Copy() {
|
|
|
96640
96629
|
|
|
96641
96630
|
|
|
96642
96631
|
|
|
96643
|
-
|
|
96644
|
-
|
|
96645
96632
|
//===----------------------------------------------------------------------===//
|
|
96646
96633
|
// DuckDB
|
|
96647
96634
|
//
|
|
@@ -98059,7 +98046,6 @@ struct ReadCSVTableFunction {
|
|
|
98059
98046
|
|
|
98060
98047
|
|
|
98061
98048
|
|
|
98062
|
-
|
|
98063
98049
|
#include <limits>
|
|
98064
98050
|
|
|
98065
98051
|
namespace duckdb {
|
|
@@ -98769,6 +98755,7 @@ struct TestAllTypesFun {
|
|
|
98769
98755
|
|
|
98770
98756
|
|
|
98771
98757
|
|
|
98758
|
+
|
|
98772
98759
|
namespace duckdb {
|
|
98773
98760
|
|
|
98774
98761
|
struct PragmaDetailedProfilingOutputOperatorData : public FunctionOperatorData {
|
|
@@ -99317,7 +99304,6 @@ void BuiltinFunctions::RegisterTableFunctions() {
|
|
|
99317
99304
|
|
|
99318
99305
|
|
|
99319
99306
|
|
|
99320
|
-
|
|
99321
99307
|
#include <limits>
|
|
99322
99308
|
|
|
99323
99309
|
namespace duckdb {
|
|
@@ -103346,8 +103332,6 @@ void UDFWrapper::RegisterAggrFunction(AggregateFunction aggr_function, ClientCon
|
|
|
103346
103332
|
|
|
103347
103333
|
|
|
103348
103334
|
|
|
103349
|
-
|
|
103350
|
-
|
|
103351
103335
|
namespace duckdb {
|
|
103352
103336
|
|
|
103353
103337
|
BaseAppender::BaseAppender() : column(0) {
|
|
@@ -104814,7 +104798,6 @@ duckdb_logical_type duckdb_struct_type_child_type(duckdb_logical_type type, idx_
|
|
|
104814
104798
|
|
|
104815
104799
|
|
|
104816
104800
|
|
|
104817
|
-
|
|
104818
104801
|
using duckdb::Connection;
|
|
104819
104802
|
using duckdb::date_t;
|
|
104820
104803
|
using duckdb::dtime_t;
|
|
@@ -106553,67 +106536,6 @@ public:
|
|
|
106553
106536
|
|
|
106554
106537
|
} // namespace duckdb
|
|
106555
106538
|
|
|
106556
|
-
//===----------------------------------------------------------------------===//
|
|
106557
|
-
// DuckDB
|
|
106558
|
-
//
|
|
106559
|
-
// duckdb/parser/statement/execute_statement.hpp
|
|
106560
|
-
//
|
|
106561
|
-
//
|
|
106562
|
-
//===----------------------------------------------------------------------===//
|
|
106563
|
-
|
|
106564
|
-
|
|
106565
|
-
|
|
106566
|
-
|
|
106567
|
-
|
|
106568
|
-
|
|
106569
|
-
|
|
106570
|
-
namespace duckdb {
|
|
106571
|
-
|
|
106572
|
-
class ExecuteStatement : public SQLStatement {
|
|
106573
|
-
public:
|
|
106574
|
-
ExecuteStatement();
|
|
106575
|
-
|
|
106576
|
-
string name;
|
|
106577
|
-
vector<unique_ptr<ParsedExpression>> values;
|
|
106578
|
-
|
|
106579
|
-
protected:
|
|
106580
|
-
ExecuteStatement(const ExecuteStatement &other);
|
|
106581
|
-
|
|
106582
|
-
public:
|
|
106583
|
-
unique_ptr<SQLStatement> Copy() const override;
|
|
106584
|
-
};
|
|
106585
|
-
} // namespace duckdb
|
|
106586
|
-
|
|
106587
|
-
|
|
106588
|
-
//===----------------------------------------------------------------------===//
|
|
106589
|
-
// DuckDB
|
|
106590
|
-
//
|
|
106591
|
-
// duckdb/parser/statement/prepare_statement.hpp
|
|
106592
|
-
//
|
|
106593
|
-
//
|
|
106594
|
-
//===----------------------------------------------------------------------===//
|
|
106595
|
-
|
|
106596
|
-
|
|
106597
|
-
|
|
106598
|
-
|
|
106599
|
-
|
|
106600
|
-
|
|
106601
|
-
namespace duckdb {
|
|
106602
|
-
|
|
106603
|
-
class PrepareStatement : public SQLStatement {
|
|
106604
|
-
public:
|
|
106605
|
-
PrepareStatement();
|
|
106606
|
-
|
|
106607
|
-
unique_ptr<SQLStatement> statement;
|
|
106608
|
-
string name;
|
|
106609
|
-
|
|
106610
|
-
protected:
|
|
106611
|
-
PrepareStatement(const PrepareStatement &other);
|
|
106612
|
-
|
|
106613
|
-
public:
|
|
106614
|
-
unique_ptr<SQLStatement> Copy() const override;
|
|
106615
|
-
};
|
|
106616
|
-
} // namespace duckdb
|
|
106617
106539
|
|
|
106618
106540
|
|
|
106619
106541
|
|
|
@@ -106777,7 +106699,6 @@ private:
|
|
|
106777
106699
|
|
|
106778
106700
|
|
|
106779
106701
|
|
|
106780
|
-
|
|
106781
106702
|
namespace duckdb {
|
|
106782
106703
|
|
|
106783
106704
|
struct ActiveQueryContext {
|
|
@@ -117936,7 +117857,6 @@ using std::ofstream;
|
|
|
117936
117857
|
|
|
117937
117858
|
|
|
117938
117859
|
|
|
117939
|
-
|
|
117940
117860
|
#include <utility>
|
|
117941
117861
|
#include <algorithm>
|
|
117942
117862
|
|
|
@@ -119157,7 +119077,6 @@ public:
|
|
|
119157
119077
|
|
|
119158
119078
|
|
|
119159
119079
|
|
|
119160
|
-
|
|
119161
119080
|
namespace duckdb {
|
|
119162
119081
|
|
|
119163
119082
|
CreateTableRelation::CreateTableRelation(shared_ptr<Relation> child_p, string schema_name, string table_name)
|
|
@@ -119229,7 +119148,6 @@ public:
|
|
|
119229
119148
|
|
|
119230
119149
|
|
|
119231
119150
|
|
|
119232
|
-
|
|
119233
119151
|
namespace duckdb {
|
|
119234
119152
|
|
|
119235
119153
|
CreateViewRelation::CreateViewRelation(shared_ptr<Relation> child_p, string view_name_p, bool replace_p,
|
|
@@ -145683,6 +145601,36 @@ unique_ptr<SQLStatement> DropStatement::Copy() const {
|
|
|
145683
145601
|
}
|
|
145684
145602
|
|
|
145685
145603
|
} // namespace duckdb
|
|
145604
|
+
//===----------------------------------------------------------------------===//
|
|
145605
|
+
// DuckDB
|
|
145606
|
+
//
|
|
145607
|
+
// duckdb/parser/statement/execute_statement.hpp
|
|
145608
|
+
//
|
|
145609
|
+
//
|
|
145610
|
+
//===----------------------------------------------------------------------===//
|
|
145611
|
+
|
|
145612
|
+
|
|
145613
|
+
|
|
145614
|
+
|
|
145615
|
+
|
|
145616
|
+
|
|
145617
|
+
|
|
145618
|
+
namespace duckdb {
|
|
145619
|
+
|
|
145620
|
+
class ExecuteStatement : public SQLStatement {
|
|
145621
|
+
public:
|
|
145622
|
+
ExecuteStatement();
|
|
145623
|
+
|
|
145624
|
+
string name;
|
|
145625
|
+
vector<unique_ptr<ParsedExpression>> values;
|
|
145626
|
+
|
|
145627
|
+
protected:
|
|
145628
|
+
ExecuteStatement(const ExecuteStatement &other);
|
|
145629
|
+
|
|
145630
|
+
public:
|
|
145631
|
+
unique_ptr<SQLStatement> Copy() const override;
|
|
145632
|
+
};
|
|
145633
|
+
} // namespace duckdb
|
|
145686
145634
|
|
|
145687
145635
|
|
|
145688
145636
|
namespace duckdb {
|
|
@@ -145840,6 +145788,35 @@ unique_ptr<SQLStatement> PragmaStatement::Copy() const {
|
|
|
145840
145788
|
}
|
|
145841
145789
|
|
|
145842
145790
|
} // namespace duckdb
|
|
145791
|
+
//===----------------------------------------------------------------------===//
|
|
145792
|
+
// DuckDB
|
|
145793
|
+
//
|
|
145794
|
+
// duckdb/parser/statement/prepare_statement.hpp
|
|
145795
|
+
//
|
|
145796
|
+
//
|
|
145797
|
+
//===----------------------------------------------------------------------===//
|
|
145798
|
+
|
|
145799
|
+
|
|
145800
|
+
|
|
145801
|
+
|
|
145802
|
+
|
|
145803
|
+
|
|
145804
|
+
namespace duckdb {
|
|
145805
|
+
|
|
145806
|
+
class PrepareStatement : public SQLStatement {
|
|
145807
|
+
public:
|
|
145808
|
+
PrepareStatement();
|
|
145809
|
+
|
|
145810
|
+
unique_ptr<SQLStatement> statement;
|
|
145811
|
+
string name;
|
|
145812
|
+
|
|
145813
|
+
protected:
|
|
145814
|
+
PrepareStatement(const PrepareStatement &other);
|
|
145815
|
+
|
|
145816
|
+
public:
|
|
145817
|
+
unique_ptr<SQLStatement> Copy() const override;
|
|
145818
|
+
};
|
|
145819
|
+
} // namespace duckdb
|
|
145843
145820
|
|
|
145844
145821
|
|
|
145845
145822
|
namespace duckdb {
|
|
@@ -153837,6 +153814,8 @@ public:
|
|
|
153837
153814
|
return max_count;
|
|
153838
153815
|
}
|
|
153839
153816
|
|
|
153817
|
+
unique_ptr<Expression> CreateExtraReference(unique_ptr<ParsedExpression> expr);
|
|
153818
|
+
|
|
153840
153819
|
private:
|
|
153841
153820
|
unique_ptr<Expression> CreateProjectionReference(ParsedExpression &expr, idx_t index);
|
|
153842
153821
|
|
|
@@ -153870,9 +153849,13 @@ unique_ptr<Expression> Binder::BindOrderExpression(OrderBinder &order_binder, un
|
|
|
153870
153849
|
return bound_expr;
|
|
153871
153850
|
}
|
|
153872
153851
|
|
|
153873
|
-
unique_ptr<Expression> Binder::BindDelimiter(ClientContext &context,
|
|
153874
|
-
const LogicalType &type,
|
|
153852
|
+
unique_ptr<Expression> Binder::BindDelimiter(ClientContext &context, OrderBinder &order_binder,
|
|
153853
|
+
unique_ptr<ParsedExpression> delimiter, const LogicalType &type,
|
|
153854
|
+
Value &delimiter_value) {
|
|
153875
153855
|
auto new_binder = Binder::CreateBinder(context, this, true);
|
|
153856
|
+
if (delimiter->HasSubquery()) {
|
|
153857
|
+
return order_binder.CreateExtraReference(move(delimiter));
|
|
153858
|
+
}
|
|
153876
153859
|
ExpressionBinder expr_binder(*new_binder, context);
|
|
153877
153860
|
expr_binder.target_type = type;
|
|
153878
153861
|
auto expr = expr_binder.Bind(delimiter);
|
|
@@ -153884,11 +153867,11 @@ unique_ptr<Expression> Binder::BindDelimiter(ClientContext &context, unique_ptr<
|
|
|
153884
153867
|
return expr;
|
|
153885
153868
|
}
|
|
153886
153869
|
|
|
153887
|
-
unique_ptr<BoundResultModifier> Binder::BindLimit(LimitModifier &limit_mod) {
|
|
153870
|
+
unique_ptr<BoundResultModifier> Binder::BindLimit(OrderBinder &order_binder, LimitModifier &limit_mod) {
|
|
153888
153871
|
auto result = make_unique<BoundLimitModifier>();
|
|
153889
153872
|
if (limit_mod.limit) {
|
|
153890
153873
|
Value val;
|
|
153891
|
-
result->limit = BindDelimiter(context, move(limit_mod.limit), LogicalType::BIGINT, val);
|
|
153874
|
+
result->limit = BindDelimiter(context, order_binder, move(limit_mod.limit), LogicalType::BIGINT, val);
|
|
153892
153875
|
if (!result->limit) {
|
|
153893
153876
|
result->limit_val = val.GetValue<int64_t>();
|
|
153894
153877
|
if (result->limit_val < 0) {
|
|
@@ -153898,7 +153881,7 @@ unique_ptr<BoundResultModifier> Binder::BindLimit(LimitModifier &limit_mod) {
|
|
|
153898
153881
|
}
|
|
153899
153882
|
if (limit_mod.offset) {
|
|
153900
153883
|
Value val;
|
|
153901
|
-
result->offset = BindDelimiter(context, move(limit_mod.offset), LogicalType::BIGINT, val);
|
|
153884
|
+
result->offset = BindDelimiter(context, order_binder, move(limit_mod.offset), LogicalType::BIGINT, val);
|
|
153902
153885
|
if (!result->offset) {
|
|
153903
153886
|
result->offset_val = val.GetValue<int64_t>();
|
|
153904
153887
|
if (result->offset_val < 0) {
|
|
@@ -153909,11 +153892,11 @@ unique_ptr<BoundResultModifier> Binder::BindLimit(LimitModifier &limit_mod) {
|
|
|
153909
153892
|
return move(result);
|
|
153910
153893
|
}
|
|
153911
153894
|
|
|
153912
|
-
unique_ptr<BoundResultModifier> Binder::BindLimitPercent(LimitPercentModifier &limit_mod) {
|
|
153895
|
+
unique_ptr<BoundResultModifier> Binder::BindLimitPercent(OrderBinder &order_binder, LimitPercentModifier &limit_mod) {
|
|
153913
153896
|
auto result = make_unique<BoundLimitPercentModifier>();
|
|
153914
153897
|
if (limit_mod.limit) {
|
|
153915
153898
|
Value val;
|
|
153916
|
-
result->limit = BindDelimiter(context, move(limit_mod.limit), LogicalType::DOUBLE, val);
|
|
153899
|
+
result->limit = BindDelimiter(context, order_binder, move(limit_mod.limit), LogicalType::DOUBLE, val);
|
|
153917
153900
|
if (!result->limit) {
|
|
153918
153901
|
result->limit_percent = val.GetValue<double>();
|
|
153919
153902
|
if (result->limit_percent < 0.0) {
|
|
@@ -153923,7 +153906,7 @@ unique_ptr<BoundResultModifier> Binder::BindLimitPercent(LimitPercentModifier &l
|
|
|
153923
153906
|
}
|
|
153924
153907
|
if (limit_mod.offset) {
|
|
153925
153908
|
Value val;
|
|
153926
|
-
result->offset = BindDelimiter(context, move(limit_mod.offset), LogicalType::BIGINT, val);
|
|
153909
|
+
result->offset = BindDelimiter(context, order_binder, move(limit_mod.offset), LogicalType::BIGINT, val);
|
|
153927
153910
|
if (!result->offset) {
|
|
153928
153911
|
result->offset_val = val.GetValue<int64_t>();
|
|
153929
153912
|
}
|
|
@@ -153988,10 +153971,10 @@ void Binder::BindModifiers(OrderBinder &order_binder, QueryNode &statement, Boun
|
|
|
153988
153971
|
break;
|
|
153989
153972
|
}
|
|
153990
153973
|
case ResultModifierType::LIMIT_MODIFIER:
|
|
153991
|
-
bound_modifier = BindLimit((LimitModifier &)*mod);
|
|
153974
|
+
bound_modifier = BindLimit(order_binder, (LimitModifier &)*mod);
|
|
153992
153975
|
break;
|
|
153993
153976
|
case ResultModifierType::LIMIT_PERCENT_MODIFIER:
|
|
153994
|
-
bound_modifier = BindLimitPercent((LimitPercentModifier &)*mod);
|
|
153977
|
+
bound_modifier = BindLimitPercent(order_binder, (LimitPercentModifier &)*mod);
|
|
153995
153978
|
break;
|
|
153996
153979
|
default:
|
|
153997
153980
|
throw Exception("Unsupported result modifier");
|
|
@@ -154002,6 +153985,18 @@ void Binder::BindModifiers(OrderBinder &order_binder, QueryNode &statement, Boun
|
|
|
154002
153985
|
}
|
|
154003
153986
|
}
|
|
154004
153987
|
|
|
153988
|
+
static void AssignReturnType(unique_ptr<Expression> &expr, const vector<LogicalType> &sql_types,
|
|
153989
|
+
idx_t projection_index) {
|
|
153990
|
+
if (!expr) {
|
|
153991
|
+
return;
|
|
153992
|
+
}
|
|
153993
|
+
if (expr->type != ExpressionType::BOUND_COLUMN_REF) {
|
|
153994
|
+
return;
|
|
153995
|
+
}
|
|
153996
|
+
auto &bound_colref = (BoundColumnRefExpression &)*expr;
|
|
153997
|
+
bound_colref.return_type = sql_types[bound_colref.binding.column_index];
|
|
153998
|
+
}
|
|
153999
|
+
|
|
154005
154000
|
void Binder::BindModifierTypes(BoundQueryNode &result, const vector<LogicalType> &sql_types, idx_t projection_index) {
|
|
154006
154001
|
for (auto &bound_mod : result.modifiers) {
|
|
154007
154002
|
switch (bound_mod->type) {
|
|
@@ -154035,6 +154030,18 @@ void Binder::BindModifierTypes(BoundQueryNode &result, const vector<LogicalType>
|
|
|
154035
154030
|
}
|
|
154036
154031
|
break;
|
|
154037
154032
|
}
|
|
154033
|
+
case ResultModifierType::LIMIT_MODIFIER: {
|
|
154034
|
+
auto &limit = (BoundLimitModifier &)*bound_mod;
|
|
154035
|
+
AssignReturnType(limit.limit, sql_types, projection_index);
|
|
154036
|
+
AssignReturnType(limit.offset, sql_types, projection_index);
|
|
154037
|
+
break;
|
|
154038
|
+
}
|
|
154039
|
+
case ResultModifierType::LIMIT_PERCENT_MODIFIER: {
|
|
154040
|
+
auto &limit = (BoundLimitPercentModifier &)*bound_mod;
|
|
154041
|
+
AssignReturnType(limit.limit, sql_types, projection_index);
|
|
154042
|
+
AssignReturnType(limit.offset, sql_types, projection_index);
|
|
154043
|
+
break;
|
|
154044
|
+
}
|
|
154038
154045
|
case ResultModifierType::ORDER_MODIFIER: {
|
|
154039
154046
|
auto &order = (BoundOrderModifier &)*bound_mod;
|
|
154040
154047
|
for (auto &order_node : order.orders) {
|
|
@@ -154663,36 +154670,6 @@ unique_ptr<LogicalOperator> Binder::CreatePlan(BoundSelectNode &statement) {
|
|
|
154663
154670
|
PlanSubqueries(&expr, &root);
|
|
154664
154671
|
}
|
|
154665
154672
|
|
|
154666
|
-
for (size_t i = 0; i < statement.modifiers.size(); i++) {
|
|
154667
|
-
auto &modifier = statement.modifiers[i];
|
|
154668
|
-
unique_ptr<LogicalOperator> limit = nullptr;
|
|
154669
|
-
if (modifier->type == ResultModifierType::LIMIT_MODIFIER) {
|
|
154670
|
-
auto &limit_modifier = (BoundLimitModifier &)*modifier;
|
|
154671
|
-
if (limit_modifier.limit || limit_modifier.offset) {
|
|
154672
|
-
PlanSubqueries(&limit_modifier.limit, &root);
|
|
154673
|
-
PlanSubqueries(&limit_modifier.offset, &root);
|
|
154674
|
-
limit = make_unique<LogicalLimit>(limit_modifier.limit_val, limit_modifier.offset_val,
|
|
154675
|
-
move(limit_modifier.limit), move(limit_modifier.offset));
|
|
154676
|
-
}
|
|
154677
|
-
} else if (modifier->type == ResultModifierType::LIMIT_PERCENT_MODIFIER) {
|
|
154678
|
-
auto &limit_modifier = (BoundLimitPercentModifier &)*modifier;
|
|
154679
|
-
if (limit_modifier.limit || limit_modifier.offset) {
|
|
154680
|
-
PlanSubqueries(&limit_modifier.limit, &root);
|
|
154681
|
-
PlanSubqueries(&limit_modifier.offset, &root);
|
|
154682
|
-
limit = make_unique<LogicalLimitPercent>(limit_modifier.limit_percent, limit_modifier.offset_val,
|
|
154683
|
-
move(limit_modifier.limit), move(limit_modifier.offset));
|
|
154684
|
-
}
|
|
154685
|
-
}
|
|
154686
|
-
if (limit) {
|
|
154687
|
-
limit->AddChild(move(root));
|
|
154688
|
-
root = move(limit);
|
|
154689
|
-
// Delete from modifiers
|
|
154690
|
-
std::swap(statement.modifiers[i], statement.modifiers.back());
|
|
154691
|
-
statement.modifiers.erase(statement.modifiers.end() - 1);
|
|
154692
|
-
i--;
|
|
154693
|
-
}
|
|
154694
|
-
}
|
|
154695
|
-
|
|
154696
154673
|
// create the projection
|
|
154697
154674
|
auto proj = make_unique<LogicalProjection>(statement.projection_index, move(statement.select_list));
|
|
154698
154675
|
auto &projection = *proj;
|
|
@@ -160267,6 +160244,12 @@ unique_ptr<Expression> OrderBinder::CreateProjectionReference(ParsedExpression &
|
|
|
160267
160244
|
ColumnBinding(projection_index, index));
|
|
160268
160245
|
}
|
|
160269
160246
|
|
|
160247
|
+
unique_ptr<Expression> OrderBinder::CreateExtraReference(unique_ptr<ParsedExpression> expr) {
|
|
160248
|
+
auto result = CreateProjectionReference(*expr, extra_list->size());
|
|
160249
|
+
extra_list->push_back(move(expr));
|
|
160250
|
+
return result;
|
|
160251
|
+
}
|
|
160252
|
+
|
|
160270
160253
|
unique_ptr<Expression> OrderBinder::Bind(unique_ptr<ParsedExpression> expr) {
|
|
160271
160254
|
// in the ORDER BY clause we do not bind children
|
|
160272
160255
|
// we bind ONLY to the select list
|
|
@@ -160337,9 +160320,7 @@ unique_ptr<Expression> OrderBinder::Bind(unique_ptr<ParsedExpression> expr) {
|
|
|
160337
160320
|
expr->ToString());
|
|
160338
160321
|
}
|
|
160339
160322
|
// otherwise we need to push the ORDER BY entry into the select list
|
|
160340
|
-
|
|
160341
|
-
extra_list->push_back(move(expr));
|
|
160342
|
-
return result;
|
|
160323
|
+
return CreateExtraReference(move(expr));
|
|
160343
160324
|
}
|
|
160344
160325
|
|
|
160345
160326
|
} // namespace duckdb
|
|
@@ -164377,8 +164358,6 @@ void WriteOverflowStringsToDisk::AllocateNewBlock(block_id_t new_block_id) {
|
|
|
164377
164358
|
|
|
164378
164359
|
|
|
164379
164360
|
|
|
164380
|
-
|
|
164381
|
-
|
|
164382
164361
|
|
|
164383
164362
|
|
|
164384
164363
|
|
|
@@ -178161,8 +178140,6 @@ bool ValidityColumnData::CheckZonemap(ColumnScanState &state, TableFilter &filte
|
|
|
178161
178140
|
|
|
178162
178141
|
|
|
178163
178142
|
|
|
178164
|
-
|
|
178165
|
-
|
|
178166
178143
|
|
|
178167
178144
|
namespace duckdb {
|
|
178168
178145
|
|
|
@@ -178680,7 +178657,6 @@ void ReplayState::ReplayCheckpoint() {
|
|
|
178680
178657
|
|
|
178681
178658
|
|
|
178682
178659
|
|
|
178683
|
-
|
|
178684
178660
|
#include <cstring>
|
|
178685
178661
|
|
|
178686
178662
|
namespace duckdb {
|
package/src/duckdb.hpp
CHANGED
|
@@ -11,8 +11,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
11
11
|
#pragma once
|
|
12
12
|
#define DUCKDB_AMALGAMATION 1
|
|
13
13
|
#define DUCKDB_AMALGAMATION_EXTENDED 1
|
|
14
|
-
#define DUCKDB_SOURCE_ID "
|
|
15
|
-
#define DUCKDB_VERSION "v0.3.3-
|
|
14
|
+
#define DUCKDB_SOURCE_ID "206ab12d8"
|
|
15
|
+
#define DUCKDB_VERSION "v0.3.3-dev1302"
|
|
16
16
|
//===----------------------------------------------------------------------===//
|
|
17
17
|
// DuckDB
|
|
18
18
|
//
|
|
@@ -13540,9 +13540,10 @@ private:
|
|
|
13540
13540
|
private:
|
|
13541
13541
|
//! Bind the default values of the columns of a table
|
|
13542
13542
|
void BindDefaultValues(vector<ColumnDefinition> &columns, vector<unique_ptr<Expression>> &bound_defaults);
|
|
13543
|
-
//! Bind a
|
|
13544
|
-
unique_ptr<Expression> BindDelimiter(ClientContext &context,
|
|
13545
|
-
const LogicalType &type,
|
|
13543
|
+
//! Bind a limit value (LIMIT or OFFSET)
|
|
13544
|
+
unique_ptr<Expression> BindDelimiter(ClientContext &context, OrderBinder &order_binder,
|
|
13545
|
+
unique_ptr<ParsedExpression> delimiter, const LogicalType &type,
|
|
13546
|
+
Value &delimiter_value);
|
|
13546
13547
|
|
|
13547
13548
|
//! Move correlated expressions from the child binder to this binder
|
|
13548
13549
|
void MoveCorrelatedExpressions(Binder &other);
|
|
@@ -13603,10 +13604,6 @@ private:
|
|
|
13603
13604
|
unique_ptr<LogicalOperator> CreatePlan(BoundExpressionListRef &ref);
|
|
13604
13605
|
unique_ptr<LogicalOperator> CreatePlan(BoundCTERef &ref);
|
|
13605
13606
|
|
|
13606
|
-
unique_ptr<LogicalOperator> BindTable(TableCatalogEntry &table, BaseTableRef &ref);
|
|
13607
|
-
unique_ptr<LogicalOperator> BindView(ViewCatalogEntry &view, BaseTableRef &ref);
|
|
13608
|
-
unique_ptr<LogicalOperator> BindTableOrView(BaseTableRef &ref);
|
|
13609
|
-
|
|
13610
13607
|
BoundStatement BindCopyTo(CopyStatement &stmt);
|
|
13611
13608
|
BoundStatement BindCopyFrom(CopyStatement &stmt);
|
|
13612
13609
|
|
|
@@ -13614,8 +13611,8 @@ private:
|
|
|
13614
13611
|
void BindModifierTypes(BoundQueryNode &result, const vector<LogicalType> &sql_types, idx_t projection_index);
|
|
13615
13612
|
|
|
13616
13613
|
BoundStatement BindSummarize(ShowStatement &stmt);
|
|
13617
|
-
unique_ptr<BoundResultModifier> BindLimit(LimitModifier &limit_mod);
|
|
13618
|
-
unique_ptr<BoundResultModifier> BindLimitPercent(LimitPercentModifier &limit_mod);
|
|
13614
|
+
unique_ptr<BoundResultModifier> BindLimit(OrderBinder &order_binder, LimitModifier &limit_mod);
|
|
13615
|
+
unique_ptr<BoundResultModifier> BindLimitPercent(OrderBinder &order_binder, LimitPercentModifier &limit_mod);
|
|
13619
13616
|
unique_ptr<Expression> BindOrderExpression(OrderBinder &order_binder, unique_ptr<ParsedExpression> expr);
|
|
13620
13617
|
|
|
13621
13618
|
unique_ptr<LogicalOperator> PlanFilter(unique_ptr<Expression> condition, unique_ptr<LogicalOperator> root);
|