Commit 2e3c194
committed
Simplify SortTocFromFile() by removing fixed buffer-size limit.
pg_restore previously coped with overlength TOC-file lines using some
complicated logic to ignore additional bufferloads. While this isn't
wrong, since we don't expect that the interesting part of a line would
run to more than a dozen or so bytes, it's more complex than it needs
to be. Use a StringInfo instead of a fixed-size buffer so that we can
process long lines as single entities and thus not need the extra
logic.
Daniel Gustafsson
Discussion: https://postgr.es/m/48A4FA71-524E-41B9-953A-FD04EF36E2E7@yesql.se1 parent c0cb87f commit 2e3c194
1 file changed
+16
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| |||
1367 | 1369 | | |
1368 | 1370 | | |
1369 | 1371 | | |
1370 | | - | |
1371 | | - | |
| 1372 | + | |
1372 | 1373 | | |
1373 | 1374 | | |
1374 | 1375 | | |
| |||
1378 | 1379 | | |
1379 | 1380 | | |
1380 | 1381 | | |
1381 | | - | |
1382 | | - | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
1383 | 1385 | | |
1384 | | - | |
1385 | | - | |
1386 | 1386 | | |
1387 | 1387 | | |
1388 | 1388 | | |
1389 | 1389 | | |
1390 | 1390 | | |
1391 | | - | |
1392 | | - | |
1393 | | - | |
1394 | | - | |
1395 | | - | |
1396 | | - | |
1397 | | - | |
1398 | | - | |
1399 | | - | |
1400 | | - | |
1401 | | - | |
1402 | | - | |
1403 | | - | |
1404 | | - | |
1405 | 1391 | | |
1406 | | - | |
| 1392 | + | |
1407 | 1393 | | |
| 1394 | + | |
1408 | 1395 | | |
| 1396 | + | |
| 1397 | + | |
1409 | 1398 | | |
1410 | 1399 | | |
1411 | | - | |
| 1400 | + | |
1412 | 1401 | | |
1413 | 1402 | | |
1414 | 1403 | | |
1415 | | - | |
1416 | | - | |
| 1404 | + | |
| 1405 | + | |
1417 | 1406 | | |
1418 | 1407 | | |
1419 | | - | |
| 1408 | + | |
1420 | 1409 | | |
1421 | 1410 | | |
1422 | 1411 | | |
| |||
1443 | 1432 | | |
1444 | 1433 | | |
1445 | 1434 | | |
| 1435 | + | |
| 1436 | + | |
1446 | 1437 | | |
1447 | 1438 | | |
1448 | 1439 | | |
| |||
0 commit comments