mirror of
https://github.com/silverstripe/silverstripe-mssql
synced 2024-10-22 08:05:53 +02:00
BUGFIX MSSQLDatabase::fullTextEnabled() should check that full-text capability is installed properly instead of just checking the status of it on the database
This commit is contained in:
parent
9779e0a58b
commit
5667388908
@ -111,14 +111,19 @@ class MSSQLDatabase extends SS_Database {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether the current database as fulltext
|
* Checks whether the current SQL Server version has full-text
|
||||||
* support enabled or not by looking into the
|
* support installed and full-text is enabled for this database.
|
||||||
* system database table.
|
|
||||||
*
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
public function fullTextEnabled() {
|
public function fullTextEnabled() {
|
||||||
return (boolean) DB::query("SELECT is_fulltext_enabled FROM sys.databases WHERE name = '$this->database'")->value();
|
$isInstalled = (boolean) DB::query("SELECT fulltextserviceproperty('isfulltextinstalled')")->value();
|
||||||
|
$enabledForDb = (boolean) DB::query("
|
||||||
|
SELECT is_fulltext_enabled
|
||||||
|
FROM sys.databases
|
||||||
|
WHERE name = '$this->database'
|
||||||
|
")->value();
|
||||||
|
return $isInstalled && $enabledForDb;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user