Commit e58620cd authored by Olivier Bertrand's avatar Olivier Bertrand

Try to fix failing tests

  modified:   storage/connect/mysql-test/connect/r/alter_xml2.result
  modified:   storage/connect/mysql-test/connect/r/infoschema2-9739.result
  modified:   storage/connect/mysql-test/connect/r/xml2_mdev5261.result
parent 7f02ab70
Warnings: Warnings:
Warning 1105 No file name. Table will use t1.xml Warning 1105 No file name. Table will use t1.xml
# #
# Testing changing table type (not in-place) # Testing changing table type (not in-place)
# #
CREATE TABLE t1 (c INT NOT NULL, d CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=CSV HEADER=1 QUOTED=1; CREATE TABLE t1 (c INT NOT NULL, d CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=CSV HEADER=1 QUOTED=1;
Warnings: Warnings:
Warning 1105 No file name. Table will use t1.csv Warning 1105 No file name. Table will use t1.csv
INSERT INTO t1 VALUES (1,'One'), (2,'Two'), (3,'Three'); INSERT INTO t1 VALUES (1,'One'), (2,'Two'), (3,'Three');
SELECT * FROM t1; SELECT * FROM t1;
c d c d
1 One 1 One
2 Two 2 Two
3 Three 3 Three
# This would fail if the top node name is not specified. # This would fail if the top node name is not specified.
# This is because the XML top node name defaults to the table name. # This is because the XML top node name defaults to the table name.
# Sure enough the temporary table name begins with '#' and is rejected by XML. # Sure enough the temporary table name begins with '#' and is rejected by XML.
# Therefore the top node name must be specified (along with the row nodes name). # Therefore the top node name must be specified (along with the row nodes name).
ALTER TABLE t1 TABLE_TYPE=XML TABNAME=t1 OPTION_LIST='xmlsup=libxml2,rownode=row'; ALTER TABLE t1 TABLE_TYPE=XML TABNAME=t1 OPTION_LIST='xmlsup=libxml2,rownode=row';
SELECT * FROM t1; SELECT * FROM t1;
c d c d
1 One 1 One
2 Two 2 Two
3 Three 3 Three
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`c` int(11) NOT NULL, `c` int(11) NOT NULL,
`d` char(10) NOT NULL `d` char(10) NOT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `HEADER`=1 `QUOTED`=1 `TABLE_TYPE`=XML `TABNAME`=t1 `OPTION_LIST`='xmlsup=libxml2,rownode=row' ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `HEADER`=1 `QUOTED`=1 `TABLE_TYPE`=XML `TABNAME`=t1 `OPTION_LIST`='xmlsup=libxml2,rownode=row'
# Let us see the XML file # Let us see the XML file
CREATE TABLE t2 (line VARCHAR(100) NOT NULL) ENGINE=CONNECT FILE_NAME='t1.xml'; CREATE TABLE t2 (line VARCHAR(100) NOT NULL) ENGINE=CONNECT FILE_NAME='t1.xml';
Warnings: Warnings:
Warning 1105 No table_type. Will be set to DOS Warning 1105 No table_type. Will be set to DOS
SELECT * FROM t2; SELECT * FROM t2;
line line
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Created by the MariaDB CONNECT Storage Engine--> <!-- Created by the MariaDB CONNECT Storage Engine-->
<t1> <t1>
<row> <row>
<TH>c</TH> <TH>c</TH>
<TH>d</TH> <TH>d</TH>
</row> </row>
<row> <row>
<c>1</c> <c>1</c>
<d>One</d> <d>One</d>
</row> </row>
<row> <row>
<c>2</c> <c>2</c>
<d>Two</d> <d>Two</d>
</row> </row>
<row> <row>
<c>3</c> <c>3</c>
<d>Three</d> <d>Three</d>
</row> </row>
</t1> </t1>
# NOTE: The first (ignored) row is due to the remaining HEADER=1 option. # NOTE: The first (ignored) row is due to the remaining HEADER=1 option.
# Testing field option modification # Testing field option modification
ALTER TABLE t1 MODIFY d CHAR(10) NOT NULL FIELD_FORMAT='@', HEADER=0; ALTER TABLE t1 MODIFY d CHAR(10) NOT NULL FIELD_FORMAT='@', HEADER=0;
SELECT * FROM t1; SELECT * FROM t1;
c d c d
1 One 1 One
2 Two 2 Two
3 Three 3 Three
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`c` int(11) NOT NULL, `c` int(11) NOT NULL,
`d` char(10) NOT NULL `FIELD_FORMAT`='@' `d` char(10) NOT NULL `FIELD_FORMAT`='@'
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `QUOTED`=1 `TABLE_TYPE`=XML `TABNAME`=t1 `OPTION_LIST`='xmlsup=libxml2,rownode=row' `HEADER`=0 ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `QUOTED`=1 `TABLE_TYPE`=XML `TABNAME`=t1 `OPTION_LIST`='xmlsup=libxml2,rownode=row' `HEADER`=0
SELECT * FROM t2; SELECT * FROM t2;
line line
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Created by the MariaDB CONNECT Storage Engine--> <!-- Created by the MariaDB CONNECT Storage Engine-->
<t1> <t1>
<row d="One"> <row d="One">
<c>1</c> <c>1</c>
</row> </row>
<row d="Two"> <row d="Two">
<c>2</c> <c>2</c>
</row> </row>
<row d="Three"> <row d="Three">
<c>3</c> <c>3</c>
</row> </row>
</t1> </t1>
DROP TABLE t1, t2; DROP TABLE t1, t2;
Warnings: Warnings:
Warning 1105 No file name. Table will use t1.xml Warning 1105 No file name. Table will use t1.xml
create table t1 (i int) engine=Connect table_type=XML option_list='xmlsup=libxml2'; create table t1 (i int) engine=Connect table_type=XML option_list='xmlsup=libxml2';
Warnings: Warnings:
Warning 1105 No file name. Table will use t1.xml Warning 1105 No file name. Table will use t1.xml
select * from information_schema.tables where create_options like '%table_type=XML%'; select * from information_schema.tables where create_options like '%table_type=XML%';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
Warnings: Warnings:
Warning 1286 Unknown storage engine 'InnoDB' Warning 1286 Unknown storage engine 'InnoDB'
Warning 1286 Unknown storage engine 'InnoDB' Warning 1286 Unknown storage engine 'InnoDB'
Warning 1296 Got error 174 'File t1.xml not found' from CONNECT Warning 1296 Got error 174 'File t1.xml not found' from CONNECT
drop table t1; drop table t1;
Warnings: Warnings:
Warning 1105 No file name. Table will use t1.xml Warning 1105 No file name. Table will use t1.xml
SET NAMES utf8; SET NAMES utf8;
CREATE TABLE t1 (i INT UNIQUE NOT NULL) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xt1.xml' OPTION_LIST='Rownode=N'; CREATE TABLE t1 (i INT UNIQUE NOT NULL) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xt1.xml' OPTION_LIST='Rownode=N';
ERROR HY000: Table type XML is not indexable ERROR HY000: Table type XML is not indexable
CREATE TABLE t1 (i INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xt1.xml' OPTION_LIST='Rownode=N'; CREATE TABLE t1 (i INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xt1.xml' OPTION_LIST='Rownode=N';
DESCRIBE t1; DESCRIBE t1;
Field Type Null Key Default Extra Field Type Null Key Default Extra
i int(11) NO NULL i int(11) NO NULL
ALTER TABLE t1 ADD UNIQUE(i); ALTER TABLE t1 ADD UNIQUE(i);
ERROR HY000: Table type XML is not indexable ERROR HY000: Table type XML is not indexable
CREATE UNIQUE INDEX i ON t1(i); CREATE UNIQUE INDEX i ON t1(i);
ERROR HY000: Table type XML is not indexable ERROR HY000: Table type XML is not indexable
DESCRIBE t1; DESCRIBE t1;
Field Type Null Key Default Extra Field Type Null Key Default Extra
i int(11) NO NULL i int(11) NO NULL
INSERT INTO t1 VALUES(2),(5),(7); INSERT INTO t1 VALUES(2),(5),(7);
SELECT * FROM t1 WHERE i = 5; SELECT * FROM t1 WHERE i = 5;
i i
5 5
ALTER TABLE t1 DROP INDEX i; ALTER TABLE t1 DROP INDEX i;
ERROR 42000: Can't DROP 'i'; check that column/key exists ERROR 42000: Can't DROP INDEX `i`; check that it exists
DROP INDEX i ON t1; DROP INDEX i ON t1;
ERROR 42000: Can't DROP 'i'; check that column/key exists ERROR 42000: Can't DROP INDEX `i`; check that it exists
DROP TABLE t1; DROP TABLE t1;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment