Unsupported Screen Size: The viewport size is too small for the theme to render properly.

SQLyog DataType Problem

forums forums SQLyog Using SQLyog SQLyog DataType Problem

  • This topic is empty.
Viewing 2 reply threads
  • Author
    Posts
    • #8270
      pporter
      Member

      I am using SQLyog Version 3.63 and I've discovered that everytime I set a column's datatype to “char” SQLyog changes it to “varchar”. Is this a bug or am I doing something wrong?

      Thanks for any input.

      Paul

    • #15340
      Ritesh
      Member

      Excerpts from the MySQL Reference Manual

      Code:
      6.5.3.1 Silent Column Specification Changes

      If any column in a table has a variable length, the entire row is variable-length as a result. Therefore, if a table contains any variable-length columns (VARCHAR, TEXT, or BLO:cool:, all CHAR columns longer than three characters are changed to VARCHAR columns. This doesn't affect how you use the columns in any way; in MySQL, VARCHAR is just a different way to store characters. MySQL performs this conversion because it saves space and makes table operations faster.

    • #15341
      pporter
      Member

      Hu-m-m! that is interesting. I'm using “MySQL” by Paul DuBois to learn MySQL and on page 99 he says: ” If your values don't very much in length, CHAR is a better choice than VARCHAR because the tables with fixed-length rows can be processed more efficiently that tables with variable-length rows. If your values are all the same length, VARCHAR will actuallly use more space due to the extra byte used to record the length of the values.”

      Being a contributor to the MySQL Reference Manual I would have thought Paul DuBois would have been aware of this behavior. I wonder why MySQL even bothers to have a CHAR data-type if it can't be used except for fields of 3 bytes or less.

      Any way thank you setting me straight.

      Paul

Viewing 2 reply threads
  • You must be logged in to reply to this topic.