function updateFtsDictionary($dictname, $comment, $name)
{
$status = $this->beginTransaction();
if ($status != 0) {
$this->rollbackTransaction();
return -1;
}
$this->fieldClean($dictname);
$status = $this->setComment('TEXT SEARCH DICTIONARY', $dictname, '', $comment);
if ($status != 0) {
$this->rollbackTransaction();
return -1;
}
// Only if the name has changed
if ($name != $dictname) {
$f_schema = $this->_schema;
$this->fieldClean($f_schema);
$this->fieldClean($name);
$sql = "ALTER TEXT SEARCH DICTIONARY \"{$f_schema}\".\"{$dictname}\" RENAME TO \"{$name}\"";
$status = $this->execute($sql);
if ($status != 0) {
$this->rollbackTransaction();
return -1;
}
}
return $this->endTransaction();
}