Bug #8968

SQL errors when using setOrderings() with multiple fields

Added by Peter Beernink about 5 years ago. Updated almost 5 years ago.

Status:Resolved Start date:2010-08-18
Priority:Must have Due date:
Assigned To:Karsten Dambekalns % Done:

100%

Category:Persistence
Target version:TYPO3 Flow Base Distribution - 1.0 alpha 11 Estimated time:1.00 hour
PHP Version: Complexity:
Has patch: Affected Flow version:

Description

When using setOrderings() with multiple fields, an SQL error is thrown. However, when using only one field, everything works as expected.
Example:

$query = $this->createQuery();
return $query
    ->setOrderings(array('lastname' => \F3\FLOW3\Persistence\QueryInterface::ORDER_ASCENDING, 'firstname' => \F3\FLOW3\Persistence\QueryInterface::ORDER_ASCENDING))
    ->execute();

Will throw the following error:
SQLSTATE[HY000]: General error: 1 ambiguous column name: _orderingtable1.parent

PDOException thrown in file
Packages/Framework/FLOW3/Classes/Persistence/Backend/GenericPdo/Backend.php in line 800.

I've tested this on Alpha 10, with both SQLite and MySQL.

Associated revisions

Revision 0e396fbb
Added by Karsten Dambekalns almost 5 years ago

[+BUGFIX] FLOW3 (Persistence): Ordering by multiple fields works again, fixes #8968.

Change-Id: Ie868e0a4ec1525a7312d894f1bd6db87c580ffcf

History

#1 Updated by Karsten Dambekalns almost 5 years ago

  • Status changed from New to Accepted
  • Assigned To set to Karsten Dambekalns
  • Start date deleted (2010-07-20)
  • Estimated time set to 2.00

#2 Updated by Karsten Dambekalns almost 5 years ago

  • Start date set to 2010-08-18
  • Estimated time changed from 2.00 to 1.00

#3 Updated by Karsten Dambekalns almost 5 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 0 to 100

Applied in changeset r5002.

Also available in: Atom PDF