-
Notifications
You must be signed in to change notification settings - Fork 759
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: reset context progress value after compact hook
- Loading branch information
1 parent
61b4af4
commit 9541020
Showing
4 changed files
with
44 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
4 changes: 4 additions & 0 deletions
4
tests/suites/0_stateless/20+_others/20_0015_compact_hook_stas_issue_13947.result
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,4 @@ | ||
expects .stats.write_progress.rows be 2 | ||
expects .error be null | ||
2 | ||
null |
30 changes: 30 additions & 0 deletions
30
tests/suites/0_stateless/20+_others/20_0015_compact_hook_stas_issue_13947.sh
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,30 @@ | ||
#!/usr/bin/env bash | ||
|
||
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) | ||
. "$CURDIR"/../../../shell_env.sh | ||
|
||
# set up | ||
cat <<EOF | $BENDSQL_CLIENT_CONNECT | ||
create database i13947; | ||
use i13947; | ||
create stage test_stage; | ||
create table tmp(id int); | ||
insert into tmp values(1); | ||
insert into tmp values(2); | ||
copy into @test_stage from (select * from tmp); | ||
EOF | ||
|
||
|
||
# It is not convenient to extract the .stats.write_progress.rows from the output of bendsql, | ||
# thus, curl is used. To prevent the immature result returned by curl(which will not poll the result until the query is finished), | ||
# pagination.wait_time_secs is set to 6 seconds. | ||
|
||
# since 2 rows will be copied into tmp table from stage | ||
echo "expects .stats.write_progress.rows be 2" | ||
echo "expects .error be null" | ||
curl -s -u root: -XPOST "http://localhost:8000/v1/query" \ | ||
--header 'Content-Type: application/json' \ | ||
-d '{"sql": "copy into i13947.tmp from (select * from @test_stage)", "pagination": { "wait_time_secs": 6}}' \ | ||
| jq -r '.stats.write_progress.rows, .error' | ||
|
||
echo "DROP database i13947;" | $BENDSQL_CLIENT_CONNECT |