HOR-1787
Slow query for login HOR-1787 Slow query for login HOR-1787 Slow query for login HOR-1787 Slow query for login HOR-1787 Slow query for login HOR-1787 Slow query for login HOR-1787 Slow query for login
This commit is contained in:
@@ -82,6 +82,9 @@ class database extends database_base
|
||||
} else {
|
||||
$sSQL .= ' NOT NULL';
|
||||
}
|
||||
if (isset( $aParameters['AutoIncrement'] ) && $aParameters['AutoIncrement']) {
|
||||
$sSQL .= ' AUTO_INCREMENT PRIMARY KEY';
|
||||
}
|
||||
if (isset( $aParameters['Key'] ) && $aParameters['Key'] == 'PRI') {
|
||||
$sKeys .= $this->sQuoteCharacter . $sColumnName . $this->sQuoteCharacter . ',';
|
||||
}
|
||||
@@ -139,6 +142,52 @@ class database extends database_base
|
||||
return $sSQL;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method has to refactor
|
||||
* @param $sTable
|
||||
* @param $sColumn
|
||||
* @param $aParameters
|
||||
* @return string
|
||||
*/
|
||||
public function generateCheckAddColumnSQL($sTable, $sColumn, $aParameters)
|
||||
{
|
||||
$sSQL = 'ALTER TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . ' DROP PRIMARY KEY ';
|
||||
$sSQL .= $this->sEndLine;
|
||||
return $sSQL;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method has to refactor
|
||||
* @param $sTable
|
||||
* @param $sColumn
|
||||
* @param $aParameters
|
||||
* @return string
|
||||
*/
|
||||
public function deleteAllIndexesIntable($sTable, $sColumn, $aParameters)
|
||||
{
|
||||
$sSQL = 'ALTER TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter . ' DROP INDEX indexLoginLog ';
|
||||
$sSQL .= $this->sEndLine;
|
||||
return $sSQL;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used exclusively to verify if it was made changes in the DB to solve the HOR-1787 issue, later
|
||||
* a generic method which covers all the possible similar problems found in the HOR-1787 issue will be generated.
|
||||
* @param $sTable
|
||||
* @param $sColumn
|
||||
* @param $aParameters
|
||||
* @return bool
|
||||
*/
|
||||
public function checkPatchHor1787($sTable, $sColumn, $aParameters)
|
||||
{
|
||||
if (isset($aParameters['AutoIncrement']) && $aParameters['AutoIncrement'] && $sTable == 'LOGIN_LOG') {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* generate an add column sentence
|
||||
*
|
||||
@@ -157,6 +206,9 @@ class database extends database_base
|
||||
$sSQL .= ' NOT NULL';
|
||||
}
|
||||
}
|
||||
if (isset( $aParameters['AutoIncrement'] ) && $aParameters['AutoIncrement']) {
|
||||
$sSQL .= ' AUTO_INCREMENT PRIMARY KEY';
|
||||
}
|
||||
/*if ($aParameters['Key'] == 'PRI') {
|
||||
$sKeys .= 'ALTER TABLE ' . $this->sQuoteCharacter . $sTable . $this->sQuoteCharacter .
|
||||
' ADD PRIMARY KEY (' . $this->sQuoteCharacter . $sColumn . $this->sQuoteCharacter . ')' . $this->sEndLine;
|
||||
|
||||
Reference in New Issue
Block a user