duckdb 0.3.2-dev1325.0 → 0.3.2-dev1329.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "duckdb",
3
3
  "main": "./lib/duckdb.js",
4
- "version": "0.3.2-dev1325.0",
4
+ "version": "0.3.2-dev1329.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -63535,11 +63535,14 @@ enum class ExplainType : uint8_t { EXPLAIN_STANDARD, EXPLAIN_ANALYZE };
63535
63535
 
63536
63536
  class ExplainStatement : public SQLStatement {
63537
63537
  public:
63538
- ExplainStatement(unique_ptr<SQLStatement> stmt, ExplainType explain_type = ExplainType::EXPLAIN_STANDARD);
63538
+ explicit ExplainStatement(unique_ptr<SQLStatement> stmt, ExplainType explain_type = ExplainType::EXPLAIN_STANDARD);
63539
63539
 
63540
63540
  unique_ptr<SQLStatement> stmt;
63541
63541
  ExplainType explain_type;
63542
63542
 
63543
+ protected:
63544
+ ExplainStatement(const ExplainStatement &other);
63545
+
63543
63546
  public:
63544
63547
  unique_ptr<SQLStatement> Copy() const override;
63545
63548
  };
@@ -98796,6 +98799,9 @@ public:
98796
98799
 
98797
98800
  unique_ptr<DropInfo> info;
98798
98801
 
98802
+ protected:
98803
+ DropStatement(const DropStatement &other);
98804
+
98799
98805
  public:
98800
98806
  unique_ptr<SQLStatement> Copy() const override;
98801
98807
  };
@@ -98825,6 +98831,9 @@ public:
98825
98831
  string name;
98826
98832
  vector<unique_ptr<ParsedExpression>> values;
98827
98833
 
98834
+ protected:
98835
+ ExecuteStatement(const ExecuteStatement &other);
98836
+
98828
98837
  public:
98829
98838
  unique_ptr<SQLStatement> Copy() const override;
98830
98839
  };
@@ -98853,6 +98862,9 @@ public:
98853
98862
  unique_ptr<SQLStatement> statement;
98854
98863
  string name;
98855
98864
 
98865
+ protected:
98866
+ PrepareStatement(const PrepareStatement &other);
98867
+
98856
98868
  public:
98857
98869
  unique_ptr<SQLStatement> Copy() const override;
98858
98870
  };
@@ -98938,6 +98950,9 @@ public:
98938
98950
 
98939
98951
  shared_ptr<Relation> relation;
98940
98952
 
98953
+ protected:
98954
+ RelationStatement(const RelationStatement &other) = default;
98955
+
98941
98956
  public:
98942
98957
  unique_ptr<SQLStatement> Copy() const override;
98943
98958
  };
@@ -98980,6 +98995,9 @@ public:
98980
98995
 
98981
98996
  unique_ptr<PragmaInfo> info;
98982
98997
 
98998
+ protected:
98999
+ PragmaStatement(const PragmaStatement &other);
99000
+
98983
99001
  public:
98984
99002
  unique_ptr<SQLStatement> Copy() const override;
98985
99003
  };
