From f7ebba2e44764d0eb92e0a5a43803a00165f625e Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 11 Nov 2005 23:08:49 +0000 Subject: [PATCH] some more db-capabilities: - like_on_text (boolean) - order_on_text (boolean or string for sprintf) --- phpgwapi/inc/class.egw_db.inc.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/phpgwapi/inc/class.egw_db.inc.php b/phpgwapi/inc/class.egw_db.inc.php index 29dc3a5073..90980ef43f 100644 --- a/phpgwapi/inc/class.egw_db.inc.php +++ b/phpgwapi/inc/class.egw_db.inc.php @@ -124,9 +124,11 @@ * @var array $capabilities, defaults will be changed be method set_capabilities($ado_driver,$db_version) */ var $capabilities = array( - 'sub_queries' => true, // will be set to false for mysql < 4.1 + 'sub_queries' => true, // will be set to false for mysql < 4.1 'distinct_on_text' => true, // is the DB able to use DISTINCT with a text or blob column - ); + 'like_on_text' => true, // is the DB able to use LIKE with text columns + 'order_on_text' => true, // is the DB able to order by a given text column, boolean or + ); // string for sprintf for a cast (eg. 'CAST(%s AS varchar)') var $prepared_sql = array(); // sql is the index @@ -328,16 +330,19 @@ { case 'mysql': case 'mysqli': - $this->capabilities['sub_queries'] = $db_version >= 4.1; + $this->capabilities['sub_queries'] = (float) $db_version >= 4.1; break; case 'mssql': $this->capabilities['distinct_on_text'] = false; + $this->capabilities['order_on_text'] = 'CAST (%s AS varchar)'; break; case 'maxdb': // if Lim ever changes it to maxdb ;-) case 'sapdb': $this->capabilities['distinct_on_text'] = false; + $this->capabilities['like_on_text'] = (float) $db_version >= 7.6; + $this->capabilities['order_on_text'] = false; break; } //echo "db::set_capabilities('$adodb_driver',$db_version)"; _debug_array($this->capabilities);