diff options
author | Alexander Barkov <bar@mariadb.org> | 2017-12-13 13:22:45 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2017-12-13 13:22:45 +0400 |
commit | a53e087ea9d865bbe1f3a53a90b1683196feb5ba (patch) | |
tree | 6d5fc57e1370386c21135bd7e594ac63ee9f9a78 /mysql-test/std_data | |
parent | d2f557fa3d64626af8a961324b16b8b9e1642f7e (diff) | |
download | mariadb-git-a53e087ea9d865bbe1f3a53a90b1683196feb5ba.tar.gz |
MDEV-14628 Wrong autoinc value assigned by LOAD XML in the NO_AUTO_VALUE_ON_ZERO mode
The fixes for these bugs:
Bug#27586 Wrong autoinc value assigned by LOAD DATA in the NO_AUTO_VALUE_ON_ZERO mode
Bug#22372 Disable spatial key, load data, enable spatial key, crashes table
fixed only LOAD DATA INFILE, but did not fix LOAD XML INFILE.
This patch does for LOAD XML FILE what patches for Bug#27586 and Bug#22372
earlier did for LOAD DATA INFILE.
1. Fixing the auto_increment problem:
a. table->auto_increment_field_not_null is not set to TRUE
anymore when a column does not have a corresponding XML tag.
b. Adding "table->auto_increment_field_not_null= false"
in the end of read_xml_field().
These two changes resemble the patch for Bug#27586.
2. Fixing the GEOMETRY problem:
The result for "reset()" was not tested for errors in read_xml_field(),
which made it possible for empty string to sneak into a "GEOMETRY NOT NULL"
column when this column does not have a corresponding XML tag with data.
After this patch the result of reset() is tested and and an error is
returned in such cases.
This change effectively resembles the patch for Bug#22372
3. Spliting the code into a new virtual method Field::load_data_set_null().
Rationale:
a. To avoid duplicate code in read_sep_field() and read_xml_field():
Changes #1 and #2 made the code handling NULL values for Field
exactly the same in read_sep_field() and read_xml_field().
b. To avoid tests for field_type(), which is not friendly to
upcoming data type plugins.
This change makes it possible for data type plugins
to implement their own special way for handling NULL values in LOAD DATA
by overriding Field_xxx::load_data_set_null(),
like Field_geom and Field_timestamp do.
Diffstat (limited to 'mysql-test/std_data')
-rw-r--r-- | mysql-test/std_data/loaddata/mdev14628a.xml | 4 | ||||
-rw-r--r-- | mysql-test/std_data/loaddata/mdev14628b.xml | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/mysql-test/std_data/loaddata/mdev14628a.xml b/mysql-test/std_data/loaddata/mdev14628a.xml new file mode 100644 index 00000000000..34ee7336a5a --- /dev/null +++ b/mysql-test/std_data/loaddata/mdev14628a.xml @@ -0,0 +1,4 @@ +<list> + <row a="1" b="bbb1"/> + <row b="bbb2"/> +</list> diff --git a/mysql-test/std_data/loaddata/mdev14628b.xml b/mysql-test/std_data/loaddata/mdev14628b.xml new file mode 100644 index 00000000000..2ea02d2a35f --- /dev/null +++ b/mysql-test/std_data/loaddata/mdev14628b.xml @@ -0,0 +1,3 @@ +<list> + <row id="1"/> +</list> |