2 This patch can be applied to version 3.0.1 and should improve
3 error messages when a migration sql query is used and correct
4 the problem identified in bug #1303 with starting Job names
7 Apply it to version 3.0.1 with:
10 patch -p0 <3.0.1-migrate-sql.patch
11 ./configure <your-options>
18 Index: src/dird/migrate.c
19 ===================================================================
20 --- src/dird/migrate.c (revision 8887)
21 +++ src/dird/migrate.c (working copy)
24 idpkt *ids = (idpkt *)ctx;
27 + if (!row || !row[0]) {
28 + Dmsg0(dbglevel, "dbid_hdlr error empty row\n");
29 + return 1; /* stop calling us */
32 add_unique_id(ids, row[0]);
33 Dmsg3(dbglevel, "dbid_hdlr count=%d Ids=%p %s\n", ids->count, ids->list, ids->list);
37 stat = get_next_jobid_from_list(&p, &JobId);
38 Dmsg3(dbglevel, "get_jobid_no=%d stat=%d JobId=%u\n", i, stat, JobId);
39 - jcr->MigrateJobId = JobId;
40 - start_migration_job(jcr);
41 - Dmsg0(dbglevel, "Back from start_migration_job\n");
43 Jmsg(jcr, M_FATAL, 0, _("Invalid JobId found.\n"));
46 Jmsg(jcr, M_INFO, 0, _("No JobIds found to %s.\n"), jcr->get_ActionName(0));
49 + jcr->MigrateJobId = JobId;
50 + start_migration_job(jcr);
51 + Dmsg0(dbglevel, "Back from start_migration_job\n");
54 /* Now get the last JobId and handle it in the current job */
56 UAContext *ua = new_ua_context(jcr);
59 - Mmsg(ua->cmd, "run %s jobid=%s", jcr->job->hdr.name,
60 + Mmsg(ua->cmd, "run job=\"%s\" jobid=%s", jcr->job->name(),
61 edit_uint64(jcr->MigrateJobId, ed1));
62 Dmsg2(dbglevel, "=============== %s cmd=%s\n", jcr->get_OperationName(), ua->cmd);
63 parse_ua_args(ua); /* parse command */