mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-19 03:09:55 +09:00
merge from 1.5.3.2 (~r11225)
git-svn-id: http://xe-core.googlecode.com/svn/trunk@11226 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
54e3a72065
commit
77f5aa2671
313 changed files with 8058 additions and 14251 deletions
|
|
@ -329,4 +329,55 @@ class MysqlSelectTest extends MysqlTest {
|
|||
';
|
||||
$this->_test($xml_file, $argsString, $expected);
|
||||
}
|
||||
|
||||
function testLikeWithDot()
|
||||
{
|
||||
$xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/likewithdot.xml";
|
||||
$argsString = '';
|
||||
$expected = 'select *
|
||||
from `xe_layouts` as `layouts`
|
||||
where `site_srl` = 0
|
||||
and `layout_type` = \'p\'
|
||||
and `layout` like \'%.%\'';
|
||||
$this->_test($xml_file, $argsString, $expected);
|
||||
|
||||
}
|
||||
|
||||
|
||||
function testFromSubquery()
|
||||
{
|
||||
$xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/from_subquery.xml";
|
||||
$argsString = '
|
||||
';
|
||||
$expected = 'SELECT `A`.`member_srl` as `member_srl`, COUNT(`A`.`cnt`) as `count`
|
||||
FROM (
|
||||
SELECT `member_srl` as `member_srl`, count(*) AS `cnt`
|
||||
FROM `xe_documents` as `documents`
|
||||
GROUP BY `member_srl`
|
||||
) AS `A`';
|
||||
$this->_test($xml_file, $argsString, $expected);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Like with image extension
|
||||
*/
|
||||
function testLikeImageExtension()
|
||||
{
|
||||
$xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/like_image_extension.xml";
|
||||
$argsString = '';
|
||||
$expected = "select `files`.`upload_target_srl` as `document_srl`
|
||||
from `xe_files` as `files`
|
||||
, `xe_documents` as `documents`
|
||||
where (
|
||||
`files`.`upload_target_srl` = `documents`.`document_srl`
|
||||
and (`files`.`source_filename` like '%.jpg'
|
||||
or `files`.`source_filename` like '%.gif'
|
||||
or `files`.`source_filename` like '%.png'))
|
||||
and `documents`.`list_order` <= 2100000000
|
||||
group by `files`.`upload_target_srl`
|
||||
order by `documents`.`list_order` asc
|
||||
limit 5";
|
||||
$this->_test($xml_file, $argsString, $expected);
|
||||
}
|
||||
}
|
||||
20
tests/classes/db/db/xml_query/mysql/data/from_subquery.xml
Normal file
20
tests/classes/db/db/xml_query/mysql/data/from_subquery.xml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<query id="getMemberInfo" action="select">
|
||||
<tables>
|
||||
<table query="true" alias="A">
|
||||
<tables>
|
||||
<table name="documents" alias="documents" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="member_srl" alias="member_srl" />
|
||||
<column name="count(*)" alias="cnt" />
|
||||
</columns>
|
||||
<groups>
|
||||
<group column="member_srl" />
|
||||
</groups>
|
||||
</table>
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="A.member_srl" alias="member_srl" />
|
||||
<column name="count(A.cnt)" alias="count" />
|
||||
</columns>
|
||||
</query>
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<query id="getImages" action="select">
|
||||
|
||||
<tables>
|
||||
|
||||
<table name="files" alias="files"/>
|
||||
|
||||
<table name="documents" alias="documents"/>
|
||||
|
||||
</tables>
|
||||
|
||||
<columns>
|
||||
|
||||
<column name="files.upload_target_srl" alias="document_srl"/>
|
||||
|
||||
</columns>
|
||||
|
||||
<conditions>
|
||||
|
||||
<condition operation="in" column="files.module_srl" var="module_srls" filter="number" />
|
||||
|
||||
<condition operation="equal" column="files.direct_download" var="direct_download" pipe="and" />
|
||||
|
||||
<condition operation="equal" column="files.isvalid" var="isvalid" pipe="and" />
|
||||
|
||||
<condition operation="equal" column="files.upload_target_srl" var="documents.document_srl" pipe="and" />
|
||||
|
||||
<group pipe="and">
|
||||
|
||||
<condition operation="like_tail" column="files.source_filename" var="s_filename1" default=".jpg" pipe="or" />
|
||||
|
||||
<condition operation="like_tail" column="files.source_filename" var="s_filename2" default=".gif" pipe="or" />
|
||||
|
||||
<condition operation="like_tail" column="files.source_filename" var="s_filename3" default=".png" pipe="or" />
|
||||
|
||||
</group>
|
||||
|
||||
</conditions>
|
||||
|
||||
<groups>
|
||||
|
||||
<group column="files.upload_target_srl" />
|
||||
|
||||
</groups>
|
||||
|
||||
<navigation>
|
||||
|
||||
<index var="list_order" default="documents.list_order" order="asc" />
|
||||
|
||||
<list_count var="list_count" default="5" />
|
||||
|
||||
</navigation>
|
||||
|
||||
</query>
|
||||
12
tests/classes/db/db/xml_query/mysql/data/likewithdot.xml
Normal file
12
tests/classes/db/db/xml_query/mysql/data/likewithdot.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<query id="likewithdot" action="select">
|
||||
<tables>
|
||||
<table name="layouts" />
|
||||
</tables>
|
||||
<columns>
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="site_srl" var="site_srl" default="0" />
|
||||
<condition operation="equal" column="layout_type" var="layout_type" default="P" pipe="and" />
|
||||
<condition operation="like" column="layout" default="%.%" pipe="and" />
|
||||
</conditions>
|
||||
</query>
|
||||
11
tests/classes/db/db/xml_query/mysql/data/sumInCondition.xml
Normal file
11
tests/classes/db/db/xml_query/mysql/data/sumInCondition.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<query id="sumInCondition" action="select">
|
||||
<tables>
|
||||
<table name="test11" alias="a" />
|
||||
</tables>
|
||||
<columns>
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="equal" column="site_srl" var="site_srl" default="0" />
|
||||
<condition operation="less" column="price" default="a.pa_1+a.pa_2" pipe="and" />
|
||||
</conditions>
|
||||
</query>
|
||||
Loading…
Add table
Add a link
Reference in a new issue