From a394fa7e529d29db69d72a16b42f48a2aea709b3 Mon Sep 17 00:00:00 2001 From: Bob Vincent Date: Thu, 30 Jun 2011 17:24:04 -0400 Subject: [PATCH] Issue 300279: Document in db_query_temporary() that table persistence depends on whether persistent connections are enabled. --- includes/database.mysql.inc | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/includes/database.mysql.inc b/includes/database.mysql.inc index 01a7d1702e77d3d212a16be6d36238bcf6d9198b..118faeaf3aa4d0f3c4bd0920830289f2a88c72d2 100644 --- a/includes/database.mysql.inc +++ b/includes/database.mysql.inc @@ -176,7 +176,7 @@ function db_fetch_array($result) { * * @param $result * A database query result resource, as returned from db_query(). - * + * * @return * The resulting field or FALSE. */ @@ -253,9 +253,12 @@ function db_query_range($query) { /** * Runs a SELECT query and stores its results in a temporary table. * - * Use this as a substitute for db_query() when the results need to stored - * in a temporary table. Temporary tables exist for the duration of the page - * request. + * Use this as a substitute for db_query() when the results need to stored in a + * temporary table. Temporary tables exist for the duration of the current + * database connection. If persistent connections are used, temporary tables + * may persist for several page requests; otherwise they are destroyed along + * with the database connection at the end of each request. + * * User-supplied arguments to the query should be passed in as separate parameters * so that they can be properly escaped to avoid SQL injection attacks. * @@ -278,9 +281,14 @@ function db_query_range($query) { * @param $table * The name of the temporary table to select into. This name will not be * prefixed as there is no risk of collision. + * * @return * A database query result resource, or FALSE if the query was not executed * correctly. + * + * @see http://dev.mysql.com/doc/refman/4.1/en/create-table.html + * @see http://php.net/manual/features.persistent-connections.php + * @see http://php.net/manual/function.mysql-pconnect.php */ function db_query_temporary($query) { $args = func_get_args(); -- 1.7.4.1