diff --git a/btrieve/BindableValue.h b/btrieve/BindableValue.h index 97d6f64..727d9aa 100644 --- a/btrieve/BindableValue.h +++ b/btrieve/BindableValue.h @@ -38,17 +38,6 @@ class BindableValue { } } - BindableValue(const char *str, size_t nChars) { - if (str == nullptr || !*str) { - type = Type::Null; - } else { - type = Type::Text; - text_value = new std::string(); - text_value->resize(nChars); - memcpy(text_value->data(), str, nChars); - } - } - BindableValue(const std::string_view data) : type(Type::Text), text_value(new std::string(data)) {} diff --git a/btrieve/SqliteDatabase.cc b/btrieve/SqliteDatabase.cc index d3f212e..51a79de 100644 --- a/btrieve/SqliteDatabase.cc +++ b/btrieve/SqliteDatabase.cc @@ -250,8 +250,15 @@ void SqliteDatabase::createSqliteMetadataTable( command.bindParameter(5, BindableValue(CURRENT_VERSION)); if (!database.getKeys().empty()) { command.bindParameter(6, BindableValue(database.getKeys()[0].getACSName())); - command.bindParameter( - 7, BindableValue(database.getKeys()[0].getACS(), ACS_LENGTH)); + if (database.getKeys()[0].getACS() == nullptr) { + command.bindParameter(7, BindableValue()); // bind null + } else { + command.bindParameter( + 7, + BindableValue(std::basic_string( + reinterpret_cast(database.getKeys()[0].getACS()), + ACS_LENGTH))); + } } else { command.bindParameter(6, BindableValue()); command.bindParameter(7, BindableValue()); diff --git a/vstudio/wbtrv32/wbtrv32.cpp b/vstudio/wbtrv32/wbtrv32.cpp index c880d41..d47c596 100644 --- a/vstudio/wbtrv32/wbtrv32.cpp +++ b/vstudio/wbtrv32/wbtrv32.cpp @@ -590,7 +590,6 @@ static BtrieveError handle(BtrieveCommand &command) { error = ::GetDirectRecord(command); break; case OperationCode::Update: - // TODO update logical currency error = ::Upsert(command, [](BtrieveDriver *driver, std::basic_string_view record) { auto position = driver->getPosition(); @@ -598,7 +597,6 @@ static BtrieveError handle(BtrieveCommand &command) { }); break; case OperationCode::Insert: - // TODO update logical currency error = ::Upsert(command, [](BtrieveDriver *driver, std::basic_string_view record) { return driver->insertRecord(record);