Ticket #1104 (closed defect: fixed)

Opened 13 months ago

Last modified 10 months ago

Firebird: SELECT FIRST x SKIP y problem

Reported by: tetikr Owned by: romanb
Priority: blocker Milestone:
Component: Query/Hydration Version: 0.11.0
Severity: Keywords: firebird skip first
Cc: Has Test:
Status: Has Patch:

Description

In 0.11.0RC3 the code:

$o = $this->connection->getTable($class)->find($id);

generates an SQL query for a Firebird database:

SELECT FIRST 1 SKIP b.id AS bid, b.personid AS ....

Note that after the SKIP keyword there is a number missing causing the query to fail.

Change History

in reply to: ↑ description   Changed 13 months ago by tetikr

A simple temporary solution that fixes this. Add into Doctrine_Connection_Firebird::modifyLimitQuery() method the line

if (!$offset) $offset = 0;

The modified method looks like this:

public function modifyLimitQuery($query, $limit = false, $offset = false, $isManip = false) {

if (!$offset) $offset = 0; if ($limit > 0) {

$query = preg_replace('/([s(])*SELECT(?!s*FIRSTs*d+)/i',

"SELECT FIRST $limit SKIP $offset", $query);

} return $query;

}

  Changed 13 months ago by jwage

  • milestone changed from 0.11.0 to 0.11.1

  Changed 13 months ago by romanb

  • status changed from new to closed
  • resolution set to fixed

(In [4483]) Fixed #1104.

  Changed 10 months ago by anonymous

  • milestone New deleted

Milestone New deleted

Note: See TracTickets for help on using tickets.