Bug #8968

SQL errors when using setOrderings() with multiple fields

Added by Peter Beernink over 10 years ago. Updated about 10 years ago.

Status:
Resolved
Priority:
Must have
Category:
Persistence
Start date:
2010-08-18
Due date:
% Done:

100%

Estimated time:
1.00 h
PHP Version:
Has patch:
Complexity:

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.

#1

Updated by Karsten Dambekalns over 10 years ago

  • Status changed from New to Accepted
  • Assignee set to Karsten Dambekalns
  • Start date deleted (2010-07-20)
  • Estimated time set to 2.00 h
#2

Updated by Karsten Dambekalns over 10 years ago

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

Updated by Karsten Dambekalns over 10 years ago

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

Applied in changeset r5002.

Also available in: Atom PDF