- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit5070349
committed
libpq: Handle NegotiateProtocolVersion message differently
Previously libpq would always error out if the server sends aNegotiateProtocolVersion message. This was fine because libpq onlysupported a single protocol version and did not support any protocolparameters. But in the upcoming commits, we will introduce a newprotocol version and the NegotiateProtocolVersion message starts toactually be used.This patch modifies the client side checks to allow a range ofsupported protocol versions, instead of only allowing the exactversion that was requested. Currently this "range" only contains the3.0 version, but in a future commit we'll change this.Also clarify the error messages, making them suitable for the worldwhere libpq will support multiple protocol versions and protocolextensions.Note that until the later commits that introduce new protocol version,this change does not have any behavioural effect, because libpq willonly request version 3.0 and will never send protocol parameters, andtherefore will never receive a NegotiateProtocolVersion message fromthe server.Author: Jelte Fennema-Nio <postgres@jeltef.nl>Reviewed-by: Robert Haas <robertmhaas@gmail.com> (earlier versions)Discussion:https://www.postgresql.org/message-id/CAGECzQTfc_O%2BHXqAo5_-xG4r3EFVsTefUeQzSvhEyyLDba-O9w@mail.gmail.comDiscussion:https://www.postgresql.org/message-id/CAGECzQRbAGqJnnJJxTdKewTsNOovUt4bsx3NFfofz3m2j-t7tA@mail.gmail.com1 parent748e98d commit5070349
File tree
3 files changed
+71
-35
lines changed- src/interfaces/libpq
3 files changed
+71
-35
lines changedLines changed: 11 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
667 | 667 |
| |
668 | 668 |
| |
669 | 669 |
| |
| 670 | + | |
670 | 671 |
| |
671 | 672 |
| |
672 | 673 |
| |
| |||
4084 | 4085 |
| |
4085 | 4086 |
| |
4086 | 4087 |
| |
| 4088 | + | |
4087 | 4089 |
| |
4088 | 4090 |
| |
| 4091 | + | |
| 4092 | + | |
| 4093 | + | |
| 4094 | + | |
| 4095 | + | |
4089 | 4096 |
| |
4090 | 4097 |
| |
4091 |
| - | |
| 4098 | + | |
4092 | 4099 |
| |
4093 | 4100 |
| |
| 4101 | + | |
| 4102 | + | |
4094 | 4103 |
| |
4095 | 4104 |
| |
4096 |
| - | |
| 4105 | + | |
4097 | 4106 |
| |
4098 | 4107 |
| |
4099 | 4108 |
| |
|
Lines changed: 58 additions & 33 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
870 | 870 |
| |
871 | 871 |
| |
872 | 872 |
| |
| 873 | + | |
873 | 874 |
| |
874 | 875 |
| |
875 | 876 |
| |
| |||
1399 | 1400 |
| |
1400 | 1401 |
| |
1401 | 1402 |
| |
1402 |
| - | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
1403 | 1406 |
| |
1404 | 1407 |
| |
1405 |
| - | |
| 1408 | + | |
1406 | 1409 |
| |
1407 | 1410 |
| |
1408 | 1411 |
| |
1409 | 1412 |
| |
1410 |
| - | |
1411 |
| - | |
| 1413 | + | |
1412 | 1414 |
| |
1413 |
| - | |
1414 | 1415 |
| |
1415 |
| - | |
1416 |
| - | |
1417 |
| - | |
| 1416 | + | |
| 1417 | + | |
1418 | 1418 |
| |
1419 | 1419 |
| |
1420 |
| - | |
| 1420 | + | |
1421 | 1421 |
| |
1422 |
| - | |
1423 |
| - | |
| 1422 | + | |
| 1423 | + | |
1424 | 1424 |
| |
1425 |
| - | |
1426 |
| - | |
1427 |
| - | |
1428 |
| - | |
1429 |
| - | |
1430 |
| - | |
1431 |
| - | |
1432 |
| - | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
1433 | 1433 |
| |
1434 | 1434 |
| |
1435 |
| - | |
1436 |
| - | |
1437 |
| - | |
1438 |
| - | |
1439 |
| - | |
| 1435 | + | |
1440 | 1436 |
| |
1441 |
| - | |
1442 |
| - | |
1443 |
| - | |
1444 |
| - | |
1445 |
| - | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
1446 | 1445 |
| |
1447 | 1446 |
| |
1448 |
| - | |
1449 |
| - | |
1450 |
| - | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
1451 | 1468 |
| |
1452 |
| - | |
1453 | 1469 |
| |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
1454 | 1477 |
| |
1455 | 1478 |
| |
1456 | 1479 |
| |
1457 | 1480 |
| |
1458 | 1481 |
| |
1459 | 1482 |
| |
| 1483 | + | |
1460 | 1484 |
| |
1461 | 1485 |
| |
1462 | 1486 |
| |
| |||
1486 | 1510 |
| |
1487 | 1511 |
| |
1488 | 1512 |
| |
| 1513 | + | |
1489 | 1514 |
| |
1490 | 1515 |
| |
1491 | 1516 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
496 | 496 |
| |
497 | 497 |
| |
498 | 498 |
| |
| 499 | + | |
| 500 | + | |
499 | 501 |
| |
500 | 502 |
| |
501 | 503 |
| |
|
0 commit comments
Comments
(0)