From 13cd6e25d5a87db2df5322e17cc1af91c6a8f98c Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Tue, 23 Feb 2010 18:04:46 +0100 Subject: [PATCH] Fix problem with MySQL with big Base jobs (temporary fix for 5.0.1) --- bacula/src/cats/sql_create.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bacula/src/cats/sql_create.c b/bacula/src/cats/sql_create.c index a106fe888e..ae1affbfb6 100644 --- a/bacula/src/cats/sql_create.c +++ b/bacula/src/cats/sql_create.c @@ -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 " -- 2.39.5