Ad Widget

Collapse

SQL error - when adding a new graph

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rootlinux
    Member
    • Dec 2004
    • 32

    #1

    SQL error - when adding a new graph

    I got the following SQL error when adding a new graph: -

    SQL error: Unknown column 'calc_fnc' in 'field list'
    Query: insert into graphs_items (graphid,itemid,color,drawtype,sortorder,yaxisside ,calc_fnc,type,periods_cnt) values (119,17575,'Blue',0,0,1,2,0,5)
  • erisan500
    Senior Member
    Zabbix Certified Specialist
    • Aug 2005
    • 285

    #2
    If you upgraded from previous versions, did you applied all db patches ?

    Greetings
    EriSan
    Zabbix Certified Specialist

    Comment

    • just2blue4u
      Senior Member
      • Apr 2006
      • 347

      #3
      If you upgraded from previous versions, did you apply the frontend which came with your server version ?
      Big ZABBIX is watching you!
      (... and my 48 hosts, 4513 items, 1280 triggers via zabbix v1.6 on CentOS 5.0)

      Comment

      • rootlinux
        Member
        • Dec 2004
        • 32

        #4
        Yes, I did upgrade all the db patches...and using the new frontend from version 1.1,

        Comment

        • rootlinux
          Member
          • Dec 2004
          • 32

          #5
          I did a SQL query using the following command below: -

          SELECT * FROM `graphs_items`

          The result I get table result I get is below: -

          gitemid | graphid | itemid | drawtype | sortorder | color | yaxisside

          There is no 'calc_fnc', why?

          Comment

          • rootlinux
            Member
            • Dec 2004
            • 32

            #6
            I am newbie in SQL...what does this mean?

            alter table graphs_items add calc_fnc int(1) DEFAULT '2' NOT NULL;
            alter table graphs_items add type int(1) DEFAULT '0' NOT NULL;
            alter table graphs_items add periods_cnt int(4) DEFAULT '5' NOT NULL;

            Got it in upgrades/dbpatches/1.1beta12_to_1.1/mysql/patch.sql

            In the create/mysql/schema.sql, there is 'calc_fnc' as below: -

            --
            -- Table structure for table 'graphs_items'
            --

            CREATE TABLE graphs_items (
            gitemid int(4) NOT NULL auto_increment,
            graphid int(4) DEFAULT '0' NOT NULL,
            itemid int(4) DEFAULT '0' NOT NULL,
            drawtype int(4) DEFAULT '0' NOT NULL,
            sortorder int(4) DEFAULT '0' NOT NULL,
            color varchar(32) DEFAULT 'Dark Green' NOT NULL,
            yaxisside int(1) DEFAULT '1' NOT NULL,
            calc_fnc int(1) DEFAULT '2' NOT NULL,
            type int(1) DEFAULT '0' NOT NULL,
            periods_cnt int(4) DEFAULT '5' NOT NULL,
            PRIMARY KEY (gitemid)
            ) type=InnoDB;

            Comment

            • rootlinux
              Member
              • Dec 2004
              • 32

              #7
              Problem solved...I missed out the dbpatches upgrades,

              Run the dbpatches for: -

              1.1beta11_to_1.1beta12

              and

              1.1beta12_to_1.1

              SOLVED... Thank you all for the hints,

              Comment

              Working...