Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-26504 blog: fixed SQL to add explicit casting

  • Loading branch information...
commit 8646d0aecbec4e0417576f5d8101b421449b35d5 1 parent 70206bb
@nebgor nebgor authored
Showing with 4 additions and 4 deletions.
  1. +3 −3 lib/db/upgrade.php
  2. +1 −1  version.php
View
6 lib/db/upgrade.php
@@ -7149,14 +7149,14 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2011120504.05);
}
- if ($oldversion < 2011120504.11) {
- $subquery = 'SELECT b.id FROM {blog_external} b where ' . $DB->sql_compare_text('b.id') . ' = ' . $DB->sql_compare_text('{post}.content');
+ if ($oldversion < 2011120504.12) {
+ $subquery = 'SELECT b.id FROM {blog_external} b where b.id = ' . $DB->sql_cast_char2int('{post}.content', true);
$sql = 'DELETE FROM {post}
WHERE {post}.module = \'blog_external\'
AND NOT EXISTS (' . $subquery . ')
AND ' . $DB->sql_isnotempty('post', 'uniquehash', false, false);
$DB->execute($sql);
- upgrade_main_savepoint(true, 2011120504.11);
+ upgrade_main_savepoint(true, 2011120504.12);
}
return true;
View
2  version.php
@@ -30,7 +30,7 @@
defined('MOODLE_INTERNAL') || die();
-$version = 2011120504.11; // 20111205 = branching date YYYYMMDD - do not modify!
+$version = 2011120504.12; // 20111205 = branching date YYYYMMDD - do not modify!
// RR = release increments - 00 in DEV branches
// .XX = incremental changes
Please sign in to comment.
Something went wrong with that request. Please try again.