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:
Sean Harvey 2010-02-11 23:09:37 +00:00
parent 9779e0a58b
commit 5667388908

View File

@ -111,14 +111,19 @@ class MSSQLDatabase extends SS_Database {
}
/**
* Checks whether the current database as fulltext
* support enabled or not by looking into the
* system database table.
* Checks whether the current SQL Server version has full-text
* support installed and full-text is enabled for this database.
*
* @return boolean
*/
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;
}
/**