Skip to content

Support multiple statements#2199

Merged
Hydrocharged merged 1 commit intomainfrom
daylon/issue-2175
Jan 15, 2026
Merged

Support multiple statements#2199
Hydrocharged merged 1 commit intomainfrom
daylon/issue-2175

Conversation

@Hydrocharged
Copy link
Copy Markdown
Collaborator

This allows for handling multiple statements within a single Query message. This fixes:

This also tests the contents of the messages returned, which were verified using Wireshark on a local Postgres instance as the source-of-truth.

@Hydrocharged Hydrocharged requested a review from zachmu January 14, 2026 13:45
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 14, 2026

Main PR
covering_index_scan_postgres 544.39/s 547.32/s +0.5%
index_join_postgres 125.87/s 127.24/s +1.0%
index_join_scan_postgres 184.42/s 186.40/s +1.0%
index_scan_postgres 11.21/s 11.37/s +1.4%
oltp_point_select 2244.34/s 2415.55/s +7.6%
oltp_read_only 1689.13/s 1745.71/s +3.3%
select_random_points 110.34/s 112.57/s +2.0%
select_random_ranges 435.66/s 438.86/s +0.7%
table_scan_postgres 11.18/s 11.23/s +0.4%
types_table_scan_postgres 5.16/s 5.18/s +0.3%

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 14, 2026

Main PR
Total 42090 42090
Successful 17559 17563
Failures 24531 24527
Partial Successes1 5584 5582
Main PR
Successful 41.7177% 41.7273%
Failures 58.2823% 58.2727%

${\color{red}Regressions (1)}$

copyselect

QUERY:          drop table test3;
RECEIVED ERROR: COPY DATA message received without a COPY FROM STDIN operation in progress

${\color{lightgreen}Progressions (13)}$

copyselect

QUERY: select 0; copy test3 from stdin; copy test3 from stdin; select 1;

psql

QUERY: CREATE TABLE foo(s TEXT) ;
ROLLBACK;
QUERY: DROP TABLE foo ;
ROLLBACK;
QUERY: BEGIN ;
CREATE TABLE foo(s TEXT) ;
INSERT INTO foo(s) VALUES ('hello'), ('world') ;
COMMIT;
QUERY: SELECT COUNT(*) AS "#mum"
FROM bla WHERE s = 'Mum' ;               -- no mum here
SELECT * FROM bla ORDER BY 1;

transactions

QUERY: SELECT 1; SELECT 2; SELECT 3;
QUERY: insert into i_table values(1); select * from i_table;
QUERY: begin; insert into i_table values(3); commit;
QUERY: begin; insert into i_table values(4); rollback;
QUERY: select 1; begin; insert into i_table values(5);
QUERY: select 1; begin; insert into i_table values(6);
QUERY: insert into i_table values(9); rollback; select 2;
QUERY: SELECT 1; BEGIN; SAVEPOINT sp; ROLLBACK TO SAVEPOINT sp; COMMIT;

Footnotes

  1. These are tests that we're marking as Successful, however they do not match the expected output in some way. This is due to small differences, such as different wording on the error messages, or the column names being incorrect while the data itself is correct.

Copy link
Copy Markdown
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but see comment about handling of empty queries in batches

Comment thread server/connection_handler.go
@Hydrocharged Hydrocharged merged commit 69d8a95 into main Jan 15, 2026
17 checks passed
@Hydrocharged Hydrocharged deleted the daylon/issue-2175 branch January 15, 2026 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants