diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2005-11-04 13:02:51 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2005-11-04 13:02:51 +0000 |
commit | 2ad97f0277c4eff591c4a7b826ad182e629a7f94 (patch) | |
tree | 0081c5bae2490981d5b264512ffd4ba48dcfe2b1 /includes/database.pgsql.inc | |
parent | 132517a8cb2d9e195687e71d6f0a8dbc505843cd (diff) | |
download | brdo-2ad97f0277c4eff591c4a7b826ad182e629a7f94.tar.gz brdo-2ad97f0277c4eff591c4a7b826ad182e629a7f94.tar.bz2 |
- #36255: Fix db_query_temporary() in pgsql
- Prefix temporary table names (helps on restricted hosts)
Diffstat (limited to 'includes/database.pgsql.inc')
-rw-r--r-- | includes/database.pgsql.inc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/includes/database.pgsql.inc b/includes/database.pgsql.inc index 89b693bab..8a1e06ebf 100644 --- a/includes/database.pgsql.inc +++ b/includes/database.pgsql.inc @@ -253,8 +253,8 @@ function db_query_range($query) { * printf() syntax. Instead of a variable number of query arguments, you may * also pass a single array containing the query arguments. * @param $table - * The name of the temporary table to select into. This name will not be - * prefixed as there is no risk of collision. + * The name of the temporary table to select into. This name will be + * prefixed for compatibility reasons (there is no risk of collision). * @return * A database query result resource, or FALSE if the query was not executed * correctly. @@ -263,7 +263,7 @@ function db_query_temporary($query) { $args = func_get_args(); $tablename = array_pop($args); - $query = preg_replace('/^SELECT/i', 'CREATE TEMPORARY TABLE '. $tablename .' AS', db_prefix_tables($query)); + $query = preg_replace('/^SELECT/i', 'CREATE TEMPORARY TABLE {'. $tablename .'} AS SELECT', db_prefix_tables($query)); if (count($args) > 1) { // Check for array (alternative syntax). if (is_array($args[1])) { |