mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-08-22 11:23:26 +02:00
31 lines
798 B
MySQL
31 lines
798 B
MySQL
|
--
|
||
|
-- Cursors
|
||
|
--
|
||
|
|
||
|
-- These tests require track_utility to be enabled.
|
||
|
SET pg_stat_statements.track_utility = TRUE;
|
||
|
SELECT pg_stat_statements_reset();
|
||
|
|
||
|
-- DECLARE
|
||
|
-- SELECT is normalized.
|
||
|
DECLARE cursor_stats_1 CURSOR WITH HOLD FOR SELECT 1;
|
||
|
CLOSE cursor_stats_1;
|
||
|
DECLARE cursor_stats_1 CURSOR WITH HOLD FOR SELECT 2;
|
||
|
CLOSE cursor_stats_1;
|
||
|
|
||
|
SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C";
|
||
|
SELECT pg_stat_statements_reset();
|
||
|
|
||
|
-- FETCH
|
||
|
BEGIN;
|
||
|
DECLARE cursor_stats_1 CURSOR WITH HOLD FOR SELECT 2;
|
||
|
DECLARE cursor_stats_2 CURSOR WITH HOLD FOR SELECT 3;
|
||
|
FETCH 1 IN cursor_stats_1;
|
||
|
FETCH 1 IN cursor_stats_2;
|
||
|
CLOSE cursor_stats_1;
|
||
|
CLOSE cursor_stats_2;
|
||
|
COMMIT;
|
||
|
|
||
|
SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C";
|
||
|
SELECT pg_stat_statements_reset();
|