[MDEV-16766] mysqldump: dump history in XML Created: 2018-07-16  Updated: 2018-07-16

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

Type: Task Priority: Minor
Reporter: Aleksey Midenkov Assignee: Aleksey Midenkov
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-16029 mysqldump: dump and restore historica... Closed

 Description   

myqldump should support dump-history in --xml mode. This imposes following requirements:

1. --xml option produces history. System fields contain Extra="ROW START/END GENERATED" option. If system fields are system-hidden they are included in <table_structure> anyway with Extra="SYSTEM INVISIBLE ROW START/END GENERATED" option. <table_structure> includes System_versioning="Y" option.

Example:

<?xml version="1.0"?>
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<database name="test">
        <table_structure name="t1" System_versioning="Y">
                <field Field="x" Type="int(11)" Null="YES" Key="" Default="NULL" Extra="" Comment="" />
                <field Field="row_start" Type="timestamp(6)" Null="NO" Key="" Extra="SYSTEM INVISIBLE ROW START GENERATED" Comment="" />
                <field Field="row_end" Type="timestamp(6)" Null="NO" Key="" Extra="SYSTEM INVISIBLE ROW END GENERATED" Comment="" />
                <options Name="t1" Engine="MyISAM" Version="10" Row_format="Fixed" Rows="2" Avg_row_length="19" Data_length="38" Max_data_length="5348024557502463" Index_length="1024" Data_free="0" Create_time="2018-07-03 09:30:09" Update_time="2018-07-03 09:30:09" Collation="latin1_swedish_ci" Create_options="" Comment="" Max_index_length="17179868160" Temporary="N" />
        </table_structure>
        <table_data name="t1">
        <row>   
                <field name="x">1</field>
                <field name="row_start">2018-07-03 09:30:09.491532</field>
                <field name="row_end">2018-07-03 09:30:09.491928</field>
        </row>
        <row>   
                <field name="x">2</field>
                <field name="row_start">2018-07-03 09:30:09.491532</field>
                <field name="row_end">2038-01-19 03:14:07.999999</field>
        </row>
        </table_data>
</database>
</mysqldump>

2. LOAD XML loads such data in case system_versioning_modify_history is ON. When system_versioning_modify_history is OFF LOAD XML fails to set row_start, row_end fields.

3. mysqlimport imports such tables with history.


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