Posted by Dave Reid on September 12, 2008 at 12:18am
| Project: | Drupal core |
| Version: | 7.x-dev |
| Component: | system.module |
| Category: | task |
| Priority: | normal |
| Assigned: | Dave Reid |
| Status: | closed (won't fix) |
| Issue tags: | actions |
Issue Summary
Currently, the entire purpose of the {actions_aid} table is to store the last {actions}.aid inserted into the {actions} table. One field, one purpose which seems like it should be able to easily be replaced with a variable or a simple query of the {actions} table. I'm working on getting a patch written.
Comments
#1
Initial patch using variable replacement with upgrade path provided. I left in a commented, alternative method using a query of the actions table, but I haven't tested it yet to see if it would be compatible with different databases and my gut instinct says it won't be. I left it just in case so if someone could possibly improvement.
#2
After review, it would be easiest to replace the actions_aid just with a variable. Update worked successfully, and passed actions configuration test 100% after a patched update and on patched fresh install.
Not really loving the fact that we don't have some definitive DBTNG documentation...
#3
You would introduce a race condition with this patch. The beauty of auto_increment is that it's atomic.
#4
Thanks for pointing that this was heading in the wrong direction. I'm playing around with making the aid column of the actions table an md5 value of (callback + parameters + description) for all actions. Doing that will get rid of the actions_aid table and seems like it might make some of the actions code a little less complicated.
#5
#6
#7
#356074: Provide a sequences API if you agree won't fix this.
#8
Agreed, #356074: Provide a sequences API seems like a much better solution in progress.