mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
Adding tests for SMALLINT and BIGINT for DBF.
modified: mysql-test/suite/connect/r/dbf.result mysql-test/suite/connect/t/dbf.test
This commit is contained in:
parent
dde8622c20
commit
1e976f420e
2 changed files with 98 additions and 31 deletions
|
@ -157,6 +157,38 @@ b0123456789b INT DEFAULT NULL
|
|||
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t02x11.dbf';
|
||||
ERROR HY000: DBF: Column name 'a0123456789a' is too long (max=11)
|
||||
#
|
||||
# Testing BIGINT
|
||||
#
|
||||
CREATE TABLE t1
|
||||
(
|
||||
a bigint DEFAULT NULL
|
||||
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
|
||||
INSERT INTO t1 VALUES (0x7FFFFFFFFFFFFFFF);
|
||||
INSERT INTO t1 VALUES (-0x8000000000000000);
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
9223372036854775807
|
||||
-9223372036854775808
|
||||
CALL dbf_header('MYSQLD_DATADIR/test/t1.dbf');
|
||||
-------- --------
|
||||
FileSize 108
|
||||
DBF_Version 03
|
||||
NRecords 2
|
||||
FirstRecPos 66
|
||||
RecLength 21
|
||||
TableFlags 0000
|
||||
CodePageMark 00
|
||||
--- ---
|
||||
FieldN 0
|
||||
Name a
|
||||
Type N
|
||||
Offset 0
|
||||
Length 20
|
||||
Dec 0
|
||||
Flags 00
|
||||
-------- --------
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Testing TINYINT
|
||||
#
|
||||
CREATE TABLE t1
|
||||
|
@ -165,6 +197,38 @@ a TINYINT DEFAULT NULL
|
|||
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
|
||||
ERROR HY000: Unsupported type for column 'a'
|
||||
#
|
||||
# Testing SMALLINT
|
||||
#
|
||||
CREATE TABLE t1
|
||||
(
|
||||
a SMALLINT DEFAULT NULL
|
||||
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
|
||||
INSERT INTO t1 VALUES (0x7FFF);
|
||||
INSERT INTO t1 VALUES (-0x8000);
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
32767
|
||||
-32768
|
||||
CALL dbf_header('MYSQLD_DATADIR/test/t1.dbf');
|
||||
-------- --------
|
||||
FileSize 80
|
||||
DBF_Version 03
|
||||
NRecords 2
|
||||
FirstRecPos 66
|
||||
RecLength 7
|
||||
TableFlags 0000
|
||||
CodePageMark 00
|
||||
--- ---
|
||||
FieldN 0
|
||||
Name a
|
||||
Type N
|
||||
Offset 0
|
||||
Length 6
|
||||
Dec 0
|
||||
Flags 00
|
||||
-------- --------
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Testing VARCHAR
|
||||
#
|
||||
CREATE TABLE t1
|
||||
|
|
|
@ -120,22 +120,23 @@ CREATE TABLE t1
|
|||
#
|
||||
|
||||
|
||||
#
|
||||
# TODO: BIGINT: 'L' (logical) DBF column type is created. This is wrong.
|
||||
#
|
||||
#--echo #
|
||||
#--echo # Testing BIGINT
|
||||
#--echo #
|
||||
#DROP TABLE IF EXISTS t1;
|
||||
#CREATE TABLE t1
|
||||
#(
|
||||
# a bigint DEFAULT NULL
|
||||
#) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
|
||||
#INSERT INTO t1 VALUES (0x7FFFFFFFFFFFFFFF);
|
||||
#INSERT INTO t1 VALUES (-0x8000000000000000);
|
||||
#SELECT * FROM t1;
|
||||
#DROP TABLE t1;
|
||||
#--remove_file $MYSQLD_DATADIR/test/t1.dbf
|
||||
--echo #
|
||||
--echo # Testing BIGINT
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
a bigint DEFAULT NULL
|
||||
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
|
||||
INSERT INTO t1 VALUES (0x7FFFFFFFFFFFFFFF);
|
||||
INSERT INTO t1 VALUES (-0x8000000000000000);
|
||||
SELECT * FROM t1;
|
||||
--chmod 0777 $MYSQLD_DATADIR/test/t1.dbf
|
||||
--vertical_results
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
eval CALL dbf_header('$MYSQLD_DATADIR/test/t1.dbf');
|
||||
--horizontal_results
|
||||
DROP TABLE t1;
|
||||
--remove_file $MYSQLD_DATADIR/test/t1.dbf
|
||||
|
||||
|
||||
#
|
||||
|
@ -155,21 +156,23 @@ CREATE TABLE t1
|
|||
#--remove_file $MYSQLD_DATADIR/test/t1.dbf
|
||||
|
||||
|
||||
#
|
||||
# TODO: SMALLINT: 'S' (unknown) DBF column type is created.
|
||||
#
|
||||
#--echo #
|
||||
#--echo # Testing SMALLINT
|
||||
#--echo #
|
||||
#CREATE TABLE t1
|
||||
#(
|
||||
# a SMALLINT DEFAULT NULL
|
||||
#) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
|
||||
#INSERT INTO t1 VALUES (0x7FFF);
|
||||
#INSERT INTO t1 VALUES (-0x8000);
|
||||
#SELECT * FROM t1;
|
||||
#DROP TABLE t1;
|
||||
#--remove_file $MYSQLD_DATADIR/test/t1.dbf
|
||||
--echo #
|
||||
--echo # Testing SMALLINT
|
||||
--echo #
|
||||
CREATE TABLE t1
|
||||
(
|
||||
a SMALLINT DEFAULT NULL
|
||||
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
|
||||
INSERT INTO t1 VALUES (0x7FFF);
|
||||
INSERT INTO t1 VALUES (-0x8000);
|
||||
SELECT * FROM t1;
|
||||
--chmod 0777 $MYSQLD_DATADIR/test/t1.dbf
|
||||
--vertical_results
|
||||
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
|
||||
eval CALL dbf_header('$MYSQLD_DATADIR/test/t1.dbf');
|
||||
--horizontal_results
|
||||
DROP TABLE t1;
|
||||
--remove_file $MYSQLD_DATADIR/test/t1.dbf
|
||||
|
||||
|
||||
--echo #
|
||||
|
|
Loading…
Reference in a new issue