Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
dae4bd0b
Commit
dae4bd0b
authored
Nov 21, 2020
by
Olivier Bertrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix xml.test failure. Fix compile error modified json.h
parent
477b5256
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
95 additions
and
92 deletions
+95
-92
storage/connect/json.h
storage/connect/json.h
+3
-0
storage/connect/mysql-test/connect/r/xml.result
storage/connect/mysql-test/connect/r/xml.result
+69
-69
storage/connect/mysql-test/connect/t/xml.test
storage/connect/mysql-test/connect/t/xml.test
+23
-23
No files found.
storage/connect/json.h
View file @
dae4bd0b
...
...
@@ -15,6 +15,9 @@
#define X
#endif
// Required by some compilers
enum
JTYP
:
short
;
enum
JTYP
:
short
{
TYPE_NULL
=
TYPE_VOID
,
TYPE_STRG
=
TYPE_STRING
,
...
...
storage/connect/mysql-test/connect/r/xml.result
View file @
dae4bd0b
...
...
@@ -85,9 +85,9 @@ DROP TABLE t1;
# Testing mixed tag and attribute values
#
CREATE TABLE t1 (
ISBN CHAR(15)
XPATH
='@',
LANG CHAR(2)
XPATH
='@',
SUBJECT CHAR(32)
XPATH
='@',
ISBN CHAR(15)
FIELD_FORMAT
='@',
LANG CHAR(2)
FIELD_FORMAT
='@',
SUBJECT CHAR(32)
FIELD_FORMAT
='@',
AUTHOR CHAR(50),
TITLE CHAR(32),
TRANSLATOR CHAR(40),
...
...
@@ -118,9 +118,9 @@ DROP TABLE t1;
# Testing INSERT on mixed tag and attribute values
#
CREATE TABLE t1 (
ISBN CHAR(15)
XPATH
='@',
LANG CHAR(2)
XPATH
='@',
SUBJECT CHAR(32)
XPATH
='@',
ISBN CHAR(15)
FIELD_FORMAT
='@',
LANG CHAR(2)
FIELD_FORMAT
='@',
SUBJECT CHAR(32)
FIELD_FORMAT
='@',
AUTHOR CHAR(50),
TITLE CHAR(32),
TRANSLATOR CHAR(40),
...
...
@@ -158,65 +158,65 @@ TRANSLATOR NULL
PUBLISHER Eyrolles Paris
DATEPUB 1998
SELECT LOAD_FILE('MYSQLD_DATADIR/test/xsample2.xml') AS xml;
xml <?xml version="1.0" encoding="UTF-8"?>
<BIBLIO SUBJECT="XML">
<BOOK ISBN="9782212090819" LANG="fr" SUBJECT="applications">
<AUTHOR>
<FIRSTNAME>Jean-Christophe</FIRSTNAME>
<LASTNAME>Bernadac</LASTNAME>
</AUTHOR>
<AUTHOR>
<FIRSTNAME>François</FIRSTNAME>
<LASTNAME>Knab</LASTNAME>
</AUTHOR>
<TITLE>Construire une application XML</TITLE>
<PUBLISHER>
<NAME>Eyrolles</NAME>
<PLACE>Paris</PLACE>
</PUBLISHER>
<DATEPUB>1999</DATEPUB>
</BOOK>
<BOOK ISBN="9782840825685" LANG="fr" SUBJECT="applications">
<AUTHOR>
<FIRSTNAME>William J.</FIRSTNAME>
<LASTNAME>Pardi</LASTNAME>
</AUTHOR>
<TRANSLATOR PREFIX="adapté de l'anglais par">
<FIRSTNAME>James</FIRSTNAME>
<LASTNAME>Guerin</LASTNAME>
</TRANSLATOR>
<TITLE>XML en Action</TITLE>
<PUBLISHER>
<NAME>Microsoft Press</NAME>
<PLACE>Paris</PLACE>
</PUBLISHER>
<DATEPUB>1999</DATEPUB>
</BOOK>
<BOOK ISBN="9782212090529" LANG="fr" SUBJECT="général">
<AUTHOR>Alain Michard</AUTHOR>
<TITLE>XML, Langage et Applications</TITLE>
<PUBLISHER>Eyrolles Paris</PUBLISHER>
<DATEPUB>1998</DATEPUB>
</BOOK>
</BIBLIO>
xml <?xml version="1.0" encoding="UTF-8"?>
<BIBLIO SUBJECT="XML">
<BOOK ISBN="9782212090819" LANG="fr" SUBJECT="applications">
<AUTHOR>
<FIRSTNAME>Jean-Christophe</FIRSTNAME>
<LASTNAME>Bernadac</LASTNAME>
</AUTHOR>
<AUTHOR>
<FIRSTNAME>François</FIRSTNAME>
<LASTNAME>Knab</LASTNAME>
</AUTHOR>
<TITLE>Construire une application XML</TITLE>
<PUBLISHER>
<NAME>Eyrolles</NAME>
<PLACE>Paris</PLACE>
</PUBLISHER>
<DATEPUB>1999</DATEPUB>
</BOOK>
<BOOK ISBN="9782840825685" LANG="fr" SUBJECT="applications">
<AUTHOR>
<FIRSTNAME>William J.</FIRSTNAME>
<LASTNAME>Pardi</LASTNAME>
</AUTHOR>
<TRANSLATOR PREFIX="adapté de l'anglais par">
<FIRSTNAME>James</FIRSTNAME>
<LASTNAME>Guerin</LASTNAME>
</TRANSLATOR>
<TITLE>XML en Action</TITLE>
<PUBLISHER>
<NAME>Microsoft Press</NAME>
<PLACE>Paris</PLACE>
</PUBLISHER>
<DATEPUB>1999</DATEPUB>
</BOOK>
<BOOK ISBN="9782212090529" LANG="fr" SUBJECT="général">
<AUTHOR>Alain Michard</AUTHOR>
<TITLE>XML, Langage et Applications</TITLE>
<PUBLISHER>Eyrolles Paris</PUBLISHER>
<DATEPUB>1998</DATEPUB>
</BOOK>
</BIBLIO>
DROP TABLE t1;
#
# Testing XPath
#
CREATE TABLE t1 (
isbn CHAR(15)
XPATH
='@ISBN',
language CHAR(2)
XPATH
='@LANG',
subject CHAR(32)
XPATH
='@SUBJECT',
authorfn CHAR(20)
XPATH
='AUTHOR/FIRSTNAME',
authorln CHAR(20)
XPATH
='AUTHOR/LASTNAME',
title CHAR(32)
XPATH
='TITLE',
translated CHAR(32)
XPATH
='TRANSLATOR/@PREFIX',
tranfn CHAR(20)
XPATH
='TRANSLATOR/FIRSTNAME',
tranln CHAR(20)
XPATH
='TRANSLATOR/LASTNAME',
publisher CHAR(20)
XPATH
='PUBLISHER/NAME',
location CHAR(20)
XPATH
='PUBLISHER/PLACE',
year INT(4)
XPATH
='DATEPUB'
isbn CHAR(15)
FIELD_FORMAT
='@ISBN',
language CHAR(2)
FIELD_FORMAT
='@LANG',
subject CHAR(32)
FIELD_FORMAT
='@SUBJECT',
authorfn CHAR(20)
FIELD_FORMAT
='AUTHOR/FIRSTNAME',
authorln CHAR(20)
FIELD_FORMAT
='AUTHOR/LASTNAME',
title CHAR(32)
FIELD_FORMAT
='TITLE',
translated CHAR(32)
FIELD_FORMAT
='TRANSLATOR/@PREFIX',
tranfn CHAR(20)
FIELD_FORMAT
='TRANSLATOR/FIRSTNAME',
tranln CHAR(20)
FIELD_FORMAT
='TRANSLATOR/LASTNAME',
publisher CHAR(20)
FIELD_FORMAT
='PUBLISHER/NAME',
location CHAR(20)
FIELD_FORMAT
='PUBLISHER/PLACE',
year INT(4)
FIELD_FORMAT
='DATEPUB'
) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xsample.xml'
TABNAME='BIBLIO' OPTION_LIST='rownode=BOOK,skipnull=1,xmlsup=domdoc';
SELECT * FROM t1;
...
...
@@ -258,7 +258,7 @@ DROP TABLE t1;
#
CREATE TABLE t1
(
isbn CHAR(15)
XPATH
='@isbn'
isbn CHAR(15)
FIELD_FORMAT
='@isbn'
) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xsample.xml'
TABNAME='BIBLIO' OPTION_LIST='rownode=BOOK,skipnull=1,xmlsup=domdoc';
SELECT * FROM t1;
...
...
@@ -323,7 +323,7 @@ HEX(c) 3F3F3F3F3F3F3F
Warnings:
Level Warning
Code 1366
Message Incorrect string value: '\xC3\x81\xC3\x82\xC3\x83...' for column
`test`.`t1`.`c`
at row 1
Message Incorrect string value: '\xC3\x81\xC3\x82\xC3\x83...' for column
'c'
at row 1
Level Warning
Code 1105
Message Out of range value ÁÂÃÄÅÆÇ for column 'c' at row 1
...
...
@@ -374,7 +374,7 @@ INSERT INTO t1 VALUES (_cp1251 0xC0C1C2C3);
Warnings:
Level Warning
Code 1105
Message Com error: Unable to save character to 'iso-8859-1' encoding.
Message Com error: Unable to save character to 'iso-8859-1' encoding.
INSERT INTO t1 VALUES ('&<>"\'');
SELECT node, hex(node) FROM t1;
...
...
@@ -383,11 +383,11 @@ hex(node) 263C3E2227
DROP TABLE t1;
SET @a=LOAD_FILE('MYSQLD_DATADIR/test/t1.xml');
SELECT CAST(@a AS CHAR CHARACTER SET latin1);
CAST(@a AS CHAR CHARACTER SET latin1) <?xml version="1.0" encoding="iso-8859-1"?>
<!-- Created by the MariaDB CONNECT Storage Engine-->
<t1>
<line>
<node>&<>"'</node>
</line>
</t1>
CAST(@a AS CHAR CHARACTER SET latin1) <?xml version="1.0" encoding="iso-8859-1"?>
<!-- Created by the MariaDB CONNECT Storage Engine-->
<t1>
<line>
<node>&<>"'</node>
</line>
</t1>
storage/connect/mysql-test/connect/t/xml.test
View file @
dae4bd0b
...
...
@@ -77,9 +77,9 @@ DROP TABLE t1;
--
echo
# Testing mixed tag and attribute values
--
echo
#
CREATE
TABLE
t1
(
ISBN
CHAR
(
15
)
XPATH
=
'@'
,
LANG
CHAR
(
2
)
XPATH
=
'@'
,
SUBJECT
CHAR
(
32
)
XPATH
=
'@'
,
ISBN
CHAR
(
15
)
FIELD_FORMAT
=
'@'
,
LANG
CHAR
(
2
)
FIELD_FORMAT
=
'@'
,
SUBJECT
CHAR
(
32
)
FIELD_FORMAT
=
'@'
,
AUTHOR
CHAR
(
50
),
TITLE
CHAR
(
32
),
TRANSLATOR
CHAR
(
40
),
...
...
@@ -98,9 +98,9 @@ DROP TABLE t1;
--
copy_file
$MTR_SUITE_DIR
/
std_data
/
xsample
.
xml
$MYSQLD_DATADIR
/
test
/
xsample2
.
xml
--
chmod
0644
$MYSQLD_DATADIR
/
test
/
xsample2
.
xml
CREATE
TABLE
t1
(
ISBN
CHAR
(
15
)
XPATH
=
'@'
,
LANG
CHAR
(
2
)
XPATH
=
'@'
,
SUBJECT
CHAR
(
32
)
XPATH
=
'@'
,
ISBN
CHAR
(
15
)
FIELD_FORMAT
=
'@'
,
LANG
CHAR
(
2
)
FIELD_FORMAT
=
'@'
,
SUBJECT
CHAR
(
32
)
FIELD_FORMAT
=
'@'
,
AUTHOR
CHAR
(
50
),
TITLE
CHAR
(
32
),
TRANSLATOR
CHAR
(
40
),
...
...
@@ -123,18 +123,18 @@ DROP TABLE t1;
--
echo
# Testing XPath
--
echo
#
CREATE
TABLE
t1
(
isbn
CHAR
(
15
)
XPATH
=
'@ISBN'
,
language
CHAR
(
2
)
XPATH
=
'@LANG'
,
subject
CHAR
(
32
)
XPATH
=
'@SUBJECT'
,
authorfn
CHAR
(
20
)
XPATH
=
'AUTHOR/FIRSTNAME'
,
authorln
CHAR
(
20
)
XPATH
=
'AUTHOR/LASTNAME'
,
title
CHAR
(
32
)
XPATH
=
'TITLE'
,
translated
CHAR
(
32
)
XPATH
=
'TRANSLATOR/@PREFIX'
,
tranfn
CHAR
(
20
)
XPATH
=
'TRANSLATOR/FIRSTNAME'
,
tranln
CHAR
(
20
)
XPATH
=
'TRANSLATOR/LASTNAME'
,
publisher
CHAR
(
20
)
XPATH
=
'PUBLISHER/NAME'
,
location
CHAR
(
20
)
XPATH
=
'PUBLISHER/PLACE'
,
year
INT
(
4
)
XPATH
=
'DATEPUB'
isbn
CHAR
(
15
)
FIELD_FORMAT
=
'@ISBN'
,
language
CHAR
(
2
)
FIELD_FORMAT
=
'@LANG'
,
subject
CHAR
(
32
)
FIELD_FORMAT
=
'@SUBJECT'
,
authorfn
CHAR
(
20
)
FIELD_FORMAT
=
'AUTHOR/FIRSTNAME'
,
authorln
CHAR
(
20
)
FIELD_FORMAT
=
'AUTHOR/LASTNAME'
,
title
CHAR
(
32
)
FIELD_FORMAT
=
'TITLE'
,
translated
CHAR
(
32
)
FIELD_FORMAT
=
'TRANSLATOR/@PREFIX'
,
tranfn
CHAR
(
20
)
FIELD_FORMAT
=
'TRANSLATOR/FIRSTNAME'
,
tranln
CHAR
(
20
)
FIELD_FORMAT
=
'TRANSLATOR/LASTNAME'
,
publisher
CHAR
(
20
)
FIELD_FORMAT
=
'PUBLISHER/NAME'
,
location
CHAR
(
20
)
FIELD_FORMAT
=
'PUBLISHER/PLACE'
,
year
INT
(
4
)
FIELD_FORMAT
=
'DATEPUB'
)
ENGINE
=
CONNECT
TABLE_TYPE
=
XML
FILE_NAME
=
'xsample.xml'
TABNAME
=
'BIBLIO'
OPTION_LIST
=
'rownode=BOOK,skipnull=1,xmlsup=domdoc'
;
SELECT
*
FROM
t1
;
...
...
@@ -150,8 +150,8 @@ DROP TABLE t1;
#--echo # Relative paths are not supported
#--echo #
#CREATE TABLE t1 (
# authorfn CHAR(20)
XPATH
='//FIRSTNAME',
# authorln CHAR(20)
XPATH
='//LASTNAME'
# authorfn CHAR(20)
FIELD_FORMAT
='//FIRSTNAME',
# authorln CHAR(20)
FIELD_FORMAT
='//LASTNAME'
#) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xsample.xml'
# TABNAME='BIBLIO' OPTION_LIST='rownode=BOOK,skipnull=1';
#SELECT * FROM t1;
...
...
@@ -165,8 +165,8 @@ DROP TABLE t1;
#--echo # Absolute path is not supported
#--echo #
#CREATE TABLE t1 (
# authorfn CHAR(20)
XPATH
='/BIBLIO/BOOK/AUTHOR/FIRSTNAME',
# authorln CHAR(20)
XPATH
='/BIBLIO/BOOK/AUTHOR/LASTNAME'
# authorfn CHAR(20)
FIELD_FORMAT
='/BIBLIO/BOOK/AUTHOR/FIRSTNAME',
# authorln CHAR(20)
FIELD_FORMAT
='/BIBLIO/BOOK/AUTHOR/LASTNAME'
#) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xsample.xml'
# TABNAME='BIBLIO' OPTION_LIST='rownode=BOOK,skipnull=1';
#SELECT * FROM t1;
...
...
@@ -178,7 +178,7 @@ DROP TABLE t1;
--
echo
#
CREATE
TABLE
t1
(
isbn
CHAR
(
15
)
XPATH
=
'@isbn'
isbn
CHAR
(
15
)
FIELD_FORMAT
=
'@isbn'
)
ENGINE
=
CONNECT
TABLE_TYPE
=
XML
FILE_NAME
=
'xsample.xml'
TABNAME
=
'BIBLIO'
OPTION_LIST
=
'rownode=BOOK,skipnull=1,xmlsup=domdoc'
;
SELECT
*
FROM
t1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment