]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
gOracle: Remove trailing whitespace
authorAki Tuomi <cmouse@cmouse.fi>
Mon, 6 Jun 2016 09:49:38 +0000 (12:49 +0300)
committerAki Tuomi <cmouse@cmouse.fi>
Mon, 6 Jun 2016 18:16:00 +0000 (21:16 +0300)
modules/goraclebackend/soracle.cc

index d38e15fe6ac4748054c5d7e463c8a9754270ebb6..d9976a43fa10590d84c8ddb1996d7fcc5c2875d7 100644 (file)
@@ -44,11 +44,11 @@ public:
     d_stmt_key[d_stmt_keysize] = 0;
   }
 
-  SSqlStatement* bind(const string& name, bool value) 
-  {  
+  SSqlStatement* bind(const string& name, bool value)
+  {
     return bind(name, (int)value);
   }
-  SSqlStatement* bind(const string& name, int value) 
+  SSqlStatement* bind(const string& name, int value)
   {
     if (d_paridx >= d_parnum)
      throw SSqlException("Attempt to bind more parameters than query has: " + d_query);
@@ -87,7 +87,7 @@ public:
     d_paridx++;
     return this;
   }
-  SSqlStatement* bind(const string& name, unsigned long value) 
+  SSqlStatement* bind(const string& name, unsigned long value)
   {
     if (d_paridx >= d_parnum)
      throw SSqlException("Attempt to bind more parameters than query has: " + d_query);
@@ -126,7 +126,7 @@ public:
     d_paridx++;
     return this;
   }
-  SSqlStatement* bind(const string& name, const std::string& value) 
+  SSqlStatement* bind(const string& name, const std::string& value)
   {
     if (d_paridx >= d_parnum)
      throw SSqlException("Attempt to bind more parameters than query has: " + d_query);
@@ -141,8 +141,8 @@ public:
     d_paridx++;
     return this;
   }
-  SSqlStatement* bindNull(const string& name) 
-  { 
+  SSqlStatement* bindNull(const string& name)
+  {
     if (d_paridx >= d_parnum)
      throw SSqlException("Attempt to bind more parameters than query has: " + d_query);
     prepareStatement();
@@ -154,12 +154,12 @@ public:
     d_paridx++;
     return this;
   }
-  SSqlStatement* execute() 
+  SSqlStatement* execute()
   {
     if (d_query.size() == 0) return this; // do not execute empty queries
     prepareStatement();
 
-    if (d_dolog) 
+    if (d_dolog)
       L<<Logger::Warning<<"Query: "<<d_query<<endl;
     ub2 fntype;
     ub4 iters;
@@ -175,16 +175,16 @@ public:
       throw SSqlException("Cannot execute statement: " + d_query + string(": ") + OCIErrStr());
     }
 
-    d_resnum = d_residx = 0; 
+    d_resnum = d_residx = 0;
 
     if (fntype == OCI_STMT_SELECT) {
       ub4 o_fnum;
       ub4 o_resnum;
 
       // figure out what the result looks like
-      if (OCIAttrGet(d_stmt, OCI_HTYPE_STMT, (dvoid*)&o_resnum, 0, OCI_ATTR_ROW_COUNT, d_err)) 
-        throw SSqlException("Cannot get statement result row count: " + d_query + string(": ") + OCIErrStr()); // this returns 0 
-      if (OCIAttrGet(d_stmt, OCI_HTYPE_STMT, (dvoid*)&o_fnum, 0, OCI_ATTR_PARAM_COUNT, d_err)) 
+      if (OCIAttrGet(d_stmt, OCI_HTYPE_STMT, (dvoid*)&o_resnum, 0, OCI_ATTR_ROW_COUNT, d_err))
+        throw SSqlException("Cannot get statement result row count: " + d_query + string(": ") + OCIErrStr()); // this returns 0
+      if (OCIAttrGet(d_stmt, OCI_HTYPE_STMT, (dvoid*)&o_fnum, 0, OCI_ATTR_PARAM_COUNT, d_err))
         throw SSqlException("Cannot get statement result column count: " + d_query + string(": ") + OCIErrStr());
 
       d_residx = 0;
@@ -205,7 +205,7 @@ public:
           if (OCIAttrGet(parms, OCI_DTYPE_PARAM, (dvoid*)&(d_res[i].colsize), 0, OCI_ATTR_DATA_SIZE, d_err) != OCI_SUCCESS) {
             throw SSqlException("Cannot get statement result column information: " + d_query + string(": ") + OCIErrStr());
           }
-          
+
           if (d_res[i].colsize == 0) {
             if (OCIAttrGet(parms, OCI_DTYPE_PARAM, (dvoid*)&o_attrtype, 0, OCI_ATTR_DATA_TYPE, d_err) != OCI_SUCCESS) {
               throw SSqlException("Cannot get statement result column information: " + d_query + string(": ") + OCIErrStr());
@@ -226,7 +226,7 @@ public:
 
       if (d_fnum > 0) {
         for(int i=0;i<d_fnum;i++) {
-          if (OCIDefineByPos(d_stmt, &(d_res[i].handle), d_err, i+1, d_res[i].content, d_res[i].colsize+1, SQLT_STR, (dvoid*)&(d_res[i].ind), NULL, NULL, OCI_DEFAULT)) 
+          if (OCIDefineByPos(d_stmt, &(d_res[i].handle), d_err, i+1, d_res[i].content, d_res[i].colsize+1, SQLT_STR, (dvoid*)&(d_res[i].ind), NULL, NULL, OCI_DEFAULT))
             throw SSqlException("Cannot bind result column: " + d_query + string(": ") + OCIErrStr());
         }
       }
@@ -237,7 +237,7 @@ public:
     return this;
   }
 
-  string OCIErrStr() 
+  string OCIErrStr()
   {
     string mReason = "ORA-UNKNOWN";
     if (d_err != NULL) {
@@ -314,7 +314,7 @@ public:
     }
     d_bind = new struct obind[d_parnum];
     memset(d_bind, 0, sizeof(struct obind)*d_parnum);
-  
+
     if (d_release_stmt) {
       if (OCIStmtRelease(d_stmt, d_err, (text*)d_stmt_key, d_stmt_keysize, OCI_DEFAULT) != OCI_SUCCESS)
         throw SSqlException("Could not release statement: " + d_query + string(": ") + OCIErrStr());
@@ -451,7 +451,7 @@ SOracle::SOracle(const string &database,
     throw sPerrorException("OCIHandleAlloc(errorHandle)" + string(": ") + getOracleError());
   }
 
-  err = OCILogon2(d_environmentHandle, d_errorHandle, &d_serviceContextHandle, (OraText*)user.c_str(), user.size(), 
+  err = OCILogon2(d_environmentHandle, d_errorHandle, &d_serviceContextHandle, (OraText*)user.c_str(), user.size(),
                  (OraText*) password.c_str(),  strlen(password.c_str()), (OraText*) database.c_str(), strlen(database.c_str()), OCI_LOGON2_STMTCACHE);
   // increase statement cache to 100
   if (err) {