From 55dc01892ba1df2c912d4e7fead335a31aba809d Mon Sep 17 00:00:00 2001 From: Danny Auble <da@llnl.gov> Date: Mon, 21 Jul 2008 19:58:02 +0000 Subject: [PATCH] moved definitions for connections to here instead of in the accounting plugin for use elsewhere --- src/database/Makefile.am | 1 - src/database/mysql_common.h | 11 ++++++++++- src/database/pgsql_common.h | 11 ++++++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/database/Makefile.am b/src/database/Makefile.am index c1538b0517f..31e2b7c0cc9 100644 --- a/src/database/Makefile.am +++ b/src/database/Makefile.am @@ -36,4 +36,3 @@ libslurm_pgsql_la_LDFLAGS = $(LIB_LDFLAGS) libslurm_mysql_la_CFLAGS = $(MYSQL_CFLAGS) libslurm_pgsql_la_CFLAGS = $(PGSQL_CFLAGS) - diff --git a/src/database/mysql_common.h b/src/database/mysql_common.h index 69acb54c499..c8fcb76a1d3 100644 --- a/src/database/mysql_common.h +++ b/src/database/mysql_common.h @@ -56,10 +56,19 @@ #include "src/common/list.h" #include "src/common/xstring.h" -#ifdef HAVE_MYSQL +#ifndef HAVE_MYSQL +typedef void mysql_conn_t; +#else #include <mysql.h> #include <mysqld_error.h> +typedef struct { + MYSQL *db_conn; + bool rollback; + List update_list; + int conn; +} mysql_conn_t; + typedef struct { uint32_t port; char *host; diff --git a/src/database/pgsql_common.h b/src/database/pgsql_common.h index cc48e8c5fad..2762d57b68c 100644 --- a/src/database/pgsql_common.h +++ b/src/database/pgsql_common.h @@ -56,9 +56,18 @@ #include "src/slurmctld/slurmctld.h" #include "src/common/xstring.h" -#ifdef HAVE_PGSQL +#ifndef HAVE_PGSQL +typedef void pgsql_conn_t; +#else #include <libpq-fe.h> +typedef struct { + PGconn *db_conn; + bool rollback; + List update_list; + int conn; +} pgsql_conn_t; + typedef struct { uint32_t port; char *host; -- GitLab