mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-08 19:42:15 +09:00
Issue 524 - Query error.
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9685 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
6eed0f10f2
commit
8de6d4338d
2 changed files with 26 additions and 4 deletions
|
|
@ -20,10 +20,22 @@
|
||||||
if($column->attrs->var)
|
if($column->attrs->var)
|
||||||
$this->argument = new QueryArgument($column);
|
$this->argument = new QueryArgument($column);
|
||||||
else {
|
else {
|
||||||
$default_value = new DefaultValue($this->name, $column->attrs->default);
|
if(strpos($column->attrs->default, '.') !== false)
|
||||||
if($default_value->isOperation())
|
$this->default_value = "'" . $dbParser->parseColumnName($column->attrs->default) . "'";
|
||||||
|
else {
|
||||||
|
$default_value = new DefaultValue($this->name, $column->attrs->default);
|
||||||
|
if($default_value->isOperation())
|
||||||
$this->argument = new QueryArgument($column, true);
|
$this->argument = new QueryArgument($column, true);
|
||||||
else $this->default_value = $dbParser->parseColumnName($column->attrs->default);
|
//else $this->default_value = $dbParser->parseColumnName($column->attrs->default);
|
||||||
|
else {
|
||||||
|
$this->default_value = $default_value->toString();
|
||||||
|
if($default_value->isString()){
|
||||||
|
$this->default_value = '"' . $this->default_value . '"';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -33,7 +45,7 @@
|
||||||
, $this->name
|
, $this->name
|
||||||
, $this->argument->argument_name);
|
, $this->argument->argument_name);
|
||||||
else {
|
else {
|
||||||
return sprintf('new UpdateExpressionWithoutArgument(\'%s\', \'%s\')'
|
return sprintf('new UpdateExpressionWithoutArgument(\'%s\', %s)'
|
||||||
, $this->name
|
, $this->name
|
||||||
, $this->default_value);
|
, $this->default_value);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,4 +52,14 @@
|
||||||
and `listorder` <= 12';
|
and `listorder` <= 12';
|
||||||
$this->_test($xml_file, $argsString, $expected);
|
$this->_test($xml_file, $argsString, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function test_communication_setMessageReaded(){
|
||||||
|
$xml_file = _XE_PATH_ . "modules/communication/queries/setMessageReaded.xml";
|
||||||
|
$argsString = '$args->message_srl = 339321; $args->related_srl = 339321;';
|
||||||
|
$expected = 'update `xe_member_message` as `member_message`
|
||||||
|
set `readed` = \'y\'
|
||||||
|
, `readed_date` = ' . date("YmdHis") . '
|
||||||
|
where `message_srl` = 339321 or `related_srl` = 339321';
|
||||||
|
$this->_test($xml_file, $argsString, $expected);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue