diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-06-24 12:59:22 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-06-24 12:59:22 +0000 |
commit | a1f25d312f628bb09acf1c7c06566fc37776412b (patch) | |
tree | 9ef3e8507ac6f32bf5699419c30b3e58d7a2042a /modules/forum | |
parent | 665a0c33b58f58cfc5eb67422b70dc5cf76b9e62 (diff) | |
download | brdo-a1f25d312f628bb09acf1c7c06566fc37776412b.tar.gz brdo-a1f25d312f628bb09acf1c7c06566fc37776412b.tar.bz2 |
#835802 by aaronbauman: Fixed DBTNG: INSERT query in forum.install should use dynamic query format.
Diffstat (limited to 'modules/forum')
-rw-r--r-- | modules/forum/forum.install | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/modules/forum/forum.install b/modules/forum/forum.install index 1a488327c..ea1771230 100644 --- a/modules/forum/forum.install +++ b/modules/forum/forum.install @@ -291,5 +291,16 @@ function forum_update_7001() { ); db_create_table('forum_index', $forum_index); - db_query('INSERT INTO {forum_index} (SELECT n.nid, n.title, f.tid, n.sticky, n.created, ncs.last_comment_timestamp, ncs.comment_count FROM {node} n INNER JOIN {forum} f on n.vid = f.vid INNER JOIN {node_comment_statistics} ncs ON n.nid = ncs.nid)'); + $select = db_select('node', 'n'); + $forum_alias = $select->join('forum', 'f', 'n.vid = f.vid'); + $ncs_alias = $select->join('node_comment_statistics', 'ncs', 'n.nid = ncs.nid'); + $select + ->fields('n', array('nid', 'title', 'sticky', 'created')) + ->fields($forum_alias, array('tid')) + ->fields($ncs_alias, array('last_comment_timestamp', 'comment_count')); + + db_insert('forum_index') + ->fields(array('nid', 'title', 'sticky', 'created', 'tid', 'last_comment_timestamp', 'comment_count')) + ->from($select) + ->execute(); } |