Doctrine 1
  1. Doctrine 1
  2. DC-954

tinyint(1) with default value in schema.yml generates blank default value, gives SQLSTATE[42000]

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      Win7 64-bit
      Netbeans 6.9.1
      Symfony 1.4.8

      Description

      doing a
      doctrine:build --all --and-load
      with a schema.yml of

      Foo:
      tableName: foo
      options:
      charset: utf8
      columns:
      bar:
      type: tinyint(1)
      default: 0

      results in a blank value generated for the default keyword, and the following error:

      SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 ENGINE = INNODB' at line 1. Failing Query: "CREATE TABLE foo (id BIGINT AUTO_INCREMENT, bar tinyint(1) DEFAULT , PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 ENGINE = INNODB". Failing Query: CREATE TABLE foo (id BIGINT AUTO_INCREMENT, bar tinyint(1) DEFAULT , PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 ENGINE = INNODB

      I've also tried combinations of tinyint, tinyint(4), single-quoting the default value, and different default values.

      Changing the type to int makes the issue disappear

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Colin Stuart
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: