mirror of
https://github.com/silverstripe/silverstripe-mssql
synced 2024-10-22 08:05:53 +02:00
MSSQL enabled for GW metlink
This commit is contained in:
parent
5b5f43f905
commit
8b6e13a823
@ -471,7 +471,7 @@ class MSSQLDatabase extends Database {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function getIndexSqlDefinition($tableName, $indexName, $indexSpec) {
|
protected function getIndexSqlDefinition($tableName, $indexName, $indexSpec) {
|
||||||
|
|
||||||
if(!is_array($indexSpec)){
|
if(!is_array($indexSpec)){
|
||||||
$indexSpec=trim($indexSpec, '()');
|
$indexSpec=trim($indexSpec, '()');
|
||||||
$bits=explode(',', $indexSpec);
|
$bits=explode(',', $indexSpec);
|
||||||
@ -547,7 +547,7 @@ class MSSQLDatabase extends Database {
|
|||||||
|
|
||||||
|
|
||||||
foreach($indexes as $index) {
|
foreach($indexes as $index) {
|
||||||
|
|
||||||
//Check for uniques:
|
//Check for uniques:
|
||||||
if(strpos($index['index_description'], 'unique')!==false)
|
if(strpos($index['index_description'], 'unique')!==false)
|
||||||
$prefix='unique ';
|
$prefix='unique ';
|
||||||
@ -965,11 +965,12 @@ class MSSQLDatabase extends Database {
|
|||||||
$tables[]="SELECT ID, '{$row['TABLE_NAME']}' AS Source FROM \"{$row['TABLE_NAME']}\" WHERE CONTAINS(\"{$row['FULLTEXT_COLUMN_NAME']}\", N'$keywords')";
|
$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!
|
//We'll do a union query on all of these tables... it's easeier!
|
||||||
$query=implode(' UNION ', $tables);
|
$query=implode(' UNION ', $tables);
|
||||||
|
|
||||||
$result=DB::query($query);
|
$result=DB::query($query);
|
||||||
|
|
||||||
$searchResults=new DataObjectSet();
|
$searchResults=new DataObjectSet();
|
||||||
foreach($result as $row){
|
foreach($result as $row){
|
||||||
$row_result=DataObject::get_by_id($row['Source'], $row['ID']);
|
$row_result=DataObject::get_by_id($row['Source'], $row['ID']);
|
||||||
|
Loading…
Reference in New Issue
Block a user