Uploaded image for project: 'Hibernate ORM'
  1. HHH-7958

length=... ignored in @Column(columnDefinition = "CHAR", length = 32)

    Details

    • Type: Bug
    • Status: Awaiting Response
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 4.1.9
    • Fix Version/s: None
    • Component/s: hibernate-core
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

      MySQL 5.5.

          @Column(columnDefinition = "CHAR", length = 32)
          private String contentHash;
      

      Created query:

      create table texydoc (id INT UNSIGNED not null auto_increment, added datetime, content TEXT, contentHash CHAR, origPath varchar(255) unique, parsingException TEXT, renderedHtml TEXT, author_id bigint, primary key (id))
      

      MySQL interprets this as `CHAR(1)`.

      IMO the length should be used for column length:

      (Optional) The column length. (Applies only if a string-valued column is used.)

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: