Closed (fixed)
Project:
Drupal core
Component:
filter.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
21 Apr 2004 at 18:28 UTC
Updated:
24 Aug 2004 at 21:20 UTC
Jump to comment: Most recent file
Comments
Comment #1
(not verified) commentedComment #2
dries commentedShouldn't that be
KEY module (module)instead ofKEY weight (module)?Comment #3
LilDave commentedYes it should be. Attached is corrected patch.
Comment #4
dries commentedCommitted to HEAD. I updated
database/updates.inctoo. Thanks.Comment #5
Steven commentedThis was not a mistake: the filters are always fetched ordered by weight so it makes sense to key on weight, no? The .mysql and .pgsql were in sync before this patch afaik.
Comment #6
LilDave commentedIf you put a unique index on the weight column you can only have 1 filter at any particular weight. Doing so kind of defeats the purpose of allowing multiple filters. More to the point, if you have this setting, unconfigured filters will insert themselves as weight 0 ... if you have any filter already installed at weight 0, the insert will fail as there is a unique key on the weight column.
If you need to have them come back in a specific order, add an order by clause the the relevant SQL with direction of ASC.
Comment #7
Steven commentedYes but note that in the mysql version, 'weight' was not a unique, primary key, it was just a regular key. The PGSQL conversion contained a mistake then...
Comment #8
LilDave commentedOk now I see what you're saying. Probably for clarity it should be an indexed column. When I think of 'KEY' I think UNIQUE as being synonymous.
Now not to quote scripture on this, but the MySQL database documentation indicates that from MySQL 4.1+, KEY is a synonym for PRIMARY KEY (which is forced NOT NULL, UNIQUE over all columns involved). In versions prior, INDEX and KEY were considered synonymous. The change in 4.1 was made such that MySQL would be more compatible with other DB systems.
So probably the best change would be to just create an INDEX on the columns you're after. INDEX would allow non-unique entries at that point.
In the interest of cross platform compatability (which seems to be lacking in a number of OTHER CMS systems), it's probably better to aim for the SQL standard rather than a specific databases implementation.
I personally am a PostgreSQL user (hence my posting this) and as far as I know, PostgreSQL is touted as one of the more SQL standard OSS engines. Just my .02$ ... take it or leave it. Just here to help.
Comment #9
killes@www.drop.org commentedSteven, did that get fixed?
Comment #10
Steven commentedI left it as is for now because the filters table was tiny anyway. In my upcoming filter patch I did take this into account though.
Comment #11
jonbob commentedFilter system is completely rewritten; this is obsolete.
Comment #12
(not verified) commented