summaryrefslogtreecommitdiffabout
path: root/src/pgsql.c
authorSergey Poznyakoff <gray@gnu.org.ua>2010-03-06 16:35:03 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2010-03-06 16:35:03 (GMT)
commit6707c35f1112aa22f13f97d4d3f233495f44e015 (patch) (side-by-side diff)
treed669c4f40813df7a305da20227c1f15ad398389d /src/pgsql.c
parentd68261197e99fe472e0d75cefd30db4c4e43775e (diff)
downloadgamma-6707c35f1112aa22f13f97d4d3f233495f44e015.tar.gz
gamma-6707c35f1112aa22f13f97d4d3f233495f44e015.tar.bz2
Bugfixes.
* src/mysql.c, src/pgsql.c: Use scm_from_ulong. * src/pgsql.c (s_pgsql_connect): Call gamma_parmlist_parse (ouch!) * src/gsql_conn.c, src/gsql_lib.c: Remove unused variables * src/guile-sql.h (gsql_conn_init) (sql_register_iface): New protos.
Diffstat (limited to 'src/pgsql.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/pgsql.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/pgsql.c b/src/pgsql.c
index c1a8e41..609fedb 100644
--- a/src/pgsql.c
+++ b/src/pgsql.c
@@ -59,6 +59,8 @@ s_pgsql_connect (SCM parmlist, const char *func_name)
SCM smob;
struct sql_connect *conn;
+ gamma_parmlist_parse (parmlist, dcltab, 0, func_name);
+
pgconn = PQsetdbLogin(hostname, port, NULL, NULL, dbname, user, pass);
if (PQstatus(pgconn) == CONNECTION_BAD) {
@@ -91,7 +93,7 @@ result_to_list(PGresult *res)
int i, j;
int ntuples = PQntuples(res);
int nfields = PQnfields(res);
- SCM row_head = SCM_EOL, row_tail;
+ SCM row_head = SCM_EOL, row_tail = SCM_EOL;
for (i = 0; i < ntuples; i++) {
SCM new_row;
@@ -123,7 +125,7 @@ s_pgsql_query(struct sql_connect *conn, const char *query)
{
PGconn *pgconn = (PGconn*) conn->data;
PGresult *res;
- SCM cell;
+ SCM cell = SCM_EOL;
ExecStatusType stat;
res = PQexec(pgconn, query);
@@ -137,7 +139,7 @@ s_pgsql_query(struct sql_connect *conn, const char *query)
switch (stat) {
case PGRES_COMMAND_OK:
/* Successful completion of a command returning no data */
- cell = scm_to_ulong(strtoul(PQcmdTuples(res), NULL, 0));
+ cell = scm_from_ulong(strtoul(PQcmdTuples(res), NULL, 0));
break;
case PGRES_TUPLES_OK:
/* The query successfully executed */

Return to:

Send suggestions and report system problems to the System administrator.