Commit 49028611 authored by Alexander Barkov's avatar Alexander Barkov

Adding test for ENGINE=VEC

added:
  mysql-test/suite/connect/r/vec.result
  mysql-test/suite/connect/t/vec.test
modified:
  storage/connect/plgdbutl.cpp
parent 63127233
CREATE TABLE dir1 (
spath VARCHAR(256) flag=1,
fname VARCHAR(256),
ftype CHAR(4),
size DOUBLE(12,0) flag=5
) ENGINE=CONNECT TABLE_TYPE=DIR FILE_NAME='*vec*';
CREATE TABLE t1
(
a INT,
b CHAR(10)
) ENGINE=CONNECT TABLE_TYPE=VEC FILE_NAME='t1vec';
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` char(10) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=VEC `FILE_NAME`='t1vec'
SELECT * FROM t1;
a b
Warnings:
Warning 1105 Open(rb) error 2 on DATADIR/./test/t1vec1: No such file or directory
Warning 1105 Open(rb) error 2 on DATADIR/./test/t1vec2: No such file or directory
INSERT INTO t1 VALUES (0,'test01'), (1,'test01'), (2,'test02'), (3,'test03');
SELECT * FROM t1;
a b
0 test01
1 test01
2 test02
3 test03
SELECT a FROM t1;
a
0
1
2
3
SELECT b FROM t1;
b
test01
test01
test02
test03
SELECT * FROM dir1 ORDER BY fname, ftype;
spath fname ftype size
DATADIR/./test/ t1vec1 16
DATADIR/./test/ t1vec2 40
DROP TABLE t1;
CREATE TABLE t1
(
a INT,
b CHAR(10)
) ENGINE=CONNECT TABLE_TYPE=VEC FILE_NAME='t1vec' MAX_ROWS=10;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` char(10) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 MAX_ROWS=10 `TABLE_TYPE`=VEC `FILE_NAME`='t1vec'
SELECT * FROM t1;
a b
Warnings:
Warning 1105 Open(rb) error 2 on DATADIR/./test/t1vec: No such file or directory
SELECT a FROM t1;
a
Warnings:
Warning 1105 Open(rb) error 2 on DATADIR/./test/t1vec: No such file or directory
SELECT b FROM t1;
b
Warnings:
Warning 1105 Open(rb) error 2 on DATADIR/./test/t1vec: No such file or directory
INSERT INTO t1 VALUES (0,'test01'), (1,'test01'), (2,'test02'), (3,'test03');
SELECT * FROM t1;
a b
0 test01
1 test01
2 test02
3 test03
SELECT a FROM t1;
a
0
1
2
3
SELECT b FROM t1;
b
test01
test01
test02
test03
SELECT * FROM dir1 ORDER BY fname, ftype;
spath fname ftype size
DATADIR/./test/ t1vec 1400
DATADIR/./test/ t1vec .blk 8
DROP TABLE t1;
#
# Clean up
#
DROP TABLE dir1;
let $MYSQLD_DATADIR= `select @@datadir`;
CREATE TABLE dir1 (
spath VARCHAR(256) flag=1,
fname VARCHAR(256),
ftype CHAR(4),
size DOUBLE(12,0) flag=5
) ENGINE=CONNECT TABLE_TYPE=DIR FILE_NAME='*vec*';
CREATE TABLE t1
(
a INT,
b CHAR(10)
) ENGINE=CONNECT TABLE_TYPE=VEC FILE_NAME='t1vec';
SHOW CREATE TABLE t1;
# Testing SELECT on empty file
--replace_result $MYSQLD_DATADIR DATADIR/
SELECT * FROM t1;
INSERT INTO t1 VALUES (0,'test01'), (1,'test01'), (2,'test02'), (3,'test03');
SELECT * FROM t1;
SELECT a FROM t1;
SELECT b FROM t1;
--replace_result $MYSQLD_DATADIR DATADIR/
SELECT * FROM dir1 ORDER BY fname, ftype;
DROP TABLE t1;
--remove_file $MYSQLD_DATADIR/test/t1vec1
--remove_file $MYSQLD_DATADIR/test/t1vec2
CREATE TABLE t1
(
a INT,
b CHAR(10)
) ENGINE=CONNECT TABLE_TYPE=VEC FILE_NAME='t1vec' MAX_ROWS=10;
SHOW CREATE TABLE t1;
# Testing SELECTs on empty file
--replace_result $MYSQLD_DATADIR DATADIR/
SELECT * FROM t1;
--replace_result $MYSQLD_DATADIR DATADIR/
SELECT a FROM t1;
--replace_result $MYSQLD_DATADIR DATADIR/
SELECT b FROM t1;
INSERT INTO t1 VALUES (0,'test01'), (1,'test01'), (2,'test02'), (3,'test03');
SELECT * FROM t1;
SELECT a FROM t1;
SELECT b FROM t1;
--replace_result $MYSQLD_DATADIR DATADIR/
SELECT * FROM dir1 ORDER BY fname, ftype;
DROP TABLE t1;
--remove_file $MYSQLD_DATADIR/test/t1vec
--remove_file $MYSQLD_DATADIR/test/t1vec.blk
--echo #
--echo # Clean up
--echo #
DROP TABLE dir1;
......@@ -176,6 +176,8 @@ global_open_error_msg(GLOBAL *g, int msgid, const char *path, const char *mode)
len= snprintf(g->Message, sizeof(g->Message) - 1,
MSG(OPEN_EMPTY_FILE), // "Opening empty file %s: %s"
path, strerror(errno));
break;
default:
DBUG_ASSERT(0);
/* Fall through*/
......
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