Author: turnstep
Date: Sun Feb 17 05:07:00 2008
New Revision: 10762

Modified:
   DBD-Pg/trunk/dbdimp.c
   DBD-Pg/trunk/quote.c

Log:
More compiler tweaks.


Modified: DBD-Pg/trunk/dbdimp.c
==============================================================================
--- DBD-Pg/trunk/dbdimp.c       (original)
+++ DBD-Pg/trunk/dbdimp.c       Sun Feb 17 05:07:00 2008
@@ -91,6 +91,8 @@
 static int pg_db_start_txn (pTHX_ SV *dbh, imp_dbh_t *imp_dbh);
 static int handle_old_async(pTHX_ SV * handle, imp_dbh_t * imp_dbh, int 
asyncflag);
 
+DBISTATE_DECLARE;
+
 /* ================================================================== */
 void dbd_init (dbistate_t *dbistate)
 {
@@ -254,8 +256,10 @@
                /* If using 3.0 protocol but not yet version 8, switch to 
"smart" */
                PGLIBVERSION >= 80000 ? 1 : 2 : 0;
 
-       /* Tell DBI that imp_dbh is all ready to go */
+       /* Tell DBI that we should call destroy when the handle dies */
        DBIc_IMPSET_on(imp_dbh);
+
+       /* Tell DBI that we should call disconnect when the handle dies */
        DBIc_ACTIVE_on(imp_dbh);
 
        return 1;
@@ -1356,6 +1360,7 @@
                }
        }
 
+       /* Tell DBI to call destroy when this handle ends */
        DBIc_IMPSET_on(imp_sth);
 
        return 1;

Modified: DBD-Pg/trunk/quote.c
==============================================================================
--- DBD-Pg/trunk/quote.c        (original)
+++ DBD-Pg/trunk/quote.c        Sun Feb 17 05:07:00 2008
@@ -20,6 +20,7 @@
 
 char * null_quote(const char *string, STRLEN len, STRLEN *retlen)
 {
+       dTHX;
        char *result;
        New(0, result, len+1, char);
        strncpy(result,string,len);
@@ -31,6 +32,7 @@
 
 char * quote_string(const char *string, STRLEN len, STRLEN *retlen)
 {
+       dTHX;
        char * result;
        STRLEN oldlen = len;
 
@@ -64,6 +66,7 @@
 
 char * quote_geom(const char *string, STRLEN len, STRLEN *retlen)
 {
+       dTHX;
        char * result;
         const char *tmp;
 
@@ -90,6 +93,7 @@
 
 char * quote_path(const char *string, STRLEN len, STRLEN *retlen)
 {
+       dTHX;
        char * result;
        const char * const tmp = string;
 
@@ -116,6 +120,7 @@
 
 char * quote_circle(const char *string, STRLEN len, STRLEN *retlen)
 {
+       dTHX;
        char * result;
        const char * const tmp = string;
 
@@ -143,6 +148,7 @@
 
 char * quote_bytea(char *string, STRLEN len, STRLEN *retlen)
 {
+       dTHX;
        char * result;
        STRLEN oldlen = len;
 
@@ -196,7 +202,7 @@
 
 char * quote_sql_binary(char *string, STRLEN len, STRLEN *retlen)
 {
-       
+       dTHX;
        /* We are going to return a quote_bytea() for backwards compat but
                 we warn first */
        warn("Use of SQL_BINARY invalid in quote()");
@@ -208,6 +214,7 @@
 
 char * quote_bool(const char *value, STRLEN len, STRLEN *retlen) 
 {
+       dTHX;
        char *result;
        long int int_value;
        STRLEN  max_len=6;
@@ -238,6 +245,7 @@
 
 char * quote_integer(const char *value, STRLEN len, STRLEN *retlen) 
 {
+       dTHX;
        char *result;
        STRLEN max_len=6;
         const int intval = *((const int*)value);
@@ -267,6 +275,7 @@
 
 void dequote_string(const char *string, STRLEN *retlen)
 {
+       dTHX;
        *retlen = strlen(string);
 }
 
@@ -274,6 +283,7 @@
 
 void dequote_bytea(char *string, STRLEN *retlen)
 {
+       dTHX;
        char *result;
 
        (*retlen) = 0;
@@ -320,6 +330,7 @@
  */
 void dequote_sql_binary(char *string, STRLEN *retlen)
 {
+       dTHX;
        /* We are going to retun a dequote_bytea(), JIC */
        warn("Use of SQL_BINARY invalid in dequote()");
        dequote_bytea(string, retlen);
@@ -331,6 +342,7 @@
 
 void dequote_bool(char *string, STRLEN *retlen)
 {
+       dTHX;
        switch(*string){
        case 'f': *string = '0'; break;
        case 't': *string = '1'; break;
@@ -344,6 +356,7 @@
 
 void null_dequote(const char *string, STRLEN *retlen)
 {
+       dTHX;
        *retlen = strlen(string);
 }
 

Reply via email to