diff --git a/src/duckdb/src/function/table/version/pragma_version.cpp b/src/duckdb/src/function/table/version/pragma_version.cpp index 640080b0..40f70206 100644 --- a/src/duckdb/src/function/table/version/pragma_version.cpp +++ b/src/duckdb/src/function/table/version/pragma_version.cpp @@ -1,5 +1,5 @@ #ifndef DUCKDB_PATCH_VERSION -#define DUCKDB_PATCH_VERSION "3-dev132" +#define DUCKDB_PATCH_VERSION "3-dev136" #endif #ifndef DUCKDB_MINOR_VERSION #define DUCKDB_MINOR_VERSION 4 @@ -8,10 +8,10 @@ #define DUCKDB_MAJOR_VERSION 1 #endif #ifndef DUCKDB_VERSION -#define DUCKDB_VERSION "v1.4.3-dev132" +#define DUCKDB_VERSION "v1.4.3-dev136" #endif #ifndef DUCKDB_SOURCE_ID -#define DUCKDB_SOURCE_ID "9c1f71da3a" +#define DUCKDB_SOURCE_ID "136dd6ada5" #endif #include "duckdb/function/table/system_functions.hpp" #include "duckdb/main/database.hpp" diff --git a/src/duckdb/src/storage/checkpoint/table_data_writer.cpp b/src/duckdb/src/storage/checkpoint/table_data_writer.cpp index 48c85a06..4bbdff13 100644 --- a/src/duckdb/src/storage/checkpoint/table_data_writer.cpp +++ b/src/duckdb/src/storage/checkpoint/table_data_writer.cpp @@ -118,6 +118,15 @@ void SingleFileTableDataWriter::FinalizeTable(const TableStatistics &global_stat if (!v1_0_0_storage) { options.emplace("v1_0_0_storage", v1_0_0_storage); } + + // If there is a context available, bind indexes before serialization. + // This is necessary so that buffered index operations are replayed before we checkpoint, otherwise + // we would lose them if there was a restart after this. + if (context && context->transaction.HasActiveTransaction()) { + info.BindIndexes(*context); + } + // FIXME: If we do not have a context, however, the unbound indexes have to be serialized to disk. + auto index_storage_infos = info.GetIndexes().SerializeToDisk(context, options); auto debug_verify_blocks = DBConfig::GetSetting(GetDatabase());