Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/my_xml.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ extern "C" {
\r, \n, \t characters.
*/
#define MY_XML_FLAG_SKIP_TEXT_NORMALIZATION 2
#define MY_XML_FLAG_ASSERT_WELL_FORMED 4

Comment on lines 39 to 43
enum my_xml_node_type
{
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/main/vector2.result
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
create table t1 (a int, b vector(0));
ERROR 42000: Incorrect column specifier for column 'b'
create table t1 (a int, b vector(10) collate utf8mb3_general_ci);
ERROR 42000: Incorrect column specifier for column 'b'
ERROR HY000: Data type 'vector' doesn't support CHARACTER SET attribute.
create table t1 (a int, b vector(10));
show create table t1;
Table Create Table
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/main/vector2.test
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
create table t1 (a int, b vector);
--error ER_WRONG_FIELD_SPEC
create table t1 (a int, b vector(0));
--error ER_WRONG_FIELD_SPEC
--error ER_UNSUPPORTED_DATA_TYPE_ATTRIBUTE
create table t1 (a int, b vector(10) collate utf8mb3_general_ci);
create table t1 (a int, b vector(10));
show create table t1;
Expand Down
8 changes: 8 additions & 0 deletions plugin/type_inet/mysql-test/type_inet/type_inet4.result
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
#
CREATE TABLE t1 (a INET4 AUTO_INCREMENT);
ERROR 42000: Incorrect column specifier for column 'a'
CREATE TABLE t1 (a INET4(6));
ERROR HY000: Data type 'INET4' doesn't support LENGTH attribute.
CREATE TABLE t1 (a INET4 CHARACTER SET latin1);
ERROR HY000: Data type 'INET4' doesn't support CHARACTER SET attribute.
CREATE TABLE t1 (a INET4 REF_SYSTEM_ID=4);
ERROR HY000: Data type 'INET4' doesn't support REF_SYSTEM_ID attribute.
CREATE TABLE t1 (a INET4);
SHOW CREATE TABLE t1;
Table Create Table
Expand Down Expand Up @@ -239,6 +245,8 @@ CAST(REPEAT(0x11,16) AS INET4)
NULL
Warnings:
Warning 1292 Incorrect inet4 value: '\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11'
SELECT CAST('0.0.0.0' AS INET4 CHARACTER SET latin1);
ERROR HY000: Data type 'INET4' doesn't support CHARACTER SET attribute.
CREATE TABLE t1 AS SELECT CAST('0.0.0.0' AS INET4);
SHOW CREATE TABLE t1;
Table Create Table
Expand Down
13 changes: 13 additions & 0 deletions plugin/type_inet/mysql-test/type_inet/type_inet4.test
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@
--error ER_WRONG_FIELD_SPEC
CREATE TABLE t1 (a INET4 AUTO_INCREMENT);

--error ER_UNSUPPORTED_DATA_TYPE_ATTRIBUTE
CREATE TABLE t1 (a INET4(6));

--error ER_UNSUPPORTED_DATA_TYPE_ATTRIBUTE
CREATE TABLE t1 (a INET4 CHARACTER SET latin1);

--error ER_UNSUPPORTED_DATA_TYPE_ATTRIBUTE
CREATE TABLE t1 (a INET4 REF_SYSTEM_ID=4);


CREATE TABLE t1 (a INET4);
SHOW CREATE TABLE t1;
DESCRIBE t1;
Expand Down Expand Up @@ -76,6 +86,9 @@ SELECT CAST(0x01 AS INET4);
SELECT CAST(REPEAT(0x00,16) AS INET4);
SELECT CAST(REPEAT(0x11,16) AS INET4);

--error ER_UNSUPPORTED_DATA_TYPE_ATTRIBUTE
SELECT CAST('0.0.0.0' AS INET4 CHARACTER SET latin1);

CREATE TABLE t1 AS SELECT CAST('0.0.0.0' AS INET4);
SHOW CREATE TABLE t1;
DROP TABLE t1;
Expand Down
10 changes: 9 additions & 1 deletion plugin/type_inet/mysql-test/type_inet/type_inet6.result
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
#
CREATE TABLE t1 (a INET6 AUTO_INCREMENT);
ERROR 42000: Incorrect column specifier for column 'a'
CREATE TABLE t1 (a INET6(6));
ERROR HY000: Data type 'INET6' doesn't support LENGTH attribute.
CREATE TABLE t1 (a INET6 CHARACTER SET latin1);
ERROR HY000: Data type 'INET6' doesn't support CHARACTER SET attribute.
CREATE TABLE t1 (a INET6 REF_SYSTEM_ID=4);
ERROR HY000: Data type 'INET6' doesn't support REF_SYSTEM_ID attribute.
CREATE TABLE t1 (a INET6);
SHOW CREATE TABLE t1;
Table Create Table
Expand Down Expand Up @@ -229,6 +235,8 @@ CAST(REPEAT(0x00,16) AS INET6)
SELECT CAST(REPEAT(0x11,16) AS INET6);
CAST(REPEAT(0x11,16) AS INET6)
1111:1111:1111:1111:1111:1111:1111:1111
SELECT CAST('::' AS INET6 CHARACTER SET latin1);
ERROR HY000: Data type 'INET6' doesn't support CHARACTER SET attribute.
CREATE TABLE t1 AS SELECT CAST('::' AS INET6);
SHOW CREATE TABLE t1;
Table Create Table
Expand Down Expand Up @@ -2249,7 +2257,7 @@ DROP TABLE t1;
#
# MDEV-27015 Assertion `!is_null()' failed in FixedBinTypeBundle<FbtImpl>::Fbt FixedBinTypeBundle<FbtImpl>::Field_fbt::to_fbt()
#
CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, a INET6(6) DEFAULT '::10');
CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, a INET6 DEFAULT '::10');
INSERT INTO t1(id) VALUES (1), (2), (3), (4);
INSERT INTO t1 VALUES (5,'::5'), (6,'::6');
SELECT * FROM t1 ORDER BY a;
Expand Down
14 changes: 13 additions & 1 deletion plugin/type_inet/mysql-test/type_inet/type_inet6.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@

