From: Nicolas Boisselier Date: Mon, 15 Jan 2018 16:50:40 +0000 (+0000) Subject: lib/php/db/table.php X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=3abe3c6c8875b2a9ee5504e70dcee8ab998ff2f6;p=nb.git lib/php/db/table.php --- diff --git a/lib/php/db/table.php b/lib/php/db/table.php index dc0f7c00..eb538e9f 100644 --- a/lib/php/db/table.php +++ b/lib/php/db/table.php @@ -1088,9 +1088,11 @@ Class Table extends nb { list($sql,$where,$limit,$select_count) = $this->rows_sql($opt); $st = null; $cursor = null; + $sql_orig = null; $fct = function() { return true; }; if ($this->db()->type == 'pgsql') { + $sql_orig = $sql; $this->db()->conn->beginTransaction(); $sql = "DECLARE table_rows CURSOR FOR $sql"; $cursor = $this->db()->conn->prepare($sql); @@ -1233,8 +1235,9 @@ Class Table extends nb { $this->count = $opt['count'] = $count; $this->limit = $opt['limit'] = $limit; - if ($opt['is_html'] or $format=='wp') { + if ($opt['is_html'] or $format=='wp' or !empty($cursor)) { + if (!empty($sql_orig)) $sql = $sql_orig; // // Tot //