]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/cats/postgresql.c
Fix get_basename() -- rewrite
[bacula/bacula] / bacula / src / cats / postgresql.c
index 0e17372783d387db1c626906c112f223e6f120ef..618b45b0abb938a8ee5b010ef6299b51a20e7ca8 100644 (file)
@@ -122,6 +122,13 @@ B_DB_POSTGRESQL::B_DB_POSTGRESQL(JCR *jcr,
    m_buf =  get_pool_memory(PM_FNAME);
    m_allow_transactions = mult_db_connections;
 
+   /* At this time, when mult_db_connections == true, this is for 
+    * specific console command such as bvfs or batch mode, and we don't
+    * want to share a batch mode or bvfs. In the future, we can change
+    * the creation function to add this parameter.
+    */
+   m_dedicated = mult_db_connections; 
+
    /*
     * Initialize the private members.
     */
@@ -273,9 +280,9 @@ void B_DB_POSTGRESQL::db_close_database(JCR *jcr)
 {
    db_end_transaction(jcr);
    P(mutex);
-   sql_free_result();
    m_ref_count--;
    if (m_ref_count == 0) {
+      sql_free_result();
       db_list->remove(this);
       if (m_connected && m_db_handle) {
          PQfinish(m_db_handle);
@@ -938,13 +945,13 @@ bool B_DB_POSTGRESQL::sql_batch_start(JCR *jcr)
    Dmsg0(500, "sql_batch_start started\n");
 
    if (!sql_query("CREATE TEMPORARY TABLE batch ("
-                          "fileindex int,"
-                          "jobid int,"
-                          "path varchar,"
-                          "name varchar,"
-                          "lstat varchar,"
-                          "md5 varchar,"
-                          "markid int)")) {
+                          "FileIndex int,"
+                          "JobId int,"
+                          "Path varchar,"
+                          "Name varchar,"
+                          "LStat varchar,"
+                          "Md5 varchar,"
+                          "DeltaSeq smallint)")) {
       Dmsg0(500, "sql_batch_start failed\n");
       return false;
    }