--error ER_WRONG_FIELD_SPEC
CREATE TABLE t1 (a INET6 AUTO_INCREMENT);

--error ER_UNSUPPORTED_DATA_TYPE_ATTRIBUTE
CREATE TABLE t1 (a INET6(6));

--error ER_UNSUPPORTED_DATA_TYPE_ATTRIBUTE
CREATE TABLE t1 (a INET6 CHARACTER SET latin1);

--error ER_UNSUPPORTED_DATA_TYPE_ATTRIBUTE
CREATE TABLE t1 (a INET6 REF_SYSTEM_ID=4);

CREATE TABLE t1 (a INET6);
SHOW CREATE TABLE t1;
Expand Down Expand Up @@ -69,6 +78,9 @@ SELECT CAST(0x01 AS INET6);
SELECT CAST(REPEAT(0x00,16) AS INET6);
SELECT CAST(REPEAT(0x11,16) AS INET6);

--error ER_UNSUPPORTED_DATA_TYPE_ATTRIBUTE
SELECT CAST('::' AS INET6 CHARACTER SET latin1);

CREATE TABLE t1 AS SELECT CAST('::' AS INET6);
SHOW CREATE TABLE t1;
DROP TABLE t1;
Expand Down Expand Up @@ -1649,7 +1661,7 @@ DROP TABLE t1;
--echo # MDEV-27015 Assertion `!is_null()' failed in FixedBinTypeBundle<FbtImpl>::Fbt FixedBinTypeBundle<FbtImpl>::Field_fbt::to_fbt()
--echo #

CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, a INET6(6) DEFAULT '::10');
CREATE TABLE t1 (id int NOT NULL PRIMARY KEY, a INET6 DEFAULT '::10');
INSERT INTO t1(id) VALUES (1), (2), (3), (4);
INSERT INTO t1 VALUES (5,'::5'), (6,'::6');
SELECT * FROM t1 ORDER BY a;
Expand Down
6 changes: 6 additions & 0 deletions plugin/type_test/mysql-test/type_test/type_test_int8.result
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ PLUGIN_DESCRIPTION Data type TEST_INT8
PLUGIN_LICENSE GPL
PLUGIN_MATURITY Experimental
PLUGIN_AUTH_VERSION 1.0
CREATE TABLE t1 (a TEST_INT8(6,2));
ERROR HY000: Data type 'TEST_INT8' doesn't support DECIMALS attribute.
CREATE TABLE t1 (a TEST_INT8 CHARACTER SET latin1);
ERROR HY000: Data type 'TEST_INT8' doesn't support CHARACTER SET attribute.
CREATE TABLE t1 (a TEST_INT8 REF_SYSTEM_ID=4);
ERROR HY000: Data type 'TEST_INT8' doesn't support REF_SYSTEM_ID attribute.
CREATE TABLE t1 (a TEST_INT8);
SHOW CREATE TABLE t1;
Table Create Table
Expand Down
9 changes: 9 additions & 0 deletions plugin/type_test/mysql-test/type_test/type_test_int8.test
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ FROM INFORMATION_SCHEMA.PLUGINS
AND PLUGIN_NAME='test_int8';
--horizontal_results

