Commit f81c60a4 authored by Olivier Bertrand's avatar Olivier Bertrand

- Update tests that failed because of NULL columns

modified:
  mysql-test/suite/connect/r/bin.result
  mysql-test/suite/connect/r/csv.result
  mysql-test/suite/connect/r/dbf.result
  mysql-test/suite/connect/r/dir.result
  mysql-test/suite/connect/r/fix.result
  mysql-test/suite/connect/r/fmt.result
  mysql-test/suite/connect/r/general.result
  mysql-test/suite/connect/r/index.result
  mysql-test/suite/connect/r/vec.result
  mysql-test/suite/connect/t/bin.test
  mysql-test/suite/connect/t/csv.test
  mysql-test/suite/connect/t/dbf.test
  mysql-test/suite/connect/t/dir.test
  mysql-test/suite/connect/t/fix.test
  mysql-test/suite/connect/t/fmt.test
  mysql-test/suite/connect/t/general.test
  mysql-test/suite/connect/t/index.test
  mysql-test/suite/connect/t/vec.test
parent 5008a3e8
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# #
CREATE TABLE t1 CREATE TABLE t1
( (
ID INT ID INT NOT NULL
) Engine=CONNECT TABLE_TYPE=BIN FILE_NAME='nonexistent.txt'; ) Engine=CONNECT TABLE_TYPE=BIN FILE_NAME='nonexistent.txt';
SELECT * FROM t1; SELECT * FROM t1;
ID ID
......
...@@ -4,7 +4,7 @@ SET NAMES utf8; ...@@ -4,7 +4,7 @@ SET NAMES utf8;
# #
CREATE TABLE t1 CREATE TABLE t1
( (
ID INT ID INT NOT NULL
) Engine=CONNECT TABLE_TYPE=CSV FILE_NAME='nonexistent.txt'; ) Engine=CONNECT TABLE_TYPE=CSV FILE_NAME='nonexistent.txt';
SELECT * FROM t1; SELECT * FROM t1;
ID ID
...@@ -16,9 +16,9 @@ DROP TABLE t1; ...@@ -16,9 +16,9 @@ DROP TABLE t1;
# #
CREATE TABLE t1 CREATE TABLE t1
( (
name CHAR(12), name CHAR(12) NOT NULL,
birth DATE DATE_FORMAT='DD/MM/YY', birth DATE NOT NULL DATE_FORMAT='DD/MM/YY',
children SMALLINT(2) children SMALLINT(2) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='people.csv' ) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='people.csv'
HEADER=1 SEP_CHAR=';' QUOTED=1; HEADER=1 SEP_CHAR=';' QUOTED=1;
SELECT * FROM t1; SELECT * FROM t1;
...@@ -44,9 +44,9 @@ Name;birth;children ...@@ -44,9 +44,9 @@ Name;birth;children
# #
CREATE TABLE t1 CREATE TABLE t1
( (
name CHAR(12), name CHAR(12) NOT NULL,
birth DATE DATE_FORMAT='DD/MM/YY', birth DATE NOT NULL DATE_FORMAT='DD/MM/YY',
children SMALLINT(2) children SMALLINT(2) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='people.csv' ) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='people.csv'
HEADER=1 SEP_CHAR=';' QUOTED=1 READONLY=yes; HEADER=1 SEP_CHAR=';' QUOTED=1 READONLY=yes;
INSERT INTO t1 VALUES ('BILL','1973-06-30',5); INSERT INTO t1 VALUES ('BILL','1973-06-30',5);
...@@ -68,9 +68,9 @@ Warning 1105 The current version of CONNECT did not check what you changed in AL ...@@ -68,9 +68,9 @@ Warning 1105 The current version of CONNECT did not check what you changed in AL
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`name` char(12) DEFAULT NULL, `name` char(12) NOT NULL,
`birth` date DEFAULT NULL `DATE_FORMAT`='DD/MM/YY', `birth` date NOT NULL `DATE_FORMAT`='DD/MM/YY',
`children` smallint(2) DEFAULT NULL `children` smallint(2) NOT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=CSV `FILE_NAME`='people.csv' `HEADER`=1 `SEP_CHAR`=';' `QUOTED`=1 `READONLY`=no ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=CSV `FILE_NAME`='people.csv' `HEADER`=1 `SEP_CHAR`=';' `QUOTED`=1 `READONLY`=no
INSERT INTO t1 VALUES ('BILL','1973-06-30',5); INSERT INTO t1 VALUES ('BILL','1973-06-30',5);
SELECT * FROM t1; SELECT * FROM t1;
...@@ -85,9 +85,9 @@ Warning 1105 The current version of CONNECT did not check what you changed in AL ...@@ -85,9 +85,9 @@ Warning 1105 The current version of CONNECT did not check what you changed in AL
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`name` char(12) DEFAULT NULL, `name` char(12) NOT NULL,
`birth` date DEFAULT NULL `DATE_FORMAT`='DD/MM/YY', `birth` date NOT NULL `DATE_FORMAT`='DD/MM/YY',
`children` smallint(2) DEFAULT NULL `children` smallint(2) NOT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=CSV `FILE_NAME`='people.csv' `HEADER`=1 `SEP_CHAR`=';' `QUOTED`=1 `READONLY`=1 ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=CSV `FILE_NAME`='people.csv' `HEADER`=1 `SEP_CHAR`=';' `QUOTED`=1 `READONLY`=1
INSERT INTO t1 VALUES ('BILL','1973-06-30',5); INSERT INTO t1 VALUES ('BILL','1973-06-30',5);
ERROR HY000: Got error 174 'Cannot modify this read/only protected table' from CONNECT ERROR HY000: Got error 174 'Cannot modify this read/only protected table' from CONNECT
...@@ -128,7 +128,7 @@ REPLACE(LOAD_FILE('DATADIR/test/tmp.csv'),'\r\n','\n') ...@@ -128,7 +128,7 @@ REPLACE(LOAD_FILE('DATADIR/test/tmp.csv'),'\r\n','\n')
# #
# Creating a CSV table from a MyISAM table # Creating a CSV table from a MyISAM table
# #
CREATE TABLE t1 (a VARCHAR(10), b INT) ENGINE=MyISAM; CREATE TABLE t1 (a VARCHAR(10) NOT NULL, b INT NOT NULL) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('test1',1), ('test2',2); INSERT INTO t1 VALUES ('test1',1), ('test2',2);
CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t2.csv' CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t2.csv'
AS SELECT * FROM t1; AS SELECT * FROM t1;
...@@ -148,7 +148,7 @@ test2,2 ...@@ -148,7 +148,7 @@ test2,2
# #
CREATE TABLE t1 CREATE TABLE t1
( (
c1 CHAR(12) c1 CHAR(12) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv' ) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv'
CHARSET=utf8; CHARSET=utf8;
INSERT INTO t1 VALUES ('á'); INSERT INTO t1 VALUES ('á');
...@@ -161,7 +161,7 @@ HEX(REPLACE(LOAD_FILE('DATADIR/test/t1.csv'),'\r\n','\n')) ...@@ -161,7 +161,7 @@ HEX(REPLACE(LOAD_FILE('DATADIR/test/t1.csv'),'\r\n','\n'))
C3A10A C3A10A
CREATE TABLE t1 CREATE TABLE t1
( (
c1 CHAR(12) c1 CHAR(12) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv' ) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv'
CHARSET=utf8 DATA_CHARSET=latin1; CHARSET=utf8 DATA_CHARSET=latin1;
INSERT INTO t1 VALUES ('á'); INSERT INTO t1 VALUES ('á');
...@@ -174,7 +174,7 @@ HEX(REPLACE(LOAD_FILE('DATADIR/test/t1.csv'),'\r\n','\n')) ...@@ -174,7 +174,7 @@ HEX(REPLACE(LOAD_FILE('DATADIR/test/t1.csv'),'\r\n','\n'))
E10A E10A
CREATE TABLE t1 CREATE TABLE t1
( (
c1 CHAR(12) c1 CHAR(12) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv'; ) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv';
INSERT INTO t1 VALUES ('á'); INSERT INTO t1 VALUES ('á');
SELECT * FROM t1; SELECT * FROM t1;
...@@ -186,7 +186,7 @@ HEX(REPLACE(LOAD_FILE('DATADIR/test/t1.csv'),'\r\n','\n')) ...@@ -186,7 +186,7 @@ HEX(REPLACE(LOAD_FILE('DATADIR/test/t1.csv'),'\r\n','\n'))
E10A E10A
CREATE TABLE t1 CREATE TABLE t1
( (
c1 CHAR(12) c1 CHAR(12) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv' ) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv'
CHARSET=latin1; CHARSET=latin1;
INSERT INTO t1 VALUES ('á'); INSERT INTO t1 VALUES ('á');
...@@ -199,7 +199,7 @@ HEX(REPLACE(LOAD_FILE('DATADIR/test/t1.csv'),'\r\n','\n')) ...@@ -199,7 +199,7 @@ HEX(REPLACE(LOAD_FILE('DATADIR/test/t1.csv'),'\r\n','\n'))
E10A E10A
CREATE TABLE t1 CREATE TABLE t1
( (
c1 CHAR(12) c1 CHAR(12) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv' ) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv'
CHARSET=latin1 DATA_CHARSET=utf8; CHARSET=latin1 DATA_CHARSET=utf8;
INSERT INTO t1 VALUES ('á'); INSERT INTO t1 VALUES ('á');
...@@ -212,8 +212,8 @@ HEX(REPLACE(LOAD_FILE('DATADIR/test/t1.csv'),'\r\n','\n')) ...@@ -212,8 +212,8 @@ HEX(REPLACE(LOAD_FILE('DATADIR/test/t1.csv'),'\r\n','\n'))
C3A10A C3A10A
CREATE TABLE t1 CREATE TABLE t1
( (
c1 CHAR(12) CHARACTER SET latin1, c1 CHAR(12) CHARACTER SET latin1 NOT NULL,
c2 CHAR(12) CHARACTER SET utf8 c2 CHAR(12) CHARACTER SET utf8 NOT NULL
) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv'; ) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv';
INSERT INTO t1 VALUES ('á','á'); INSERT INTO t1 VALUES ('á','á');
SELECT * FROM t1; SELECT * FROM t1;
......
# #
# Testing errors # Testing errors
# #
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) NOT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=DBF `FILE_NAME`='t1.dbf' ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=DBF `FILE_NAME`='t1.dbf'
SELECT * FROM t1; SELECT * FROM t1;
a a
...@@ -56,11 +56,11 @@ END// ...@@ -56,11 +56,11 @@ END//
# #
# Testing READONLY tables # Testing READONLY tables
# #
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) NOT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=DBF `FILE_NAME`='t1.dbf' ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=DBF `FILE_NAME`='t1.dbf'
INSERT INTO t1 VALUES (10),(20); INSERT INTO t1 VALUES (10),(20);
SELECT * FROM t1; SELECT * FROM t1;
...@@ -73,7 +73,7 @@ Warning 1105 The current version of CONNECT did not check what you changed in AL ...@@ -73,7 +73,7 @@ Warning 1105 The current version of CONNECT did not check what you changed in AL
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) NOT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=DBF `FILE_NAME`='t1.dbf' `READONLY`=Yes ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=DBF `FILE_NAME`='t1.dbf' `READONLY`=Yes
INSERT INTO t1 VALUES (30); INSERT INTO t1 VALUES (30);
ERROR HY000: Got error 174 'Cannot modify this read/only protected table' from CONNECT ERROR HY000: Got error 174 'Cannot modify this read/only protected table' from CONNECT
...@@ -89,7 +89,7 @@ Warning 1105 The current version of CONNECT did not check what you changed in AL ...@@ -89,7 +89,7 @@ Warning 1105 The current version of CONNECT did not check what you changed in AL
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) NOT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=DBF `FILE_NAME`='t1.dbf' `READONLY`=NO ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=DBF `FILE_NAME`='t1.dbf' `READONLY`=NO
INSERT INTO t1 VALUES (30); INSERT INTO t1 VALUES (30);
SELECT * FROM t1; SELECT * FROM t1;
...@@ -103,9 +103,9 @@ DROP TABLE t1; ...@@ -103,9 +103,9 @@ DROP TABLE t1;
# #
CREATE TABLE t1 CREATE TABLE t1
( (
a int(11) DEFAULT NULL, a int(11) NOT NULL,
b char(10) DEFAULT NULL, b char(10) NOT NULL,
c varchar(10) DEFAULT NULL c varchar(10) NOT NULL
) ENGINE=CONNECT table_type=DBF file_name='t1.dbf'; ) ENGINE=CONNECT table_type=DBF file_name='t1.dbf';
INSERT INTO t1 VALUES (1,'1','1'); INSERT INTO t1 VALUES (1,'1','1');
INSERT INTO t1 VALUES (2,'2','2'); INSERT INTO t1 VALUES (2,'2','2');
...@@ -117,22 +117,22 @@ DROP TABLE t1; ...@@ -117,22 +117,22 @@ DROP TABLE t1;
# #
# Testing that table options in lower case and mixed case are understood: # Testing that table options in lower case and mixed case are understood:
# #
CREATE TABLE t1 (a INT) ENGINE=CONNECT table_type=dbf file_name='t1.dbf'; CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT table_type=dbf file_name='t1.dbf';
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) NOT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `table_type`=dbf `file_name`='t1.dbf' ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `table_type`=dbf `file_name`='t1.dbf'
INSERT INTO t1 VALUES (10); INSERT INTO t1 VALUES (10);
SELECT * FROM t1; SELECT * FROM t1;
a a
10 10
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (a CHAR(10)) ENGINE=CONNECT Table_Type=dbf File_Name='t1.dbf'; CREATE TABLE t1 (a CHAR(10) NOT NULL) ENGINE=CONNECT Table_Type=dbf File_Name='t1.dbf';
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` char(10) DEFAULT NULL `a` char(10) NOT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `Table_Type`=dbf `File_Name`='t1.dbf' ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `Table_Type`=dbf `File_Name`='t1.dbf'
INSERT INTO t1 VALUES ('test'); INSERT INTO t1 VALUES ('test');
SELECT * FROM t1; SELECT * FROM t1;
...@@ -162,9 +162,9 @@ DROP TABLE t1; ...@@ -162,9 +162,9 @@ DROP TABLE t1;
# #
CREATE TABLE t1 CREATE TABLE t1
( (
a INT DEFAULT NULL, a INT NOT NULL,
b CHAR(10) DEFAULT NULL, b CHAR(10) NOT NULL,
c VARCHAR(10) DEFAULT NULL c VARCHAR(10) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
INSERT INTO t1 VALUES (1,'1','1'); INSERT INTO t1 VALUES (1,'1','1');
INSERT INTO t1 VALUES (2,'2','2'); INSERT INTO t1 VALUES (2,'2','2');
...@@ -212,7 +212,7 @@ DROP TABLE t1; ...@@ -212,7 +212,7 @@ DROP TABLE t1;
# #
CREATE TABLE t1 CREATE TABLE t1
( (
a012345678901234567890123456789 INT DEFAULT NULL a012345678901234567890123456789 INT NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
ERROR HY000: DBF: Column name 'a012345678901234567890123456789' is too long (max=10) ERROR HY000: DBF: Column name 'a012345678901234567890123456789' is too long (max=10)
# #
...@@ -220,8 +220,8 @@ ERROR HY000: DBF: Column name 'a012345678901234567890123456789' is too long (max ...@@ -220,8 +220,8 @@ ERROR HY000: DBF: Column name 'a012345678901234567890123456789' is too long (max
# #
CREATE TABLE t1 CREATE TABLE t1
( (
a0123456789a INT DEFAULT NULL, a0123456789a INT NOT NULL,
b0123456789b INT DEFAULT NULL b0123456789b INT NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t02x11.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t02x11.dbf';
ERROR HY000: DBF: Column name 'a0123456789a' is too long (max=10) ERROR HY000: DBF: Column name 'a0123456789a' is too long (max=10)
# #
...@@ -229,8 +229,8 @@ ERROR HY000: DBF: Column name 'a0123456789a' is too long (max=10) ...@@ -229,8 +229,8 @@ ERROR HY000: DBF: Column name 'a0123456789a' is too long (max=10)
# #
CREATE TABLE t1 CREATE TABLE t1
( (
a012345678a INT DEFAULT NULL, a012345678a INT NOT NULL,
b012345678b INT DEFAULT NULL b012345678b INT NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t02x12.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t02x12.dbf';
ERROR HY000: DBF: Column name 'a012345678a' is too long (max=10) ERROR HY000: DBF: Column name 'a012345678a' is too long (max=10)
# #
...@@ -238,14 +238,14 @@ ERROR HY000: DBF: Column name 'a012345678a' is too long (max=10) ...@@ -238,14 +238,14 @@ ERROR HY000: DBF: Column name 'a012345678a' is too long (max=10)
# #
CREATE TABLE t1 CREATE TABLE t1
( (
a01234567a INT DEFAULT NULL, a01234567a INT NOT NULL,
b01234567b INT DEFAULT NULL b01234567b INT NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t02x13.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t02x13.dbf';
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a01234567a` int(11) DEFAULT NULL, `a01234567a` int(11) NOT NULL,
`b01234567b` int(11) DEFAULT NULL `b01234567b` int(11) NOT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=DBF `FILE_NAME`='t02x13.dbf' ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=DBF `FILE_NAME`='t02x13.dbf'
INSERT INTO t1 VALUES (1,2); INSERT INTO t1 VALUES (1,2);
SELECT * FROM t1; SELECT * FROM t1;
...@@ -257,7 +257,7 @@ DROP TABLE t1; ...@@ -257,7 +257,7 @@ DROP TABLE t1;
# #
CREATE TABLE t1 CREATE TABLE t1
( (
a bigint DEFAULT NULL a bigint NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
INSERT INTO t1 VALUES (0x7FFFFFFFFFFFFFFF); INSERT INTO t1 VALUES (0x7FFFFFFFFFFFFFFF);
INSERT INTO t1 VALUES (-0x8000000000000000); INSERT INTO t1 VALUES (-0x8000000000000000);
...@@ -289,7 +289,7 @@ DROP TABLE t1; ...@@ -289,7 +289,7 @@ DROP TABLE t1;
# #
CREATE TABLE t1 CREATE TABLE t1
( (
a TINYINT DEFAULT NULL a TINYINT NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
INSERT INTO t1 VALUES (123); INSERT INTO t1 VALUES (123);
SELECT * FROM t1; SELECT * FROM t1;
...@@ -301,7 +301,7 @@ DROP TABLE t1; ...@@ -301,7 +301,7 @@ DROP TABLE t1;
# #
CREATE TABLE t1 CREATE TABLE t1
( (
a SMALLINT DEFAULT NULL a SMALLINT NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
INSERT INTO t1 VALUES (0x7FFF); INSERT INTO t1 VALUES (0x7FFF);
INSERT INTO t1 VALUES (-0x8000); INSERT INTO t1 VALUES (-0x8000);
...@@ -333,7 +333,7 @@ DROP TABLE t1; ...@@ -333,7 +333,7 @@ DROP TABLE t1;
# #
CREATE TABLE t1 CREATE TABLE t1
( (
a VARCHAR(255) a VARCHAR(255) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
INSERT INTO t1 VALUES (REPEAT('a',255)); INSERT INTO t1 VALUES (REPEAT('a',255));
SELECT LENGTH(a) FROM t1; SELECT LENGTH(a) FROM t1;
...@@ -364,7 +364,7 @@ DROP TABLE t1; ...@@ -364,7 +364,7 @@ DROP TABLE t1;
# #
CREATE TABLE t1 CREATE TABLE t1
( (
a CHAR(86) CHARACTER SET utf8 a CHAR(86) CHARACTER SET utf8 NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
ERROR HY000: DBF: Column length too big for 'a' (max=255) ERROR HY000: DBF: Column length too big for 'a' (max=255)
# #
...@@ -373,17 +373,17 @@ ERROR HY000: DBF: Column length too big for 'a' (max=255) ...@@ -373,17 +373,17 @@ ERROR HY000: DBF: Column length too big for 'a' (max=255)
# #
CREATE TABLE t1 CREATE TABLE t1
( (
a VARCHAR(256) a VARCHAR(256) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
ERROR HY000: DBF: Column length too big for 'a' (max=255) ERROR HY000: DBF: Column length too big for 'a' (max=255)
CREATE TABLE t1 CREATE TABLE t1
( (
a VARCHAR(86) CHARACTER SET utf8 a VARCHAR(86) CHARACTER SET utf8 NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
ERROR HY000: DBF: Column length too big for 'a' (max=255) ERROR HY000: DBF: Column length too big for 'a' (max=255)
CREATE TABLE t1 CREATE TABLE t1
( (
a VARCHAR(64000) a VARCHAR(64000) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
ERROR HY000: DBF: Column length too big for 'a' (max=255) ERROR HY000: DBF: Column length too big for 'a' (max=255)
# #
...@@ -414,7 +414,7 @@ ERROR HY000: Unsupported type for column 'a' ...@@ -414,7 +414,7 @@ ERROR HY000: Unsupported type for column 'a'
# #
CREATE TABLE t1 CREATE TABLE t1
( (
a DATE a DATE NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
INSERT INTO t1 VALUES ('2001-01-01'); INSERT INTO t1 VALUES ('2001-01-01');
SELECT * FROM t1; SELECT * FROM t1;
...@@ -444,7 +444,7 @@ DROP TABLE t1; ...@@ -444,7 +444,7 @@ DROP TABLE t1;
# #
CREATE TABLE t1 CREATE TABLE t1
( (
a FLOAT(12,4) a FLOAT(12,4) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
INSERT INTO t1 VALUES (123); INSERT INTO t1 VALUES (123);
SELECT * FROM t1; SELECT * FROM t1;
...@@ -474,7 +474,7 @@ DROP TABLE t1; ...@@ -474,7 +474,7 @@ DROP TABLE t1;
# #
CREATE TABLE t1 CREATE TABLE t1
( (
a DOUBLE(20,5) a DOUBLE(20,5) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
INSERT INTO t1 VALUES (123); INSERT INTO t1 VALUES (123);
INSERT INTO t1 VALUES (123456789.12345); INSERT INTO t1 VALUES (123456789.12345);
...@@ -506,7 +506,7 @@ DROP TABLE IF EXISTS t1; ...@@ -506,7 +506,7 @@ DROP TABLE IF EXISTS t1;
# #
CREATE TABLE t1 CREATE TABLE t1
( (
a VARCHAR(10) a VARCHAR(10) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
INSERT INTO t1 VALUES ('10'); INSERT INTO t1 VALUES ('10');
SELECT * FROM t1; SELECT * FROM t1;
...@@ -532,7 +532,7 @@ Flags 00 ...@@ -532,7 +532,7 @@ Flags 00
-------- -------- -------- --------
ALTER TABLE t1 MODIFY a VARCHAR(10) NOT NULL; ALTER TABLE t1 MODIFY a VARCHAR(10) NOT NULL;
Warnings: Warnings:
Warning 1265 Data truncated for column 'a' at row 1 Warning 1105 The current version of CONNECT did not check what you changed in ALTER. Use on your own risk
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
...@@ -594,22 +594,24 @@ DROP TABLE IF EXISTS t1; ...@@ -594,22 +594,24 @@ DROP TABLE IF EXISTS t1;
# #
CREATE TABLE t1 CREATE TABLE t1
( (
c1 VARCHAR(10), c1 VARCHAR(10) NOT NULL,
c2 VARCHAR(10) DEFAULT 'def', c2 VARCHAR(10) NOT NULL DEFAULT 'def',
i1 INT, i1 INT NOT NULL,
i2 INT DEFAULT 123 i2 INT NOT NULL DEFAULT 123
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
INSERT INTO t1 VALUES ('10','10',10,10); INSERT INTO t1 VALUES ('10','10',10,10);
INSERT INTO t1 VALUES (NULL,NULL,NULL,NULL); INSERT INTO t1(c1,i1) VALUES ('20',20);
INSERT INTO t1 VALUES ('30',DEFAULT,30,DEFAULT);
SELECT * FROM t1; SELECT * FROM t1;
c1 c2 i1 i2 c1 c2 i1 i2
10 10 10 10 10 10 10 10
0 0 20 20 0
30 def 30 123
CALL dbf_header('MYSQLD_DATADIR/test/t1.dbf'); CALL dbf_header('MYSQLD_DATADIR/test/t1.dbf');
-------- -------- -------- --------
FileSize 248 FileSize 291
DBF_Version 03 DBF_Version 03
NRecords 2 NRecords 3
FirstRecPos 162 FirstRecPos 162
RecLength 43 RecLength 43
TableFlags 0000 TableFlags 0000
......
CREATE TABLE t1 ( CREATE TABLE t1 (
path VARCHAR(256) flag=1, path VARCHAR(256) NOT NULL flag=1,
fname VARCHAR(256), fname VARCHAR(256) NOT NULL,
ftype CHAR(4), ftype CHAR(4) NOT NULL,
size DOUBLE(12,0) flag=5 size DOUBLE(12,0) NOT NULL flag=5
) ENGINE=CONNECT TABLE_TYPE=DIR FILE_NAME='*.txt' ) ENGINE=CONNECT TABLE_TYPE=DIR FILE_NAME='*.txt'
OPTION_LIST='subdir=1'; OPTION_LIST='subdir=1';
SELECT * FROM t1; SELECT * FROM t1;
...@@ -18,10 +18,10 @@ Warning 1105 The current version of CONNECT did not check what you changed in AL ...@@ -18,10 +18,10 @@ Warning 1105 The current version of CONNECT did not check what you changed in AL
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`path` varchar(256) DEFAULT NULL `flag`=1, `path` varchar(256) NOT NULL `flag`=1,
`fname` varchar(256) DEFAULT NULL, `fname` varchar(256) NOT NULL,
`ftype` char(4) DEFAULT NULL, `ftype` char(4) NOT NULL,
`size` double(12,0) DEFAULT NULL `flag`=5 `size` double(12,0) NOT NULL `flag`=5
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=DIR `FILE_NAME`='*.txt' `OPTION_LIST`='subdir=0' ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=DIR `FILE_NAME`='*.txt' `OPTION_LIST`='subdir=0'
SELECT fname, ftype, size FROM t1 ORDER BY fname, ftype, size; SELECT fname, ftype, size FROM t1 ORDER BY fname, ftype, size;
fname ftype size fname ftype size
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# #
CREATE TABLE t1 CREATE TABLE t1
( (
ID INT ID INT NOT NULL
) Engine=CONNECT TABLE_TYPE=DOS FILE_NAME='nonexistent.txt'; ) Engine=CONNECT TABLE_TYPE=DOS FILE_NAME='nonexistent.txt';
SELECT * FROM t1; SELECT * FROM t1;
ID ID
...@@ -15,7 +15,7 @@ DROP TABLE t1; ...@@ -15,7 +15,7 @@ DROP TABLE t1;
# #
CREATE TABLE t1 CREATE TABLE t1
( (
id INT id INT NOT NULL
) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='t1.txt'; ) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='t1.txt';
INSERT INTO t1 VALUES (10); INSERT INTO t1 VALUES (10);
SELECT * FROM t1; SELECT * FROM t1;
...@@ -27,7 +27,7 @@ Warning 1105 The current version of CONNECT did not check what you changed in AL ...@@ -27,7 +27,7 @@ Warning 1105 The current version of CONNECT did not check what you changed in AL
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`id` int(11) DEFAULT NULL `id` int(11) NOT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=FIX `FILE_NAME`='t1.txt' `READONLY`=1 ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=FIX `FILE_NAME`='t1.txt' `READONLY`=1
INSERT INTO t1 VALUES (20); INSERT INTO t1 VALUES (20);
ERROR HY000: Got error 174 'Cannot modify this read/only protected table' from CONNECT ERROR HY000: Got error 174 'Cannot modify this read/only protected table' from CONNECT
...@@ -43,7 +43,7 @@ Warning 1105 The current version of CONNECT did not check what you changed in AL ...@@ -43,7 +43,7 @@ Warning 1105 The current version of CONNECT did not check what you changed in AL
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`id` int(11) DEFAULT NULL `id` int(11) NOT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=FIX `FILE_NAME`='t1.txt' `READONLY`=0 ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=FIX `FILE_NAME`='t1.txt' `READONLY`=0
INSERT INTO t1 VALUES (20); INSERT INTO t1 VALUES (20);
SELECT * FROM t1; SELECT * FROM t1;
...@@ -57,10 +57,10 @@ DROP TABLE t1; ...@@ -57,10 +57,10 @@ DROP TABLE t1;
CREATE TABLE t1 CREATE TABLE t1
( (
number CHAR(4) not null, number CHAR(4) not null,
location CHAR(15) flag=5, location CHAR(15) NOT NULL flag=5,
director CHAR(5) flag=20, director CHAR(5) NOT NULL flag=20,
function CHAR(12) flag=26, function CHAR(12) NOT NULL flag=26,
name CHAR(22) flag=38 name CHAR(22) NOT NULL flag=38
) ENGINE=CONNECT TABLE_TYPE=DOS FILE_NAME='dept.dat'; ) ENGINE=CONNECT TABLE_TYPE=DOS FILE_NAME='dept.dat';
SELECT * FROM t1; SELECT * FROM t1;
number location director function name number location director function name
...@@ -71,10 +71,10 @@ number location director function name ...@@ -71,10 +71,10 @@ number location director function name
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 CREATE TABLE t1
( (
name char(12), name char(12) not null,
city char(12), city char(12) not null,
birth date date_format='DD/MM/YYYY', birth date not null date_format='DD/MM/YYYY',
hired date date_format='DD/MM/YYYY' flag=36 hired date not null date_format='DD/MM/YYYY' flag=36
) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='boys.txt' ENDING=1; ) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='boys.txt' ENDING=1;
SELECT * FROM t1; SELECT * FROM t1;
name city birth hired name city birth hired
...@@ -87,10 +87,10 @@ Bill Boston 1 1986-09-01 2008-02-10 ...@@ -87,10 +87,10 @@ Bill Boston 1 1986-09-01 2008-02-10
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 CREATE TABLE t1
( (
name char(12), name char(12) not null,
city char(12), city char(12) not null,
birth date date_format='DD/MM/YYYY', birth date not null date_format='DD/MM/YYYY',
hired date date_format='DD/MM/YYYY' flag=36 hired date not null date_format='DD/MM/YYYY' flag=36
) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='boys.txt' LRECL=47 ENDING=1; ) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='boys.txt' LRECL=47 ENDING=1;
SELECT * FROM t1; SELECT * FROM t1;
name city birth hired name city birth hired
...@@ -103,10 +103,10 @@ Bill Boston 1 1986-09-01 2008-02-10 ...@@ -103,10 +103,10 @@ Bill Boston 1 1986-09-01 2008-02-10
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 CREATE TABLE t1
( (
name char(12), name char(12) not null,
city char(12), city char(12) not null,
birth date date_format='DD/MM/YYYY', birth date not null date_format='DD/MM/YYYY',
hired date date_format='DD/MM/YYYY' flag=36 hired date not null date_format='DD/MM/YYYY' flag=36
) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='boyswin.txt' ENDING=2; ) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='boyswin.txt' ENDING=2;
SELECT * FROM t1; SELECT * FROM t1;
name city birth hired name city birth hired
...@@ -119,10 +119,10 @@ Bill Boston 1 1986-09-01 2008-02-10 ...@@ -119,10 +119,10 @@ Bill Boston 1 1986-09-01 2008-02-10
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 CREATE TABLE t1
( (
name char(12), name char(12) not null,
city char(12), city char(12) not null,
birth date date_format='DD/MM/YYYY', birth date not null date_format='DD/MM/YYYY',
hired date date_format='DD/MM/YYYY' flag=36 hired date not null date_format='DD/MM/YYYY' flag=36
) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='boyswin.txt' LRECL=47 ENDING=2; ) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='boyswin.txt' LRECL=47 ENDING=2;
SELECT * FROM t1; SELECT * FROM t1;
name city birth hired name city birth hired
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# #
CREATE TABLE t1 CREATE TABLE t1
( (
ID INT field_format=' %n%d%n' ID INT NOT NULL field_format=' %n%d%n'
) Engine=CONNECT table_type=FMT file_name='nonexistent.txt'; ) Engine=CONNECT table_type=FMT file_name='nonexistent.txt';
SELECT * FROM t1; SELECT * FROM t1;
ID ID
...@@ -15,7 +15,7 @@ DROP TABLE t1; ...@@ -15,7 +15,7 @@ DROP TABLE t1;
# #
CREATE TABLE t1 CREATE TABLE t1
( (
id INT field_format=' %n%d%n' id INT NOT NULL field_format=' %n%d%n'
) ENGINE=CONNECT TABLE_TYPE=FMT FILE_NAME='t1.txt'; ) ENGINE=CONNECT TABLE_TYPE=FMT FILE_NAME='t1.txt';
INSERT INTO t1 VALUES (10),(20); INSERT INTO t1 VALUES (10),(20);
ERROR HY000: Got error 122 'Writing FMT files is not implemented yet' from CONNECT ERROR HY000: Got error 122 'Writing FMT files is not implemented yet' from CONNECT
...@@ -25,10 +25,10 @@ DROP TABLE t1; ...@@ -25,10 +25,10 @@ DROP TABLE t1;
# #
CREATE TABLE t1 CREATE TABLE t1
( (
ID Integer(5) field_format=' %n%d%n', ID Integer(5) not null field_format=' %n%d%n',
NAME Char(16) field_format=" , '%n%[^']%n'", NAME Char(16) not null field_format=" , '%n%[^']%n'",
DEPNO Integer(4) field_format=' , #%n%d%n', DEPNO Integer(4) not null field_format=' , #%n%d%n',
SALARY Double(12,2) field_format=' ; %n%f%n' SALARY Double(12,2) not null field_format=' ; %n%f%n'
) Engine=CONNECT table_type=FMT file_name='funny.txt'; ) Engine=CONNECT table_type=FMT file_name='funny.txt';
SELECT * FROM t1; SELECT * FROM t1;
ID NAME DEPNO SALARY ID NAME DEPNO SALARY
...@@ -38,20 +38,20 @@ ID NAME DEPNO SALARY ...@@ -38,20 +38,20 @@ ID NAME DEPNO SALARY
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 CREATE TABLE t1
( (
ID Integer(5) field_format=' %n%d%n', ID Integer(5) not null field_format=' %n%d%n',
NAME Char(16) field_format=" , '%n%[^']%n'", NAME Char(16) not null field_format=" , '%n%[^']%n'",
DEPNO Integer(4) field_format=' , #%n%d%n', DEPNO Integer(4) not null field_format=' , #%n%d%n',
SALARY Double(12,2) field_format=' ; %n%f%n' SALARY Double(12,2) not null field_format=' ; %n%f%n'
) Engine=CONNECT table_type=FMT file_name='funny2.txt'; ) Engine=CONNECT table_type=FMT file_name='funny2.txt';
SELECT * FROM t1; SELECT * FROM t1;
ERROR HY000: Got error 122 'Bad format line 2 field 3 of t1' from CONNECT ERROR HY000: Got error 122 'Bad format line 2 field 3 of t1' from CONNECT
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 CREATE TABLE t1
( (
ID Integer(5) field_format=' %n%d%n', ID Integer(5) not null field_format=' %n%d%n',
NAME Char(16) field_format=' , ''%n%[^'']%m', NAME Char(16) not null field_format=' , ''%n%[^'']%m',
DEPNO Integer(4) field_format=''' , #%n%d%m', DEPNO Integer(4) not null field_format=''' , #%n%d%m',
SALARY Double(12,2) field_format=' ; %n%f%n' SALARY Double(12,2) not null field_format=' ; %n%f%n'
) Engine=CONNECT table_type=FMT file_name='funny2.txt'; ) Engine=CONNECT table_type=FMT file_name='funny2.txt';
SELECT * FROM t1; SELECT * FROM t1;
ID NAME DEPNO SALARY ID NAME DEPNO SALARY
......
# #
# Testing features not specific to any TABLE_TYPE # Testing features not specific to any TABLE_TYPE
# #
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=NON_EXISTING; CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=NON_EXISTING;
Warnings: Warnings:
Warning 1105 No table_type. Was set to DOS Warning 1105 No table_type. Was set to DOS
Warning 1105 No file name. Table will use t1.DOS Warning 1105 No file name. Table will use t1.DOS
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL `a` int(11) NOT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `table_type`=DOS ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `table_type`=DOS
DROP TABLE t1; DROP TABLE t1;
...@@ -15,7 +15,7 @@ brut INT(5) NOT NULL, ...@@ -15,7 +15,7 @@ brut INT(5) NOT NULL,
net DOUBLE(8,2) NOT NULL, net DOUBLE(8,2) NOT NULL,
service INT(2) NOT NULL, service INT(2) NOT NULL,
sitmat CHAR(1) NOT NULL, sitmat CHAR(1) NOT NULL,
formation CHAR(5), formation CHAR(5) NOT NULL,
INDEX NP(nom,prenom) INDEX NP(nom,prenom)
) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='emp.txt' ENDING=2; ) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='emp.txt' ENDING=2;
SELECT * FROM t1 LIMIT 10; SELECT * FROM t1 LIMIT 10;
......
CREATE TABLE dir1 ( CREATE TABLE dir1 (
spath VARCHAR(256) flag=1, spath VARCHAR(256) NOT NULL flag=1,
fname VARCHAR(256), fname VARCHAR(256) NOT NULL,
ftype CHAR(4), ftype CHAR(4) NOT NULL,
size DOUBLE(12,0) flag=5 size DOUBLE(12,0) NOT NULL flag=5
) ENGINE=CONNECT TABLE_TYPE=DIR FILE_NAME='*vec*'; ) ENGINE=CONNECT TABLE_TYPE=DIR FILE_NAME='*vec*';
CREATE TABLE t1 CREATE TABLE t1
( (
a INT, a INT NOT NULL,
b CHAR(10) b CHAR(10) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=VEC FILE_NAME='t1vec'; ) ENGINE=CONNECT TABLE_TYPE=VEC FILE_NAME='t1vec';
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL, `a` int(11) NOT NULL,
`b` char(10) DEFAULT NULL `b` char(10) NOT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=VEC `FILE_NAME`='t1vec' ) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=VEC `FILE_NAME`='t1vec'
SELECT * FROM t1; SELECT * FROM t1;
a b a b
...@@ -46,14 +46,14 @@ t1vec2 40 ...@@ -46,14 +46,14 @@ t1vec2 40
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 CREATE TABLE t1
( (
a INT, a INT NOT NULL,
b CHAR(10) b CHAR(10) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=VEC FILE_NAME='t1vec' MAX_ROWS=10; ) ENGINE=CONNECT TABLE_TYPE=VEC FILE_NAME='t1vec' MAX_ROWS=10;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL, `a` int(11) NOT NULL,
`b` char(10) DEFAULT NULL `b` char(10) NOT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 MAX_ROWS=10 `TABLE_TYPE`=VEC `FILE_NAME`='t1vec' ) ENGINE=CONNECT DEFAULT CHARSET=latin1 MAX_ROWS=10 `TABLE_TYPE`=VEC `FILE_NAME`='t1vec'
SELECT * FROM t1; SELECT * FROM t1;
a b a b
...@@ -99,8 +99,8 @@ Warning 1105 The current version of CONNECT did not check what you changed in AL ...@@ -99,8 +99,8 @@ Warning 1105 The current version of CONNECT did not check what you changed in AL
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL, `a` int(11) NOT NULL,
`b` char(10) DEFAULT NULL `b` char(10) NOT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 MAX_ROWS=10 `TABLE_TYPE`=VEC `FILE_NAME`='t1vec' `READONLY`=yes ) ENGINE=CONNECT DEFAULT CHARSET=latin1 MAX_ROWS=10 `TABLE_TYPE`=VEC `FILE_NAME`='t1vec' `READONLY`=yes
INSERT INTO t1 VALUES (4,'test04'); INSERT INTO t1 VALUES (4,'test04');
ERROR HY000: Got error 174 'Cannot modify this read/only protected table' from CONNECT ERROR HY000: Got error 174 'Cannot modify this read/only protected table' from CONNECT
...@@ -116,8 +116,8 @@ Warning 1105 The current version of CONNECT did not check what you changed in AL ...@@ -116,8 +116,8 @@ Warning 1105 The current version of CONNECT did not check what you changed in AL
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
Table Create Table Table Create Table
t1 CREATE TABLE `t1` ( t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL, `a` int(11) NOT NULL,
`b` char(10) DEFAULT NULL `b` char(10) NOT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 MAX_ROWS=10 `TABLE_TYPE`=VEC `FILE_NAME`='t1vec' `READONLY`=no ) ENGINE=CONNECT DEFAULT CHARSET=latin1 MAX_ROWS=10 `TABLE_TYPE`=VEC `FILE_NAME`='t1vec' `READONLY`=no
INSERT INTO t1 VALUES (4,'test04'); INSERT INTO t1 VALUES (4,'test04');
UPDATE t1 SET b='test04a' WHERE a=4; UPDATE t1 SET b='test04a' WHERE a=4;
......
...@@ -6,7 +6,7 @@ let $MYSQLD_DATADIR= `select @@datadir`; ...@@ -6,7 +6,7 @@ let $MYSQLD_DATADIR= `select @@datadir`;
--echo # --echo #
CREATE TABLE t1 CREATE TABLE t1
( (
ID INT ID INT NOT NULL
) Engine=CONNECT TABLE_TYPE=BIN FILE_NAME='nonexistent.txt'; ) Engine=CONNECT TABLE_TYPE=BIN FILE_NAME='nonexistent.txt';
--replace_regex /on .*test.nonexistent.txt/on DATADIR\/test\/nonexistent.txt/ --replace_regex /on .*test.nonexistent.txt/on DATADIR\/test\/nonexistent.txt/
# TODO: check why this is needed for Windows # TODO: check why this is needed for Windows
......
...@@ -8,7 +8,7 @@ SET NAMES utf8; ...@@ -8,7 +8,7 @@ SET NAMES utf8;
--echo # --echo #
CREATE TABLE t1 CREATE TABLE t1
( (
ID INT ID INT NOT NULL
) Engine=CONNECT TABLE_TYPE=CSV FILE_NAME='nonexistent.txt'; ) Engine=CONNECT TABLE_TYPE=CSV FILE_NAME='nonexistent.txt';
--replace_regex /on .*test.nonexistent.txt/on DATADIR\/test\/nonexistent.txt/ --replace_regex /on .*test.nonexistent.txt/on DATADIR\/test\/nonexistent.txt/
# TODO: check why this is needed for Windows # TODO: check why this is needed for Windows
...@@ -21,9 +21,9 @@ DROP TABLE t1; ...@@ -21,9 +21,9 @@ DROP TABLE t1;
--echo # --echo #
CREATE TABLE t1 CREATE TABLE t1
( (
name CHAR(12), name CHAR(12) NOT NULL,
birth DATE DATE_FORMAT='DD/MM/YY', birth DATE NOT NULL DATE_FORMAT='DD/MM/YY',
children SMALLINT(2) children SMALLINT(2) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='people.csv' ) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='people.csv'
HEADER=1 SEP_CHAR=';' QUOTED=1; HEADER=1 SEP_CHAR=';' QUOTED=1;
SELECT * FROM t1; SELECT * FROM t1;
...@@ -39,9 +39,9 @@ DROP TABLE t1; ...@@ -39,9 +39,9 @@ DROP TABLE t1;
--echo # --echo #
CREATE TABLE t1 CREATE TABLE t1
( (
name CHAR(12), name CHAR(12) NOT NULL,
birth DATE DATE_FORMAT='DD/MM/YY', birth DATE NOT NULL DATE_FORMAT='DD/MM/YY',
children SMALLINT(2) children SMALLINT(2) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='people.csv' ) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='people.csv'
HEADER=1 SEP_CHAR=';' QUOTED=1 READONLY=yes; HEADER=1 SEP_CHAR=';' QUOTED=1 READONLY=yes;
--error ER_GET_ERRMSG --error ER_GET_ERRMSG
...@@ -84,7 +84,7 @@ DROP TABLE t1; ...@@ -84,7 +84,7 @@ DROP TABLE t1;
--echo # --echo #
--echo # Creating a CSV table from a MyISAM table --echo # Creating a CSV table from a MyISAM table
--echo # --echo #
CREATE TABLE t1 (a VARCHAR(10), b INT) ENGINE=MyISAM; CREATE TABLE t1 (a VARCHAR(10) NOT NULL, b INT NOT NULL) ENGINE=MyISAM;
INSERT INTO t1 VALUES ('test1',1), ('test2',2); INSERT INTO t1 VALUES ('test1',1), ('test2',2);
CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t2.csv' CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t2.csv'
AS SELECT * FROM t1; AS SELECT * FROM t1;
...@@ -101,7 +101,7 @@ DROP TABLE t1; ...@@ -101,7 +101,7 @@ DROP TABLE t1;
--echo # --echo #
CREATE TABLE t1 CREATE TABLE t1
( (
c1 CHAR(12) c1 CHAR(12) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv' ) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv'
CHARSET=utf8; CHARSET=utf8;
INSERT INTO t1 VALUES ('á'); INSERT INTO t1 VALUES ('á');
...@@ -114,7 +114,7 @@ DROP TABLE t1; ...@@ -114,7 +114,7 @@ DROP TABLE t1;
CREATE TABLE t1 CREATE TABLE t1
( (
c1 CHAR(12) c1 CHAR(12) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv' ) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv'
CHARSET=utf8 DATA_CHARSET=latin1; CHARSET=utf8 DATA_CHARSET=latin1;
INSERT INTO t1 VALUES ('á'); INSERT INTO t1 VALUES ('á');
...@@ -127,7 +127,7 @@ DROP TABLE t1; ...@@ -127,7 +127,7 @@ DROP TABLE t1;
CREATE TABLE t1 CREATE TABLE t1
( (
c1 CHAR(12) c1 CHAR(12) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv'; ) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv';
INSERT INTO t1 VALUES ('á'); INSERT INTO t1 VALUES ('á');
SELECT * FROM t1; SELECT * FROM t1;
...@@ -139,7 +139,7 @@ DROP TABLE t1; ...@@ -139,7 +139,7 @@ DROP TABLE t1;
CREATE TABLE t1 CREATE TABLE t1
( (
c1 CHAR(12) c1 CHAR(12) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv' ) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv'
CHARSET=latin1; CHARSET=latin1;
INSERT INTO t1 VALUES ('á'); INSERT INTO t1 VALUES ('á');
...@@ -152,7 +152,7 @@ DROP TABLE t1; ...@@ -152,7 +152,7 @@ DROP TABLE t1;
CREATE TABLE t1 CREATE TABLE t1
( (
c1 CHAR(12) c1 CHAR(12) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv' ) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv'
CHARSET=latin1 DATA_CHARSET=utf8; CHARSET=latin1 DATA_CHARSET=utf8;
INSERT INTO t1 VALUES ('á'); INSERT INTO t1 VALUES ('á');
...@@ -165,8 +165,8 @@ DROP TABLE t1; ...@@ -165,8 +165,8 @@ DROP TABLE t1;
CREATE TABLE t1 CREATE TABLE t1
( (
c1 CHAR(12) CHARACTER SET latin1, c1 CHAR(12) CHARACTER SET latin1 NOT NULL,
c2 CHAR(12) CHARACTER SET utf8 c2 CHAR(12) CHARACTER SET utf8 NOT NULL
) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv'; ) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.csv';
INSERT INTO t1 VALUES ('á','á'); INSERT INTO t1 VALUES ('á','á');
SELECT * FROM t1; SELECT * FROM t1;
......
...@@ -4,7 +4,7 @@ let $MYSQLD_DATADIR= `select @@datadir`; ...@@ -4,7 +4,7 @@ let $MYSQLD_DATADIR= `select @@datadir`;
--echo # --echo #
--echo # Testing errors --echo # Testing errors
--echo # --echo #
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
--replace_regex /on .*test.t1.dbf/on DATADIR\/test\/t1.dbf/ --replace_regex /on .*test.t1.dbf/on DATADIR\/test\/t1.dbf/
SELECT * FROM t1; SELECT * FROM t1;
...@@ -61,7 +61,7 @@ DELIMITER ;// ...@@ -61,7 +61,7 @@ DELIMITER ;//
--echo # --echo #
--echo # Testing READONLY tables --echo # Testing READONLY tables
--echo # --echo #
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES (10),(20); INSERT INTO t1 VALUES (10),(20);
SELECT * FROM t1; SELECT * FROM t1;
...@@ -88,9 +88,9 @@ DROP TABLE t1; ...@@ -88,9 +88,9 @@ DROP TABLE t1;
--echo # --echo #
CREATE TABLE t1 CREATE TABLE t1
( (
a int(11) DEFAULT NULL, a int(11) NOT NULL,
b char(10) DEFAULT NULL, b char(10) NOT NULL,
c varchar(10) DEFAULT NULL c varchar(10) NOT NULL
) ENGINE=CONNECT table_type=DBF file_name='t1.dbf'; ) ENGINE=CONNECT table_type=DBF file_name='t1.dbf';
INSERT INTO t1 VALUES (1,'1','1'); INSERT INTO t1 VALUES (1,'1','1');
INSERT INTO t1 VALUES (2,'2','2'); INSERT INTO t1 VALUES (2,'2','2');
...@@ -102,13 +102,13 @@ DROP TABLE t1; ...@@ -102,13 +102,13 @@ DROP TABLE t1;
--echo # --echo #
--echo # Testing that table options in lower case and mixed case are understood: --echo # Testing that table options in lower case and mixed case are understood:
--echo # --echo #
CREATE TABLE t1 (a INT) ENGINE=CONNECT table_type=dbf file_name='t1.dbf'; CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT table_type=dbf file_name='t1.dbf';
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES (10); INSERT INTO t1 VALUES (10);
SELECT * FROM t1; SELECT * FROM t1;
DROP TABLE t1; DROP TABLE t1;
--remove_file $MYSQLD_DATADIR/test/t1.dbf --remove_file $MYSQLD_DATADIR/test/t1.dbf
CREATE TABLE t1 (a CHAR(10)) ENGINE=CONNECT Table_Type=dbf File_Name='t1.dbf'; CREATE TABLE t1 (a CHAR(10) NOT NULL) ENGINE=CONNECT Table_Type=dbf File_Name='t1.dbf';
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES ('test'); INSERT INTO t1 VALUES ('test');
SELECT * FROM t1; SELECT * FROM t1;
...@@ -129,9 +129,9 @@ DROP TABLE t1; ...@@ -129,9 +129,9 @@ DROP TABLE t1;
--echo # --echo #
CREATE TABLE t1 CREATE TABLE t1
( (
a INT DEFAULT NULL, a INT NOT NULL,
b CHAR(10) DEFAULT NULL, b CHAR(10) NOT NULL,
c VARCHAR(10) DEFAULT NULL c VARCHAR(10) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
INSERT INTO t1 VALUES (1,'1','1'); INSERT INTO t1 VALUES (1,'1','1');
INSERT INTO t1 VALUES (2,'2','2'); INSERT INTO t1 VALUES (2,'2','2');
...@@ -151,7 +151,7 @@ DROP TABLE t1; ...@@ -151,7 +151,7 @@ DROP TABLE t1;
--error ER_UNKNOWN_ERROR --error ER_UNKNOWN_ERROR
CREATE TABLE t1 CREATE TABLE t1
( (
a012345678901234567890123456789 INT DEFAULT NULL a012345678901234567890123456789 INT NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
--echo # --echo #
...@@ -160,8 +160,8 @@ CREATE TABLE t1 ...@@ -160,8 +160,8 @@ CREATE TABLE t1
--error ER_UNKNOWN_ERROR --error ER_UNKNOWN_ERROR
CREATE TABLE t1 CREATE TABLE t1
( (
a0123456789a INT DEFAULT NULL, a0123456789a INT NOT NULL,
b0123456789b INT DEFAULT NULL b0123456789b INT NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t02x11.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t02x11.dbf';
--echo # --echo #
...@@ -170,8 +170,8 @@ CREATE TABLE t1 ...@@ -170,8 +170,8 @@ CREATE TABLE t1
--error ER_UNKNOWN_ERROR --error ER_UNKNOWN_ERROR
CREATE TABLE t1 CREATE TABLE t1
( (
a012345678a INT DEFAULT NULL, a012345678a INT NOT NULL,
b012345678b INT DEFAULT NULL b012345678b INT NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t02x12.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t02x12.dbf';
--echo # --echo #
...@@ -179,8 +179,8 @@ CREATE TABLE t1 ...@@ -179,8 +179,8 @@ CREATE TABLE t1
--echo # --echo #
CREATE TABLE t1 CREATE TABLE t1
( (
a01234567a INT DEFAULT NULL, a01234567a INT NOT NULL,
b01234567b INT DEFAULT NULL b01234567b INT NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t02x13.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t02x13.dbf';
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES (1,2); INSERT INTO t1 VALUES (1,2);
...@@ -194,7 +194,7 @@ DROP TABLE t1; ...@@ -194,7 +194,7 @@ DROP TABLE t1;
--echo # --echo #
CREATE TABLE t1 CREATE TABLE t1
( (
a bigint DEFAULT NULL a bigint NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
INSERT INTO t1 VALUES (0x7FFFFFFFFFFFFFFF); INSERT INTO t1 VALUES (0x7FFFFFFFFFFFFFFF);
INSERT INTO t1 VALUES (-0x8000000000000000); INSERT INTO t1 VALUES (-0x8000000000000000);
...@@ -213,7 +213,7 @@ DROP TABLE t1; ...@@ -213,7 +213,7 @@ DROP TABLE t1;
--echo # --echo #
CREATE TABLE t1 CREATE TABLE t1
( (
a TINYINT DEFAULT NULL a TINYINT NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
INSERT INTO t1 VALUES (123); INSERT INTO t1 VALUES (123);
SELECT * FROM t1; SELECT * FROM t1;
...@@ -226,7 +226,7 @@ DROP TABLE t1; ...@@ -226,7 +226,7 @@ DROP TABLE t1;
--echo # --echo #
CREATE TABLE t1 CREATE TABLE t1
( (
a SMALLINT DEFAULT NULL a SMALLINT NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
INSERT INTO t1 VALUES (0x7FFF); INSERT INTO t1 VALUES (0x7FFF);
INSERT INTO t1 VALUES (-0x8000); INSERT INTO t1 VALUES (-0x8000);
...@@ -245,7 +245,7 @@ DROP TABLE t1; ...@@ -245,7 +245,7 @@ DROP TABLE t1;
--echo # --echo #
CREATE TABLE t1 CREATE TABLE t1
( (
a VARCHAR(255) a VARCHAR(255) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
INSERT INTO t1 VALUES (REPEAT('a',255)); INSERT INTO t1 VALUES (REPEAT('a',255));
SELECT LENGTH(a) FROM t1; SELECT LENGTH(a) FROM t1;
...@@ -265,7 +265,7 @@ DROP TABLE t1; ...@@ -265,7 +265,7 @@ DROP TABLE t1;
--error ER_UNKNOWN_ERROR --error ER_UNKNOWN_ERROR
CREATE TABLE t1 CREATE TABLE t1
( (
a CHAR(86) CHARACTER SET utf8 a CHAR(86) CHARACTER SET utf8 NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
--error ER_UNKNOWN_ERROR --error ER_UNKNOWN_ERROR
...@@ -277,17 +277,17 @@ CREATE TABLE t1 ...@@ -277,17 +277,17 @@ CREATE TABLE t1
--error ER_UNKNOWN_ERROR --error ER_UNKNOWN_ERROR
CREATE TABLE t1 CREATE TABLE t1
( (
a VARCHAR(256) a VARCHAR(256) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
--error ER_UNKNOWN_ERROR --error ER_UNKNOWN_ERROR
CREATE TABLE t1 CREATE TABLE t1
( (
a VARCHAR(86) CHARACTER SET utf8 a VARCHAR(86) CHARACTER SET utf8 NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
--error ER_UNKNOWN_ERROR --error ER_UNKNOWN_ERROR
CREATE TABLE t1 CREATE TABLE t1
( (
a VARCHAR(64000) a VARCHAR(64000) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
...@@ -336,7 +336,7 @@ CREATE TABLE t1 ...@@ -336,7 +336,7 @@ CREATE TABLE t1
--echo # --echo #
CREATE TABLE t1 CREATE TABLE t1
( (
a DATE a DATE NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
INSERT INTO t1 VALUES ('2001-01-01'); INSERT INTO t1 VALUES ('2001-01-01');
SELECT * FROM t1; SELECT * FROM t1;
...@@ -355,7 +355,7 @@ DROP TABLE t1; ...@@ -355,7 +355,7 @@ DROP TABLE t1;
--echo # --echo #
CREATE TABLE t1 CREATE TABLE t1
( (
a FLOAT(12,4) a FLOAT(12,4) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
INSERT INTO t1 VALUES (123); INSERT INTO t1 VALUES (123);
SELECT * FROM t1; SELECT * FROM t1;
...@@ -373,7 +373,7 @@ DROP TABLE t1; ...@@ -373,7 +373,7 @@ DROP TABLE t1;
# #
#CREATE TABLE t1 #CREATE TABLE t1
#( #(
# a FLOAT # a FLOAT NOT NULL
#) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; #) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
#--error ER_GET_ERRMSG - why this error? #--error ER_GET_ERRMSG - why this error?
#INSERT INTO t1 VALUES (123); #INSERT INTO t1 VALUES (123);
...@@ -390,7 +390,7 @@ DROP TABLE t1; ...@@ -390,7 +390,7 @@ DROP TABLE t1;
#--echo # #--echo #
#CREATE TABLE t1 #CREATE TABLE t1
#( #(
# a DATETIME # a DATETIME NOT NULL
#) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; #) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
#INSERT INTO t1 VALUES ('2013-02-01'); #INSERT INTO t1 VALUES ('2013-02-01');
#SELECT * FROM t1; #SELECT * FROM t1;
...@@ -419,7 +419,7 @@ DROP TABLE t1; ...@@ -419,7 +419,7 @@ DROP TABLE t1;
--echo # --echo #
CREATE TABLE t1 CREATE TABLE t1
( (
a DOUBLE(20,5) a DOUBLE(20,5) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
INSERT INTO t1 VALUES (123); INSERT INTO t1 VALUES (123);
INSERT INTO t1 VALUES (123456789.12345); INSERT INTO t1 VALUES (123456789.12345);
...@@ -445,7 +445,7 @@ DROP TABLE IF EXISTS t1; ...@@ -445,7 +445,7 @@ DROP TABLE IF EXISTS t1;
--echo # --echo #
CREATE TABLE t1 CREATE TABLE t1
( (
a VARCHAR(10) a VARCHAR(10) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
INSERT INTO t1 VALUES ('10'); INSERT INTO t1 VALUES ('10');
SELECT * FROM t1; SELECT * FROM t1;
...@@ -488,13 +488,15 @@ DROP TABLE IF EXISTS t1; ...@@ -488,13 +488,15 @@ DROP TABLE IF EXISTS t1;
# TODO: NULLs should probably change to DEFAULT and produce a warning # TODO: NULLs should probably change to DEFAULT and produce a warning
CREATE TABLE t1 CREATE TABLE t1
( (
c1 VARCHAR(10), c1 VARCHAR(10) NOT NULL,
c2 VARCHAR(10) DEFAULT 'def', c2 VARCHAR(10) NOT NULL DEFAULT 'def',
i1 INT, i1 INT NOT NULL,
i2 INT DEFAULT 123 i2 INT NOT NULL DEFAULT 123
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
INSERT INTO t1 VALUES ('10','10',10,10); INSERT INTO t1 VALUES ('10','10',10,10);
INSERT INTO t1 VALUES (NULL,NULL,NULL,NULL); #INSERT INTO t1 VALUES (NULL,NULL,NULL,NULL);
INSERT INTO t1(c1,i1) VALUES ('20',20);
INSERT INTO t1 VALUES ('30',DEFAULT,30,DEFAULT);
SELECT * FROM t1; SELECT * FROM t1;
--chmod 0777 $MYSQLD_DATADIR/test/t1.dbf --chmod 0777 $MYSQLD_DATADIR/test/t1.dbf
--vertical_results --vertical_results
......
let $MYSQLD_DATADIR= `select @@datadir`; let $MYSQLD_DATADIR= `select @@datadir`;
CREATE TABLE t1 ( CREATE TABLE t1 (
path VARCHAR(256) flag=1, path VARCHAR(256) NOT NULL flag=1,
fname VARCHAR(256), fname VARCHAR(256) NOT NULL,
ftype CHAR(4), ftype CHAR(4) NOT NULL,
size DOUBLE(12,0) flag=5 size DOUBLE(12,0) NOT NULL flag=5
) ENGINE=CONNECT TABLE_TYPE=DIR FILE_NAME='*.txt' ) ENGINE=CONNECT TABLE_TYPE=DIR FILE_NAME='*.txt'
OPTION_LIST='subdir=1'; OPTION_LIST='subdir=1';
......
...@@ -8,7 +8,7 @@ let $MYSQLD_DATADIR= `select @@datadir`; ...@@ -8,7 +8,7 @@ let $MYSQLD_DATADIR= `select @@datadir`;
--echo # --echo #
CREATE TABLE t1 CREATE TABLE t1
( (
ID INT ID INT NOT NULL
) Engine=CONNECT TABLE_TYPE=DOS FILE_NAME='nonexistent.txt'; ) Engine=CONNECT TABLE_TYPE=DOS FILE_NAME='nonexistent.txt';
--replace_regex /on .*test.nonexistent.txt/on DATADIR\/test\/nonexistent.txt/ --replace_regex /on .*test.nonexistent.txt/on DATADIR\/test\/nonexistent.txt/
# TODO: check why this is needed for Windows # TODO: check why this is needed for Windows
...@@ -21,7 +21,7 @@ DROP TABLE t1; ...@@ -21,7 +21,7 @@ DROP TABLE t1;
--echo # --echo #
CREATE TABLE t1 CREATE TABLE t1
( (
id INT id INT NOT NULL
) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='t1.txt'; ) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='t1.txt';
INSERT INTO t1 VALUES (10); INSERT INTO t1 VALUES (10);
SELECT * FROM t1; SELECT * FROM t1;
...@@ -49,30 +49,30 @@ DROP TABLE t1; ...@@ -49,30 +49,30 @@ DROP TABLE t1;
CREATE TABLE t1 CREATE TABLE t1
( (
number CHAR(4) not null, number CHAR(4) not null,
location CHAR(15) flag=5, location CHAR(15) NOT NULL flag=5,
director CHAR(5) flag=20, director CHAR(5) NOT NULL flag=20,
function CHAR(12) flag=26, function CHAR(12) NOT NULL flag=26,
name CHAR(22) flag=38 name CHAR(22) NOT NULL flag=38
) ENGINE=CONNECT TABLE_TYPE=DOS FILE_NAME='dept.dat'; ) ENGINE=CONNECT TABLE_TYPE=DOS FILE_NAME='dept.dat';
SELECT * FROM t1; SELECT * FROM t1;
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 CREATE TABLE t1
( (
name char(12), name char(12) not null,
city char(12), city char(12) not null,
birth date date_format='DD/MM/YYYY', birth date not null date_format='DD/MM/YYYY',
hired date date_format='DD/MM/YYYY' flag=36 hired date not null date_format='DD/MM/YYYY' flag=36
) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='boys.txt' ENDING=1; ) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='boys.txt' ENDING=1;
SELECT * FROM t1; SELECT * FROM t1;
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 CREATE TABLE t1
( (
name char(12), name char(12) not null,
city char(12), city char(12) not null,
birth date date_format='DD/MM/YYYY', birth date not null date_format='DD/MM/YYYY',
hired date date_format='DD/MM/YYYY' flag=36 hired date not null date_format='DD/MM/YYYY' flag=36
) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='boys.txt' LRECL=47 ENDING=1; ) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='boys.txt' LRECL=47 ENDING=1;
SELECT * FROM t1; SELECT * FROM t1;
DROP TABLE t1; DROP TABLE t1;
...@@ -80,20 +80,20 @@ DROP TABLE t1; ...@@ -80,20 +80,20 @@ DROP TABLE t1;
CREATE TABLE t1 CREATE TABLE t1
( (
name char(12), name char(12) not null,
city char(12), city char(12) not null,
birth date date_format='DD/MM/YYYY', birth date not null date_format='DD/MM/YYYY',
hired date date_format='DD/MM/YYYY' flag=36 hired date not null date_format='DD/MM/YYYY' flag=36
) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='boyswin.txt' ENDING=2; ) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='boyswin.txt' ENDING=2;
SELECT * FROM t1; SELECT * FROM t1;
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 CREATE TABLE t1
( (
name char(12), name char(12) not null,
city char(12), city char(12) not null,
birth date date_format='DD/MM/YYYY', birth date not null date_format='DD/MM/YYYY',
hired date date_format='DD/MM/YYYY' flag=36 hired date not null date_format='DD/MM/YYYY' flag=36
) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='boyswin.txt' LRECL=47 ENDING=2; ) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='boyswin.txt' LRECL=47 ENDING=2;
SELECT * FROM t1; SELECT * FROM t1;
DROP TABLE t1; DROP TABLE t1;
......
...@@ -7,7 +7,7 @@ let $MYSQLD_DATADIR= `select @@datadir`; ...@@ -7,7 +7,7 @@ let $MYSQLD_DATADIR= `select @@datadir`;
--echo # --echo #
CREATE TABLE t1 CREATE TABLE t1
( (
ID INT field_format=' %n%d%n' ID INT NOT NULL field_format=' %n%d%n'
) Engine=CONNECT table_type=FMT file_name='nonexistent.txt'; ) Engine=CONNECT table_type=FMT file_name='nonexistent.txt';
--replace_regex /on .*test.nonexistent.txt/on DATADIR\/test\/nonexistent.txt/ --replace_regex /on .*test.nonexistent.txt/on DATADIR\/test\/nonexistent.txt/
# TODO: check why this is needed for Windows # TODO: check why this is needed for Windows
...@@ -21,7 +21,7 @@ DROP TABLE t1; ...@@ -21,7 +21,7 @@ DROP TABLE t1;
--echo # --echo #
CREATE TABLE t1 CREATE TABLE t1
( (
id INT field_format=' %n%d%n' id INT NOT NULL field_format=' %n%d%n'
) ENGINE=CONNECT TABLE_TYPE=FMT FILE_NAME='t1.txt'; ) ENGINE=CONNECT TABLE_TYPE=FMT FILE_NAME='t1.txt';
--error ER_GET_ERRMSG --error ER_GET_ERRMSG
INSERT INTO t1 VALUES (10),(20); INSERT INTO t1 VALUES (10),(20);
...@@ -40,10 +40,10 @@ DROP TABLE t1; ...@@ -40,10 +40,10 @@ DROP TABLE t1;
--echo # --echo #
CREATE TABLE t1 CREATE TABLE t1
( (
ID Integer(5) field_format=' %n%d%n', ID Integer(5) not null field_format=' %n%d%n',
NAME Char(16) field_format=" , '%n%[^']%n'", NAME Char(16) not null field_format=" , '%n%[^']%n'",
DEPNO Integer(4) field_format=' , #%n%d%n', DEPNO Integer(4) not null field_format=' , #%n%d%n',
SALARY Double(12,2) field_format=' ; %n%f%n' SALARY Double(12,2) not null field_format=' ; %n%f%n'
) Engine=CONNECT table_type=FMT file_name='funny.txt'; ) Engine=CONNECT table_type=FMT file_name='funny.txt';
SELECT * FROM t1; SELECT * FROM t1;
DROP TABLE t1; DROP TABLE t1;
...@@ -53,10 +53,10 @@ DROP TABLE t1; ...@@ -53,10 +53,10 @@ DROP TABLE t1;
# #
CREATE TABLE t1 CREATE TABLE t1
( (
ID Integer(5) field_format=' %n%d%n', ID Integer(5) not null field_format=' %n%d%n',
NAME Char(16) field_format=" , '%n%[^']%n'", NAME Char(16) not null field_format=" , '%n%[^']%n'",
DEPNO Integer(4) field_format=' , #%n%d%n', DEPNO Integer(4) not null field_format=' , #%n%d%n',
SALARY Double(12,2) field_format=' ; %n%f%n' SALARY Double(12,2) not null field_format=' ; %n%f%n'
) Engine=CONNECT table_type=FMT file_name='funny2.txt'; ) Engine=CONNECT table_type=FMT file_name='funny2.txt';
--error ER_GET_ERRMSG --error ER_GET_ERRMSG
SELECT * FROM t1; SELECT * FROM t1;
...@@ -64,10 +64,10 @@ DROP TABLE t1; ...@@ -64,10 +64,10 @@ DROP TABLE t1;
CREATE TABLE t1 CREATE TABLE t1
( (
ID Integer(5) field_format=' %n%d%n', ID Integer(5) not null field_format=' %n%d%n',
NAME Char(16) field_format=' , ''%n%[^'']%m', NAME Char(16) not null field_format=' , ''%n%[^'']%m',
DEPNO Integer(4) field_format=''' , #%n%d%m', DEPNO Integer(4) not null field_format=''' , #%n%d%m',
SALARY Double(12,2) field_format=' ; %n%f%n' SALARY Double(12,2) not null field_format=' ; %n%f%n'
) Engine=CONNECT table_type=FMT file_name='funny2.txt'; ) Engine=CONNECT table_type=FMT file_name='funny2.txt';
SELECT * FROM t1; SELECT * FROM t1;
--error ER_GET_ERRMSG --error ER_GET_ERRMSG
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
--echo # Testing features not specific to any TABLE_TYPE --echo # Testing features not specific to any TABLE_TYPE
--echo # --echo #
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=NON_EXISTING; CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=NON_EXISTING;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
DROP TABLE t1; DROP TABLE t1;
#CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='t1.txt'; #CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='t1.txt';
#INSERT INTO t1 VALUES (10); #INSERT INTO t1 VALUES (10);
#SELECT * FROM t1; #SELECT * FROM t1;
#--error ER_GET_ERRMSG #--error ER_GET_ERRMSG
......
...@@ -20,7 +20,7 @@ CREATE TABLE t1 ...@@ -20,7 +20,7 @@ CREATE TABLE t1
net DOUBLE(8,2) NOT NULL, net DOUBLE(8,2) NOT NULL,
service INT(2) NOT NULL, service INT(2) NOT NULL,
sitmat CHAR(1) NOT NULL, sitmat CHAR(1) NOT NULL,
formation CHAR(5), formation CHAR(5) NOT NULL,
INDEX NP(nom,prenom) INDEX NP(nom,prenom)
) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='emp.txt' ENDING=2; ) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='emp.txt' ENDING=2;
SELECT * FROM t1 LIMIT 10; SELECT * FROM t1 LIMIT 10;
......
let $MYSQLD_DATADIR= `select @@datadir`; let $MYSQLD_DATADIR= `select @@datadir`;
CREATE TABLE dir1 ( CREATE TABLE dir1 (
spath VARCHAR(256) flag=1, spath VARCHAR(256) NOT NULL flag=1,
fname VARCHAR(256), fname VARCHAR(256) NOT NULL,
ftype CHAR(4), ftype CHAR(4) NOT NULL,
size DOUBLE(12,0) flag=5 size DOUBLE(12,0) NOT NULL flag=5
) ENGINE=CONNECT TABLE_TYPE=DIR FILE_NAME='*vec*'; ) ENGINE=CONNECT TABLE_TYPE=DIR FILE_NAME='*vec*';
CREATE TABLE t1 CREATE TABLE t1
( (
a INT, a INT NOT NULL,
b CHAR(10) b CHAR(10) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=VEC FILE_NAME='t1vec'; ) ENGINE=CONNECT TABLE_TYPE=VEC FILE_NAME='t1vec';
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
# Testing SELECT on empty file # Testing SELECT on empty file
...@@ -30,8 +30,8 @@ DROP TABLE t1; ...@@ -30,8 +30,8 @@ DROP TABLE t1;
CREATE TABLE t1 CREATE TABLE t1
( (
a INT, a INT NOT NULL,
b CHAR(10) b CHAR(10) NOT NULL
) ENGINE=CONNECT TABLE_TYPE=VEC FILE_NAME='t1vec' MAX_ROWS=10; ) ENGINE=CONNECT TABLE_TYPE=VEC FILE_NAME='t1vec' MAX_ROWS=10;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
# Testing SELECTs on empty file # Testing SELECTs on empty file
......
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