MDL-26504 blog: fixed SQL to add explicit casting

This commit is contained in:
Aparup Banerjee
2012-09-05 10:41:29 +08:00
parent 70206bbda8
commit 8646d0aecb
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -7149,14 +7149,14 @@ FROM
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;
+1 -1
View File
@@ -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