From 5c99a06f9f30b23eb587e2bc3c3e4b5dc95ac54f Mon Sep 17 00:00:00 2001
From: Dries Buytaert <dries@buytaert.net>
Date: Wed, 27 Dec 2006 22:13:56 +0000
Subject: [PATCH] - Patch #85979 by RobRoy, keith.smith, fgm and webchick:
 improve documentation of db_next_id().

---
 includes/database.mysql.inc  | 3 +++
 includes/database.mysqli.inc | 3 +++
 includes/database.pgsql.inc  | 3 +++
 3 files changed, 9 insertions(+)

diff --git a/includes/database.mysql.inc b/includes/database.mysql.inc
index bdb3abb1df4a..aa87b5bffde3 100644
--- a/includes/database.mysql.inc
+++ b/includes/database.mysql.inc
@@ -249,6 +249,9 @@ function db_error() {
  * database tables. Instead, this function is used to return a new unique ID
  * of the type requested. If necessary, a new sequence with the given name
  * will be created.
+ *
+ * Note that the table name should be in curly brackets to preserve compatibility
+ * with table prefixes. For example, db_next_id('{node}_nid');
  */
 function db_next_id($name) {
   $name = db_prefix_tables($name);
diff --git a/includes/database.mysqli.inc b/includes/database.mysqli.inc
index 5a1dea60fa1e..e22e3ada4640 100644
--- a/includes/database.mysqli.inc
+++ b/includes/database.mysqli.inc
@@ -234,6 +234,9 @@ function db_error() {
  * database tables. Instead, this function is used to return a new unique ID
  * of the type requested. If necessary, a new sequence with the given name
  * will be created.
+ *
+ * Note that the table name should be in curly brackets to preserve compatibility
+ * with table prefixes. For example, db_next_id('{node}_nid');
  */
 function db_next_id($name) {
   $name = db_prefix_tables($name);
diff --git a/includes/database.pgsql.inc b/includes/database.pgsql.inc
index fad269e05c80..71723d84db00 100644
--- a/includes/database.pgsql.inc
+++ b/includes/database.pgsql.inc
@@ -228,6 +228,9 @@ function db_error() {
  * database tables. Instead, this function is used to return a new unique ID
  * of the type requested. If necessary, a new sequence with the given name
  * will be created.
+ *
+ * Note that the table name should be in curly brackets to preserve compatibility
+ * with table prefixes. For example, db_next_id('{node}_nid');
  */
 function db_next_id($name) {
   $id = db_result(db_query("SELECT nextval('%s_seq')", db_prefix_tables($name)));
-- 
GitLab