Skip to content

Commit

Permalink
Merge branch 'main' into wasi-merge
Browse files Browse the repository at this point in the history
  • Loading branch information
pmp-p authored Nov 25, 2024
2 parents ab83a1f + ae36974 commit c3fe53e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
5 changes: 5 additions & 0 deletions .changeset/swift-news-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@electric-sql/pglite': patch
---

Fix a bug with pipelining prepared statements.
12 changes: 8 additions & 4 deletions packages/pglite/tests/exec-protocol.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,23 @@ describe('exec protocol', () => {
it('should perform an extended query', async () => {
const r1 = await db.execProtocol(serialize.parse({ text: 'SELECT $1' }))
const messageNames1 = r1.messages.map((msg) => msg.name)
expect(messageNames1).toEqual(['notice', 'parseComplete'])
expect(messageNames1).toEqual(['notice', 'parseComplete', 'readyForQuery'])

const r2 = await db.execProtocol(serialize.bind({ values: ['1'] }))
const messageNames2 = r2.messages.map((msg) => msg.name)
expect(messageNames2).toEqual(['notice', 'bindComplete'])
expect(messageNames2).toEqual(['notice', 'bindComplete', 'readyForQuery'])

const r3 = await db.execProtocol(serialize.describe({ type: 'P' }))
const messageNames3 = r3.messages.map((msg) => msg.name)
expect(messageNames3).toEqual(['rowDescription'])
expect(messageNames3).toEqual(['rowDescription', 'readyForQuery'])

const r4 = await db.execProtocol(serialize.execute({}))
const messageNames4 = r4.messages.map((msg) => msg.name)
expect(messageNames4).toEqual(['dataRow', 'commandComplete'])
expect(messageNames4).toEqual([
'dataRow',
'commandComplete',
'readyForQuery',
])

const r5 = await db.execProtocol(serialize.sync())
const messageNames5 = r5.messages.map((msg) => msg.name)
Expand Down
11 changes: 0 additions & 11 deletions patches/interactive_one.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,6 @@ static void io_init(bool in_auth, bool out_auth) {

}

/*
static void wait_unlock() {
int busy = 0;
while (access(PGS_OLOCK, F_OK) == 0) {
if (!(busy++ % 1110222))
printf("# 150: FIXME: busy wait lock removed %d\n", busy);
}
}
*/

EMSCRIPTEN_KEEPALIVE int
cma_wsize = 0;

Expand Down Expand Up @@ -637,4 +627,3 @@ printf("# 353 : node+repl is_wire/is_socket -> true : %c\n", firstchar);
}



0 comments on commit c3fe53e

Please sign in to comment.