Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Blocker
-
Resolution: Unresolved
-
Affects Version/s: 1.2.3
-
Fix Version/s: None
-
Component/s: Query
-
Labels:None
-
Environment:Windows 2003 Server, Oracle 10g, Symfony 1.4.8
Description
Schema in yml format
in Symfony it looks more simple, but i'm going to show relation in detail
PrType:
columns:
name: { type: string(255), notnull: true }
PrTypeTranslation:
columns:
id: { type: integer, notnull: true }
name: { type: string(255), notnull: true }
lang: { type: string(255), notnull: true }
relations:
PrType: { onDelete: CASCADE, local: id_id, foreign: id, foreignAlias: Translation }
When i try to execute this code:
$q = Doctrine_Query::create()
->from('PrType tp')
->leftJoin('tp.Translation t WITH t.lang = ?', 'ru')
->orderBy('t.name')
->limit(10);
doctrine executes next statement:
SELECT "p"."id", "p2"."name" AS "p2__name", "p2"."lang" AS "p2__lang" FROM "pr_type" "p" LEFT JOIN "pr_type_translation" "p2" ON "p"."id" = "p2"."id" AND ("p2"."lang" = :oci_b_var_1) WHERE "p"."id" IN ( SELECT a."id" FROM ( SELECT DISTINCT "p3"."id" FROM "pr_type" "p3" INNER JOIN "pr_type_translation" "p4" ON "p3"."id" = "p4"."id" AND ("p4"."lang" = 'ru') ORDER BY "p4"."name" ) a WHERE ROWNUM <= 10) ORDER BY "p2"."name"
This sql code produces next error
ORA-01791: not a SELECTed expression
Error occures, because (from ORACODE)
There is an incorrect ORDER BY item. The query is a SELECT DISTINCT query with an ORDER BY clause. In this context, all ORDER BY items must be constants, SELECT list expressions, or expressions whose operands are constants or SELECT list expressions
Activity
Dmitriy
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Component/s | Query [ 10037 ] | |
| Component/s | Connection [ 10021 ] |
This list may be incomplete, as errors occurred whilst retrieving source from linked applications:
- Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DC-918, expand=changesets[-21:-1].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)
Some very similar issue were reported and resolved here http://trac.doctrine-project.org/ticket/1038.