From d2af4afc667eebe22fdbb32b8c413f6d7c9e21db Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 13 Aug 2015 12:51:16 +0000 Subject: [PATCH] * PostgreSQL/Filemanager: fix SQL error while downloading files with long name (probably other cases too) --- phpgwapi/inc/class.egw_db.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.egw_db.inc.php b/phpgwapi/inc/class.egw_db.inc.php index 3fff1519ed..63e239ce7a 100644 --- a/phpgwapi/inc/class.egw_db.inc.php +++ b/phpgwapi/inc/class.egw_db.inc.php @@ -787,6 +787,7 @@ class egw_db "\n$this->Error ($this->Errno)". ($inputarr ? "\nParameters: '".implode("','",$inputarr)."'":''), $this->Errno); } + elseif(empty($this->Query_ID->sql)) $this->Query_ID->sql = $Query_String; return $this->Query_ID; } @@ -1650,7 +1651,7 @@ class egw_db if ($truncate_varchar) { - $maxlength = $column_definitions[$col]['type'] == 'varchar' ? $column_definitions[$col]['precision'] : null; + $maxlength = in_array($column_definitions[$col]['type'], array('varchar','ascii')) ? $column_definitions[$col]['precision'] : null; } // dont use IN ( ), if there's only one value, it's slower for MySQL if (is_array($data) && count($data) == 1)