fixed SQL error when importing object tools
authorVictor Kirhenshtein <victor@netxms.org>
Wed, 9 Dec 2015 15:03:12 +0000 (17:03 +0200)
committerVictor Kirhenshtein <victor@netxms.org>
Wed, 9 Dec 2015 15:03:12 +0000 (17:03 +0200)
src/server/core/objtools.cpp
tools/Makefile.am

index f785474..1f0cf56 100644 (file)
@@ -1024,7 +1024,7 @@ bool ImportObjectTool(ConfigEntry *config)
           ObjectArray<ConfigEntry> *inputFields = inputFieldsRoot->getOrderedSubEntries(_T("inputField#*"));
       if (inputFields->size() > 0)
       {
-         hStmt = DBPrepare(hdb, _T("INSERT INTO object_tools_input_fields (tool_id,name,input_type,display_name,config) VALUES (?,?,?,?,?)"));
+         hStmt = DBPrepare(hdb, _T("INSERT INTO object_tools_input_fields (tool_id,name,input_type,display_name,config,sequence_num) VALUES (?,?,?,?,?,?)"));
          if (hStmt == NULL)
             return ImportFailure(hdb, hStmt);
 
@@ -1036,6 +1036,7 @@ bool ImportObjectTool(ConfigEntry *config)
             DBBind(hStmt, 3, DB_SQLTYPE_INTEGER, (INT32)c->getSubEntryValueAsInt(_T("type")));
             DBBind(hStmt, 4, DB_SQLTYPE_VARCHAR, c->getSubEntryValue(_T("displayName")), DB_BIND_STATIC);
             DBBind(hStmt, 5, DB_SQLTYPE_TEXT, c->getSubEntryValue(_T("config")), DB_BIND_STATIC);
+            DBBind(hStmt, 6, DB_SQLTYPE_INTEGER, (INT32)(i + 1));
 
             if (!DBExecute(hStmt))
             {
index 678e652..d218b40 100644 (file)
@@ -19,4 +19,5 @@ EXTRA_DIST = \
        patch_config.status.pl \
        sharIt \
        stub.sh \
+       updatetag.sh \
        update_xrc.pl