Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update utility test expectation #66

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions expected/utility.out
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ select count(*) = 0 from pg_tracing_consume_spans;

-- Force a query to start from ExecutorRun
SET plan_cache_mode='force_generic_plan';
CALL clean_spans();
EXECUTE test_prepared_one_param(200);
?column?
----------
Expand Down Expand Up @@ -324,6 +325,7 @@ SELECT query_id = :query_id from pg_tracing_peek_spans where trace_id='000000000
CALL clean_spans();
-- Test prepared statement with generic plan
SET plan_cache_mode='force_generic_plan';
CALL clean_spans();
EXECUTE test_prepared_one_param(200);
?column?
----------
Expand All @@ -335,32 +337,29 @@ SET plan_cache_mode TO DEFAULT;
select count(distinct(trace_id)) from pg_tracing_peek_spans;
count
-------
3
2
(1 row)

-- Check spans of test_prepared_one_param execution
select span_operation, parameters, lvl from peek_ordered_spans;
span_operation | parameters | lvl
---------------------------------------------------------+------------+-----
SET plan_cache_mode='force_generic_plan'; | | 1
ProcessUtility | | 2
EXECUTE test_prepared_one_param(200); | | 1
ProcessUtility | | 2
PREPARE test_prepared_one_param (integer) AS SELECT $1; | | 3
ExecutorRun | | 4
Result | | 5
SET plan_cache_mode TO DEFAULT; | | 1
ProcessUtility | | 2
(9 rows)
(7 rows)

-- Check the top span (standalone top span has trace_id=parent_id)
select span_operation, parameters, lvl from peek_ordered_spans where right(trace_id, 16) = parent_id;
span_operation | parameters | lvl
-------------------------------------------+------------+-----
SET plan_cache_mode='force_generic_plan'; | | 1
EXECUTE test_prepared_one_param(200); | | 1
SET plan_cache_mode TO DEFAULT; | | 1
(3 rows)
span_operation | parameters | lvl
---------------------------------------+------------+-----
EXECUTE test_prepared_one_param(200); | | 1
SET plan_cache_mode TO DEFAULT; | | 1
(2 rows)

CALL clean_spans();
-- Second create extension should generate an error that is captured by span
Expand Down
2 changes: 2 additions & 0 deletions sql/utility.sql
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ select count(*) = 0 from pg_tracing_consume_spans;

-- Force a query to start from ExecutorRun
SET plan_cache_mode='force_generic_plan';
CALL clean_spans();
EXECUTE test_prepared_one_param(200);
SET plan_cache_mode TO DEFAULT;

Expand Down Expand Up @@ -276,6 +277,7 @@ CALL clean_spans();

-- Test prepared statement with generic plan
SET plan_cache_mode='force_generic_plan';
CALL clean_spans();
EXECUTE test_prepared_one_param(200);
SET plan_cache_mode TO DEFAULT;

Expand Down