Closed (fixed)
Project:
Drupal core
Version:
5.x-dev
Component:
database system
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
25 Sep 2006 at 21:06 UTC
Updated:
10 Jan 2007 at 22:46 UTC
Jump to comment: Most recent file
For most situations, the format of the $name parameter to db_next_id($name) should be: {sometable}_someid.
This rule is followed by all calls to db_next_id() in core, and part of contrib. However, there are many contributed modules using the non-prefixed form: sometable_someid instead, which can cause issues on multisites.
This should be documented on the API page for db_next_id().
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 85979.patch | 2.4 KB | keith.smith |
| #6 | db_next_id_2.patch | 1.61 KB | keith.smith |
| #4 | db_next_id_1.patch | 1.57 KB | fgm |
| #2 | db_next_id_0.patch | 1.57 KB | webchick |
| #1 | db_next_id.patch | 3.46 KB | webchick |
Comments
Comment #1
webchickYes, it should. Thanks for catching this.
Comment #2
webchickOops. That included a completely different thing.
Comment #3
drummThe examples should have single quotes.
Comment #4
fgmChanged quotes to single.
Comment #5
morbus iffComment #6
keith.smith commentedModified the patch in #4 such that both examples of db_next_id calls in the comments used single quotes, and added "curly" before the word brackets as well, per http://en.wikipedia.org/wiki/Bracket which states, in part:
"Presumably due to the similarity of the words brace and bracket (although they do not share an etymology), many people casually treat brace as a synonym for bracket. Therefore, when it is necessary to avoid any possibility of confusion, such as in computer programming, it may be best to use the term curly bracket rather than brace. However, general usage in North American English favours the latter form. The term curly braces is redundant since no other type of brace exists. Indian programmers often use the name "flower bracket"."
Comment #7
RobRoy commentedLooks good to me.
Comment #8
RobRoy commentedOops, think we're missing mysqli docs.
Comment #9
keith.smith commented...and comments copied to equivalent position within database.mysqli.inc....
Comment #10
dries commentedCommitted to CVS HEAD. Thanks.
Comment #11
(not verified) commented