Skip to content

Commit

Permalink
Fix re-using a multirange codec already in codec cache (#765)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaclarke authored Nov 7, 2023
1 parent d1f711b commit dc76cb6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/driver/src/codecs/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ export class CodecsRegistry {
}

case CTYPE_RANGE:
case CTYPE_MULTIRANGE:
case CTYPE_SCALAR: {
frb.discard(2);
break;
Expand Down
9 changes: 9 additions & 0 deletions packages/driver/test/client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1372,6 +1372,15 @@ if (getEdgeDBVersion().major >= 4) {
);

expect(multiRangeRes).toEqual([expected]);

// query to make sure we exercise the code path where we re-use the
// multirange codec from the last query
await client.query(
`select {
multirange := <multirange<int32>>$mr
}`,
{ mr: expected }
);
} finally {
await client.close();
}
Expand Down

0 comments on commit dc76cb6

Please sign in to comment.