@@ -109274,23 +109292,25 @@ PreparedStatementData::~PreparedStatementData() {
109274
109292
 
109275
109293
  void PreparedStatementData::Bind(vector<Value> values) {
109276
109294
  // set parameters
109277
- if (values.size() != value_map.size()) {
109295
+ const auto required = unbound_statement ? unbound_statement->n_param : 0;
109296
+ if (values.size() != required) {
109278
109297
  throw BinderException("Parameter/argument count mismatch for prepared statement. Expected %llu, got %llu",
109279
- value_map.size(), values.size());
109298
+ required, values.size());
109280
109299
  }
109281
- // bind the values
109282
- for (idx_t i = 0; i < values.size(); i++) {
109283
- auto it = value_map.find(i + 1);
109284
- if (it == value_map.end()) {
109300
+
109301
+ // bind the required values
109302
+ for (auto &it : value_map) {
109303
+ const idx_t i = it.first - 1;
109304
+ if (i >= values.size()) {
109285
109305
  throw BinderException("Could not find parameter with index %llu", i + 1);
109286
109306
  }
109287
- D_ASSERT(!it->second.empty());
109288
- if (!values[i].TryCastAs(it->second[0]->type())) {
109307
+ D_ASSERT(!it.second.empty());
109308
+ if (!values[i].TryCastAs(it.second[0]->type())) {
109289
109309
  throw BinderException(
109290
109310
  "Type mismatch for binding parameter with index %llu, expected type %s but got type %s", i + 1,
109291
- it->second[0]->type().ToString().c_str(), values[i].type().ToString().c_str());
109311
+ it.second[0]->type().ToString().c_str(), values[i].type().ToString().c_str());
109292
109312
  }
109293
- for (auto &target : it->second) {
109313
+ for (auto &target : it.second) {
109294
109314
  *target = values[i];
109295
109315
  }
109296
109316
  }
@@ -110543,6 +110563,9 @@ public:
110543
110563
 
110544
110564
  unique_ptr<CreateInfo> info;
110545
110565
 
110566
+ protected:
110567
+ CreateStatement(const CreateStatement &other);
110568
+
110546
110569
  public:
110547
110570
  unique_ptr<SQLStatement> Copy() const override;
110548
110571
  };
@@ -110793,6 +110816,9 @@ public:
110793
110816
  unique_ptr<TableRef> table;
110794
110817
  vector<unique_ptr<TableRef>> using_clauses;
110795
110818
 
110819
+ protected:
110820
+ DeleteStatement(const DeleteStatement &other);
110821
+
110796
110822
  public:
110797
110823
  unique_ptr<SQLStatement> Copy() const override;
110798
110824
  };
@@ -111186,6 +111212,9 @@ public:
111186
111212
  //! Schema name to insert to
111187
111213
  string schema;
111188
111214
 
111215
+ protected:
111216
+ InsertStatement(const InsertStatement &other);
111217
+
111189
111218
  public:
111190
111219
  unique_ptr<SQLStatement> Copy() const override;
111191
111220
  };
@@ -112085,6 +112114,9 @@ public:
112085
112114
  vector<string> columns;
112086
112115
  vector<unique_ptr<ParsedExpression>> expressions;
112087
112116
 
112117
+ protected:
112118
+ UpdateStatement(const UpdateStatement &other);
112119
+
112088
112120
  public:
112089
112121
  unique_ptr<SQLStatement> Copy() const override;
112090
112122
  };
@@ -112325,6 +112357,9 @@ public:
112325
112357
  // The SQL statement used instead of a table when copying data out to a file
112326
112358
  unique_ptr<QueryNode> select_statement;
112327
112359
 
112360
+ protected:
112361
+ CopyStatement(const CopyStatement &other);
112362
+
112328
112363
  public:
112329
112364
  unique_ptr<SQLStatement> Copy() const override;
112330
112365
  };
@@ -135603,6 +135638,8 @@ private:
135603
135638
  private:
135604
135639
  //! Transforms a Postgres statement into a single SQL statement
135605
135640
  unique_ptr<SQLStatement> TransformStatement(duckdb_libpgquery::PGNode *stmt);
135641
+ //! Transforms a Postgres statement into a single SQL statement
135642
+ unique_ptr<SQLStatement> TransformStatementInternal(duckdb_libpgquery::PGNode *stmt);
135606
135643
  //===--------------------------------------------------------------------===//
135607
135644
  // Statement transformation
135608
135645
  //===--------------------------------------------------------------------===//
