[geeklog-cvs] geeklog: Need to check for InnoDB support again when migrating
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Mon Jan 5 05:07:08 EST 2009
details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/3f7294b43f79
changeset: 6629:3f7294b43f79
user: Dirk Haun <dirk at haun-online.de>
date: Thu Jan 01 17:16:23 2009 +0100
description:
Need to check for InnoDB support again when migrating
diffstat:
3 files changed, 30 insertions(+), 27 deletions(-)
public_html/admin/install/index.php | 26 +-------------------------
public_html/admin/install/lib-upgrade.php | 22 +++++++++++++++++++++-
public_html/admin/install/migrate.php | 9 ++++++++-
diffs (104 lines):
diff -r 9bd8b2905fe6 -r 3f7294b43f79 public_html/admin/install/index.php
--- a/public_html/admin/install/index.php Thu Jan 01 16:59:31 2009 +0100
+++ b/public_html/admin/install/index.php Thu Jan 01 17:16:23 2009 +0100
@@ -8,14 +8,10 @@
// | |
// | Geeklog installation script. |
// +---------------------------------------------------------------------------+
-// | Copyright (C) 2000-2009 by the following authors: |
+// | Copyright (C) 2007-2009 by the following authors: |
// | |
// | Authors: Matt West - matt AT mattdanger DOT net |
-// | Tony Bibbs - tony AT tonybibbs DOT com |
-// | Mark Limburg - mlimburg AT users DOT sourceforge DOT net |
-// | Jason Whittenburg - jwhitten AT securitygeeks DOT com |
// | Dirk Haun - dirk AT haun-online DOT de |
-// | Randy Kolenko - randy AT nextide DOT ca |
// +---------------------------------------------------------------------------+
// | |
// | This program is free software; you can redistribute it and/or |
@@ -820,26 +816,6 @@
/**
- * Check for InnoDB table support (usually as of MySQL 4.0, but may be
- * available in earlier versions, e.g. "Max" or custom builds).
- *
- * @return boolean true = InnoDB tables supported, false = not supported
- *
- */
-function INST_innodbSupported()
-{
- $result = DB_query ("SHOW VARIABLES LIKE 'have_innodb'");
- $A = DB_fetchArray ($result, true);
-
- if (strcasecmp ($A[1], 'yes') == 0) {
- return true;
- } else {
- return false;
- }
-}
-
-
-/**
* Handle default install of available plugins
*
* Picks up and installs all plugins with an autoinstall.php.
diff -r 9bd8b2905fe6 -r 3f7294b43f79 public_html/admin/install/lib-upgrade.php
--- a/public_html/admin/install/lib-upgrade.php Thu Jan 01 16:59:31 2009 +0100
+++ b/public_html/admin/install/lib-upgrade.php Thu Jan 01 17:16:23 2009 +0100
@@ -8,7 +8,7 @@
// | |
// | Functions needed to perform a database update. |
// +---------------------------------------------------------------------------+
-// | Copyright (C) 2008 by the following authors: |
+// | Copyright (C) 2000-2009 by the following authors: |
// | |
// | Authors: Matt West - matt.danger.west AT gmail DOT com |
// | Dirk Haun - dirk AT haun-online DOT de |
@@ -727,6 +727,26 @@
/**
+ * Check for InnoDB table support (usually as of MySQL 4.0, but may be
+ * available in earlier versions, e.g. "Max" or custom builds).
+ *
+ * @return boolean true = InnoDB tables supported, false = not supported
+ *
+ */
+function INST_innodbSupported()
+{
+ $result = DB_query("SHOW VARIABLES LIKE 'have_innodb'");
+ $A = DB_fetchArray($result, true);
+
+ if (strcasecmp($A[1], 'yes') == 0) {
+ return true;
+ }
+
+ return false;
+}
+
+
+/**
* Check if a current plugin is installed
*
* @param string $plugin Name of plugin to check
diff -r 9bd8b2905fe6 -r 3f7294b43f79 public_html/admin/install/migrate.php
--- a/public_html/admin/install/migrate.php Thu Jan 01 16:59:31 2009 +0100
+++ b/public_html/admin/install/migrate.php Thu Jan 01 17:16:23 2009 +0100
@@ -613,7 +613,14 @@
$db_engine = DB_getItem($_TABLES['vars'], 'value',
"name = 'database_engine'");
if ($db_engine == 'InnoDB') {
- $use_innodb = true;
+ // we've migrated, probably to a different server
+ // - so check InnoDB support again
+ if (INST_innodbSupported()) {
+ $use_innodb = true;
+ } else {
+ // no InnoDB support on this server
+ DB_delete($_TABLES['vars'], 'name', 'database_engine');
+ }
}
if (! INST_doDatabaseUpgrades($version)) {
More information about the geeklog-cvs
mailing list