Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fix a regression bug on (XML) HTML tables.
modified: tabxml.cpp added: xml_html.test xml_html.result beers.xml coffee.htm - Fix MDEV-7935 by suppressing error resetting code in delete_or_rename_table. However, the issue is that this code was added because without it an assertion was raised in some cases. Unfortunately I can't remember what were these cases. Therefore fixing it in this case will perhaps make a new crash happening on another cases. modified: ha_connect.cc - Add the UDF Json_Array_Delete. modified: jsonudf.cpp
- Loading branch information
1 parent
c09c265
commit a82f475
Showing
7 changed files
with
201 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
Warnings: | ||
Warning 1105 No file name. Table will use t1.xml | ||
SET NAMES utf8; | ||
# | ||
# Testing HTML like XML file | ||
# | ||
CREATE TABLE beers ( | ||
`Name` CHAR(16) FIELD_FORMAT='brandName', | ||
`Origin` CHAR(16) FIELD_FORMAT='origin', | ||
`Description` CHAR(32) FIELD_FORMAT='details') | ||
ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='beers.xml' | ||
TABNAME='table' OPTION_LIST='xmlsup=libxml2,rownode=tr,colnode=td'; | ||
SELECT * FROM beers; | ||
Name Origin Description | ||
Huntsman Bath, UK Wonderful hop, light alcohol | ||
Tuborg Danmark In small bottles | ||
DROP TABLE beers; | ||
# | ||
# Testing HTML file | ||
# | ||
CREATE TABLE coffee ( | ||
`Name` CHAR(16), | ||
`Cups` INT(8), | ||
`Type` CHAR(16), | ||
`Sugar` CHAR(4)) | ||
ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='coffee.htm' | ||
TABNAME='TABLE' HEADER=1 OPTION_LIST='xmlsup=libxml2,Coltype=HTML'; | ||
SELECT * FROM coffee; | ||
Name Cups Type Sugar | ||
T. Sexton 10 Espresso No | ||
J. Dinnen 5 Decaf Yes | ||
DROP TABLE coffee; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0"?> | ||
<Beers> | ||
<table> | ||
<th><td>Name</td><td>Origin</td><td>Description</td></th> | ||
<tr> | ||
<td><brandName>Huntsman</brandName></td> | ||
<td><origin>Bath, UK</origin></td> | ||
<td><details>Wonderful hop, light alcohol</details></td> | ||
</tr> | ||
<tr> | ||
<td><brandName>Tuborg</brandName></td> | ||
<td><origin>Danmark</origin></td> | ||
<td><details>In small bottles</details></td> | ||
</tr> | ||
</table> | ||
</Beers> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<TABLE summary="This table charts the number of cups of coffe | ||
consumed by each senator, the type of coffee (decaf | ||
or regular), and whether taken with sugar."> | ||
<CAPTION>Cups of coffee consumed by each senator</CAPTION> | ||
<TR> | ||
<TH>Name</TH> | ||
<TH>Cups</TH> | ||
<TH>Type of Coffee</TH> | ||
<TH>Sugar?</TH> | ||
</TR> | ||
<TR> | ||
<TD>T. Sexton</TD> | ||
<TD>10</TD> | ||
<TD>Espresso</TD> | ||
<TD>No</TD> | ||
</TR> | ||
<TR> | ||
<TD>J. Dinnen</TD> | ||
<TD>5</TD> | ||
<TD>Decaf</TD> | ||
<TD>Yes</TD> | ||
</TR> | ||
</TABLE> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--source have_libxml2.inc | ||
|
||
let $MYSQLD_DATADIR= `select @@datadir`; | ||
|
||
SET NAMES utf8; | ||
|
||
--copy_file $MTR_SUITE_DIR/std_data/beers.xml $MYSQLD_DATADIR/test/beers.xml | ||
--copy_file $MTR_SUITE_DIR/std_data/coffee.htm $MYSQLD_DATADIR/test/coffee.htm | ||
|
||
--echo # | ||
--echo # Testing HTML like XML file | ||
--echo # | ||
CREATE TABLE beers ( | ||
`Name` CHAR(16) FIELD_FORMAT='brandName', | ||
`Origin` CHAR(16) FIELD_FORMAT='origin', | ||
`Description` CHAR(32) FIELD_FORMAT='details') | ||
ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='beers.xml' | ||
TABNAME='table' OPTION_LIST='xmlsup=libxml2,rownode=tr,colnode=td'; | ||
SELECT * FROM beers; | ||
DROP TABLE beers; | ||
|
||
--echo # | ||
--echo # Testing HTML file | ||
--echo # | ||
CREATE TABLE coffee ( | ||
`Name` CHAR(16), | ||
`Cups` INT(8), | ||
`Type` CHAR(16), | ||
`Sugar` CHAR(4)) | ||
ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='coffee.htm' | ||
TABNAME='TABLE' HEADER=1 OPTION_LIST='xmlsup=libxml2,Coltype=HTML'; | ||
SELECT * FROM coffee; | ||
DROP TABLE coffee; | ||
|
||
# | ||
# Clean up | ||
# | ||
--remove_file $MYSQLD_DATADIR/test/beers.xml | ||
--remove_file $MYSQLD_DATADIR/test/coffee.htm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Buggynours can you add/check the documentation for Json_Array_Delete here https://mariadb.com/kb/en/mariadb/connect-json-table-type
no point adding code if people can't see its there in documentation.