Index: includes/locale.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/locale.inc,v retrieving revision 1.198 diff -u -p -r1.198 locale.inc --- includes/locale.inc 19 Dec 2008 03:55:23 -0000 1.198 +++ includes/locale.inc 29 Dec 2008 00:28:14 -0000 @@ -2519,9 +2519,9 @@ function locale_batch_by_language($langc $components = array(); $query = "SELECT name, filename FROM {system} WHERE status = 1"; if (count($skip)) { - $query .= " AND name NOT IN (" . db_placeholders($skip, 'varchar') . ")"; + $query .= " AND name NOT IN (:skip)"; } - $result = db_query($query, $skip); + $result = db_query($query, array(':skip' => $skip)); while ($component = db_fetch_object($result)) { // Collect all files for all components, names as $langcode.po or // with names ending with $langcode.po. This allows for filenames Index: includes/database/database.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/database/database.inc,v retrieving revision 1.38 diff -u -p -r1.38 database.inc --- includes/database/database.inc 26 Dec 2008 14:23:38 -0000 1.38 +++ includes/database/database.inc 29 Dec 2008 00:28:16 -0000 @@ -1816,23 +1816,6 @@ function update_sql($sql) { } /** - * Generate placeholders for an array of query arguments of a single type. - * - * Given a Schema API field type, return correct %-placeholders to - * embed in a query - * - * @todo This may be possible to remove in favor of db_select(). - * @param $arguments - * An array with at least one element. - * @param $type - * The Schema API type of a field (e.g. 'int', 'text', or 'varchar'). - */ -function db_placeholders($arguments, $type = 'int') { - $placeholder = db_type_placeholder($type); - return implode(',', array_fill(0, count($arguments), $placeholder)); -} - -/** * Wraps the given table.field entry with a DISTINCT(). The wrapper is added to * the SELECT list entry of the given query and the resulting query is returned. * This function only applies the wrapper if a DISTINCT doesn't already exist in Index: modules/block/block.module =================================================================== RCS file: /cvs/drupal/drupal/modules/block/block.module,v retrieving revision 1.316 diff -u -p -r1.316 block.module --- modules/block/block.module 16 Dec 2008 23:57:31 -0000 1.316 +++ modules/block/block.module 29 Dec 2008 00:28:16 -0000 @@ -353,7 +353,7 @@ function block_box_save($edit, $delta) { function block_user_form(&$edit, &$account, $category = NULL) { if ($category == 'account') { $rids = array_keys($account->roles); - $result = db_query("SELECT DISTINCT b.* FROM {block} b LEFT JOIN {block_role} r ON b.module = r.module AND b.delta = r.delta WHERE b.status = 1 AND b.custom != 0 AND (r.rid IN (" . db_placeholders($rids) . ") OR r.rid IS NULL) ORDER BY b.weight, b.module", $rids); + $result = db_query("SELECT DISTINCT b.* FROM {block} b LEFT JOIN {block_role} r ON b.module = r.module AND b.delta = r.delta WHERE b.status = 1 AND b.custom != 0 AND (r.rid IN (:rids) OR r.rid IS NULL) ORDER BY b.weight, b.module", array(':rids' => $rids)); $form['block'] = array('#type' => 'fieldset', '#title' => t('Block configuration'), '#weight' => 3, '#collapsible' => TRUE, '#tree' => TRUE); while ($block = db_fetch_object($result)) { $data = module_invoke($block->module, 'block_list'); @@ -420,7 +420,7 @@ function _block_load_blocks() { $blocks = array(); $rids = array_keys($user->roles); - $result = db_query(db_rewrite_sql("SELECT DISTINCT b.* FROM {block} b LEFT JOIN {block_role} r ON b.module = r.module AND b.delta = r.delta WHERE b.theme = '%s' AND b.status = 1 AND (r.rid IN (" . db_placeholders($rids) . ") OR r.rid IS NULL) ORDER BY b.region, b.weight, b.module", 'b', 'bid'), array_merge(array($theme_key), $rids)); + $result = db_query(db_rewrite_sql("SELECT DISTINCT b.* FROM {block} b LEFT JOIN {block_role} r ON b.module = r.module AND b.delta = r.delta WHERE b.theme = :theme AND b.status = 1 AND (r.rid IN (:rids) OR r.rid IS NULL) ORDER BY b.region, b.weight, b.module", 'b', 'bid'), array(':theme' => array_merge(array($theme_key)), ':rids' => $rids)); while ($block = db_fetch_object($result)) { if (!isset($blocks[$block->region])) { $blocks[$block->region] = array(); Index: modules/blogapi/blogapi.module =================================================================== RCS file: /cvs/drupal/drupal/modules/blogapi/blogapi.module,v retrieving revision 1.136 diff -u -p -r1.136 blogapi.module --- modules/blogapi/blogapi.module 8 Dec 2008 21:54:31 -0000 1.136 +++ modules/blogapi/blogapi.module 29 Dec 2008 00:28:17 -0000 @@ -584,7 +584,7 @@ function blogapi_mt_validate_terms($node $term_list = array_unique($node->taxonomy); $params = $term_list; $params[] = $node->type; - $result = db_query(db_rewrite_sql("SELECT t.tid, t.vid FROM {term_data} t INNER JOIN {vocabulary_node_type} n ON t.vid = n.vid WHERE t.tid IN (". db_placeholders($term_list) .") AND n.type = '%s'", 't', 'tid'), $params); + $result = db_query(db_rewrite_sql("SELECT t.tid, t.vid FROM {term_data} t INNER JOIN {vocabulary_node_type} n ON t.vid = n.vid WHERE t.tid IN (:term_list) AND n.type = :type", 't', 'tid'), array(':term_list' => $term_list, ':type' => $node->type)); $found_terms = array(); $found_count = 0; while ($term = db_fetch_object($result)) { Index: modules/book/book.module =================================================================== RCS file: /cvs/drupal/drupal/modules/book/book.module,v retrieving revision 1.482 diff -u -p -r1.482 book.module --- modules/book/book.module 23 Dec 2008 14:32:08 -0000 1.482 +++ modules/book/book.module 29 Dec 2008 00:28:17 -0000 @@ -723,7 +723,7 @@ function book_build_active_trail($book_l * Implementation of hook_nodeapi_load(). */ function book_nodeapi_load($nodes, $types) { - $result = db_query("SELECT * FROM {book} b INNER JOIN {menu_links} ml ON b.mlid = ml.mlid WHERE b.nid IN (" . db_placeholders(array_keys($nodes)) . ")", array_keys($nodes), array('fetch' => PDO::FETCH_ASSOC)); + $result = db_query("SELECT * FROM {book} b INNER JOIN {menu_links} ml ON b.mlid = ml.mlid WHERE b.nid IN (:nids)", array(':nids' => array_keys($nodes)), array('fetch' => PDO::FETCH_ASSOC)); foreach ($result as $record) { $nodes[$record['nid']]->book = $record; $nodes[$record['nid']]->book['href'] = $record['link_path']; Index: modules/comment/comment.module =================================================================== RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v retrieving revision 1.673 diff -u -p -r1.673 comment.module --- modules/comment/comment.module 20 Dec 2008 18:24:35 -0000 1.673 +++ modules/comment/comment.module 29 Dec 2008 00:28:18 -0000 @@ -605,7 +605,7 @@ function comment_nodeapi_load($nodes, $t // For nodes with comments enabled, fetch information from the database. if (!empty($comments_enabled)) { - $result = db_query('SELECT nid, last_comment_timestamp, last_comment_name, comment_count FROM {node_comment_statistics} WHERE nid IN(' . db_placeholders($comments_enabled) . ')', $comments_enabled); + $result = db_query('SELECT nid, last_comment_timestamp, last_comment_name, comment_count FROM {node_comment_statistics} WHERE nid IN(:comments_enabled))', array(':comments_enabled' => $comments_enabled)); foreach ($result as $record) { $nodes[$record->nid]->last_comment_timestamp = $record->last_comment_timestamp; $nodes[$record->nid]->last_comment_name = $record->last_comment_name; Index: modules/forum/forum.module =================================================================== RCS file: /cvs/drupal/drupal/modules/forum/forum.module,v retrieving revision 1.479 diff -u -p -r1.479 forum.module --- modules/forum/forum.module 20 Dec 2008 18:24:36 -0000 1.479 +++ modules/forum/forum.module 29 Dec 2008 00:28:19 -0000 @@ -358,7 +358,7 @@ function forum_nodeapi_load($nodes, $typ } } if (!empty($node_vids)) { - $result = db_query('SELECT nid, tid FROM {forum} WHERE vid IN(' . db_placeholders($node_vids) . ')', $node_vids); + $result = db_query('SELECT nid, tid FROM {forum} WHERE vid IN(:node_vids)', array(':node_vids' => $node_vids)); foreach ($result as $record) { $nodes[$record->nid]->forum_tid = $record->tid; } Index: modules/node/node.api.php =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.api.php,v retrieving revision 1.4 diff -u -p -r1.4 node.api.php --- modules/node/node.api.php 20 Dec 2008 18:24:38 -0000 1.4 +++ modules/node/node.api.php 29 Dec 2008 00:28:19 -0000 @@ -245,7 +245,7 @@ function hook_nodeapi_insert($node) { * An array containing the types of the nodes. */ function hook_nodeapi_load($nodes, $types) { - $result = db_query('SELECT nid, foo FROM {mytable} WHERE nid IN(' . db_placeholders(array_keys($nodes)) . ')', array_keys($nodes)); + $result = db_query('SELECT nid, foo FROM {mytable} WHERE nid IN(:nids)', array(':nids' => array_keys($nodes))); foreach ($result as $record) { $nodes[$record->nid]->foo = $record->foo; } @@ -693,7 +693,7 @@ function hook_insert($node) { * For a detailed usage example, see node_example.module. */ function hook_load($nodes) { - $result = db_fetch_object(db_query('SELECT nid, foo FROM {mytable} WHERE nid IN (' . db_placeholders(array_keys($nodes)) . ')', array_keys($nodes))); + $result = db_query('SELECT nid, foo FROM {mytable} WHERE nid IN (:nids)', array(':nids' => array_keys($nodes))); foreach ($result as $record) { $nodes[$record->nid]->foo = $record->foo; } Index: modules/taxonomy/taxonomy.api.php =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.api.php,v retrieving revision 1.2 diff -u -p -r1.2 taxonomy.api.php --- modules/taxonomy/taxonomy.api.php 5 Dec 2008 22:18:46 -0000 1.2 +++ modules/taxonomy/taxonomy.api.php 29 Dec 2008 00:28:20 -0000 @@ -85,7 +85,7 @@ function hook_taxonomy_vocabulary_delete * An array of term objects, indexed by tid. */ function hook_taxonomy_term_load($terms) { - $result = db_query('SELECT tid, foo FROM {mytable} WHERE tid IN (' . db_placeholders(array_keys($terms)) . ')', array_keys($terms)); + $result = db_query('SELECT tid, foo FROM {mytable} WHERE tid IN (:tids)', array(':tids' => array_keys($terms))); foreach ($result as $record) { $terms[$record->tid]->foo = $record->foo; } Index: modules/taxonomy/taxonomy.pages.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.pages.inc,v retrieving revision 1.19 diff -u -p -r1.19 taxonomy.pages.inc --- modules/taxonomy/taxonomy.pages.inc 19 Dec 2008 03:55:23 -0000 1.19 +++ modules/taxonomy/taxonomy.pages.inc 29 Dec 2008 00:28:21 -0000 @@ -16,7 +16,7 @@ function taxonomy_term_page($terms, $dep $str_tids = $terms['str_tids']; if ($terms['tids']) { - $result = db_query(db_rewrite_sql('SELECT t.tid, t.name FROM {term_data} t WHERE t.tid IN (' . db_placeholders($terms['tids']) . ')', 't', 'tid'), $terms['tids']); + $result = db_query(db_rewrite_sql('SELECT t.tid, t.name FROM {term_data} t WHERE t.tid IN (:tids))', 't', 'tid'), array(':tids' => $terms['tids'])); $tids = array(); // we rebuild the $tids-array so it only contains terms the user has access to. $names = array(); while ($term = db_fetch_object($result)) { Index: modules/user/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.module,v retrieving revision 1.949 diff -u -p -r1.949 user.module --- modules/user/user.module 23 Dec 2008 14:18:31 -0000 1.949 +++ modules/user/user.module 29 Dec 2008 00:28:23 -0000 @@ -489,7 +489,7 @@ function user_role_permissions($roles = if ($fetch) { // Get from the database permissions that were not in the static variable. // Only role IDs with at least one permission assigned will return rows. - $result = db_query("SELECT r.rid, p.permission FROM {role} r INNER JOIN {role_permission} p ON p.rid = r.rid WHERE r.rid IN (" . db_placeholders($fetch) . ")", $fetch); + $result = db_query("SELECT r.rid, p.permission FROM {role} r INNER JOIN {role_permission} p ON p.rid = r.rid WHERE r.rid IN (:fetch)", array(':fetch' => $fetch)); while ($row = db_fetch_array($result)) { $stored_permissions[$row['rid']][$row['permission']] = TRUE;