Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
4 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
tests/queries/0_stateless/02771_log_faminy_truncate_count.reference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
0 | ||
0 |
26 changes: 26 additions & 0 deletions
26
tests/queries/0_stateless/02771_log_faminy_truncate_count.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
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; |