duckdb 0.5.1-dev149.0 → 0.5.1-dev154.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 +10 -5
- package/src/duckdb.hpp +4 -4
- package/src/parquet-amalgamation.cpp +29254 -29254
package/package.json
CHANGED
package/src/duckdb.cpp
CHANGED
|
@@ -4092,6 +4092,9 @@ unique_ptr<CatalogEntry> TableCatalogEntry::SetNotNull(ClientContext &context, S
|
|
|
4092
4092
|
}
|
|
4093
4093
|
|
|
4094
4094
|
idx_t not_null_idx = GetColumnIndex(info.column_name);
|
|
4095
|
+
if (columns[not_null_idx].Generated()) {
|
|
4096
|
+
throw BinderException("Unsupported constraint for generated column!");
|
|
4097
|
+
}
|
|
4095
4098
|
bool has_not_null = false;
|
|
4096
4099
|
for (idx_t i = 0; i < constraints.size(); i++) {
|
|
4097
4100
|
auto constraint = constraints[i]->Copy();
|
|
@@ -4115,8 +4118,9 @@ unique_ptr<CatalogEntry> TableCatalogEntry::SetNotNull(ClientContext &context, S
|
|
|
4115
4118
|
storage);
|
|
4116
4119
|
}
|
|
4117
4120
|
|
|
4118
|
-
// Return with new storage info
|
|
4119
|
-
auto new_storage = make_shared<DataTable>(context, *storage,
|
|
4121
|
+
// Return with new storage info. Note that we need the bound column index here.
|
|
4122
|
+
auto new_storage = make_shared<DataTable>(context, *storage,
|
|
4123
|
+
make_unique<BoundNotNullConstraint>(columns[not_null_idx].StorageOid()));
|
|
4120
4124
|
return make_unique<TableCatalogEntry>(catalog, schema, (BoundCreateTableInfo *)bound_create_info.get(),
|
|
4121
4125
|
new_storage);
|
|
4122
4126
|
}
|
|
@@ -197152,7 +197156,7 @@ DataTable::DataTable(ClientContext &context, DataTable &parent, idx_t removed_co
|
|
|
197152
197156
|
}
|
|
197153
197157
|
|
|
197154
197158
|
// Alter column to add new constraint
|
|
197155
|
-
DataTable::DataTable(ClientContext &context, DataTable &parent, unique_ptr<
|
|
197159
|
+
DataTable::DataTable(ClientContext &context, DataTable &parent, unique_ptr<BoundConstraint> constraint)
|
|
197156
197160
|
: info(parent.info), db(parent.db), total_rows(parent.total_rows.load()), row_groups(parent.row_groups),
|
|
197157
197161
|
is_root(true) {
|
|
197158
197162
|
|
|
@@ -197606,14 +197610,15 @@ static void VerifyDeleteForeignKeyConstraint(const BoundForeignKeyConstraint &bf
|
|
|
197606
197610
|
VerifyForeignKeyConstraint(bfk, context, chunk, false);
|
|
197607
197611
|
}
|
|
197608
197612
|
|
|
197609
|
-
void DataTable::VerifyNewConstraint(ClientContext &context, DataTable &parent, const
|
|
197613
|
+
void DataTable::VerifyNewConstraint(ClientContext &context, DataTable &parent, const BoundConstraint *constraint) {
|
|
197610
197614
|
if (constraint->type != ConstraintType::NOT_NULL) {
|
|
197611
197615
|
throw NotImplementedException("FIXME: ALTER COLUMN with such constraint is not supported yet");
|
|
197612
197616
|
}
|
|
197613
197617
|
// scan the original table, check if there's any null value
|
|
197614
|
-
auto ¬_null_constraint = (
|
|
197618
|
+
auto ¬_null_constraint = (BoundNotNullConstraint &)*constraint;
|
|
197615
197619
|
auto &transaction = Transaction::GetTransaction(context);
|
|
197616
197620
|
vector<LogicalType> scan_types;
|
|
197621
|
+
D_ASSERT(not_null_constraint.index < parent.column_definitions.size());
|
|
197617
197622
|
scan_types.push_back(parent.column_definitions[not_null_constraint.index].Type());
|
|
197618
197623
|
DataChunk scan_chunk;
|
|
197619
197624
|
auto &allocator = Allocator::Get(context);
|
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.5.1-
|
|
14
|
+
#define DUCKDB_SOURCE_ID "547e20988"
|
|
15
|
+
#define DUCKDB_VERSION "v0.5.1-dev154"
|
|
16
16
|
//===----------------------------------------------------------------------===//
|
|
17
17
|
// DuckDB
|
|
18
18
|
//
|
|
@@ -24306,7 +24306,7 @@ public:
|
|
|
24306
24306
|
DataTable(ClientContext &context, DataTable &parent, idx_t changed_idx, const LogicalType &target_type,
|
|
24307
24307
|
vector<column_t> bound_columns, Expression &cast_expr);
|
|
24308
24308
|
//! Constructs a DataTable as a delta on an existing data table but with one column added new constraint
|
|
24309
|
-
DataTable(ClientContext &context, DataTable &parent, unique_ptr<
|
|
24309
|
+
DataTable(ClientContext &context, DataTable &parent, unique_ptr<BoundConstraint> constraint);
|
|
24310
24310
|
|
|
24311
24311
|
shared_ptr<DataTableInfo> info;
|
|
24312
24312
|
|
|
@@ -24411,7 +24411,7 @@ public:
|
|
|
24411
24411
|
|
|
24412
24412
|
private:
|
|
24413
24413
|
//! Verify the new added constraints against current persistent&local data
|
|
24414
|
-
void VerifyNewConstraint(ClientContext &context, DataTable &parent, const
|
|
24414
|
+
void VerifyNewConstraint(ClientContext &context, DataTable &parent, const BoundConstraint *constraint);
|
|
24415
24415
|
//! Verify constraints with a chunk from the Append containing all columns of the table
|
|
24416
24416
|
void VerifyAppendConstraints(TableCatalogEntry &table, ClientContext &context, DataChunk &chunk);
|
|
24417
24417
|
//! Verify constraints with a chunk from the Update containing only the specified column_ids
|