branch: elpa/pg
commit 995f0939185c57797e4cde7789357cde16ba2068
Author: Eric Marsden <[email protected]>
Commit: Eric Marsden <[email protected]>
Read protocol version as 2 16-bit numbers instead of 1 32-bit number
---
pg.el | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/pg.el b/pg.el
index e427a46ad61..94631f9984b 100644
--- a/pg.el
+++ b/pg.el
@@ -706,10 +706,9 @@ Uses database DBNAME, user USER and password PASSWORD."
;; backend implements exactly the requested protocol version.
(?v
(let* ((_msglen (pg-read-net-int con 4))
- (protocol-supported (pg-read-net-int con 4))
- (unrec-option-count (pg-read-net-int con 4))
- (protocol-major-supported (ash protocol-supported -16))
- (protocol-minor-supported (mod protocol-supported (ash 1 16))))
+ (protocol-major-supported (pg-read-net-int con 2))
+ (protocol-minor-supported (pg-read-net-int con 2))
+ (unrec-option-count (pg-read-net-int con 4)))
(unless (eql protocol-major-supported 3)
(let ((msg (format "PostgreSQL backend supports protocol major
version %d, we only support version 3"
protocol-major-supported)))