]> git.sur5r.net Git - bacula/bacula/commitdiff
Turn off some code when batch insert not enabled.
authorKern Sibbald <kern@sibbald.com>
Sun, 23 Sep 2007 20:08:13 +0000 (20:08 +0000)
committerKern Sibbald <kern@sibbald.com>
Sun, 23 Sep 2007 20:08:13 +0000 (20:08 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5634 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/cats/mysql.c
bacula/src/cats/postgresql.c
bacula/src/cats/sql_create.c
bacula/src/cats/sqlite.c
bacula/technotes-2.3

index 631e6a474f0d535e0aae9b7d9b2d89d6b59e738d..98bd085a268b34f9b186f6c18148e746b29e4551 100644 (file)
@@ -350,6 +350,7 @@ void my_mysql_free_result(B_DB *mdb)
    db_unlock(mdb);
 }
 
+#ifdef HAVE_BATCH_FILE_INSERT
 char *my_mysql_batch_lock_path_query = "LOCK TABLES Path write,     " 
                                        "            batch write,    " 
                                        "            Path as p write ";
@@ -378,5 +379,6 @@ char *my_mysql_batch_fill_filename_query = "INSERT INTO Filename (Name)       "
                                            "   (SELECT Name                   "
                                            "      FROM Filename AS f          "
                                            "      WHERE f.Name = a.Name)      ";
+#endif /* HAVE_BATCH_FILE_INSERT */
 
 #endif /* HAVE_MYSQL */
index 82d4e09112c6bc11e934d00735ee98ca653cf5fe..ad3ba5e5ac7d09df0b91067e21196343ee54a373 100644 (file)
@@ -799,6 +799,7 @@ char *my_postgresql_copy_escape(char *dest, char *src, size_t len)
    return dest;
 }
 
+#ifdef HAVE_BATCH_FILE_INSERT
 char *my_pg_batch_lock_path_query = "BEGIN; LOCK TABLE Path IN SHARE ROW EXCLUSIVE MODE";
 
 
@@ -817,4 +818,6 @@ char *my_pg_batch_fill_filename_query = "INSERT INTO Filename (Name)        "
                                         "    (SELECT DISTINCT Name FROM batch) as a "
                                         "    WHERE NOT EXISTS               "
                                         "      (SELECT Name FROM Filename WHERE Name = a.Name)";
+#endif /* HAVE_BATCH_FILE_INSERT */
+
 #endif /* HAVE_POSTGRESQL */
index b3b37726e291c45154e899eb6ad9acf8f405f8ff..65dc2224975e224259af4dbf6ca67632986a4974 100644 (file)
@@ -668,6 +668,8 @@ bool db_create_fileset_record(JCR *jcr, B_DB *mdb, FILESET_DBR *fsr)
  *  };
  */
 
+#ifdef HAVE_BATCH_FILE_INSERT
+
 /*  All sql_batch_* functions are used to do bulk batch insert in File/Filename/Path
  *  tables. This code can be activated by adding "#define HAVE_BATCH_FILE_INSERT 1"
  *  in baconfig.h
@@ -746,7 +748,6 @@ bool my_batch_end(JCR *jcr, B_DB *mdb, const char *error)
    return true;
 }
 
-#ifdef HAVE_BATCH_FILE_INSERT
 /* 
  * Returns 1 if OK
  *         0 if failed
index 460fafe452ab4e173005c5656d8c2e2abd603604..0fd4d0d7e26dec9ed9a4e03540f5cfc9d6f7077e 100644 (file)
@@ -448,6 +448,7 @@ SQL_FIELD *my_sqlite_fetch_field(B_DB *mdb)
    return mdb->fields[mdb->field++];
 }
 
+#ifdef HAVE_BATCH_FILE_INSERT
 char *my_sqlite_batch_lock_query = "BEGIN";
 char *my_sqlite_batch_unlock_query = "COMMIT";
 char *my_sqlite_batch_fill_path_query = "INSERT INTO Path (Path)          " 
@@ -457,7 +458,7 @@ char *my_sqlite_batch_fill_path_query = "INSERT INTO Path (Path)          "
 char *my_sqlite_batch_fill_filename_query = "INSERT INTO Filename (Name)       " 
                                             " SELECT DISTINCT Name FROM batch  "
                                             " EXCEPT SELECT Name FROM Filename ";
-
+#endif /* HAVE_BATCH_FILE_INSERT */
 
 
 #endif /* HAVE_SQLITE */
index e3e7b2602931f9d7ef9f7203079ea0b15dd09c9b..33cd3fe787d439a9144e9cf4172209aa2fa31c3d 100644 (file)
@@ -2,6 +2,7 @@
 
 General:
 23Sep07 
+kes  Turn off some code when batch insert not enabled.
 kes  Edit FD name in connect error messages.
 kes  Rework the reservation system to take into account that the Director
      might give us a Volume that is different from the current one being