From e9ecbccaa6547cb067653e7240947a76cc60d8ed 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-command.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libpqpp/pq-command.h') diff --git a/libpqpp/pq-command.h b/libpqpp/pq-command.h index 056706e..e054da8 100644 --- a/libpqpp/pq-command.h +++ b/libpqpp/pq-command.h @@ -5,6 +5,7 @@ #include #include #include +#include "pq-connection.h" namespace PQ { class Connection; @@ -21,7 +22,7 @@ namespace PQ { class Command : public virtual DB::Command { public: - Command(Connection *, const std::string & sql, unsigned int no); + Command(Connection *, const std::string & sql, const DB::CommandOptions *); virtual ~Command() = 0; void bindParamI(unsigned int, int) override; @@ -44,6 +45,7 @@ namespace PQ { void bindNull(unsigned int) override; protected: void prepareSql(std::stringstream & psql, const std::string & sql) const; + Connection::StatementHash hash; const std::string stmntName; Connection * const c; -- cgit v1.2.3