Closed (won't fix)
Project:
Drupal core
Version:
5.11
Component:
path.module
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
20 Oct 2008 at 13:05 UTC
Updated:
24 Feb 2012 at 21:48 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
Anonymous (not verified) commentedThis patch doesn't appear to be correct. You say you set a database lock yet the patch is removing database locks and unlocks. However, I don't see locks as the answer since MyISAM locks the entire table and not a row. There is a push for D7 to support InnoDB engine instead so that transactional row locking can take place. But, if two users are updating the same url_alias then the one who updates last will be the winner regardless of the lock.
Comment #2
mkalkbrennerYes, after the patch the complete table url_alias will be locked in line 142 and the lock will be released after all operations on this table.
The database error I described occurs if two threads try to set the same new alias at the same time.
In both threads $alias_count equals '0'. So both threads try to INSERT a row. Regarding the primary key 'pid' there's no problem because it's an auto_increment but the UNIQUE KEY constraint on column 'dst' causes the second INSERT to fail with a database error.
BTW from my point of view using an auto_increment for 'pid' violates drupal's architecture to use a sequence table for ids.
Comment #3
Anonymous (not verified) commentedThe patch was still created in reverse. I.E. the new was specified as the old and vice versa.
The sequence table is gone in D6. Locking entire tables as MyISAM would do for your patch isn't a good thing for this issue. Doing a ON DUPLICATE KEY UPDATE is better but maybe won't be a good fit for this.
Comment #4
mkalkbrennerYou're right. I created the patch in reverse direction. I'll attach a corrected one soon.
ON DUPLICATE KEY UPDATE was introduced in MySQL 4.1. According to http://drupal.org/requirements drupal 5 supports MySQL since 3.23.17.
Another Option is REPLACE INTO but I think this one isn't portable to other databases.
Comment #5
mkalkbrennerHere's the right patch, sorry.
Comment #6
dpearcefl commentedConsidering the time elapsed between now and the last comment plus the fact that D5 is no longer supported, I am closing this ticket.
Comment #7
dpearcefl commentedReopening this issue until I can check to see if this is useable in newer Drupal.
Comment #8
codi commentedold issue and drupal 5 is no longer supported.