Commit cfced9b
libpq: Handle NegotiateProtocolVersion message differently
Previously libpq would always error when the server returns a
NegotiateProtocolVersion message. This was fine because libpq only
supported a single protocol version and did not support any protocol
parameters. But we now that we're discussing protocol changes we need to
change this behaviour, and introduce a fallback mechanism when
connecting to an older server.
This patch modifies the client side checks to allow a range of supported
protocol versions, instead of only allowing the exact version that was
requested. Currently this "range" only contains the 3.0 version, but in
a future commit we'll change this. In addition it changes the errors for
protocol to say that they error because we did not request any
parameters, not because the server did not support some of them. In a
future commit more infrastructure for protocol parameters will be added,
so that these checks can also succeed when receiving unsupported
parameters back.
Note that at the moment this change does not have any behavioural
effect, because libpq will only request version 3.0 and will never send
protocol parameters. Which means that the client never receives a
NegotiateProtocolVersion message from the server.1 parent 3a0e369 commit cfced9b
2 files changed
+43
-28
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4067 | 4067 | | |
4068 | 4068 | | |
4069 | 4069 | | |
| 4070 | + | |
| 4071 | + | |
| 4072 | + | |
| 4073 | + | |
4070 | 4074 | | |
4071 | 4075 | | |
4072 | | - | |
| 4076 | + | |
4073 | 4077 | | |
4074 | 4078 | | |
4075 | 4079 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1407 | 1407 | | |
1408 | 1408 | | |
1409 | 1409 | | |
1410 | | - | |
1411 | | - | |
| 1410 | + | |
1412 | 1411 | | |
1413 | | - | |
1414 | 1412 | | |
1415 | | - | |
| 1413 | + | |
1416 | 1414 | | |
1417 | | - | |
1418 | 1415 | | |
1419 | 1416 | | |
1420 | 1417 | | |
1421 | 1418 | | |
1422 | | - | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
1423 | 1444 | | |
1424 | 1445 | | |
1425 | 1446 | | |
1426 | 1447 | | |
1427 | | - | |
1428 | 1448 | | |
1429 | 1449 | | |
1430 | | - | |
1431 | | - | |
1432 | | - | |
1433 | | - | |
1434 | | - | |
1435 | | - | |
1436 | | - | |
1437 | | - | |
1438 | | - | |
1439 | | - | |
1440 | | - | |
1441 | | - | |
1442 | | - | |
1443 | | - | |
1444 | | - | |
1445 | | - | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
1446 | 1457 | | |
1447 | 1458 | | |
1448 | | - | |
1449 | | - | |
1450 | | - | |
| 1459 | + | |
1451 | 1460 | | |
1452 | | - | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
1453 | 1464 | | |
1454 | 1465 | | |
1455 | 1466 | | |
| |||
0 commit comments