Commit bffa06c7 authored by Olivier Bertrand's avatar Olivier Bertrand

Try to fix failing tests on LINUX

  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_grant.result
  modified:   storage/connect/mysql-test/connect/r/xml2_mdev5261.result
  modified:   storage/connect/mysql-test/connect/r/xml_mdev5261.result
  modified:   storage/connect/mysql-test/connect/t/xml2_mdev5261.test
  modified:   storage/connect/mysql-test/connect/t/xml_mdev5261.test
parent e58620cd
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)
#
CREATE TABLE t1 (c INT NOT NULL, d CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=CSV HEADER=1 QUOTED=1;
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');
SELECT * FROM t1;
c d
1 One
2 Two
3 Three
c d
1 One
2 Two
3 Three
# This would fail if the top node name is not specified.
# 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.
# 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';
SELECT * FROM t1;
c d
1 One
2 Two
3 Three
c d
1 One
2 Two
3 Three
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
Table Create Table
t1 CREATE TABLE `t1` (
`c` int(11) 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'
# Let us see the XML file
CREATE TABLE t2 (line VARCHAR(100) NOT NULL) ENGINE=CONNECT FILE_NAME='t1.xml';
Warnings:
Warning 1105 No table_type. Will be set to DOS
Warning 1105 No table_type. Will be set to DOS
SELECT * FROM t2;
line
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created by the MariaDB CONNECT Storage Engine-->
<t1>
<row>
<TH>c</TH>
<TH>d</TH>
</row>
<row>
<c>1</c>
<d>One</d>
</row>
<row>
<c>2</c>
<d>Two</d>
</row>
<row>
<c>3</c>
<d>Three</d>
</row>
<row>
<TH>c</TH>
<TH>d</TH>
</row>
<row>
<c>1</c>
<d>One</d>
</row>
<row>
<c>2</c>
<d>Two</d>
</row>
<row>
<c>3</c>
<d>Three</d>
</row>
</t1>
# NOTE: The first (ignored) row is due to the remaining HEADER=1 option.
# Testing field option modification
ALTER TABLE t1 MODIFY d CHAR(10) NOT NULL FIELD_FORMAT='@', HEADER=0;
SELECT * FROM t1;
c d
1 One
2 Two
3 Three
c d
1 One
2 Two
3 Three
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
Table Create Table
t1 CREATE TABLE `t1` (
`c` int(11) NOT NULL,
`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
......@@ -73,14 +73,14 @@ line
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created by the MariaDB CONNECT Storage Engine-->
<t1>
<row d="One">
<c>1</c>
</row>
<row d="Two">
<c>2</c>
</row>
<row d="Three">
<c>3</c>
</row>
<row d="One">
<c>1</c>
</row>
<row d="Two">
<c>2</c>
</row>
<row d="Three">
<c>3</c>
</row>
</t1>
DROP TABLE t1, t2;
Warnings:
Warning 1105 No file name. Table will use t1.xml
create table t1 (i int) engine=Connect table_type=XML option_list='xmlsup=libxml2';
Warning 1105 No file name. Table will use t1.xml
create table t1 (i int) engine=Connect table_type=XML option_list='xmlsup=libxml2;
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%';
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:
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 1286 Unknown storage engine 'InnoDB'
Warning 1286 Unknown storage engine 'InnoDB'
Warning 1296 Got error 174 'File t1.xml not found' from CONNECT
drop table t1;
......@@ -6,6 +6,8 @@ Warning 1105 No file name. Table will use t1.xml
CREATE USER user@localhost;
GRANT ALL PRIVILEGES ON *.* TO user@localhost;
REVOKE FILE ON *.* FROM user@localhost;
connect user,localhost,user,,;
connection user;
SELECT user();
user()
user@localhost
......@@ -34,11 +36,13 @@ DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=XML OPTION_LIST='xmlsup=libxml2,rownode=row' FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
connection default;
SELECT user();
user()
root@localhost
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=XML OPTION_LIST='xmlsup=libxml2,rownode=row' FILE_NAME='t1.EXT';
INSERT INTO t1 VALUES (10);
connection user;
SELECT user();
user()
user@localhost
......@@ -61,10 +65,12 @@ ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
CREATE VIEW v1 AS SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
# Testing a VIEW created with FILE privileges but accessed with no FILE
connection default;
SELECT user();
user()
root@localhost
CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT * FROM t1;
connection user;
SELECT user();
user()
user@localhost
......@@ -76,6 +82,7 @@ UPDATE v1 SET a=123;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
DELETE FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
connection default;
SELECT user();
user()
root@localhost
......@@ -85,12 +92,15 @@ CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=XML OPTION_LIST='xmls
Warnings:
Warning 1105 No file name. Table will use t1.xml
INSERT INTO t1 VALUES (10);
connection user;
SELECT user();
user()
user@localhost
ALTER TABLE t1 FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
connection default;
DROP TABLE t1;
disconnect user;
DROP USER user@localhost;
#
# End of grant.inc
......
Warnings:
Warning 1105 No file name. Table will use t1.xml
Warning 1105 No file name. Table will use t1.xml
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='xmlsup=libxml2,Rownode=N';
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='xmlsup=libxml2,Rownode=N';
DESCRIBE t1;
Field Type Null Key Default Extra
i int(11) NO NULL
Field Type Null Key Default Extra
i int(11) NO NULL
ALTER TABLE t1 ADD UNIQUE(i);
ERROR HY000: Table type XML is not indexable
CREATE UNIQUE INDEX i ON t1(i);
ERROR HY000: Table type XML is not indexable
DESCRIBE t1;
Field Type Null Key Default Extra
i int(11) NO NULL
Field Type Null Key Default Extra
i int(11) NO NULL
INSERT INTO t1 VALUES(2),(5),(7);
SELECT * FROM t1 WHERE i = 5;
i
......
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='xmlsup=domdoc,Rownode=N';
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='xmlsup=domdoc,Rownode=N';
DESCRIBE t1;
Field Type Null Key Default Extra
i int(11) NO NULL
......
......@@ -8,8 +8,8 @@ SET NAMES utf8;
#--echo Testing indexing on not indexable table type
#
--error ER_UNKNOWN_ERROR
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 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='xmlsup=libxml2,Rownode=N';
CREATE TABLE t1 (i INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xt1.xml' OPTION_LIST='xmlsup=libxml2,Rownode=N';
DESCRIBE t1;
# one could *add* an index to an existing table
--error ER_UNKNOWN_ERROR
......
......@@ -8,8 +8,8 @@ SET NAMES utf8;
#--echo Testing indexing on not indexable table type
#
--error ER_UNKNOWN_ERROR
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 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='xmlsup=domdoc,Rownode=N';
CREATE TABLE t1 (i INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=XML FILE_NAME='xt1.xml' OPTION_LIST='xmlsup=domdoc,Rownode=N';
DESCRIBE t1;
# one could *add* an index to an existing table
--error ER_UNKNOWN_ERROR
......
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