fixed typo CAPABILITY_CAST_AS_VA(R)CHAR

This commit is contained in:
Ralf Becker 2011-03-20 12:49:22 +00:00
parent c492c57e2f
commit 778d03772a
2 changed files with 6 additions and 5 deletions

View File

@ -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)
{

View File

@ -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':