Commit ead2372e authored by Alexander Barkov's avatar Alexander Barkov

Adding tests for NULL column values.

modified:
  mysql-test/suite/connect/r/dbf.result
  mysql-test/suite/connect/t/dbf.test
parent 49e3bb02
......@@ -515,5 +515,64 @@ Dec 0
Flags 00
-------- --------
DROP TABLE IF EXISTS t1;
#
# Testing NULL
#
CREATE TABLE t1
(
c1 VARCHAR(10),
c2 VARCHAR(10) DEFAULT 'def',
i1 INT,
i2 INT DEFAULT 123
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
INSERT INTO t1 VALUES ('10','10',10,10);
INSERT INTO t1 VALUES (NULL,NULL,NULL,NULL);
SELECT * FROM t1;
c1 c2 i1 i2
10 10 10 10
0 0
CALL dbf_header('MYSQLD_DATADIR/test/t1.dbf');
-------- --------
FileSize 248
DBF_Version 03
NRecords 2
FirstRecPos 162
RecLength 43
TableFlags 0000
CodePageMark 00
--- ---
FieldN 0
Name c1
Type C
Offset 0
Length 10
Dec 0
Flags 00
--- ---
FieldN 1
Name c2
Type C
Offset 0
Length 10
Dec 0
Flags 00
--- ---
FieldN 2
Name i1
Type N
Offset 0
Length 11
Dec 0
Flags 00
--- ---
FieldN 3
Name i2
Type N
Offset 0
Length 11
Dec 0
Flags 00
-------- --------
DROP TABLE IF EXISTS t1;
DROP PROCEDURE test.dbf_field;
DROP PROCEDURE test.dbf_header;
......@@ -414,5 +414,28 @@ eval CALL dbf_header('$MYSQLD_DATADIR/test/t1.dbf');
DROP TABLE IF EXISTS t1;
--remove_file $MYSQLD_DATADIR/test/t1.dbf
--echo #
--echo # Testing NULL
--echo #
# TODO: NULLs should probably change to DEFAULT and produce a warning
CREATE TABLE t1
(
c1 VARCHAR(10),
c2 VARCHAR(10) DEFAULT 'def',
i1 INT,
i2 INT DEFAULT 123
) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.dbf';
INSERT INTO t1 VALUES ('10','10',10,10);
INSERT INTO t1 VALUES (NULL,NULL,NULL,NULL);
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 IF EXISTS t1;
--remove_file $MYSQLD_DATADIR/test/t1.dbf
DROP PROCEDURE test.dbf_field;
DROP PROCEDURE test.dbf_header;
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