From 778d03772ae4f373daf645310b141d2d6988439e Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 20 Mar 2011 12:49:22 +0000 Subject: [PATCH] fixed typo CAPABILITY_CAST_AS_VA(R)CHAR --- etemplate/inc/class.so_sql.inc.php | 2 +- phpgwapi/inc/class.egw_db.inc.php | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/etemplate/inc/class.so_sql.inc.php b/etemplate/inc/class.so_sql.inc.php index 3bf047df1b..8ac2f5b160 100644 --- a/etemplate/inc/class.so_sql.inc.php +++ b/etemplate/inc/class.so_sql.inc.php @@ -1096,7 +1096,7 @@ class so_sql $numeric_columns[] = $col; continue; } - $columns[] = sprintf($this->db->capabilities[egw_db::CAPABILITY_CAST_AS_VACHAR],"COALESCE($col,'')"); + $columns[] = sprintf($this->db->capabilities[egw_db::CAPABILITY_CAST_AS_VARCHAR],"COALESCE($col,'')"); } if($columns) { diff --git a/phpgwapi/inc/class.egw_db.inc.php b/phpgwapi/inc/class.egw_db.inc.php index b3803b4e34..bfc34e42e3 100644 --- a/phpgwapi/inc/class.egw_db.inc.php +++ b/phpgwapi/inc/class.egw_db.inc.php @@ -227,9 +227,9 @@ class egw_db * * MySQL requires to use CAST(%s AS char)! * - * Use as: $sql = sprintf($GLOBALS['egw']->db->capabilities[egw_db::CAPABILITY_CAST_AS_VACHAR],$expression); + * Use as: $sql = sprintf($GLOBALS['egw']->db->capabilities[egw_db::CAPABILITY_CAST_AS_VARCHAR],$expression); */ - const CAPABILITY_CAST_AS_VACHAR = 'cast_as_varchar'; + const CAPABILITY_CAST_AS_VARCHAR = 'cast_as_varchar'; /** * default capabilities will be changed by method set_capabilities($ado_driver,$db_version) * @@ -248,7 +248,7 @@ class egw_db self::CAPABILITY_CLIENT_ENCODING => false, self::CAPABILITY_CASE_INSENSITIV_LIKE => 'LIKE', self::CAPABILITY_REQUIRE_TRUNCATE_VARCHAR => false, - self::CAPABILITY_CAST_AS_VACHAR => 'CAST(%s AS varchar)', + self::CAPABILITY_CAST_AS_VARCHAR => 'CAST(%s AS varchar)', ); var $prepared_sql = array(); // sql is the index @@ -357,6 +357,7 @@ class egw_db switch($this->Type) // convert to ADO db-type-names { case 'pgsql': +$this->query_log = '/tmp/pgsql-query.log'; $type = 'postgres'; // name in ADOdb // create our own pgsql connection-string, to allow unix domain soccets if !$Host $Host = "dbname=$this->Database".($this->Host ? " host=$this->Host".($this->Port ? " port=$this->Port" : '') : ''). @@ -507,7 +508,7 @@ class egw_db $this->capabilities[self::CAPABILITY_UNION] = (float) $db_version >= 4.0; $this->capabilities[self::CAPABILITY_NAME_CASE] = 'preserv'; $this->capabilities[self::CAPABILITY_CLIENT_ENCODING] = (float) $db_version >= 4.1; - $this->capabilities[self::CAPABILITY_CAST_AS_VACHAR] = 'CAST(%s AS char)'; + $this->capabilities[self::CAPABILITY_CAST_AS_VARCHAR] = 'CAST(%s AS char)'; break; case 'postgres':