From fe07a94d3e871fb1d17cf2dea323c6ba9877cafb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Czern=C3=BD?= Date: Tue, 18 May 2021 18:49:08 +0200 Subject: [PATCH] B #5400: Fix PoolSQL::exist (#1224) (cherry picked from commit 5267d9d712d167381674e16db34093f00f27c43c) --- src/pool/PoolSQL.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/pool/PoolSQL.cc b/src/pool/PoolSQL.cc index 0c796b1ef0..e2ba4a0e8e 100644 --- a/src/pool/PoolSQL.cc +++ b/src/pool/PoolSQL.cc @@ -158,7 +158,14 @@ void PoolSQL::exist(const string& id_str, std::set& id_list) std::vector existing_items; one_util::split_unique(id_str, ',', id_list); - search(existing_items, table.c_str(), "true order by 1 ASC"); + if (Nebula::instance().get_db_backend() == "postgresql") + { + search(existing_items, table.c_str(), "true order by 1 ASC"); + } + else + { + search(existing_items, table.c_str(), "1 order by 1 ASC"); + } for (auto iterator = id_list.begin(); iterator != id_list.end();) {