Bug #22096 » 13490_dbal.diff
class.ux_t3lib_db.php (working copy) | ||
---|---|---|
$t = $sqlPartArray[$k]['table'] ? $sqlPartArray[$k]['table'] : $defaultTable;
|
||
// Mapping field name, if set:
|
||
if (is_array($this->mapping[$t]['mapFieldNames']) && $this->mapping[$t]['mapFieldNames'][$sqlPartArray[$k]['field']]) {
|
||
if (is_array($this->mapping[$t]['mapFieldNames']) && isset($this->mapping[$t]['mapFieldNames'][$sqlPartArray[$k]['field']])) {
|
||
$sqlPartArray[$k]['field'] = $this->mapping[$t]['mapFieldNames'][$sqlPartArray[$k]['field']];
|
||
}
|
||
tests/db_mssql_testcase.php (working copy) | ||
---|---|---|
}
|
||
///////////////////////////////////////
|
||
// Tests concerning remapping with
|
||
// external (non-TYPO3) databases
|
||
///////////////////////////////////////
|
||
/**
|
||
* @test
|
||
* @see http://bugs.typo3.org/view.php?id=13490
|
||
*/
|
||
public function canRemapPidToZero() {
|
||
$selectFields = 'uid, FirstName, LastName';
|
||
$fromTables = 'Members';
|
||
$whereClause = 'pid=0 AND cruser_id=1';
|
||
$groupBy = '';
|
||
$orderBy = '';
|
||
$GLOBALS['TYPO3_DB']->_callRef('map_remapSELECTQueryParts', $selectFields, $fromTables, $whereClause, $groupBy, $orderBy);
|
||
$query = $this->cleanSql($GLOBALS['TYPO3_DB']->SELECTquery($selectFields, $fromTables, $whereClause, $groupBy, $orderBy));
|
||
$expected = 'SELECT "MemberID", "FirstName", "LastName" FROM "Members" WHERE 0 = 0 AND 1 = 1';
|
||
$this->assertEquals($expected, $query);
|
||
}
|
||
///////////////////////////////////////
|
||
// Tests concerning advanced operators
|
||
///////////////////////////////////////
|
||
tests/fixtures/mssql.config.php (working copy) | ||
---|---|---|
'datastructure' => 'ds',
|
||
),
|
||
),
|
||
'Members' => array(
|
||
'mapFieldNames' => array(
|
||
'pid' => '0',
|
||
'cruser_id' => '1',
|
||
'uid' => 'MemberID',
|
||
),
|
||
),
|
||
);
|
||
?>
|
- « Previous
- 1
- 2
- Next »