Revision: 2507
https://sourceforge.net/p/mrbs/code/2507/
Author: cimorrison
Date: 2012-10-17 21:04:25 +0000 (Wed, 17 Oct 2012)
Log Message:
-----------
Fixed bug in upgrade procedure causing the upgrade to fail if the number of
rows affected by a query was zero.
Modified Paths:
--------------
mrbs/trunk/web/upgrade.inc
Modified: mrbs/trunk/web/upgrade.inc
===================================================================
--- mrbs/trunk/web/upgrade.inc 2012-10-17 20:59:06 UTC (rev 2506)
+++ mrbs/trunk/web/upgrade.inc 2012-10-17 21:04:25 UTC (rev 2507)
@@ -51,18 +51,18 @@
$sql = str_replace('%DB_TBL_PREFIX%', $db_tbl_prefix, $sql);
- foreach (explode(";", $sql) as $command)
+ foreach (explode(";", $sql) as $query)
{
- // Skip any empty command (so that last semi-colon doesn't run
- // an empty command)
- if (preg_match("/\S/", $command))
+ // Skip any empty query (so that last semi-colon doesn't run
+ // an empty query)
+ if (preg_match("/\S/", $query))
{
- $res = sql_command($command, $upgrade_handle);
- if ($res == -1)
+ $res = sql_query($query, $upgrade_handle);
+ if ($res === FALSE)
{
// No need to localise, should hopefully never happen
print "<br>Tried:<pre>
-".htmlspecialchars($command)."
+".htmlspecialchars($query)."
</pre> and got error:<pre>
".sql_error($upgrade_handle)."
</pre>\n";
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits