MSSQL versions of MySQL commands implemented

This commit is contained in:
Geoff Munn 2009-03-29 21:28:55 +00:00
parent 8b6e13a823
commit 772fb23e22

View File

@ -347,6 +347,8 @@ class MSSQLDatabase extends Database {
/*
$this->runTableCheckCommand("VACUUM FULL \"$tableName\"");
*/
//NOTE: MSSQL does not appear to support any vacuum or optimise commands
return true;
}
@ -471,7 +473,7 @@ class MSSQLDatabase extends Database {
}
protected function getIndexSqlDefinition($tableName, $indexName, $indexSpec) {
if(!is_array($indexSpec)){
$indexSpec=trim($indexSpec, '()');
$bits=explode(',', $indexSpec);
@ -547,7 +549,7 @@ class MSSQLDatabase extends Database {
foreach($indexes as $index) {
//Check for uniques:
if(strpos($index['index_description'], 'unique')!==false)
$prefix='unique ';
@ -965,12 +967,11 @@ class MSSQLDatabase extends Database {
$tables[]="SELECT ID, '{$row['TABLE_NAME']}' AS Source FROM \"{$row['TABLE_NAME']}\" WHERE CONTAINS(\"{$row['FULLTEXT_COLUMN_NAME']}\", N'$keywords')";
}
//We'll do a union query on all of these tables... it's easeier!
$query=implode(' UNION ', $tables);
$result=DB::query($query);
$searchResults=new DataObjectSet();
foreach($result as $row){
$row_result=DataObject::get_by_id($row['Source'], $row['ID']);
@ -1013,13 +1014,11 @@ class MSSQLQuery extends Query {
}
public function __destroy() {
//mysql_free_result($this->handle);
mysql_free_result($this->handle);
}
public function seek($row) {
//return mysql_data_seek($this->handle, $row);
//This is unnecessary in postgres. You can just provide a row number with the fetch
//command.
return mssql_data_seek($this->handle, $row);
}
public function numRecords() {