--source have_zip.inc
--source windows.inc

let $MYSQLD_DATADIR= `select @@datadir`;

--vertical_results

--copy_file $MTR_SUITE_DIR/std_data/xsample2.xml $MYSQLD_DATADIR/test/xsample2.xml

--echo #
--echo # Testing zipped XML tables
--echo #
CREATE TABLE t1 (
ISBN CHAR(13) NOT NULL XPATH='@',
LANG CHAR(2) NOT NULL XPATH='@',
SUBJECT CHAR(12) NOT NULL XPATH='@',
AUTHOR_FIRSTNAME CHAR(15) NOT NULL XPATH='AUTHOR/FIRSTNAME',
AUTHOR_LASTNAME CHAR(8) NOT NULL XPATH='AUTHOR/LASTNAME',
TRANSLATOR_PREFIX CHAR(24) DEFAULT NULL XPATH='TRANSLATOR/@PREFIX',
TRANSLATOR_FIRSTNAME CHAR(6) DEFAULT NULL XPATH='TRANSLATOR/FIRSTNAME',
TRANSLATOR_LASTNAME CHAR(6) DEFAULT NULL XPATH='TRANSLATOR/LASTNAME',
TITLE CHAR(30) NOT NULL,
PUBLISHER_NAME CHAR(15) NOT NULL XPATH='PUBLISHER/NAME',
PUBLISHER_PLACE CHAR(5) NOT NULL XPATH='PUBLISHER/PLACE',
DATEPUB CHAR(4) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xsample2.zip' ZIPPED=YES
OPTION_LIST='depth=0,entry=xsample2.xml,load=xsample2.xml,rownode=BOOK,xmlsup=domdoc,expand=1,mulnode=AUTHOR';
SELECT * FROM t1;

#testing discovery
CREATE TABLE t2
ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xsample2.zip' ZIPPED=YES
OPTION_LIST='depth=0,xmlsup=domdoc';
SELECT * FROM t2;
DROP TABLE t1,t2;

#
# Clean up
#
--remove_file $MYSQLD_DATADIR/test/xsample2.xml
--remove_file $MYSQLD_DATADIR/test/xsample2.zip
