aboutsummaryrefslogtreecommitdiff
path: root/src/pgsql.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pgsql.c')
-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.