[MDEV-16858] system versioning to automatically store SESSION_USER() info Created: 2018-07-30  Updated: 2020-01-29

Status: Open
Project: MariaDB Server
Component/s: Versioned Tables
Fix Version/s: None

Type: Task Priority: Minor
Reporter: Robert Dyas Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

It would be great if system versioning could somehow store the SESSION_USER() responsible for the change (insert/update/delete), this way you could see not only the change but who did it.

It seems doable for insert and update, but for delete the ROW_END timestamp appears the only thing changed on the existing history record... so a delete would need its own history record to save this info... not sure if my understanding is correct or not. Is this possible?



 Comments   
Comment by Sergei Golubchik [ 2018-08-10 ]

Perhaps you'd need two columns for that? ROW_START_USER and ROW_END_USER?

Anyway, system versioning is implemented to follow the SQL Standard, and auditing apparently was not one of the goals that the SQL standard committee tried to solve.

And for now we want to complete standard compatible versioning first, before introducing new non-standard extensions.

Comment by Robert Dyas [ 2018-08-10 ]

That makes sense to me. ROW_START_USER would be specified for INSERT and UPDATE operations, and ROW_END_USER for DELETE operations?

It seems kind of wasteful, since only a deleted row would ever need a ROW_END_USER but I don't see any obvious other way since delete operations don't generate a new history record.

Generated at Thu Feb 08 08:32:05 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.