Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 8941)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 8942)
@@ -89,4 +89,8 @@
      - the number of events in format version V9 seems to be
        to high by one. We correct for this.
+
+   * msql/MSQLMagic.[h,cc]:
+     - fixed InsertUpdate. The primary key was not inserted 
+       if Insert was called
 
 
Index: /trunk/MagicSoft/Mars/NEWS
===================================================================
--- /trunk/MagicSoft/Mars/NEWS	(revision 8941)
+++ /trunk/MagicSoft/Mars/NEWS	(revision 8942)
@@ -71,5 +71,5 @@
    * Implemented cc file version 2008-20-02/0
 
-   * Added Pyroemeter information to output (stored in a new Tree
+   * Added Pyrometer information to output (stored in a new Tree
      Pyrometer, needs a complete new merpp, i.e. new calibration)
 
Index: /trunk/MagicSoft/Mars/msql/MSQLMagic.cc
===================================================================
--- /trunk/MagicSoft/Mars/msql/MSQLMagic.cc	(revision 8941)
+++ /trunk/MagicSoft/Mars/msql/MSQLMagic.cc	(revision 8942)
@@ -217,5 +217,5 @@
 // In Dummy mode no query is send an -1 is returned.
 //
-Int_t MSQLMagic::Insert(const char *table, const char *vars)
+Int_t MSQLMagic::Insert(const char *table, const char *vars, const char *where)
 {
     // Build query
@@ -224,4 +224,9 @@
     query += " SET ";
     query += vars;
+    if (!TString(where).IsNull())
+    {
+        query += ", ";
+        query += where;
+    }
 
     // Check for dummy mode
@@ -286,5 +291,5 @@
     return ExistStr(col, table, val) ?
         Update(table, vars, Form("%s=%s", col, val)) :
-        Insert(table, vars);
+        Insert(table, vars, Form("%s=%s", col, val));
 }
 
Index: /trunk/MagicSoft/Mars/msql/MSQLMagic.h
===================================================================
--- /trunk/MagicSoft/Mars/msql/MSQLMagic.h	(revision 8941)
+++ /trunk/MagicSoft/Mars/msql/MSQLMagic.h	(revision 8942)
@@ -46,5 +46,5 @@
     Bool_t  ExistStr(const char *column, const char *table, const char *test);
 
-    Int_t Insert(const char *table, const char *vars);
+    Int_t Insert(const char *table, const char *vars, const char *where=0);
     Int_t Update(const char *table, const char *vars, const char *where);
     Int_t Delete(const char *table, const char *where);
