Ad Widget

Collapse

[1.6.6] Inconsistency: fresh install / upgrade from 1.4

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NOB
    Senior Member
    Zabbix Certified Specialist
    • Mar 2007
    • 469

    #1

    [1.6.6] Inconsistency: fresh install / upgrade from 1.4

    Hi

    in the upgrade script from 1.4 to 1.6 (zabbix-1.6.6/upgrades/dbpatches/1.6/mysql/patch.sql) the following code can be found:

    Code:
    alter table graphs_items change color color varchar(6) DEFAULT '009600' NOT NULL;
    which reduces the size of the color field from varchar(32) to varchar(6).

    However, in the script to create the DB (zabbix-1.6.6/create/schema/mysql.sql) you'll find:

    Code:
    CREATE TABLE graphs_items (
            gitemid         bigint unsigned         DEFAULT '0'     NOT NULL,
            graphid         bigint unsigned         DEFAULT '0'     NOT NULL,
            itemid          bigint unsigned         DEFAULT '0'     NOT NULL,
            drawtype                integer         DEFAULT '0'     NOT NULL,
            sortorder               integer         DEFAULT '0'     NOT NULL,
            color           varchar(32)             DEFAULT '009600'        NOT NULL,
            yaxisside               integer         DEFAULT '1'     NOT NULL,
            calc_fnc                integer         DEFAULT '2'     NOT NULL,
            type            integer         DEFAULT '0'     NOT NULL,
            periods_cnt             integer         DEFAULT '5'     NOT NULL,
            PRIMARY KEY (gitemid)
    ) type=InnoDB;
    This creates the table with the color field set to varchar(32).

    OK, this might not show up as an error, anywhere.
    I'm just surprised.

    Regards

    Norbert.
  • NOB
    Senior Member
    Zabbix Certified Specialist
    • Mar 2007
    • 469

    #2
    Hi

    Our solution is to change the color field to varchar(6) in the create/schema
    script.

    Can somebody confirm that this is OK, please ?

    Regards

    Norbert.

    Comment

    • Alexei
      Founder, CEO
      Zabbix Certified Trainer
      Zabbix Certified SpecialistZabbix Certified Professional
      • Sep 2004
      • 5654

      #3
      It looks like a typo. It shouldn't affect anything though. Thanks for reporting!
      Alexei Vladishev
      Creator of Zabbix, Product manager
      New York | Tokyo | Riga
      My Twitter

      Comment

      • boy01
        Junior Member
        • Dec 2007
        • 24

        #4
        Originally posted by NOB
        which reduces the size of the color field from varchar(32) to varchar(6).
        ...
        This creates the table with the color field set to varchar(32).
        So, which one is correct; varchar(32) or varchar(6)?

        Comment

        • NOB
          Senior Member
          Zabbix Certified Specialist
          • Mar 2007
          • 469

          #5
          Originally posted by boy01
          So, which one is correct; varchar(32) or varchar(6)?
          The field contains just RGB values in hexadecimal notation like
          FF0000 (for Red). So a size of varchar(6) would be sufficient.
          That's why I suggest using varchar(6).

          We'll update our ZABBIX DB (zbxdb) package and patch the schema files
          for a fresh install to use varchar(6), too.
          An upgrade will then be fine and consistent with fresh installs.

          We hope that the developers will do the same, of course.
          Alexei reported, the difference won't effect anything, anyway.

          Regards

          Norbert.

          Comment

          • richlv
            Senior Member
            Zabbix Certified Trainer
            Zabbix Certified SpecialistZabbix Certified Professional
            • Oct 2005
            • 3112

            #6
            my guess - before, colours were stored as human readable strings like "Dark Green".
            initially, upgrade to 1.6 did not convert these strings to hex, thus most likely the field was left as is.

            if you look a the latest upgrade patch, you'll see also statements like :
            Code:
            update graphs_items set color='009600' where color='Dark Green';
            so, again, my guess - yes, the field should be set to varchar(6).

            additionally, it might be nice to perform colour & field conversions for people who upgraded to initial 1.6 releases by adding these statements to 1.8 patch as well.

            could you open a report on the tracker so that this issue is not lost ?
            thanks.
            Zabbix 3.0 Network Monitoring book

            Comment

            • NOB
              Senior Member
              Zabbix Certified Specialist
              • Mar 2007
              • 469

              #7
              Originally posted by richlv
              my guess - before, colours were stored as human readable strings like "Dark Green".
              initially, upgrade to 1.6 did not convert these strings to hex, thus most likely the field was left as is.

              if you look a the latest upgrade patch, you'll see also statements like :
              Code:
              update graphs_items set color='009600' where color='Dark Green';
              so, again, my guess - yes, the field should be set to varchar(6).

              additionally, it might be nice to perform colour & field conversions for people who upgraded to initial 1.6 releases by adding these statements to 1.8 patch as well.

              could you open a report on the tracker so that this issue is not lost ?
              thanks.
              Already done: ZBX-1023

              Regards

              Norbert.

              Comment

              Working...