many others, a complete list can be found in the file AUTHORS.
This program is Free Software; you can redistribute it and/or
modify it under the terms of version two of the GNU General Public
- License as published by the Free Software Foundation plus additions
- that are listed in the file LICENSE.
+ License as published by the Free Software Foundation and included
+ in the file LICENSE.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
if (mdb->db_socket) {
free(mdb->db_socket);
}
- my_postgresql_free_result(mdb);
free(mdb);
}
V(mutex);
void my_postgresql_free_result(B_DB *mdb)
{
+
+ db_lock(mdb);
if (mdb->result) {
PQclear(mdb->result);
mdb->result = NULL;
free(mdb->fields);
mdb->fields = NULL;
}
+ db_unlock(mdb);
}
int my_postgresql_currval(B_DB *mdb, char *table_name)
mdb->row_number = -1;
mdb->field_number = -1;
- if (mdb->result != NULL) {
- my_postgresql_free_result(mdb);
- }
+ my_postgresql_free_result(mdb);
for (int i=0; i < 10; i++) {
mdb->result = PQexec(mdb->db, query);