From 60b6073643e8fdf33efeb98148632dbb75e4059d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Kurzeja?= Date: Fri, 9 Dec 2016 21:48:43 +0100 Subject: [PATCH] Fixes #6167 - nextval issue on master-slave PostgreSQL setup --- lib/Doctrine/ORM/Id/SequenceGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/ORM/Id/SequenceGenerator.php b/lib/Doctrine/ORM/Id/SequenceGenerator.php index a27edae90..18d238499 100644 --- a/lib/Doctrine/ORM/Id/SequenceGenerator.php +++ b/lib/Doctrine/ORM/Id/SequenceGenerator.php @@ -76,7 +76,7 @@ class SequenceGenerator extends AbstractIdGenerator implements Serializable $conn = $em->getConnection(); $sql = $conn->getDatabasePlatform()->getSequenceNextValSQL($this->_sequenceName); - $this->_nextValue = (int) $conn->fetchColumn($sql); + $this->_nextValue = (int) $conn->query($sql)->fetchColumn(0); $this->_maxValue = $this->_nextValue + $this->_allocationSize; }