@@ -136863,10 +136900,12 @@ namespace duckdb {
136863
136900
  class AlterStatement : public SQLStatement {
136864
136901
  public:
136865
136902
  AlterStatement();
136866
- explicit AlterStatement(unique_ptr<AlterInfo> info);
136867
136903
 
136868
136904
  unique_ptr<AlterInfo> info;
136869
136905
 
136906
+ protected:
136907
+ AlterStatement(const AlterStatement &other);
136908
+
136870
136909
  public:
136871
136910
  unique_ptr<SQLStatement> Copy() const override;
136872
136911
  };
@@ -136878,13 +136917,12 @@ namespace duckdb {
136878
136917
 
136879
136918
  AlterStatement::AlterStatement() : SQLStatement(StatementType::ALTER_STATEMENT) {
136880
136919
  }
136881
- AlterStatement::AlterStatement(unique_ptr<AlterInfo> info)
136882
- : SQLStatement(StatementType::ALTER_STATEMENT), info(move(info)) {
136920
+
136921
+ AlterStatement::AlterStatement(const AlterStatement &other) : SQLStatement(other), info(other.info->Copy()) {
136883
136922
  }
136884
136923
 
136885
136924
  unique_ptr<SQLStatement> AlterStatement::Copy() const {
136886
- auto result = make_unique<AlterStatement>(info->Copy());
136887
- return move(result);
136925
+ return unique_ptr<AlterStatement>(new AlterStatement(*this));
136888
136926
  }
136889
136927
 
136890
136928
  } // namespace duckdb
@@ -136910,6 +136948,9 @@ public:
136910
136948
 
136911
136949
  unique_ptr<ParsedExpression> function;
136912
136950
 
136951
+ protected:
136952
+ CallStatement(const CallStatement &other);
136953
+
136913
136954
  public:
136914
136955
  unique_ptr<SQLStatement> Copy() const override;
136915
136956
  };
@@ -136921,10 +136962,11 @@ namespace duckdb {
136921
136962
  CallStatement::CallStatement() : SQLStatement(StatementType::CALL_STATEMENT) {
136922
136963
  }
136923
136964
 
136965
+ CallStatement::CallStatement(const CallStatement &other) : SQLStatement(other), function(other.function->Copy()) {
136966
+ }
136967
+
136924
136968
  unique_ptr<SQLStatement> CallStatement::Copy() const {
136925
- auto result = make_unique<CallStatement>();
136926
- result->function = function->Copy();
136927
- return move(result);
136969
+ return unique_ptr<CallStatement>(new CallStatement(*this));
136928
136970
  }
136929
136971
 
136930
136972
  } // namespace duckdb
@@ -136935,13 +136977,14 @@ namespace duckdb {
136935
136977
  CopyStatement::CopyStatement() : SQLStatement(StatementType::COPY_STATEMENT), info(make_unique<CopyInfo>()) {
136936
136978
  }
136937
136979
 
136938
- unique_ptr<SQLStatement> CopyStatement::Copy() const {
136939
- auto result = make_unique<CopyStatement>();
136940
- result->info = info->Copy();
136941
- if (select_statement) {
136942
- result->select_statement = select_statement->Copy();
136980
+ CopyStatement::CopyStatement(const CopyStatement &other) : SQLStatement(other), info(other.info->Copy()) {
136981
+ if (other.select_statement) {
136982
+ select_statement = other.select_statement->Copy();
136943
136983
  }
136944
- return move(result);
136984
+ }
136985
+
136986
+ unique_ptr<SQLStatement> CopyStatement::Copy() const {
136987
+ return unique_ptr<CopyStatement>(new CopyStatement(*this));
136945
136988
  }
136946
136989
 
136947
136990
  } // namespace duckdb
@@ -136952,10 +136995,11 @@ namespace duckdb {
136952
136995
  CreateStatement::CreateStatement() : SQLStatement(StatementType::CREATE_STATEMENT) {
136953
136996
  }
136954
136997
 
136998
+ CreateStatement::CreateStatement(const CreateStatement &other) : SQLStatement(other), info(other.info->Copy()) {
136999
+ }
137000
+
136955
137001
  unique_ptr<SQLStatement> CreateStatement::Copy() const {
136956
- auto result = make_unique<CreateStatement>();
136957
- result->info = info->Copy();
136958
- return move(result);
137002
+ return unique_ptr<CreateStatement>(new CreateStatement(*this));
136959
137003
  }
136960
137004
 
136961
137005
  } // namespace duckdb
@@ -136966,16 +137010,17 @@ namespace duckdb {
136966
137010
  DeleteStatement::DeleteStatement() : SQLStatement(StatementType::DELETE_STATEMENT) {
136967
137011
  }
136968
137012
 
136969
- unique_ptr<SQLStatement> DeleteStatement::Copy() const {
136970
- auto result = make_unique<DeleteStatement>();
136971
- if (condition) {
136972
- result->condition = condition->Copy();
137013
+ DeleteStatement::DeleteStatement(const DeleteStatement &other) : SQLStatement(other), table(other.table->Copy()) {
137014
+ if (other.condition) {
137015
+ condition = other.condition->Copy();
136973
137016
  }
136974
- result->table = table->Copy();
136975
- for (auto &using_clause : using_clauses) {
136976
- result->using_clauses.push_back(using_clause->Copy());
137017
+ for (const auto &using_clause : other.using_clauses) {
137018
+ using_clauses.push_back(using_clause->Copy());
136977
137019
  }
136978
- return move(result);
137020
+ }
137021
+
137022
+ unique_ptr<SQLStatement> DeleteStatement::Copy() const {
137023
+ return unique_ptr<DeleteStatement>(new DeleteStatement(*this));
136979
137024
  }
136980
137025
 
136981
137026
  } // namespace duckdb
@@ -136986,10 +137031,11 @@ namespace duckdb {
136986
137031
  DropStatement::DropStatement() : SQLStatement(StatementType::DROP_STATEMENT), info(make_unique<DropInfo>()) {
136987
137032
  }
136988
137033
 
137034
+ DropStatement::DropStatement(const DropStatement &other) : SQLStatement(other), info(other.info->Copy()) {
137035
+ }
137036
+
136989
137037
  unique_ptr<SQLStatement> DropStatement::Copy() const {
136990
- auto result = make_unique<DropStatement>();
136991
- result->info = info->Copy();
136992
- return move(result);
137038
+ return unique_ptr<DropStatement>(new DropStatement(*this));
136993
137039
  }
136994
137040
 
136995
137041
  } // namespace duckdb
@@ -137000,13 +137046,14 @@ namespace duckdb {
137000
137046
  ExecuteStatement::ExecuteStatement() : SQLStatement(StatementType::EXECUTE_STATEMENT) {
137001
137047
  }
137002
137048
 
137003
- unique_ptr<SQLStatement> ExecuteStatement::Copy() const {
137004
- auto result = make_unique<ExecuteStatement>();
137005
- result->name = name;
137006
- for (auto &value : values) {
137007
- result->values.push_back(value->Copy());
137049
+ ExecuteStatement::ExecuteStatement(const ExecuteStatement &other) : SQLStatement(other), name(other.name) {
137050
+ for (const auto &value : other.values) {
137051
+ values.push_back(value->Copy());
137008
137052
  }
137009
- return move(result);
137053
+ }
137054
+
137055
+ unique_ptr<SQLStatement> ExecuteStatement::Copy() const {
137056
+ return unique_ptr<ExecuteStatement>(new ExecuteStatement(*this));
137010
137057
  }
137011
137058
 
137012
137059
  } // namespace duckdb
@@ -137018,9 +137065,12 @@ ExplainStatement::ExplainStatement(unique_ptr<SQLStatement> stmt, ExplainType ex
137018
137065
  : SQLStatement(StatementType::EXPLAIN_STATEMENT), stmt(move(stmt)), explain_type(explain_type) {
137019
137066
  }
137020
137067
 
137068
+ ExplainStatement::ExplainStatement(const ExplainStatement &other)
137069
+ : SQLStatement(other), stmt(other.stmt->Copy()), explain_type(other.explain_type) {
137070
+ }
137071
+
137021
137072
  unique_ptr<SQLStatement> ExplainStatement::Copy() const {
137022
- auto result = make_unique<ExplainStatement>(stmt->Copy(), explain_type);
137023
- return move(result);
137073
+ return unique_ptr<ExplainStatement>(new ExplainStatement(*this));
137024
137074
  }
137025
137075
 
137026
137076
  } // namespace duckdb
@@ -137046,6 +137096,9 @@ public:
137046
137096
 
137047
137097
  unique_ptr<CopyInfo> info;
137048
137098
 
137099
+ protected:
137100
+ ExportStatement(const ExportStatement &other);
137101
+
137049
137102
  public:
137050
137103
  unique_ptr<SQLStatement> Copy() const override;
137051
137104
  };
@@ -137059,8 +137112,11 @@ ExportStatement::ExportStatement(unique_ptr<CopyInfo> info)
137059
137112
  : SQLStatement(StatementType::EXPORT_STATEMENT), info(move(info)) {
137060
137113
  }
137061
137114
 
137115
+ ExportStatement::ExportStatement(const ExportStatement &other) : SQLStatement(other), info(other.info->Copy()) {
137116
+ }
137117
+
137062
137118
  unique_ptr<SQLStatement> ExportStatement::Copy() const {
137063
- return make_unique_base<SQLStatement, ExportStatement>(info->Copy());
137119
+ return unique_ptr<ExportStatement>(new ExportStatement(*this));
137064
137120
  }
137065
137121
 
137066
137122
  } // namespace duckdb
@@ -137071,20 +137127,21 @@ namespace duckdb {
137071
137127
  InsertStatement::InsertStatement() : SQLStatement(StatementType::INSERT_STATEMENT), schema(DEFAULT_SCHEMA) {
137072
137128
  }
137073
137129
 
137130
+ InsertStatement::InsertStatement(const InsertStatement &other)
137131
+ : SQLStatement(other),
137132
+ select_statement(unique_ptr_cast<SQLStatement, SelectStatement>(other.select_statement->Copy())),
137133
+ columns(other.columns), table(other.table), schema(other.schema) {
137134
+ }
137135
+
137074
137136
  unique_ptr<SQLStatement> InsertStatement::Copy() const {
137075
- auto result = make_unique<InsertStatement>();
137076
- result->select_statement = unique_ptr_cast<SQLStatement, SelectStatement>(select_statement->Copy());
137077
- result->columns = columns;
137078
- result->table = table;
137079
- result->schema = schema;
137080
- return move(result);
137137
+ return unique_ptr<InsertStatement>(new InsertStatement(*this));
137081
137138
  }
137082
137139
 
137083
137140
  } // namespace duckdb
137084
137141
  //===----------------------------------------------------------------------===//
137085
137142
  // DuckDB
137086
137143
  //
137087
- // duckdb/parser/statement/set_statement.hpp
137144
+ // duckdb/parser/statement/load_statement.hpp
137088
137145
  //
137089
137146
  //
137090
137147
  //===----------------------------------------------------------------------===//
@@ -137100,6 +137157,9 @@ class LoadStatement : public SQLStatement {
137100
137157
  public:
137101
137158
  LoadStatement();
137102
137159
 
137160
+ protected:
137161
+ LoadStatement(const LoadStatement &other);
137162
+
137103
137163
  public:
137104
137164
  unique_ptr<SQLStatement> Copy() const override;
137105
137165
 
@@ -137113,10 +137173,11 @@ namespace duckdb {
137113
137173
  LoadStatement::LoadStatement() : SQLStatement(StatementType::LOAD_STATEMENT) {
137114
137174
  }
137115
137175
 
137176
+ LoadStatement::LoadStatement(const LoadStatement &other) : SQLStatement(other), info(other.info->Copy()) {
137177
+ }
137178
+
137116
137179
  unique_ptr<SQLStatement> LoadStatement::Copy() const {
137117
- auto result = make_unique<LoadStatement>();
137118
- result->info = info->Copy();
137119
- return move(result);
137180
+ return unique_ptr<LoadStatement>(new LoadStatement(*this));
137120
137181
  }
137121
137182
 
137122
137183
  } // namespace duckdb
@@ -137127,10 +137188,11 @@ namespace duckdb {
137127
137188
  PragmaStatement::PragmaStatement() : SQLStatement(StatementType::PRAGMA_STATEMENT), info(make_unique<PragmaInfo>()) {
137128
137189
  }
137129
137190
 
137191
+ PragmaStatement::PragmaStatement(const PragmaStatement &other) : SQLStatement(other), info(other.info->Copy()) {
137192
+ }
137193
+
137130
137194
  unique_ptr<SQLStatement> PragmaStatement::Copy() const {
137131
- auto result = make_unique<PragmaStatement>();
137132
- result->info = info->Copy();
137133
- return move(result);
137195
+ return unique_ptr<PragmaStatement>(new PragmaStatement(*this));
137134
137196
  }
137135
137197
 
137136
137198
  } // namespace duckdb
@@ -137141,11 +137203,12 @@ namespace duckdb {
137141
137203
  PrepareStatement::PrepareStatement() : SQLStatement(StatementType::PREPARE_STATEMENT), statement(nullptr), name("") {
137142
137204
  }
137143
137205
 
137206
+ PrepareStatement::PrepareStatement(const PrepareStatement &other)
137207
+ : SQLStatement(other), statement(other.statement->Copy()), name(other.name) {
137208
+ }
137209
+
137144
137210
  unique_ptr<SQLStatement> PrepareStatement::Copy() const {
137145
- auto result = make_unique<PrepareStatement>();
137146
- result->statement = statement->Copy();
137147
- result->name = name;
137148
- return move(result);
137211
+ return unique_ptr<PrepareStatement>(new PrepareStatement(*this));
137149
137212
  }
137150
137213
 
137151
137214
  } // namespace duckdb
@@ -137158,8 +137221,7 @@ RelationStatement::RelationStatement(shared_ptr<Relation> relation)
137158
137221
  }
137159
137222
 
137160
137223
  unique_ptr<SQLStatement> RelationStatement::Copy() const {
137161
- auto result = make_unique<RelationStatement>(relation);
137162
- return move(result);
137224
+ return unique_ptr<RelationStatement>(new RelationStatement(*this));
137163
137225
  }
137164
137226
 
137165
137227
  } // namespace duckdb
@@ -137169,10 +137231,11 @@ unique_ptr<SQLStatement> RelationStatement::Copy() const {
137169
137231
 
137170
137232
  namespace duckdb {
137171
137233
 
137234
+ SelectStatement::SelectStatement(const SelectStatement &other) : SQLStatement(other), node(other.node->Copy()) {
137235
+ }
137236
+
137172
137237
  unique_ptr<SQLStatement> SelectStatement::Copy() const {
137173
- auto result = make_unique<SelectStatement>();
137174
- result->node = node->Copy();
137175
- return move(result);
137238
+ return unique_ptr<SelectStatement>(new SelectStatement(*this));
137176
137239
  }
137177
137240
 
137178
137241
  void SelectStatement::Serialize(Serializer &serializer) const {
@@ -137214,6 +137277,9 @@ class SetStatement : public SQLStatement {
137214
137277
  public:
137215
137278
  SetStatement(std::string name_p, Value value_p, SetScope scope_p);
137216
137279
 
137280
+ protected:
137281
+ SetStatement(const SetStatement &other) = default;
137282
+
137217
137283
  public:
137218
137284
  unique_ptr<SQLStatement> Copy() const override;
137219
137285
 
@@ -137231,7 +137297,7 @@ SetStatement::SetStatement(std::string name_p, Value value_p, SetScope scope_p)
137231
137297
  }
137232
137298
 
137233
137299
  unique_ptr<SQLStatement> SetStatement::Copy() const {
137234
- return make_unique<SetStatement>(name, value, scope);
137300
+ return unique_ptr<SetStatement>(new SetStatement(*this));
137235
137301
  }
137236
137302
 
137237
137303
  } // namespace duckdb
@@ -137256,6 +137322,9 @@ public:
137256
137322
 
137257
137323
  unique_ptr<ShowSelectInfo> info;
137258
137324
 
137325
+ protected:
137326
+ ShowStatement(const ShowStatement &other);
137327
+
137259
137328
  public:
137260
137329
  unique_ptr<SQLStatement> Copy() const override;
137261
137330
  };
@@ -137268,10 +137337,11 @@ namespace duckdb {
137268
137337
  ShowStatement::ShowStatement() : SQLStatement(StatementType::SHOW_STATEMENT), info(make_unique<ShowSelectInfo>()) {
137269
137338
  }
137270
137339
 
137340
+ ShowStatement::ShowStatement(const ShowStatement &other) : SQLStatement(other), info(other.info->Copy()) {
137341
+ }
137342
+
137271
137343
  unique_ptr<SQLStatement> ShowStatement::Copy() const {
137272
- auto result = make_unique<ShowStatement>();
137273
- result->info = info->Copy();
137274
- return move(result);
137344
+ return unique_ptr<ShowStatement>(new ShowStatement(*this));
137275
137345
  }
137276
137346
 
137277
137347
  } // namespace duckdb
@@ -137296,6 +137366,9 @@ public:
137296
137366
 
137297
137367
  unique_ptr<TransactionInfo> info;
137298
137368
 
137369
+ protected:
137370
+ TransactionStatement(const TransactionStatement &other);
137371
+
137299
137372
  public:
137300
137373
  unique_ptr<SQLStatement> Copy() const override;
137301
137374
  };
@@ -137308,8 +137381,12 @@ TransactionStatement::TransactionStatement(TransactionType type)
137308
137381
  : SQLStatement(StatementType::TRANSACTION_STATEMENT), info(make_unique<TransactionInfo>(type)) {
137309
137382
  }
137310
137383
 
137384
+ TransactionStatement::TransactionStatement(const TransactionStatement &other)
137385
+ : SQLStatement(other), info(make_unique<TransactionInfo>(other.info->type)) {
137386
+ }
137387
+
137311
137388
  unique_ptr<SQLStatement> TransactionStatement::Copy() const {
137312
- return make_unique_base<SQLStatement, TransactionStatement>(info->type);
137389
+ return unique_ptr<TransactionStatement>(new TransactionStatement(*this));
137313
137390
  }
137314
137391
 
137315
137392
  } // namespace duckdb
@@ -137320,20 +137397,21 @@ namespace duckdb {
137320
137397
  UpdateStatement::UpdateStatement() : SQLStatement(StatementType::UPDATE_STATEMENT) {
137321
137398
  }
137322
137399
 
137323
- unique_ptr<SQLStatement> UpdateStatement::Copy() const {
137324
- auto result = make_unique<UpdateStatement>();
137325
- if (condition) {
137326
- result->condition = condition->Copy();
137400
+ UpdateStatement::UpdateStatement(const UpdateStatement &other)
137401
+ : SQLStatement(other), table(other.table->Copy()), columns(other.columns) {
137402
+ if (other.condition) {
137403
+ condition = other.condition->Copy();
137327
137404
  }
137328
- result->table = table->Copy();
137329
- if (from_table) {
137330
- result->from_table = from_table->Copy();
137405
+ if (other.from_table) {
137406
+ from_table = other.from_table->Copy();
137331
137407
  }
137332
- result->columns = columns;
137333
- for (auto &expr : expressions) {
137334
- result->expressions.push_back(expr->Copy());
137408
+ for (auto &expr : other.expressions) {
137409
+ expressions.emplace_back(expr->Copy());
137335
137410
  }
137336
- return move(result);
137411
+ }
137412
+
137413
+ unique_ptr<SQLStatement> UpdateStatement::Copy() const {
137414
+ return unique_ptr<UpdateStatement>(new UpdateStatement(*this));
137337
137415
  }
137338
137416
 
137339
137417
  } // namespace duckdb
@@ -137359,6 +137437,9 @@ public:
137359
137437
 
137360
137438
  unique_ptr<VacuumInfo> info;
137361
137439
 
137440
+ protected:
137441
+ VacuumStatement(const VacuumStatement &other) : SQLStatement(other) {};
137442
+
137362
137443
  public:
137363
137444
  unique_ptr<SQLStatement> Copy() const override;
137364
137445
  };
@@ -137372,7 +137453,7 @@ VacuumStatement::VacuumStatement() : SQLStatement(StatementType::VACUUM_STATEMEN
137372
137453
  }
137373
137454
 
137374
137455
  unique_ptr<SQLStatement> VacuumStatement::Copy() const {
137375
- return make_unique<VacuumStatement>();
137456
+ return unique_ptr<VacuumStatement>(new VacuumStatement(*this));
137376
137457
  }
137377
137458
 
137378
137459
  } // namespace duckdb
@@ -141693,7 +141774,10 @@ unique_ptr<AlterStatement> Transformer::TransformRename(duckdb_libpgquery::PGNod
141693
141774
  throw NotImplementedException("Schema element not supported yet!");
141694
141775
  }
141695
141776
  D_ASSERT(info);
141696
- return make_unique<AlterStatement>(move(info));
141777
+
141778
+ auto result = make_unique<AlterStatement>();
141779
+ result->info = move(info);
141780
+ return result;
141697
141781
  }
141698
141782
 
141699
141783
  } // namespace duckdb
@@ -142366,6 +142450,12 @@ StackChecker Transformer::StackCheck(idx_t extra_stack) {
142366
142450
  }
142367
142451
 
142368
142452
  unique_ptr<SQLStatement> Transformer::TransformStatement(duckdb_libpgquery::PGNode *stmt) {
142453
+ auto result = TransformStatementInternal(stmt);
142454
+ result->n_param = ParamCount();
142455
+ return result;
142456
+ }
142457
+
142458
+ unique_ptr<SQLStatement> Transformer::TransformStatementInternal(duckdb_libpgquery::PGNode *stmt) {
142369
142459
  switch (stmt->type) {
142370
142460
  case duckdb_libpgquery::T_PGRawStmt: {
142371
142461
  auto raw_stmt = (duckdb_libpgquery::PGRawStmt *)stmt;
@@ -153141,7 +153231,9 @@ void Planner::PlanExecute(unique_ptr<SQLStatement> statement) {
153141
153231
  vector<Value> bind_values;
153142
153232
  for (idx_t i = 0; i < stmt.values.size(); i++) {
153143
153233
  ConstantBinder cbinder(*binder, context, "EXECUTE statement");
153144
- cbinder.target_type = prepared->GetType(i + 1);
153234
+ if (prepared->value_map.count(i + 1)) {
153235
+ cbinder.target_type = prepared->GetType(i + 1);
153236
+ }
153145
153237
  auto bound_expr = cbinder.Bind(stmt.values[i]);
153146
153238
 
153147
153239
  Value value = ExpressionExecutor::EvaluateScalar(*bound_expr);
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 "86af59255"
15
- #define DUCKDB_VERSION "v0.3.2-dev1325"
14
+ #define DUCKDB_SOURCE_ID "a9e63a665"
15
+ #define DUCKDB_VERSION "v0.3.2-dev1329"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //
@@ -11055,6 +11055,9 @@ public:
11055
11055
  //! The query text that corresponds to this SQL statement
11056
11056
  string query;
11057
11057
 
11058
+ protected:
11059
+ SQLStatement(const SQLStatement &other) = default;
11060
+
11058
11061
  public:
11059
11062
  //! Create a copy of this SelectStatement
11060
11063
  virtual unique_ptr<SQLStatement> Copy() const = 0;
@@ -16273,6 +16276,9 @@ public:
16273
16276
  //! The main query node
16274
16277
  unique_ptr<QueryNode> node;
16275
16278
 
16279
+ protected:
16280
+ SelectStatement(const SelectStatement &other);
16281
+
16276
16282
  public:
16277
16283
  //! Create a copy of this SelectStatement
16278
16284
  unique_ptr<SQLStatement> Copy() const override;