Doctrine 1
  1. Doctrine 1
  2. DC-183

Undefined constant Doctrine_Core::ATTR_DEFAULT_TEXTFLD_LENGTH

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.2.0-BETA1
    • Fix Version/s: 1.2.0-BETA3
    • Component/s: Native SQL
    • Labels:
      None
    • Environment:
      All

      Description

      File http://trac.doctrine-project.org/browser/branches/1.2/lib/Doctrine/DataDict/Sqlite.php

      Contains undefined constant Doctrine_Core::ATTR_DEFAULT_TEXTFLD_LENGTH which breaks generation of sql for sqlite

      Proposed fix: use $this->conn->options['default_text_field_length'] ?

        Activity

        Hide
        Juozas Kaziukenas added a comment - - edited

        I've tested it again and now it seems to be broken in that same line.

        Now in 76 line of Doctrine_DataDict_Sqlite I need to use:

        return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR('.$this->conn->varchar_max_length.')')

        Which I found in Mysql datadict, even though Mssql uses:

        return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR('.$this->conn->options['default_text_field_length'].')')

        Which won't work because there is no options in conn.

        Using rev6721

        Show
        Juozas Kaziukenas added a comment - - edited I've tested it again and now it seems to be broken in that same line. Now in 76 line of Doctrine_DataDict_Sqlite I need to use: return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR('.$this->conn->varchar_max_length.')') Which I found in Mysql datadict, even though Mssql uses: return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR('.$this->conn->options ['default_text_field_length'] .')') Which won't work because there is no options in conn. Using rev6721
        Hide
        Juozas Kaziukenas added a comment -

        It is caused by the fact that $options in connection are (now?) protected, hence cannot be accessed like that. There is way to access them by:

        return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR('.$this->conn->getOption('default_text_field_length').')')

        But key doesn't exist and return value is null.

        Show
        Juozas Kaziukenas added a comment - It is caused by the fact that $options in connection are (now?) protected, hence cannot be accessed like that. There is way to access them by: return $fixed ? ($length ? 'CHAR('.$length.')' : 'CHAR('.$this->conn->getOption('default_text_field_length').')') But key doesn't exist and return value is null.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: