mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-27 22:33:10 +09:00
Issue 364 - Query error related escape characters.
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9494 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
f0a9bfa02f
commit
0016c7963a
3 changed files with 21 additions and 13 deletions
|
|
@ -37,10 +37,17 @@
|
|||
$this->argument_name = $this->argument->getArgumentName();
|
||||
}
|
||||
else {
|
||||
if($condition->attrs->default){
|
||||
if(!$isColumnName && !is_numeric($condition->attrs->default))
|
||||
$condition->attrs->default = "\'" . $condition->attrs->default . "\'";
|
||||
$this->default_column = "'" . $condition->attrs->default . "'" ;
|
||||
$default_value = $condition->attrs->default;
|
||||
if($default_value){
|
||||
if($isColumnName){
|
||||
$default_value = "'" . $default_value . "'";
|
||||
}
|
||||
else if(in_array($this->operation, array('in', 'between', 'not in')))
|
||||
$default_value = "\"" . $default_value . "\"";
|
||||
else if(!$isColumnName && !is_numeric($default_value) && !is_array($default_value)){
|
||||
$default_value = "\"" . $default_value . "\"";
|
||||
}
|
||||
$this->default_column = $default_value;
|
||||
}
|
||||
else
|
||||
$this->default_column = "'" . $dbParser->parseColumnName($condition->attrs->var) . "'" ;
|
||||
|
|
|
|||
|
|
@ -163,7 +163,8 @@
|
|||
$args->s_member_srl = 4;';
|
||||
$expected = 'select *
|
||||
from "xe_documents" as "documents"
|
||||
where "member_srl" = 4
|
||||
where ("member_srl" = 4)
|
||||
and "list_order" <= 2100000000
|
||||
order by "list_order" asc
|
||||
limit 0, 30';
|
||||
$this->_test($xml_file, $argsString, $expected);
|
||||
|
|
@ -205,7 +206,9 @@
|
|||
$args->sort_order = \'asc\';
|
||||
$args->list_count = 40;
|
||||
$args->page_count = 10;';
|
||||
$expected = 'select * from "xe_member" as "member"
|
||||
$expected = 'select *
|
||||
from "xe_member" as "member"
|
||||
where "list_order" <= 2100000000
|
||||
order by "list_order" asc
|
||||
limit 0, 40';
|
||||
$this->_test($xml_file, $argsString, $expected);
|
||||
|
|
|
|||
|
|
@ -162,12 +162,10 @@
|
|||
$expected = 'select count(*) as [count]
|
||||
from [xe_module_grants] as [module_grants]
|
||||
where [module_srl] = ?
|
||||
and [name] in (?,?,?)
|
||||
and (
|
||||
[group_srl] >= ?
|
||||
or [group_srl] = ?
|
||||
or [group_srl] = ?
|
||||
)';
|
||||
$this->_test($xml_file, $argsString, $expected, array(67, array('\'access\'', '\'view\'', '\'list\''), 1, -1, -2));
|
||||
and [name] in (\'access\',\'view\',\'list\')
|
||||
and ([group_srl] >= 1
|
||||
or [group_srl] = -1
|
||||
or [group_srl] = -2)';
|
||||
$this->_test($xml_file, $argsString, $expected, array(67));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue