diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-06-05 12:13:23 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-06-05 12:13:23 +0000 |
commit | 27388f66557cddce6aff1cc945601c5f843304cd (patch) | |
tree | 3a12f2afdc14b5af5be1b03d9c1fde6ac3d77928 /includes/database.mysql.inc | |
parent | 745222200e0670f55c6d695e467558171b7bb5d8 (diff) | |
download | brdo-27388f66557cddce6aff1cc945601c5f843304cd.tar.gz brdo-27388f66557cddce6aff1cc945601c5f843304cd.tar.bz2 |
- Patch #149176 by chx, David et al: getting rid of the sequences table, using db_last_insert_id() instead of db_next_id().
Diffstat (limited to 'includes/database.mysql.inc')
-rw-r--r-- | includes/database.mysql.inc | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/includes/database.mysql.inc b/includes/database.mysql.inc index 45426fff2..c3c6b0710 100644 --- a/includes/database.mysql.inc +++ b/includes/database.mysql.inc @@ -47,12 +47,6 @@ function db_version() { /** * Initialize a database connection. - * - * Note that you can change the mysql_connect() call to mysql_pconnect() if you - * want to use persistent connections. This is not recommended on shared hosts, - * and might require additional database/webserver tuning. It can increase - * performance, however, when the overhead to connect to your database is high - * (e.g. your database and web server live on different machines). */ function db_connect($url) { $url = parse_url($url); @@ -239,25 +233,6 @@ function db_error() { } /** - * Return a new unique ID in the given sequence. - * - * For compatibility reasons, Drupal does not use auto-numbered fields in its - * 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) { - global $active_db; - $name = db_prefix_tables($name); - db_query('INSERT INTO {sequences} VALUES ("%s", LAST_INSERT_ID(1)) ON DUPLICATE KEY UPDATE id = LAST_INSERT_ID(id + 1)', $name); - - return mysql_insert_id($active_db); -} - -/** * Determine the number of rows changed by the preceding query. */ function db_affected_rows() { |