Commit 3ce6d75
committed
Add failing test: batch scan corrupted in cache_statement mode
sendBatchExtendedWithDescription passes eqb.ResultFormats to
SendQueryStatement by reference. The next Build call reuses the backing
array (reset sets len=0, append overwrites), corrupting the stored format
codes for earlier queries. The server sends binary data (Bind was encoded
correctly), but the local scan plan uses the corrupted text format code.
Introduced in v5.9.0 by c3a1750 ("pgx batch uses SendQueryStatement"),
part of "Skip Describe Portal for cached prepared statements reducing
network round trips". The previous SendQueryPrepared path sent Describe
Portal, so the server's RowDescription provided correct format codes
regardless of the stored slice contents.
Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>1 parent b4d8e62 commit 3ce6d75
1 file changed
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1267 | 1267 | | |
1268 | 1268 | | |
1269 | 1269 | | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
0 commit comments