|
29 | 29 | INSERT INTO foo(a) SELECT * FROM generate_series(1, 5000); |
30 | 30 | }); |
31 | 31 |
|
32 | | -note "unnamed portal: temporary file dropped under first SELECT query"; |
| 32 | +note "unnamed portal: temporary file dropped under second SELECT query"; |
33 | 33 | my $log_offset = -s $node->logfile; |
34 | 34 | $node->safe_psql( |
35 | 35 | "postgres", qq{ |
|
39 | 39 | END; |
40 | 40 | }); |
41 | 41 | ok( $node->log_contains( |
42 | | - qr/LOG:\s+temporary file: path.*\n.*\ STATEMENT:\s+SELECT a FROM foo ORDER BY a OFFSET \$1/s, |
| 42 | + qr/LOG:\s+temporary file: path.*\n.*\ STATEMENT:\s+SELECT 'unnamed portal'/s, |
43 | 43 | $log_offset), |
44 | 44 | "unnamed portal"); |
45 | 45 |
|
46 | | -note |
47 | | - "bind and implicit transaction: temporary file dropped under single query"; |
| 46 | +note "bind and implicit transaction: temporary file dropped without query"; |
48 | 47 | $log_offset = -s $node->logfile; |
49 | 48 | $node->safe_psql( |
50 | 49 | "postgres", qq{ |
51 | 50 | SELECT a FROM foo ORDER BY a OFFSET \$1 \\bind 4991 \\g |
52 | 51 | }); |
53 | | -ok( $node->log_contains( |
54 | | - qr/LOG:\s+temporary file: path.*\n.*\ STATEMENT:\s+SELECT a FROM foo ORDER BY a OFFSET \$1/s, |
55 | | - $log_offset), |
56 | | - "bind and implicit transaction"); |
| 52 | +ok( $node->log_contains(qr/LOG:\s+temporary file:/s, $log_offset), |
| 53 | + "bind and implicit transaction, temporary file removed"); |
| 54 | +ok( !$node->log_contains(qr/STATEMENT:/s, $log_offset), |
| 55 | + "bind and implicit transaction, no statement logged"); |
57 | 56 |
|
58 | | -note "named portal: temporary file dropped under first SELECT query"; |
| 57 | +note "named portal: temporary file dropped under second SELECT query"; |
59 | 58 | $node->safe_psql( |
60 | 59 | "postgres", qq{ |
61 | 60 | BEGIN; |
|
65 | 64 | END; |
66 | 65 | }); |
67 | 66 | ok( $node->log_contains( |
68 | | - qr/LOG:\s+temporary file: path.*\n.*\ STATEMENT:\s+SELECT a FROM foo ORDER BY a OFFSET \$1/s, |
| 67 | + qr/LOG:\s+temporary file: path.*\n.*\ STATEMENT:\s+SELECT 'named portal'/s, |
69 | 68 | $log_offset), |
70 | 69 | "named portal"); |
71 | 70 |
|
72 | | -note "pipelined query: temporary file dropped under first SELECT query"; |
| 71 | +note "pipelined query: temporary file dropped under second SELECT query"; |
73 | 72 | $log_offset = -s $node->logfile; |
74 | 73 | $node->safe_psql( |
75 | 74 | "postgres", qq{ |
|
79 | 78 | \\endpipeline |
80 | 79 | }); |
81 | 80 | ok( $node->log_contains( |
82 | | - qr/LOG:\s+temporary file: path.*\n.*\ STATEMENT:\s+SELECT a FROM foo ORDER BY a OFFSET \$1/s, |
| 81 | + qr/LOG:\s+temporary file: path.*\n.*\ STATEMENT:\s+SELECT 'pipelined query'/s, |
83 | 82 | $log_offset), |
84 | 83 | "pipelined query"); |
85 | 84 |
|
86 | | -note "parse and bind: temporary file dropped under SELECT query"; |
| 85 | +note "parse and bind: temporary file dropped without query"; |
87 | 86 | $log_offset = -s $node->logfile; |
88 | 87 | $node->safe_psql( |
89 | 88 | "postgres", qq{ |
90 | 89 | SELECT a, a, a FROM foo ORDER BY a OFFSET \$1 \\parse p1 |
91 | 90 | \\bind_named p1 4993 \\g |
92 | 91 | }); |
93 | | -ok( $node->log_contains( |
94 | | - qr/LOG:\s+temporary file: path.*\n.*\ STATEMENT:\s+SELECT a, a, a FROM foo ORDER BY a OFFSET \$1/s, |
95 | | - $log_offset), |
96 | | - "parse and bind"); |
| 92 | +ok($node->log_contains(qr/LOG:\s+temporary file:/s, $log_offset), |
| 93 | + "parse and bind, temporary file removed"); |
| 94 | +ok(!$node->log_contains(qr/STATEMENT:/s, $log_offset), |
| 95 | + "bind and bind, no statement logged"); |
97 | 96 |
|
98 | 97 | note "simple query: temporary file dropped under SELECT query"; |
99 | 98 | $log_offset = -s $node->logfile; |
|
0 commit comments