Issue 524 - Query error - fix for ipaddess.

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9687 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ucorina 2011-10-19 12:43:18 +00:00
parent 3830e90733
commit e41941ccd2
2 changed files with 20 additions and 4 deletions

View file

@ -7,6 +7,8 @@
var $is_operation = false;
var $operation = '';
var $_is_string = false;
function DefaultValue($column_name, $value){
$dbParser = &DB::getParser();
$this->column_name = $dbParser->parseColumnName($column_name);
@ -15,9 +17,10 @@
}
function isString(){
$str_pos = strpos($this->value, '(');
if($str_pos===false) return true;
return false;
return $this->_is_string;
$str_pos = strpos($this->value, '(');
if($str_pos===false) return true;
return false;
}
function isSequence(){
@ -43,7 +46,10 @@
$str_pos = strpos($this->value, '(');
// // TODO Replace this with parseExpression
if($str_pos===false) return '\''.$this->value.'\'';
if($str_pos===false) {
$this->_is_string = true;
return '\''.$this->value.'\'';
}
//if($str_pos===false) return $this->value;
$func_name = substr($this->value, 0, $str_pos);

View file

@ -62,4 +62,14 @@
where `message_srl` = 339321 or `related_srl` = 339321';
$this->_test($xml_file, $argsString, $expected);
}
function test_session_updateSession(){
$xml_file = _XE_PATH_ . "modules/session/queries/updateSession.xml";
$argsString = '$args->session_key = 339321; $args->val = "yuhuu";';
$expected = 'update `xe_session` as `session`
set `member_srl` = 0, `val` = \'yuhuu\'
, `last_update` = ' . date("YmdHis") . '
where `session_key` = \'339321\'';
$this->_test($xml_file, $argsString, $expected);
}
}