~ubuntu-branches/ubuntu/wily/dovecot/wily

« back to all changes in this revision

Viewing changes to src/lib-sql/driver-pgsql.c

  • Committer: Package Import Robot
  • Author(s): Jaldhar H. Vyas
  • Date: 2013-09-09 00:57:32 UTC
  • mfrom: (1.13.11)
  • mto: (4.8.5 experimental) (1.16.1)
  • mto: This revision was merged to the branch mainline in revision 97.
  • Revision ID: package-import@ubuntu.com-20130909005732-dn1eell8srqbhh0e
Tags: upstream-2.2.5
ImportĀ upstreamĀ versionĀ 2.2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2004-2012 Dovecot authors, see the included COPYING file */
 
1
/* Copyright (c) 2004-2013 Dovecot authors, see the included COPYING file */
2
2
 
3
3
#include "lib.h"
4
4
#include "array.h"
45
45
        const char **fields;
46
46
        const char **values;
47
47
 
48
 
        ARRAY_DEFINE(binary_values, struct pgsql_binary_value);
 
48
        ARRAY(struct pgsql_binary_value) binary_values;
49
49
 
50
50
        sql_query_callback_t *callback;
51
51
        void *context;
168
168
        }
169
169
 
170
170
        if (io_dir == 0) {
171
 
                i_info("%s: Connected to database %s",
172
 
                       pgsql_prefix(db), PQdb(db->pg));
173
171
                if (db->to_connect != NULL)
174
172
                        timeout_remove(&db->to_connect);
175
173
                driver_pgsql_set_state(db, SQL_DB_STATE_IDLE);
485
483
                (void)sql_connect(&db->api);
486
484
        }
487
485
        if (db->api.state != SQL_DB_STATE_DISCONNECTED) {
 
486
                int error;
 
487
 
488
488
                to = t_buffer_get(len * 2 + 1);
489
 
                len = PQescapeStringConn(db->pg, to, string, len, NULL);
 
489
                len = PQescapeStringConn(db->pg, to, string, len, &error);
490
490
        } else
491
491
#endif
492
492
        {
1085
1085
        }
1086
1086
};
1087
1087
 
1088
 
const char *driver_pgsql_version = DOVECOT_VERSION;
 
1088
const char *driver_pgsql_version = DOVECOT_ABI_VERSION;
1089
1089
 
1090
1090
void driver_pgsql_init(void);
1091
1091
void driver_pgsql_deinit(void);