Various small mysqldump manual improvements for the --as-of and --tz-utc options (MDEV-26946)

[MDEV-27749] Binary changes for --as-of and --tz-utc options Created: 2022-02-04  Updated: 2023-11-27  Resolved: 2022-04-20

Status: Closed
Project: MariaDB Server
Component/s: Scripts & Clients, Versioned Tables
Affects Version/s: 10.7, 10.8
Fix Version/s: 10.7.4, 10.8.3

Type: Technical task Priority: Critical
Reporter: Roel Van de Paar Assignee: Aleksey Midenkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Issue split
split from MDEV-26946 Various small mysqldump manual improv... Open
Problem/Incident
is caused by MDEV-16355 Add option for mysqldump to read data... Closed

 Description   

Implement binary changes enumerated in MDEV-26946

Proposed texts as per MDEV-26946:

$ ./bin/mysqldump --help --verbose | grep -A3 -m1 'as-of' 
  --as-of=name        Dump system versioned tables as of the specified timestamp. 
                      Note that table structures are always dumped, irrespective of 
                      the date/time specified. Note that the timestamp is interpreted 
                      according to the --tz-utc setting (ref MDEV-26943 and --tz-utc).
 
$ ./bin/mysqldump --help --verbose | grep -A5 -m1 'tz-utc' 
  --tz-utc            This option enables TIMESTAMP columns to be dumped and 
                      reloaded between servers in different time zones. 
                      mysqldump sets its connection time zone to UTC before 
                      commencing the dump, and adds SET TIME_ZONE=´+00:00´ 
                      to the top of the dump file.



 Comments   
Comment by Aleksey Midenkov [ 2022-02-09 ]

--help is not the man page. --help briefly describes what each option does. Brevity is the main feature here: basically it lists what the options are available long and short for the user to interact. When the user wants details he reads the man page. That's the common UNIX practice!

If you think differently, please suggest the text for the p.4 and approve this ticket with serg.

Comment by Roel Van de Paar [ 2022-02-16 ]

midenok sorry to say, but did you even read the bug report I wrote? A proposed text is/was already there, and is exactly one line longer than the current text.

Comment by Aleksey Midenkov [ 2022-02-21 ]

Roel Maybe I read wrong this:

4. The mysqldump binary's help for -as-of should be changed in a similar matter as items 1 to 3 above.

So it requires to include this:
---------
1. It needs to be clarified that this option is only applicable to the data, not the table structure. The table structure is always dumped, irrespective of the date/time specified. @serg fyi, in case this is considered a bug.

CREATE TABLE t1 (a INT) WITH SYSTEM VERSIONING;
INSERT t1 (a) VALUES (1),(2),(3);
DELETE FROM t1 WHERE a=1;

Followed by:

./bin/mysqldump -uroot -S./socket.sock --compact --as-of="1990-01-01 00:01" test t1

Will dump the table structure but not the data.

2. In regards timestamps, the connection with -tz-utc / -skip-tz-utc would best be clarified to make it easier for users to understand why their timestamps are not working when dumping data. Perhaps something like:

Please note the interaction of this option with <a href="https://jira.mariadb.org/browse/MDEV-26943">--tz-utc</a>.

----------------
And where is the proposed text for the above? I see two p.4 though in your list so I referred to the first one.

Comment by Aleksey Midenkov [ 2022-02-21 ]

Roel to avoid further misunderstanding please update this task description with exact instructions for this task only.

Comment by Roel Van de Paar [ 2022-02-22 ]

midenok Again, the proposed text for --tz-utc was already there and for --as-of I simply used the sentences which were also already there. I've added it into the description above for you.

Comment by Roel Van de Paar [ 2022-02-22 ]

midenok serg As mentioned in MDEV-26946, before documenting this, it needs to be validated that it is correct and expected behavior to dump table structures always. i.e. when a user dumps with an --as-of set to 1990 it will dump a table structure created in 2022, even if no data is included.

Comment by Sergei Golubchik [ 2022-02-23 ]

yes, as far as table structure is concerned — it's definitely correct and expected.

as far as --as-of help text is concerned — I agree that it could benefit from a second statement, like "Timestamp is interpreted according to the --tz-utc setting".

Comment by Roel Van de Paar [ 2022-02-25 ]

Updated description to match, thank you!

Comment by Aleksey Midenkov [ 2022-03-01 ]

Please review bb-10.7-midenok

Comment by Roel Van de Paar [ 2022-03-02 ]

IMHO, the original proposed text above has two advantages not present in the proposed patch;
1) MDEV-26943 is a helpful reference
2) "This option enables TIMESTAMP columns to be dumped and reloaded between servers in different time zones." is (and was) helpful

There is also a typo: "versioned table" should read "versioned table(s)" as it can be more than one.

Comment by Aleksey Midenkov [ 2022-03-29 ]

Roel We do not specify MDEV references in the UI, do we?
As for 2) this is obvious for SA having servers in different time zones. Like I said, --help is not man page.

Comment by Sergei Golubchik [ 2022-04-10 ]

b8a66d853cb4ba52c0ab09074f34f566ae25bf52 is ok to push, thanks

Generated at Thu Feb 08 09:55:17 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.