[MDEV-15923] option to control who can set session @@timestamp Created: 2018-04-18  Updated: 2018-05-17  Resolved: 2018-05-12

Status: Closed
Project: MariaDB Server
Component/s: Replication, Versioned Tables
Fix Version/s: 10.3.7

Type: Task Priority: Critical
Reporter: Sergei Golubchik Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
blocks MDEV-15380 Index for versioned table gets corrup... Closed
blocks MDEV-16029 mysqldump: dump and restore historica... Closed

 Description   

It's a bit strange now that one cannot create an arbitrary history with arbitrary timestamps, unless one abuses replication, in which case one can. This is illogical.

A consistent approach could be a new command line option that controls who can set @@timestamp.
Something like --who-can-set-session-timestamp=NOBODY|REPLICATION|SUPER|ANYONE
(here "SUPER" implies "REPLICATION")

Can be set via command-line option only, read-only server variable.

perhaps REPLICATION is unnecessary, and NOBODY|SUPER|ANYONE is enough (if SUPER can abuse REPLICATION to change timestamp anyway).

And system versioning will use @@timestamp and not a separate shadow system time anymore.



 Comments   
Comment by Sergei Golubchik [ 2018-05-03 ]

The option is:

  --secure-timestamp=name 
                      Restricts direct setting of a session timestamp. Possible
                      levels are: YES - timestamp cannot deviate from the
                      system clock, REPLICATION - replication thread can adjust
                      timestamp to match the master's, SUPER - a user with this
                      privilege and a replication thread can adjust timestamp,
                      NO - historical behavior, anyone can modify session
                      timestamp

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