ClickHouse/tests/queries/0_stateless/02771_log_faminy_truncate_count.sql
flynn ad74189bc2
Fix Log family table return wrong rows count after truncate (#50585)
* Fix Log family table return wrong rows count after truncate

* fix test

* update test

* update test
2023-06-09 14:32:45 +03:00

27 lines
582 B
SQL

DROP TABLE IF EXISTS test_log;
CREATE TABLE test_log
(
`crypto_name` String,
`trade_date` Date
)
ENGINE = Log;
INSERT INTO test_log (crypto_name, trade_date) VALUES ('abc', '2021-01-01'), ('def', '2022-02-02');
TRUNCATE TABLE test_log;
SELECT count() FROM test_log;
DROP TABLE IF EXISTS test_log;
CREATE TABLE test_log
(
`crypto_name` String,
`trade_date` Date
)
ENGINE = StripeLog;
INSERT INTO test_log (crypto_name, trade_date) VALUES ('abc', '2021-01-01'), ('def', '2022-02-02');
TRUNCATE TABLE test_log;
SELECT count() FROM test_log;
DROP TABLE test_log;