Correct file engine settings tests

This commit is contained in:
M0r64n 2021-02-18 11:36:17 +04:00
parent 75117389ec
commit adf5d24177
2 changed files with 12 additions and 10 deletions

View File

@ -13,3 +13,4 @@ SET engine_file_empty_if_not_exists=1;
SELECT * FROM file_engine_table;
SET engine_file_empty_if_not_exists=0;
DROP TABLE file_engine_table;

View File

@ -1,20 +1,21 @@
INSERT INTO TABLE FUNCTION file('01718_file/test/data.TSV', 'TSV', 'id UInt32') VALUES ('file', 42);
DROP TABLE IF EXISTS test;
INSERT INTO TABLE FUNCTION file('01718_file/test/data.TSV', 'TSV', 'id UInt32') VALUES (1);
ATTACH TABLE test FROM '01718_file/test' (id UInt8) ENGINE=File(TSV);
CREATE TABLE file_engine_table (id UInt32) ENGINE=File(TabSeparated);
INSERT INTO file_engine_table VALUES (1), (2), (3);
INSERT INTO file_engine_table VALUES (4);
SELECT * FROM file_engine_table;
INSERT INTO test VALUES (2), (3);
INSERT INTO test VALUES (4);
SELECT * FROM test;
SET engine_file_truncate_on_insert=0;
INSERT INTO file_engine_table VALUES (5), (6);
SELECT * FROM file_engine_table;
INSERT INTO test VALUES (5), (6);
SELECT * FROM test;
SET engine_file_truncate_on_insert=1;
INSERT INTO file_engine_table VALUES (0), (1), (2);
SELECT * FROM file_engine_table;
INSERT INTO test VALUES (0), (1), (2);
SELECT * FROM test;
SET engine_file_truncate_on_insert=0;
DROP TABLE test;