summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-03-15 23:35:47 +0000
committerAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2010-03-15 23:35:47 +0000
commitf62eb161769f62163f671dd55ded475147b64f67 (patch)
tree4fe634d7ec7b358a7cf21f53de54e65d9a7ebbe7
parentb7477fc4d045442102d8e570aa3a4dd8bdcb75e6 (diff)
Removed old parts for 1.7.x from mydbgen and fixed db_mysql_write query for /nickserv set
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2814 5417fbe8-f217-4b02-8779-1006273d7864
-rwxr-xr-xsrc/bin/mydbgen71
-rw-r--r--src/modules/mysql/db_mysql_write.cpp2
2 files changed, 2 insertions, 71 deletions
diff --git a/src/bin/mydbgen b/src/bin/mydbgen
index f3599a252..b6efbf048 100755
--- a/src/bin/mydbgen
+++ b/src/bin/mydbgen
@@ -19,13 +19,7 @@ else
n="-n"
fi
-# Fix for bug 10
-for try in HOME/services anope/data ../data data .. .
-do
- if [ -f "$try/$DBSQL" ]; then
- DBFILE="$try/$DBSQL"
- fi
-done
+DBFILE=../data/$DBSQL
if [ ! -f "./$DBFILE" ] ; then
echo "Error: Required file $DBSQL was not found!";
@@ -117,73 +111,11 @@ if test "$?" = "1" ; then
FAILED="$FAILED 'schema creation'"
fi
else
- # Introduced on Anope 1.6.0 -> Table anope_info
- $MYSQL -Bs -e "show tables like 'anope_info'" | grep -q anope_info
- if test "$?" = "1" ; then
- echo -n "Unable to find Anope info table, creating... "
- echo "CREATE TABLE anope_info (version int, date datetime) TYPE=MyISAM" > $TFILE
- mysql -h$SQLHOST -u$SQLUSER $SQLPASS_PREFIX$SQLPASS $SQLDB < $TFILE >/dev/null 2>&1
- if test "$?" = "0" ; then
- echo "done!"
-
- else
- echo "failed!"
- FAILED="$FAILED 'anope_info table'"
- fi
- else
- LVER="$($MYSQL -sB -e "select version from anope_info")"
- if test "x$LVER" = "x" ; then
- LVER=0
- fi
- fi
-
- # Introduced on Anope 1.5.14.5 -> anope_cs_info.memomax
- $MYSQL -Bs -e "describe anope_cs_info memomax" 2> /dev/null | grep -q memomax
- if test "$?" = "1" ; then
- echo -n "Unable to find anope_cs_info.memomax, altering... "
- echo "ALTER TABLE anope_cs_info ADD memomax smallint unsigned NOT NULL default 0" > $TFILE
- mysql -h$SQLHOST -u$SQLUSER $SQLPASS_PREFIX$SQLPASS $SQLDB < $TFILE >/dev/null 2>&1
- if test "$?" = "0" ; then
- echo "done!"
-
- else
- echo "failed!"
- FAILED="$FAILED 'anope_cs_info.memomax alter'"
- fi
- fi
-
- # Introduced on Anope 1.5.14.5 -> anope_cs_info.ttb
- $MYSQL -Bs -e "describe anope_cs_info ttb" 2> /dev/null | grep -q ttb
- if test "$?" = "1" ; then
- echo -n "Unable to find anope_cs_info.ttb, altering... "
- echo "ALTER TABLE anope_cs_info ADD ttb smallint NOT NULL default 0" > $TFILE
- mysql -h$SQLHOST -u$SQLUSER $SQLPASS_PREFIX$SQLPASS $SQLDB < $TFILE >/dev/null 2>&1
- if test "$?" = "0" ; then
- echo "done!"
-
- else
- echo "failed!"
- FAILED="$FAILED 'anope_cs_info.ttb alter'"
- fi
- fi
-
- # Introduced on Anope 1.7.7 -> status smallint to inst unsigned.
- echo "Blindly altering status for bigger capacity... "
- echo "ALTER TABLE anope_ns_alias CHANGE status status int(11) unsigned NOT NULL default 0" > $TFILE
- mysql -h$SQLHOST -u$SQLUSER $SQLPASS_PREFIX$SQLPASS $SQLDB < $TFILE >/dev/null 2>&1
-
- # Introduced on Anope 1.7.8 (620) proxy scanner removed.
- echo "Removing proxy scanner cache... "
- echo "DROP TABLE IF EXISTS anope_os_cache" > $TFILE
- mysql -h$SQLHOST -u$SQLUSER $SQLPASS_PREFIX$SQLPASS $SQLDB < $TFILE >/dev/null 2>&1
-
echo "done!"
-
fi
echo ""
-# Insert initial version number. This will have to be redesigned for 1.7
if [ $LVER -ne $SVER ]; then
echo -n "Inserting initial version number... "
$MYSQL -Bs -e "delete from anope_info"
@@ -200,7 +132,6 @@ fi
rm -f $TFILE
if test "x$FAILED" = "x" ; then
# Try to find out more about this installation
- SQLSOCK="$(mysql_config --socket 2> /dev/null)"
SQLPORT="$(mysql_config --port 2> /dev/null)"
echo ""
echo "Your MySQL setup is complete and your Anope schema is up to date. Make"
diff --git a/src/modules/mysql/db_mysql_write.cpp b/src/modules/mysql/db_mysql_write.cpp
index 05d474603..746b46260 100644
--- a/src/modules/mysql/db_mysql_write.cpp
+++ b/src/modules/mysql/db_mysql_write.cpp
@@ -454,7 +454,7 @@ class DBMySQLWrite : public DBMySQL
}
else if (cmd == "KILL" || cmd == "SECURE" || cmd == "PRIVATE" || cmd == "MSG" || cmd == "HIDE" || cmd == "AUTOOP")
{
- query << "UPDATE `anope_ns_core` SET `flags` = " << BuildFlagsList(nc) << " WHERE `display` = " << mysqlpp::quote << nc->display;
+ query << "UPDATE `anope_ns_core` SET `flags` = '" << BuildFlagsList(nc) << "' WHERE `display` = " << mysqlpp::quote << nc->display;
ExecuteQuery(query);
}
}