mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-09 20:12:14 +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();
|
$this->argument_name = $this->argument->getArgumentName();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if($condition->attrs->default){
|
$default_value = $condition->attrs->default;
|
||||||
if(!$isColumnName && !is_numeric($condition->attrs->default))
|
if($default_value){
|
||||||
$condition->attrs->default = "\'" . $condition->attrs->default . "\'";
|
if($isColumnName){
|
||||||
$this->default_column = "'" . $condition->attrs->default . "'" ;
|
$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
|
else
|
||||||
$this->default_column = "'" . $dbParser->parseColumnName($condition->attrs->var) . "'" ;
|
$this->default_column = "'" . $dbParser->parseColumnName($condition->attrs->var) . "'" ;
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,8 @@
|
||||||
$args->s_member_srl = 4;';
|
$args->s_member_srl = 4;';
|
||||||
$expected = 'select *
|
$expected = 'select *
|
||||||
from "xe_documents" as "documents"
|
from "xe_documents" as "documents"
|
||||||
where "member_srl" = 4
|
where ("member_srl" = 4)
|
||||||
|
and "list_order" <= 2100000000
|
||||||
order by "list_order" asc
|
order by "list_order" asc
|
||||||
limit 0, 30';
|
limit 0, 30';
|
||||||
$this->_test($xml_file, $argsString, $expected);
|
$this->_test($xml_file, $argsString, $expected);
|
||||||
|
|
@ -205,7 +206,9 @@
|
||||||
$args->sort_order = \'asc\';
|
$args->sort_order = \'asc\';
|
||||||
$args->list_count = 40;
|
$args->list_count = 40;
|
||||||
$args->page_count = 10;';
|
$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
|
order by "list_order" asc
|
||||||
limit 0, 40';
|
limit 0, 40';
|
||||||
$this->_test($xml_file, $argsString, $expected);
|
$this->_test($xml_file, $argsString, $expected);
|
||||||
|
|
|
||||||
|
|
@ -162,12 +162,10 @@
|
||||||
$expected = 'select count(*) as [count]
|
$expected = 'select count(*) as [count]
|
||||||
from [xe_module_grants] as [module_grants]
|
from [xe_module_grants] as [module_grants]
|
||||||
where [module_srl] = ?
|
where [module_srl] = ?
|
||||||
and [name] in (?,?,?)
|
and [name] in (\'access\',\'view\',\'list\')
|
||||||
and (
|
and ([group_srl] >= 1
|
||||||
[group_srl] >= ?
|
or [group_srl] = -1
|
||||||
or [group_srl] = ?
|
or [group_srl] = -2)';
|
||||||
or [group_srl] = ?
|
$this->_test($xml_file, $argsString, $expected, array(67));
|
||||||
)';
|
|
||||||
$this->_test($xml_file, $argsString, $expected, array(67, array('\'access\'', '\'view\'', '\'list\''), 1, -1, -2));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue