mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-01 16:22:41 +09:00
Issue 388 - Query cache error related table alias
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9544 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
92a49aa179
commit
308d1606a7
8 changed files with 94 additions and 14 deletions
|
|
@ -26,6 +26,7 @@
|
|||
require(_XE_PATH_.'classes/db/queryparts/expression/SelectExpression.class.php');
|
||||
require(_XE_PATH_.'classes/db/queryparts/expression/InsertExpression.class.php');
|
||||
require(_XE_PATH_.'classes/db/queryparts/expression/UpdateExpression.class.php');
|
||||
require(_XE_PATH_.'classes/db/queryparts/expression/UpdateExpressionWithoutArgument.class.php');
|
||||
require(_XE_PATH_.'classes/db/queryparts/table/Table.class.php');
|
||||
require(_XE_PATH_.'classes/db/queryparts/table/JoinTable.class.php');
|
||||
require(_XE_PATH_.'classes/db/queryparts/table/CubridTableWithHint.class.php');
|
||||
|
|
@ -605,22 +606,22 @@
|
|||
$columnsList = $query->getUpdateString($with_values);
|
||||
if($columnsList == '') return new Object(-1, "Invalid query");
|
||||
|
||||
$tableName = $query->getFirstTableName();
|
||||
if($tableName == '') return new Object(-1, "Invalid query");
|
||||
$tables = $query->getFromString($with_values);
|
||||
if($tables == '') return new Object(-1, "Invalid query");
|
||||
|
||||
$where = $query->getWhereString($with_values);
|
||||
if($where != '') $where = ' WHERE ' . $where;
|
||||
|
||||
|
||||
$priority = $with_priority?$query->getPriority():'';
|
||||
|
||||
return "UPDATE $priority $tableName SET $columnsList ".$where;
|
||||
return "UPDATE $priority $tables SET $columnsList ".$where;
|
||||
}
|
||||
|
||||
function getInsertSql($query, $with_values = true, $with_priority = false){
|
||||
$tableName = $query->getFirstTableName();
|
||||
$values = $query->getInsertString($with_values);
|
||||
$priority = $with_priority?$query->getPriority():'';
|
||||
|
||||
|
||||
return "INSERT $priority INTO $tableName \n $values";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
/**
|
||||
* @class UpdateExpression
|
||||
* @author Arnia Software
|
||||
* @brief
|
||||
*
|
||||
*/
|
||||
|
||||
class UpdateExpressionWithoutArgument extends UpdateExpression {
|
||||
var $argument;
|
||||
|
||||
function UpdateExpressionWithoutArgument($column_name, $argument){
|
||||
parent::Expression($column_name);
|
||||
$this->argument = $argument;
|
||||
}
|
||||
|
||||
function getExpression($with_value = true){
|
||||
return "$this->column_name = $this->argument";
|
||||
}
|
||||
|
||||
function getValue(){
|
||||
// TODO Escape value according to column type instead of variable type
|
||||
$value = $this->argument;
|
||||
if(!is_numeric($value)) return "'".$value."'";
|
||||
return $value;
|
||||
}
|
||||
|
||||
function show(){
|
||||
if(!$this->argument) return false;
|
||||
$value = $this->argument;
|
||||
if(!isset($value)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
function getArgument(){
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue