diff --git a/ml_metadata/metadata_store/query_config_executor.cc b/ml_metadata/metadata_store/query_config_executor.cc index 094a7abd4..d369a511d 100644 --- a/ml_metadata/metadata_store/query_config_executor.cc +++ b/ml_metadata/metadata_store/query_config_executor.cc @@ -283,11 +283,11 @@ absl::Status QueryConfigExecutor::DowngradeMetadataSource( } std::string QueryConfigExecutor::Bind(const char* value) { - return metadata_source_->EscapeString(value); + return absl::StrCat("'", metadata_source_->EscapeString(value), "'"); } std::string QueryConfigExecutor::Bind(absl::string_view value) { - return metadata_source_->EscapeString(value); + return absl::StrCat("'", metadata_source_->EscapeString(value), "'"); } std::string QueryConfigExecutor::Bind(int value) { diff --git a/ml_metadata/metadata_store/sqlite_metadata_source.cc b/ml_metadata/metadata_store/sqlite_metadata_source.cc index fa3482453..7c1fb2e1f 100644 --- a/ml_metadata/metadata_store/sqlite_metadata_source.cc +++ b/ml_metadata/metadata_store/sqlite_metadata_source.cc @@ -174,7 +174,7 @@ absl::Status SqliteMetadataSource::RollbackImpl() { } std::string SqliteMetadataSource::EscapeString(absl::string_view value) const { - return SqliteEscapeString(value); + return absl::StrCat("'", SqliteEscapeString(value), "'"); } std::string SqliteMetadataSource::EncodeBytes(absl::string_view value) const {