Permalink
Browse files

gpsqlbackend: don't append empty dbname=/user= values to connect string

  • Loading branch information...
1 parent 9a6e39c commit 3506cc636f0a408cfe18d4c05b6a6a993191798a @stbuehler stbuehler committed with mind04 Jul 13, 2013
Showing with 6 additions and 4 deletions.
  1. +6 −4 modules/gpgsqlbackend/spgsql.cc
@@ -14,11 +14,13 @@ SPgSQL::SPgSQL(const string &database, const string &host, const string& port, c
const string &password)
{
d_db=0;
+ d_connectstr="";
- d_connectstr="dbname=";
- d_connectstr+=database;
- d_connectstr+=" user=";
- d_connectstr+=user;
+ if (!database.empty())
+ d_connectstr+="dbname="+database;
+
+ if (!user.empty())
+ d_connectstr+=" user="+user;
if(!host.empty())
d_connectstr+=" host="+host;

0 comments on commit 3506cc6

Please sign in to comment.