--error ER_UNSUPPORTED_DATA_TYPE_ATTRIBUTE
CREATE TABLE t1 (a TEST_INT8(6,2));

--error ER_UNSUPPORTED_DATA_TYPE_ATTRIBUTE
CREATE TABLE t1 (a TEST_INT8 CHARACTER SET latin1);

--error ER_UNSUPPORTED_DATA_TYPE_ATTRIBUTE
CREATE TABLE t1 (a TEST_INT8 REF_SYSTEM_ID=4);

CREATE TABLE t1 (a TEST_INT8);
SHOW CREATE TABLE t1;
DROP TABLE t1;
Expand Down
2 changes: 2 additions & 0 deletions plugin/type_test/plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class Type_handler_test_int8: public Type_handler_longlong
{
return &type_collection_test;
}
uint get_column_attributes() const override { return ATTR_LENGTH; }
const Type_handler *type_handler_signed() const override
{
return this;
Expand Down Expand Up @@ -121,6 +122,7 @@ class Type_handler_test_double: public Type_handler_double
{
return &type_collection_test;
}
uint get_column_attributes() const override { return ATTR_LENGTH | ATTR_DEC; }
const Type_handler *type_handler_signed() const override
{
return this;
Expand Down
6 changes: 6 additions & 0 deletions plugin/type_uuid/mysql-test/type_uuid/type_uuid.result
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
#
CREATE TABLE t1 (a UUID AUTO_INCREMENT);
ERROR 42000: Incorrect column specifier for column 'a'
CREATE TABLE t1 (a UUID(6));
ERROR HY000: Data type 'UUID' doesn't support LENGTH attribute.
CREATE TABLE t1 (a UUID CHARACTER SET latin1);
ERROR HY000: Data type 'UUID' doesn't support CHARACTER SET attribute.
CREATE TABLE t1 (a UUID REF_SYSTEM_ID=4);
ERROR HY000: Data type 'UUID' doesn't support REF_SYSTEM_ID attribute.
CREATE TABLE t1 (a UUID);
SHOW CREATE TABLE t1;
Table Create Table
Expand Down
10 changes: 10 additions & 0 deletions plugin/type_uuid/mysql-test/type_uuid/type_uuid.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@
--error ER_WRONG_FIELD_SPEC
CREATE TABLE t1 (a UUID AUTO_INCREMENT);

--error ER_UNSUPPORTED_DATA_TYPE_ATTRIBUTE
CREATE TABLE t1 (a UUID(6));

--error ER_UNSUPPORTED_DATA_TYPE_ATTRIBUTE
CREATE TABLE t1 (a UUID CHARACTER SET latin1);

--error ER_UNSUPPORTED_DATA_TYPE_ATTRIBUTE
CREATE TABLE t1 (a UUID REF_SYSTEM_ID=4);


CREATE TABLE t1 (a UUID);
SHOW CREATE TABLE t1;
DESCRIBE t1;
Expand Down
18 changes: 18 additions & 0 deletions plugin/type_xmltype/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2025, MariaDB corporation.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA

MYSQL_ADD_PLUGIN(type_xmltype
plugin.cc sql_type_xmltype.cc item_func_xml_isvalid.cc
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The file item_func_xml_isvalid.cc is listed as a source file for the type_xmltype plugin, but it is missing from the pull request. This will cause compilation and linking to fail because the implementation of Item_func_xml_isvalid methods (such as val_bool and fix_length_and_dec) is not provided.

MANDATORY RECOMPILE_FOR_EMBEDDED)
Loading
Loading