Download & Extend

Replace actions_aid table with variable

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

Title:Remove unnecessary actions_aid table» Replace actions_aid table with variable or actions table query
Status:active» needs review

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.

AttachmentSizeStatusTest resultOperations
307259.actions_aid_table.patch2.74 KBIgnored: Check issue status.NoneNone

#2

Title:Replace actions_aid table with variable or actions table query» Replace actions_aid table with variable

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...

AttachmentSizeStatusTest resultOperations
actions_aid_table.patch2.46 KBIgnored: Check issue status.NoneNone

#3

Status:needs review» needs work

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

Issue tags:+actions

#7

#356074: Provide a sequences API if you agree won't fix this.

#8

Status:needs work» closed (won't fix)

Agreed, #356074: Provide a sequences API seems like a much better solution in progress.

nobody click here