mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-22 05:15:29 +09:00
Issue 1103: problem of not in query
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9898 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
def75c83ef
commit
30a9d499ab
3 changed files with 57 additions and 2 deletions
|
|
@ -3,8 +3,10 @@
|
||||||
class ConditionWithoutArgument extends Condition {
|
class ConditionWithoutArgument extends Condition {
|
||||||
function ConditionWithoutArgument($column_name, $argument, $operation, $pipe = ""){
|
function ConditionWithoutArgument($column_name, $argument, $operation, $pipe = ""){
|
||||||
parent::Condition($column_name, $argument, $operation, $pipe);
|
parent::Condition($column_name, $argument, $operation, $pipe);
|
||||||
if(in_array($operation, array('in', 'notin')))
|
if(in_array($operation, array('in', 'notin'))){
|
||||||
$this->_value = '('. $argument .')';
|
if(is_array($argument)) $argument = implode($argument, ',');
|
||||||
|
$this->_value = '('. $argument .')';
|
||||||
|
}
|
||||||
else
|
else
|
||||||
$this->_value = $argument;
|
$this->_value = $argument;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -207,4 +207,26 @@
|
||||||
limit 20';
|
limit 20';
|
||||||
$this->_test($xml_file, $argsString, $expected);
|
$this->_test($xml_file, $argsString, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function test_homepage_getNewestComments(){
|
||||||
|
$xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/homepage.getNewestComments.xml";
|
||||||
|
$argsString = ';';
|
||||||
|
$expected = 'select `sites`.`domain` as `domain`
|
||||||
|
, `comments`.*
|
||||||
|
from `xe_homepages` as `homepages`
|
||||||
|
, `xe_sites` as `sites`
|
||||||
|
, `xe_comments` as `comments`
|
||||||
|
, `xe_modules` as `modules`
|
||||||
|
left join `xe_module_grants` as `module_grants`
|
||||||
|
on `module_grants`.`module_srl` = `modules`.`module_srl`
|
||||||
|
and `module_grants`.`name` = \'access\'
|
||||||
|
and `module_grants`.`group_srl` not in (0,-1)
|
||||||
|
where (`homepages`.`site_srl` = `sites`.`site_srl`
|
||||||
|
and `homepages`.`site_srl` = `modules`.`site_srl`
|
||||||
|
and `comments`.`module_srl` = `modules`.`module_srl`
|
||||||
|
and `module_grants`.`group_srl` is null)
|
||||||
|
and `comments`.`list_order` <= 2100000000
|
||||||
|
order by `comments`.`list_order` asc limit 0, 5';
|
||||||
|
$this->_test($xml_file, $argsString, $expected);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
<query id="getNewestComments" action="select">
|
||||||
|
<tables>
|
||||||
|
<table name="homepages" />
|
||||||
|
<table name="sites" />
|
||||||
|
<table name="comments" />
|
||||||
|
<table name="modules" />
|
||||||
|
<table name="module_grants" alias="module_grants" type="left join">
|
||||||
|
<conditions>
|
||||||
|
<condition operation="equal" column="module_grants.module_srl" default="modules.module_srl" />
|
||||||
|
<condition operation="equal" column="module_grants.name" default="access" pipe="and" />
|
||||||
|
<condition operation="notin" column="module_grants.group_srl" default="0,-1" pipe="and" />
|
||||||
|
</conditions>
|
||||||
|
</table>
|
||||||
|
</tables>
|
||||||
|
<columns>
|
||||||
|
<column name="sites.domain" alias="domain" />
|
||||||
|
<column name="comments.*" />
|
||||||
|
</columns>
|
||||||
|
<conditions>
|
||||||
|
<condition operation="equal" column="homepages.site_srl" default="sites.site_srl" notnull="notnull" />
|
||||||
|
<condition operation="equal" column="homepages.site_srl" default="modules.site_srl" notnull="notnull" pipe="and" />
|
||||||
|
<condition operation="equal" column="comments.module_srl" default="modules.module_srl" notnull="notnull" pipe="and" />
|
||||||
|
<condition operation="null" column="module_grants.group_srl" pipe="and" />
|
||||||
|
</conditions>
|
||||||
|
<navigation>
|
||||||
|
<index var="sort_index" default="comments.list_order" order="asc" />
|
||||||
|
<list_count var="list_count" default="5" />
|
||||||
|
<page_count var="page_count" default="5" />
|
||||||
|
<page var="page" default="1" />
|
||||||
|
</navigation>
|
||||||
|
</query>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue