mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-29 15:22:15 +09:00
add priority_hint to mysql
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9485 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
cc7477d4e3
commit
055b7e0d68
4 changed files with 30 additions and 9 deletions
|
|
@ -583,9 +583,10 @@
|
|||
return $select . ' ' . $from . ' ' . $where . ' ' . $index_hint_list . ' ' . $groupBy . ' ' . $orderBy . ' ' . $limit;
|
||||
}
|
||||
|
||||
function getDeleteSql($query, $with_values = true){
|
||||
function getDeleteSql($query, $with_values = true, $with_priority = false){
|
||||
$sql = 'DELETE ';
|
||||
|
||||
$sql .= $with_priority?$query->getPriority():'';
|
||||
$tables = $query->getTables();
|
||||
|
||||
$sql .= $tables[0]->getAlias();
|
||||
|
|
@ -600,7 +601,7 @@
|
|||
return $sql;
|
||||
}
|
||||
|
||||
function getUpdateSql($query, $with_values = true){
|
||||
function getUpdateSql($query, $with_values = true, $with_priority = false){
|
||||
$columnsList = $query->getUpdateString($with_values);
|
||||
if($columnsList == '') return new Object(-1, "Invalid query");
|
||||
|
||||
|
|
@ -609,15 +610,18 @@
|
|||
|
||||
$where = $query->getWhereString($with_values);
|
||||
if($where != '') $where = ' WHERE ' . $where;
|
||||
|
||||
$priority = $with_priority?$query->getPriority():'';
|
||||
|
||||
return "UPDATE $tableName SET $columnsList ".$where;
|
||||
return "UPDATE $priority $tableName SET $columnsList ".$where;
|
||||
}
|
||||
|
||||
function getInsertSql($query, $with_values = true){
|
||||
function getInsertSql($query, $with_values = true, $with_priority = false){
|
||||
$tableName = $query->getFirstTableName();
|
||||
$values = $query->getInsertString($with_values);
|
||||
|
||||
return "INSERT INTO $tableName \n $values";
|
||||
$priority = $with_priority?$query->getPriority():'';
|
||||
|
||||
return "INSERT $priority INTO $tableName \n $values";
|
||||
}
|
||||
|
||||
function _getSlaveConnectionStringIndex() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue