-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql/copy: use the proper interface for internal queries
Sicne these internal queries are executed in order to run a user-initiated command, it should use the planner's internal executor rather than making a new one from the InternalDB. This doesn't matter on this branch apart from code hygiene, but in 24.1, this could cause test-only assertions to fail. Specifically, the check that makes sure internally generated queries use SERIALIZABLE would incorrectly catch these queries executed on behalf of COPY. This also removes an outdated comment on the isql.Rows interface. This comment is no longer true ever since 0316935 was merged. Release note: None
- Loading branch information
Showing
5 changed files
with
32 additions
and
5 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
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,27 @@ | ||
# Verify that the default transaction isolation level is applied to the | ||
# internal queries issued by the COPY command. | ||
exec-ddl | ||
SET default_transaction_isolation = 'read committed' | ||
---- | ||
|
||
copy-to | ||
COPY (SELECT current_setting('transaction_isolation')) TO STDOUT | ||
---- | ||
read committed | ||
|
||
copy-to | ||
COPY (SELECT 1, 2, 3) TO STDOUT | ||
---- | ||
1 2 3 | ||
|
||
copy-to | ||
COPY ( | ||
SELECT repeat('a' || i::STRING, 5), repeat('b' || i::STRING, 5) | ||
FROM ROWS FROM (generate_series(1, 5)) AS i | ||
) TO STDOUT; | ||
---- | ||
a1a1a1a1a1 b1b1b1b1b1 | ||
a2a2a2a2a2 b2b2b2b2b2 | ||
a3a3a3a3a3 b3b3b3b3b3 | ||
a4a4a4a4a4 b4b4b4b4b4 | ||
a5a5a5a5a5 b5b5b5b5b5 |
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