From 9758d7cdc98f0d948581fb5630c33e98e4b52855 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 6 Jan 2017 02:11:57 +0000 Subject: Use SQL hash for prepared statement names, increases reuse and avoids random reuse --- libpqpp/pq-prepared.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'libpqpp/pq-prepared.cpp') diff --git a/libpqpp/pq-prepared.cpp b/libpqpp/pq-prepared.cpp index 8e6cea5..63a1cb5 100644 --- a/libpqpp/pq-prepared.cpp +++ b/libpqpp/pq-prepared.cpp @@ -1,10 +1,9 @@ #include "pq-prepared.h" #include "pq-connection.h" -PQ::PreparedStatement::PreparedStatement(Connection * c, const std::string & sql, unsigned int no, const DB::CommandOptions * opts) : +PQ::PreparedStatement::PreparedStatement(Connection * c, const std::string & sql, const DB::CommandOptions * opts) : DB::Command(sql), - Command(c, sql, no), - hash(opts && opts->hash ? *opts->hash : std::hash()(sql)), + Command(c, sql, opts), pstmt(nullptr) { } -- cgit v1.2.3