summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changes1
-rw-r--r--src/mysql.c15
-rw-r--r--version.log6
3 files changed, 19 insertions, 3 deletions
diff --git a/Changes b/Changes
index 106b58866..3aa932800 100644
--- a/Changes
+++ b/Changes
@@ -8,6 +8,7 @@ Provided by Anope Dev. <dev@anope.org> - 2006
09/10 F Issues with make strict for the src/tools dir. [#579]
09/10 F Help for NickServ SET AUTOOP was missing. [#587]
09/10 F Added HOP to the /CS ACCESS error when XOP is enabled. [#598]
+09/10 F MySQL no longer connects again on each query. [#595]
Provided by Trystan <trystan@nomadirc.net> - 2006
08/20 F Fixed several compiler warnings. [#586]
diff --git a/src/mysql.c b/src/mysql.c
index c7dfc8fbe..0dcdf95df 100644
--- a/src/mysql.c
+++ b/src/mysql.c
@@ -22,6 +22,8 @@ MYSQL_RES *mysql_res; /* MySQL Result */
MYSQL_FIELD *mysql_fields; /* MySQL Fields */
MYSQL_ROW mysql_row; /* MySQL Row */
+int mysql_is_connected = 0; /* Are we currently connected? */
+
/*************************************************************************/
void db_mysql_error(int severity, char *msg)
@@ -87,7 +89,11 @@ int db_mysql_open()
/* If MySQL is disabled, return 0 */
if (!do_mysql)
return 0;
-
+
+ /* If we're already connected, return 1 */
+ if (mysql_is_connected)
+ return 1;
+
mysql = mysql_init(NULL);
if (mysql == NULL)
db_mysql_error(MYSQL_WARNING, "Unable to create mysql object");
@@ -112,7 +118,9 @@ int db_mysql_open()
return 0;
}
}
-
+
+ mysql_is_connected = 1;
+
return 1;
}
@@ -190,6 +198,9 @@ int db_mysql_close()
if (mysql_res)
mysql_free_result(mysql_res);
mysql_close(mysql);
+
+ mysql_is_connected = 0;
+
return 1;
}
diff --git a/version.log b/version.log
index 4151a6460..de77abe64 100644
--- a/version.log
+++ b/version.log
@@ -9,10 +9,14 @@ VERSION_MAJOR="1"
VERSION_MINOR="7"
VERSION_PATCH="15"
VERSION_EXTRA="-svn"
-VERSION_BUILD="1149"
+VERSION_BUILD="1150"
# $Log$
#
+# BUILD : 1.7.15 (1150)
+# BUGS : 595
+# NOTES : Fixed MySQL making a new connection for each query (bit TOO enthousiastic?)
+#
# BUILD : 1.7.15 (1149)
# BUGS : 598
# NOTES : Added HOP to the list of XOP commands in the error from ChanServ ACCESS when XOP is enabled on supported ircds (and that line is too long!)