]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix problem with MySQL with big Base jobs (temporary fix for 5.0.1)
authorEric Bollengier <eric@eb.homelinux.org>
Tue, 23 Feb 2010 17:04:46 +0000 (18:04 +0100)
committerEric Bollengier <eric@eb.homelinux.org>
Tue, 23 Feb 2010 17:06:35 +0000 (18:06 +0100)
bacula/src/cats/sql_create.c

index a106fe888e84e394dd826f426a1b78816d43ed8e..ae1affbfb650db605202b08e2a98b95ac30828ea 100644 (file)
@@ -1237,6 +1237,15 @@ bool db_create_base_file_list(JCR *jcr, B_DB *mdb, char *jobids)
    if (!db_sql_query(mdb, mdb->cmd, NULL, NULL)) {
       goto bail_out;
    }
+   /* Quick and dirty fix for MySQL and Bacula 5.0.1 */
+#ifdef HAVE_MYSQL
+   Mmsg(mdb->cmd, 
+        "CREATE INDEX basefile%lld_idx ON basefile%lld (Path(255), Name(255))", 
+        (uint64_t) jcr->JobId, (uint64_t) jcr->JobId);
+   if (!db_sql_query(mdb, mdb->cmd, NULL, NULL)) {
+      goto bail_out;
+   }
+#endif
    Mmsg(buf, select_recent_version[db_type], jobids, jobids);
    Mmsg(mdb->cmd,
 "CREATE TEMPORARY TABLE new_basefile%lld AS  "