------------------------------------------------------------
revno: 230
committer: John Deal <bassd...@yahoo.com>
branch nick: dbBackEnd
timestamp: Tue 2011-07-05 02:39:13 -0400
message:
  Fixed SQLite Directory so it does not change fields CreatedOn and CreatedBy 
upon a workplace update.
modified:
  mira-server/src/directory/db/sqlite/DbSqliteDirectory.cpp


--
lp:~mira-dev/mira/dbBackEnd
https://code.launchpad.net/~mira-dev/mira/dbBackEnd

You are subscribed to branch lp:~mira-dev/mira/dbBackEnd.
To unsubscribe from this branch go to 
https://code.launchpad.net/~mira-dev/mira/dbBackEnd/+edit-subscription
=== modified file 'mira-server/src/directory/db/sqlite/DbSqliteDirectory.cpp'
--- mira-server/src/directory/db/sqlite/DbSqliteDirectory.cpp	2011-06-06 11:42:22 +0000
+++ mira-server/src/directory/db/sqlite/DbSqliteDirectory.cpp	2011-07-05 06:39:13 +0000
@@ -67,7 +67,7 @@
 static const char m_get_workplace_id_sql[] = "select workplaceID from workplaces where workplacename = :workplacename";
 static const char m_get_workplace_workplacename_sql[] = "select workplaceID, workplaceName, workplaceDesc, createdOn, createdBy, installedUtilities from workplaces where workplaceName = :workplaceName";
 static const char m_put_workplace_sql[] = "insert into workplaces (workplaceName, workplaceDesc, createdOn, createdBy, installedUtilities) values (:workplaceName, :workplaceDesc, :createdOn, :createdBy, :installedUtilities)";
-static const char m_update_workplace_sql[] = "update workplaces set workplaceName = :workplaceName, workplaceDesc = :workplaceDesc, createdOn = :createdOn, createdBy = :createdBy, installedUtilities = :installedUtilities where workplaceID = :workplaceID";
+static const char m_update_workplace_sql[] = "update workplaces set workplaceName = :workplaceName, workplaceDesc = :workplaceDesc, installedUtilities = :installedUtilities where workplaceID = :workplaceID";
 static const char m_delete_workplace_sql[] = "delete from workplaces where workplaceID = :workplaceID";
 
 // RoleTypes SQL.
@@ -2032,27 +2032,6 @@
         return false;
     }
 
-    // Bind createdOn using server date/time.
-    error_code = sqlite3_bind_int64(m_prep_update_workplace, 3,
-        (long) time(NULL));
-
-    if (error_code != SQLITE_OK)
-    { // Binding failed.
-        cout << "Error (DbSqliteDirectory::update_workplace): Binding of createdOn failed. Error Code: "
-            << error_code << " Message: " << sqlite3_errmsg(m_db) << endl;
-        return false;
-    }
-
-    // Bind CreatedBy.  Currently not used(?).  Set to zero for now.
-    error_code = sqlite3_bind_int(m_prep_update_workplace, 4, (int) 0);
-
-    if (error_code != SQLITE_OK)
-    { // Binding failed.
-        cout << "Error (DbSqliteDirectory::update_workplace): Binding of createdBy failed. Error Code: "
-            << error_code << " Message: " << sqlite3_errmsg(m_db) << endl;
-        return false;
-    }
-
     // Build utility list.
     work_field = workplace.get_field(ATTRIBUTE_UTILITY_LIST);
     work_string = "";
@@ -2070,7 +2049,7 @@
         work_string.resize(work_string.size() - 1);
     }
 
-    error_code = sqlite3_bind_text(m_prep_update_workplace, 5,
+    error_code = sqlite3_bind_text(m_prep_update_workplace, 3,
         work_string.c_str(), -1, SQLITE_STATIC);
 
     if (error_code != SQLITE_OK)
@@ -2080,7 +2059,7 @@
         return false;
     }
 
-    error_code = sqlite3_bind_int64(m_prep_update_workplace, 6,
+    error_code = sqlite3_bind_int64(m_prep_update_workplace, 4,
         workplace.get_id()); // Bind workplaceID of workplace to update.
 
     if (error_code != SQLITE_OK)

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Mira-development mailing list
Mira-development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mira-development

Reply via email to