Doctrine 1
  1. Doctrine 1
  2. DC-278

Invalid qubquery generated if using oracle adapter instead of pdo_oci

    Details

    • Type: Bug Bug
    • Status: Reopened
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 1.2.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      Linux, Oracle 10g

      Description

      Doctrine generates the following invalid subquery if oracle adapter is used (same query is generated corret if pdo_oci is used):

      SELECT DISTINCT "s2"."code"
      FROM "spend_category" "s2"
      INNER JOIN "company_spend_category" "c4" ON ("s2"."code" = "c4"."spendcategory_code")
      INNER JOIN "company" "c3" ON "c3"."code" = "c4"."company_code"
      WHERE "s2"."code" = '19000000'
      AND "c3"."is_deleted" IS NOT NULL
      AND "s2"."is_deleted" IS NOT NULL
      ORDER BY "c3"."name" desc

      The problem is that the order by column is not part of the selected columns.

      Sample dql statement to reproduce this error:

      $this->pageAllPager = new Doctrine_Pager(
      $q = Doctrine_Query::create()
      ->select('c.code, c.name, c.is_activated, c.is_deleted, sc.code')
      ->from('SpendCategory sc')
      ->innerJoin('sc.Companies c')
      ->where("sc.code = '$spendcategory'")
      ->addWhere('c.is_deleted IS NOT NULL')
      ->addWhere('sc.is_deleted IS NOT NULL')
      ->orderBy($orderBy)
      ->setHydrationMode(Doctrine::HYDRATE_ARRAY),
      $page,
      $resultsPerPage);
      }

        Activity

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Thomas Wahle
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: