From 386375b6dd9841fdb24a56dcd637be38fcb4c175 Mon Sep 17 00:00:00 2001
From: Jaroslaw Staniek <staniek@kde.org>
Date: Tue, 27 Mar 2018 00:20:34 +0200
Subject: Fix crash in KDbConnection::recordCount(KDbTableSchema)

FIXED-IN:3.1.1
---
 src/KDbConnection.cpp | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/KDbConnection.cpp b/src/KDbConnection.cpp
index e53bb33..d416d12 100644
--- a/src/KDbConnection.cpp
+++ b/src/KDbConnection.cpp
@@ -3420,10 +3420,8 @@ int KDbConnection::recordCount(const KDbTableSchema& tableSchema)
 {
     //! @todo does not work with non-SQL data sources
     int count = -1; // will be changed only on success of querySingleNumber()
-    const tristate result
-        = querySingleNumber(KDbEscapedString("SELECT COUNT(*) FROM ")
-                                + tableSchema.connection()->escapeIdentifier(tableSchema.name()),
-                            &count);
+    const tristate result = querySingleNumber(
+        KDbEscapedString("SELECT COUNT(*) FROM ") + escapeIdentifier(tableSchema.name()), &count);
     if (~result) {
         count = 0;
     }
-- 
cgit v0.11.2
