Commit 1e976f42 authored by Alexander Barkov's avatar Alexander Barkov

Adding tests for SMALLINT and BIGINT for DBF.

modified:
  mysql-test/suite/connect/r/dbf.result
  mysql-test/suite/connect/t/dbf.test
parent dde8622c
...@@ -157,6 +157,38 @@ b0123456789b INT DEFAULT NULL ...@@ -157,6 +157,38 @@ b0123456789b INT DEFAULT 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=11) 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 # Testing TINYINT
# #
CREATE TABLE t1 CREATE TABLE t1
...@@ -165,6 +197,38 @@ a TINYINT DEFAULT NULL ...@@ -165,6 +197,38 @@ a TINYINT DEFAULT NULL
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
ERROR HY000: Unsupported type for column 'a' 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 # Testing VARCHAR
# #
CREATE TABLE t1 CREATE TABLE t1
......
...@@ -120,22 +120,23 @@ CREATE TABLE t1 ...@@ -120,22 +120,23 @@ CREATE TABLE t1
# #
# --echo #
# TODO: BIGINT: 'L' (logical) DBF column type is created. This is wrong. --echo # Testing BIGINT
# --echo #
#--echo # CREATE TABLE t1
#--echo # Testing BIGINT (
#--echo # a bigint DEFAULT NULL
#DROP TABLE IF EXISTS t1; ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
#CREATE TABLE t1 INSERT INTO t1 VALUES (0x7FFFFFFFFFFFFFFF);
#( INSERT INTO t1 VALUES (-0x8000000000000000);
# a bigint DEFAULT NULL SELECT * FROM t1;
#) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; --chmod 0777 $MYSQLD_DATADIR/test/t1.dbf
#INSERT INTO t1 VALUES (0x7FFFFFFFFFFFFFFF); --vertical_results
#INSERT INTO t1 VALUES (-0x8000000000000000); --replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
#SELECT * FROM t1; eval CALL dbf_header('$MYSQLD_DATADIR/test/t1.dbf');
#DROP TABLE t1; --horizontal_results
#--remove_file $MYSQLD_DATADIR/test/t1.dbf DROP TABLE t1;
--remove_file $MYSQLD_DATADIR/test/t1.dbf
# #
...@@ -155,21 +156,23 @@ CREATE TABLE t1 ...@@ -155,21 +156,23 @@ CREATE TABLE t1
#--remove_file $MYSQLD_DATADIR/test/t1.dbf #--remove_file $MYSQLD_DATADIR/test/t1.dbf
# --echo #
# TODO: SMALLINT: 'S' (unknown) DBF column type is created. --echo # Testing SMALLINT
# --echo #
#--echo # CREATE TABLE t1
#--echo # Testing SMALLINT (
#--echo # a SMALLINT DEFAULT NULL
#CREATE TABLE t1 ) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
#( INSERT INTO t1 VALUES (0x7FFF);
# a SMALLINT DEFAULT NULL INSERT INTO t1 VALUES (-0x8000);
#) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf'; SELECT * FROM t1;
#INSERT INTO t1 VALUES (0x7FFF); --chmod 0777 $MYSQLD_DATADIR/test/t1.dbf
#INSERT INTO t1 VALUES (-0x8000); --vertical_results
#SELECT * FROM t1; --replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
#DROP TABLE t1; eval CALL dbf_header('$MYSQLD_DATADIR/test/t1.dbf');
#--remove_file $MYSQLD_DATADIR/test/t1.dbf --horizontal_results
DROP TABLE t1;
--remove_file $MYSQLD_DATADIR/test/t1.dbf
--echo # --echo #
......
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