reverse merge from 1.6.0 (r10013)

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@10690 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ovclas 2012-05-16 09:21:05 +00:00
parent ac1783e77f
commit 75f9ef95cf
7 changed files with 116 additions and 26 deletions

View file

@ -21,18 +21,23 @@ class MysqlInsertTest extends MysqlTest
{
$this->_testQuery($xml_file, $argsString, $expected, 'getInsertSql', $columnList);
}
function testInsertIntoNumericColumnConvertsValue()
/**
* @brief testInsertSelectStatement - checks that when query action is 'insert-selct' an 'INSERT INTO .. SELECT ...' statement is properly generated
* @developer Corina Udrescu (xe_dev@arnia.ro)
* @access public
* @return void
*/
function testInsertSelectStatement()
{
$xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/member_insert_injection.xml";
$argsString = '$args->member_srl = 7;
$args->find_account_question = "1\'";
';
$expected = 'insert into `xe_member` (`member_srl`, `find_account_question`) values (7, 1)';
$xml_file = _TEST_PATH_ . "db/xml_query/mysql/data/insert_select.xml";
$argsString = '$args->condition_value = 7;';
$expected = 'insert into `xe_table1` (`column1`, `column2`, `column3`)
select `column4`, `column5`, `column6`
from `xe_table2` as `table2`
where `column4` >= 7';
$this->_test($xml_file, $argsString, $expected);
}
}
/* End of file MysqlInsertTest.php */

View file

@ -0,0 +1,23 @@
<query id="QUERY_ID" action="insert-select">
<tables>
<table name="table1" />
</tables>
<columns>
<column name="column1" />
<column name="column2" />
<column name="column3" />
</columns>
<query>
<tables>
<table name="table2" />
</tables>
<columns>
<column name="column4" />
<column name="column5" />
<column name="column6" />
</columns>
<conditions>
<condition operation="more" column="column4" default="100" var="condition_value" />
</conditions>
</query>
</query>