mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 11:01:52 +01:00
70e92c855e
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/general.result mysql-test/suite/connect/r/ini.result mysql-test/suite/connect/r/vec.result mysql-test/suite/connect/t/dbf.test mysql-test/suite/connect/t/dir.test mysql-test/suite/connect/t/general.test
102 lines
3.4 KiB
Text
102 lines
3.4 KiB
Text
#
|
|
# Testing errors
|
|
#
|
|
CREATE TABLE t1
|
|
(
|
|
ID INT
|
|
) Engine=CONNECT TABLE_TYPE=BIN FILE_NAME='nonexistent.txt';
|
|
SELECT * FROM t1;
|
|
ID
|
|
Warnings:
|
|
Warning 1105 Open(rb) error 2 on DATADIR/test/nonexistent.txt: No such file or directory
|
|
DROP TABLE t1;
|
|
CREATE TABLE t1
|
|
(
|
|
fig INT(4) NOT NULL FIELD_FORMAT='C',
|
|
name CHAR(10) not null,
|
|
birth DATE NOT NULL,
|
|
id CHAR(5) NOT NULL FIELD_FORMAT='S',
|
|
salary DOUBLE(9,2) NOT NULL DEFAULT 0.00 FIELD_FORMAT='F',
|
|
dept INT(4) NOT NULL FIELD_FORMAT='S'
|
|
) ENGINE=CONNECT TABLE_TYPE=BIN BLOCK_SIZE=5 FILE_NAME='Testbal.dat';
|
|
SELECT * FROM t1;
|
|
fig name birth id salary dept
|
|
5500 ARCHIBALD 1980-01-25 3789 4380.50 318
|
|
123 OLIVER 1953-08-10 23456 3400.68 2158
|
|
3123 FOO 2002-07-23 888 0.00 318
|
|
INSERT INTO t1 VALUES (55555,'RONALD','1980-02-26','3333',4444.44,555);
|
|
ERROR HY000: Got error 122 'Value too long for field fig (5 --> 4)' from CONNECT
|
|
INSERT INTO t1 VALUES (5555,'RONALD','1980-02-26','3333',4444.44,555);
|
|
SELECT * FROM t1;
|
|
fig name birth id salary dept
|
|
5500 ARCHIBALD 1980-01-25 3789 4380.50 318
|
|
123 OLIVER 1953-08-10 23456 3400.68 2158
|
|
3123 FOO 2002-07-23 888 0.00 318
|
|
5555 RONALD 1980-02-26 3333 4444.44 555
|
|
DROP TABLE t1;
|
|
#
|
|
# Testing READONLY tables
|
|
#
|
|
CREATE TABLE t1
|
|
(
|
|
fig INT(4) NOT NULL FIELD_FORMAT='C',
|
|
name CHAR(10) not null,
|
|
birth DATE NOT NULL,
|
|
id CHAR(5) NOT NULL FIELD_FORMAT='S',
|
|
salary DOUBLE(9,2) NOT NULL DEFAULT 0.00 FIELD_FORMAT='F',
|
|
dept INT(4) NOT NULL FIELD_FORMAT='S'
|
|
) ENGINE=CONNECT TABLE_TYPE=BIN READONLY=Yes FILE_NAME='Testbal.dat';
|
|
INSERT INTO t1 VALUES (7777,'BILL','1973-06-30',4444,5555.555,777);
|
|
ERROR HY000: Got error 174 'Cannot modify this read/only protected table' from CONNECT
|
|
ALTER TABLE t1 READONLY=NO;
|
|
Warnings:
|
|
Warning 1105 The current version of CONNECT did not check what you changed in ALTER. Use on your own risk
|
|
SHOW CREATE TABLE t1;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`fig` int(4) NOT NULL `FIELD_FORMAT`='C',
|
|
`name` char(10) NOT NULL,
|
|
`birth` date NOT NULL,
|
|
`id` char(5) NOT NULL `FIELD_FORMAT`='S',
|
|
`salary` double(9,2) NOT NULL DEFAULT '0.00' `FIELD_FORMAT`='F',
|
|
`dept` int(4) NOT NULL `FIELD_FORMAT`='S'
|
|
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=BIN `FILE_NAME`='Testbal.dat' `READONLY`=NO
|
|
INSERT INTO t1 VALUES (7777,'BILL','1973-06-30',4444,5555.555,777);
|
|
SELECT * FROM t1;
|
|
fig name birth id salary dept
|
|
5500 ARCHIBALD 1980-01-25 3789 4380.50 318
|
|
123 OLIVER 1953-08-10 23456 3400.68 2158
|
|
3123 FOO 2002-07-23 888 0.00 318
|
|
5555 RONALD 1980-02-26 3333 4444.44 555
|
|
7777 BILL 1973-06-30 4444 5555.56 777
|
|
ALTER TABLE t1 READONLY=YES;
|
|
Warnings:
|
|
Warning 1105 The current version of CONNECT did not check what you changed in ALTER. Use on your own risk
|
|
SHOW CREATE TABLE t1;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`fig` int(4) NOT NULL `FIELD_FORMAT`='C',
|
|
`name` char(10) NOT NULL,
|
|
`birth` date NOT NULL,
|
|
`id` char(5) NOT NULL `FIELD_FORMAT`='S',
|
|
`salary` double(9,2) NOT NULL DEFAULT '0.00' `FIELD_FORMAT`='F',
|
|
`dept` int(4) NOT NULL `FIELD_FORMAT`='S'
|
|
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=BIN `FILE_NAME`='Testbal.dat' `READONLY`=YES
|
|
INSERT INTO t1 VALUES (7777,'BILL','1973-06-30',4444,5555.555,777);
|
|
ERROR HY000: Got error 174 'Cannot modify this read/only protected table' from CONNECT
|
|
DROP TABLE t1;
|
|
#
|
|
# Testing that the underlying file is created
|
|
#
|
|
CREATE TABLE t1
|
|
(
|
|
c CHAR(4) NOT NULL FIELD_FORMAT='C'
|
|
) ENGINE=CONNECT TABLE_TYPE=BIN FILE_NAME='bin2.dat';
|
|
INSERT INTO t1 VALUES (10),(20),(300),(4000);
|
|
SELECT * FROM t1;
|
|
c
|
|
10
|
|
20
|
|
300
|
|
4000
|
|
DROP TABLE t1;
|