Doctrine 1
  1. Doctrine 1
  2. DC-606

[Oracle] Query on M:M with relation name doesn't work

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.1
    • Fix Version/s: None
    • Component/s: Query
    • Labels:
      None

      Description

      My schema:

      ---
      Actuality:
        connection:         web
        tableName:          actuality
        actAs:
          softDelete:       ~
          Timestampable:    ~
          Sluggable:
            fields:         [name]
            builder:        [tool, slugify]
            indexName:      actuality_sluggable
            canUpdate:      true
        columns:
          id:
            type:           integer(4)
            primary:        true
            unsigned:       true
            sequence:       actuality
          created_at:
            type:           timestamp
          updated_at:
            type:           timestamp
          published_at:
            type:           timestamp
            notnull:        true
          unpublished_at:
            type:           timestamp
          name:
            type:           string(255)
            notnull:        true
          description_short:
            type:           string(1000)
            notnull:        true
          description:
            type:           clob
            notnull:        true
          is_professional:
            type:           boolean
            default:        true
        relations:
          Categories:
            class: ActualityCategory
            local: actuality_id
            foreign: actuality_category_id
            refClass: ActualityActualityCategory
            foreignAlias: Actualities
      

      And my query:

      public function retrieveCloud($is_professional, $limit = 20)
        {
          return $this->createQuery('ac')
          ->leftJoin('ac.Actualities a2')
          ->where('ac.id IN (SELECT aac.actuality_category_id FROM Actuality a LEFTJOIN a.ActualityActualityCategory aac WHERE a.published_at < ? AND a.is_professional = ?)', array(date('Y-m-d H:i:s'), $is_professional))
          ->orderBy('ac.name')
          ->limit($limit)
          ->execute();
        }
      

      I have this error: Doctrine_Connection_Oracle_Exception

      ORA-01008: not all variables bound : SELECT a.id AS a__id, a.created_at AS a__created_at, a.updated_at AS a__updated_at, a.name AS a__name, a.deleted_at AS a__deleted_at, a.slug AS a__slug, a2.id AS a2__id, a2.created_at AS a2__created_at, a2.updated_at AS a2__updated_at, a2.published_at AS a2__published_at, a2.unpublished_at AS a2__unpublished_at, a2.name AS a2__name, a2.description_short AS a2__description_short, a2.description AS a2__description, a2.is_professional AS a2__is_professional, a2.deleted_at AS a2__deleted_at, a2.slug AS a2__slug FROM actuality_category a LEFT JOIN actuality_actuality_category a3 ON (a.id = a3.actuality_category_id) LEFT JOIN actuality a2 ON a2.id = a3.actuality_id AND (a2.deleted_at IS NULL) WHERE a.id IN (SELECT a4.id FROM ( SELECT DISTINCT a4.id FROM actuality_category a4 LEFT JOIN actuality_actuality_category a6 ON (a4.id = a6.actuality_category_id) LEFT JOIN actuality a5 ON a5.id = a6.actuality_id AND (a5.deleted_at IS NULL) WHERE a4.id IN (SELECT a8.actuality_category_id AS a5__actuality_category_id FROM actuality a7 LEFT JOIN actuality_actuality_category a8 ON a7.id = a8.actuality_id WHERE (a7.published_at < :oci_b_var_1 AND a7.is_professional = :oci_b_var_2)) AND (a4.deleted_at IS NULL) ORDER BY a4.name ) a4 WHERE ROWNUM <= 20) AND (a.id IN (SELECT a5.actuality_category_id AS a5__actuality_category_id FROM actuality a4 LEFT JOIN actuality_actuality_category a5 ON a4.id = a5.actuality_id WHERE (a4.published_at < :oci_b_var_3 AND a4.is_professional = :oci_b_var_4)) AND (a.deleted_at IS NULL)) ORDER BY a.name
      

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Guilherme Blanco
            Reporter:
            Bertrand Zuchuat
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: