some more db-capabilities:

- like_on_text (boolean)
- order_on_text (boolean or string for sprintf)
This commit is contained in:
Ralf Becker 2005-11-11 23:08:49 +00:00
parent 0be34d315b
commit f7ebba2e44

View File

@ -124,9 +124,11 @@
* @var array $capabilities, defaults will be changed be method set_capabilities($ado_driver,$db_version) * @var array $capabilities, defaults will be changed be method set_capabilities($ado_driver,$db_version)
*/ */
var $capabilities = array( 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 '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 var $prepared_sql = array(); // sql is the index
@ -328,16 +330,19 @@
{ {
case 'mysql': case 'mysql':
case 'mysqli': case 'mysqli':
$this->capabilities['sub_queries'] = $db_version >= 4.1; $this->capabilities['sub_queries'] = (float) $db_version >= 4.1;
break; break;
case 'mssql': case 'mssql':
$this->capabilities['distinct_on_text'] = false; $this->capabilities['distinct_on_text'] = false;
$this->capabilities['order_on_text'] = 'CAST (%s AS varchar)';
break; break;
case 'maxdb': // if Lim ever changes it to maxdb ;-) case 'maxdb': // if Lim ever changes it to maxdb ;-)
case 'sapdb': case 'sapdb':
$this->capabilities['distinct_on_text'] = false; $this->capabilities['distinct_on_text'] = false;
$this->capabilities['like_on_text'] = (float) $db_version >= 7.6;
$this->capabilities['order_on_text'] = false;
break; break;
} }
//echo "db::set_capabilities('$adodb_driver',$db_version)"; _debug_array($this->capabilities); //echo "db::set_capabilities('$adodb_driver',$db_version)"; _debug_array($this->capabilities);