2 * Copyright (c) 2007-2015, SUSE LLC
4 * This program is licensed under the BSD license, read LICENSE.BSD
5 * for further information
11 * Transaction handling
20 #include "transaction.h"
29 obsq_sortcmp(const void *ap, const void *bp, void *dp)
33 Solvable *s, *oas, *obs;
44 s = pool->solvables + a;
45 oas = pool->solvables + oa;
46 obs = pool->solvables + ob;
47 if (oas->name != obs->name)
49 /* bring "same name" obsoleters (i.e. upgraders) to front */
50 if (oas->name == s->name)
52 if (obs->name == s->name)
54 return strcmp(pool_id2str(pool, oas->name), pool_id2str(pool, obs->name));
56 r = pool_evrcmp(pool, oas->evr, obs->evr, EVRCMP_COMPARE);
58 return -r; /* highest version first */
59 if (oas->arch != obs->arch)
61 /* bring same arch to front */
62 if (oas->arch == s->arch)
64 if (obs->arch == s->arch)
71 transaction_all_obs_pkgs(Transaction *trans, Id p, Queue *pkgs)
73 Pool *pool = trans->pool;
74 Solvable *s = pool->solvables + p;
75 Queue *ti = &trans->transaction_info;
80 if (p <= 0 || !s->repo)
82 if (s->repo == pool->installed)
84 q = trans->transaction_installed[p - pool->installed->start];
89 /* only a single obsoleting package */
93 /* find which packages obsolete us */
94 for (i = 0; i < ti->count; i += 2)
95 if (ti->elements[i + 1] == p)
96 queue_push2(pkgs, p, ti->elements[i]);
99 solv_sort(pkgs->elements, pkgs->count / 2, 2 * sizeof(Id), obsq_sortcmp, pool);
100 for (i = 0; i < pkgs->count; i += 2)
101 pkgs->elements[i / 2] = pkgs->elements[i + 1];
102 queue_truncate(pkgs, pkgs->count / 2);
106 /* find the packages we obsolete */
107 for (i = 0; i < ti->count; i += 2)
109 if (ti->elements[i] == p)
110 queue_push(pkgs, ti->elements[i + 1]);
111 else if (pkgs->count)
118 transaction_obs_pkg(Transaction *trans, Id p)
120 Pool *pool = trans->pool;
121 Solvable *s = pool->solvables + p;
125 if (p <= 0 || !s->repo)
127 if (s->repo == pool->installed)
129 p = trans->transaction_installed[p - pool->installed->start];
130 return p < 0 ? -p : p;
132 ti = &trans->transaction_info;
133 for (i = 0; i < ti->count; i += 2)
134 if (ti->elements[i] == p)
135 return ti->elements[i + 1];
141 * calculate base type of transaction element
145 transaction_base_type(Transaction *trans, Id p)
147 Pool *pool = trans->pool;
152 if (!MAPTST(&trans->transactsmap, p))
153 return SOLVER_TRANSACTION_IGNORE;
154 p2 = transaction_obs_pkg(trans, p);
155 if (pool->installed && pool->solvables[p].repo == pool->installed)
159 return SOLVER_TRANSACTION_ERASE;
160 s = pool->solvables + p;
161 s2 = pool->solvables + p2;
162 if (s->name == s2->name)
164 if (s->evr == s2->evr && solvable_identical(s, s2))
165 return SOLVER_TRANSACTION_REINSTALLED;
166 r = pool_evrcmp(pool, s->evr, s2->evr, EVRCMP_COMPARE);
168 return SOLVER_TRANSACTION_UPGRADED;
170 return SOLVER_TRANSACTION_DOWNGRADED;
171 return SOLVER_TRANSACTION_CHANGED;
173 return SOLVER_TRANSACTION_OBSOLETED;
177 /* install or multiinstall */
178 int multi = trans->multiversionmap.size && MAPTST(&trans->multiversionmap, p);
183 s = pool->solvables + p;
184 s2 = pool->solvables + p2;
185 if (s->name == s2->name && s->arch == s2->arch && s->evr == s2->evr)
186 return SOLVER_TRANSACTION_MULTIREINSTALL;
188 return SOLVER_TRANSACTION_MULTIINSTALL;
191 return SOLVER_TRANSACTION_INSTALL;
192 s = pool->solvables + p;
193 s2 = pool->solvables + p2;
194 if (s->name == s2->name)
196 if (s->evr == s2->evr && solvable_identical(s, s2))
197 return SOLVER_TRANSACTION_REINSTALL;
198 r = pool_evrcmp(pool, s->evr, s2->evr, EVRCMP_COMPARE);
200 return SOLVER_TRANSACTION_UPGRADE;
202 return SOLVER_TRANSACTION_DOWNGRADE;
204 return SOLVER_TRANSACTION_CHANGE;
206 return SOLVER_TRANSACTION_OBSOLETES;
210 /* these packages do not get installed by the package manager */
212 is_pseudo_package(Pool *pool, Solvable *s)
214 const char *n = pool_id2str(pool, s->name);
215 if (*n == 'p' && !strncmp(n, "patch:", 6))
217 if (*n == 'p' && !strncmp(n, "pattern:", 8))
219 if (*n == 'p' && !strncmp(n, "product:", 8))
221 if (*n == 'a' && !strncmp(n, "application:", 12))
226 /* these packages will never show up installed */
228 is_noinst_pseudo_package(Pool *pool, Solvable *s)
230 const char *n = pool_id2str(pool, s->name);
231 if (!strncmp(n, "patch:", 6))
233 if (!strncmp(n, "pattern:", 8))
235 #if defined(SUSE) && defined(ENABLE_LINKED_PKGS)
236 /* unlike normal patterns, autopatterns *can* be installed (via the package link),
237 so do not filter them */
240 Id prv, *prvp = s->repo->idarraydata + s->provides;
241 while ((prv = *prvp++) != 0)
242 if (ISRELDEP(prv) && !strcmp(pool_id2str(pool, prv), "autopattern()"))
252 obsoleted_by_pseudos_only(Transaction *trans, Id p)
254 Pool *pool = trans->pool;
259 op = transaction_obs_pkg(trans, p);
260 if (op && !is_pseudo_package(pool, pool->solvables + op))
263 transaction_all_obs_pkgs(trans, p, &q);
264 for (i = 0; i < q.count; i++)
265 if (!is_pseudo_package(pool, pool->solvables + q.elements[i]))
267 i = !q.count || i < q.count ? 0 : 1;
273 * return type of transaction element
275 * filtering is needed if either not all packages are shown
276 * or replaces are not shown, as otherwise parts of the
277 * transaction might not be shown to the user */
280 transaction_type(Transaction *trans, Id p, int mode)
282 Pool *pool = trans->pool;
283 Solvable *s = pool->solvables + p;
289 return SOLVER_TRANSACTION_IGNORE;
291 /* XXX: SUSE only? */
292 if (!(mode & SOLVER_TRANSACTION_KEEP_PSEUDO) && is_noinst_pseudo_package(pool, s))
293 return SOLVER_TRANSACTION_IGNORE;
295 type = transaction_base_type(trans, p);
297 if (type == SOLVER_TRANSACTION_IGNORE)
298 return SOLVER_TRANSACTION_IGNORE; /* not part of the transaction */
300 if ((mode & SOLVER_TRANSACTION_RPM_ONLY) != 0)
302 /* application wants to know what to feed to the package manager */
303 if (!(mode & SOLVER_TRANSACTION_KEEP_PSEUDO) && is_pseudo_package(pool, s))
304 return SOLVER_TRANSACTION_IGNORE;
305 if (type == SOLVER_TRANSACTION_ERASE || type == SOLVER_TRANSACTION_INSTALL || type == SOLVER_TRANSACTION_MULTIINSTALL)
307 if (s->repo == pool->installed)
309 /* check if we're a real package that is obsoleted by pseudos */
310 if (!is_pseudo_package(pool, s) && obsoleted_by_pseudos_only(trans, s - pool->solvables))
311 return SOLVER_TRANSACTION_ERASE;
312 return SOLVER_TRANSACTION_IGNORE; /* ignore as we're being obsoleted */
314 if (type == SOLVER_TRANSACTION_MULTIREINSTALL)
315 return SOLVER_TRANSACTION_MULTIINSTALL;
316 return SOLVER_TRANSACTION_INSTALL;
319 if ((mode & SOLVER_TRANSACTION_SHOW_MULTIINSTALL) == 0)
321 /* application wants to make no difference between install
322 * and multiinstall */
323 if (type == SOLVER_TRANSACTION_MULTIINSTALL)
324 type = SOLVER_TRANSACTION_INSTALL;
325 if (type == SOLVER_TRANSACTION_MULTIREINSTALL)
326 type = SOLVER_TRANSACTION_REINSTALL;
329 if ((mode & SOLVER_TRANSACTION_CHANGE_IS_REINSTALL) != 0)
331 /* application wants to make no difference between change
333 if (type == SOLVER_TRANSACTION_CHANGED)
334 type = SOLVER_TRANSACTION_REINSTALLED;
335 else if (type == SOLVER_TRANSACTION_CHANGE)
336 type = SOLVER_TRANSACTION_REINSTALL;
339 if (type == SOLVER_TRANSACTION_ERASE || type == SOLVER_TRANSACTION_INSTALL || type == SOLVER_TRANSACTION_MULTIINSTALL)
342 if (s->repo == pool->installed && (mode & SOLVER_TRANSACTION_SHOW_ACTIVE) == 0)
344 /* erase element and we're showing the passive side */
345 if (type == SOLVER_TRANSACTION_OBSOLETED && (mode & SOLVER_TRANSACTION_SHOW_OBSOLETES) == 0)
346 type = SOLVER_TRANSACTION_ERASE;
347 if (type == SOLVER_TRANSACTION_OBSOLETED && (mode & SOLVER_TRANSACTION_OBSOLETE_IS_UPGRADE) != 0)
348 type = SOLVER_TRANSACTION_UPGRADED;
351 if (s->repo != pool->installed && (mode & SOLVER_TRANSACTION_SHOW_ACTIVE) != 0)
353 /* install element and we're showing the active side */
354 if (type == SOLVER_TRANSACTION_OBSOLETES && (mode & SOLVER_TRANSACTION_SHOW_OBSOLETES) == 0)
355 type = SOLVER_TRANSACTION_INSTALL;
356 if (type == SOLVER_TRANSACTION_OBSOLETES && (mode & SOLVER_TRANSACTION_OBSOLETE_IS_UPGRADE) != 0)
357 type = SOLVER_TRANSACTION_UPGRADE;
361 /* the element doesn't match the show mode */
363 /* if we're showing all references, we can ignore this package */
364 if ((mode & (SOLVER_TRANSACTION_SHOW_ALL|SOLVER_TRANSACTION_SHOW_OBSOLETES)) == (SOLVER_TRANSACTION_SHOW_ALL|SOLVER_TRANSACTION_SHOW_OBSOLETES))
365 return SOLVER_TRANSACTION_IGNORE;
367 /* we're not showing all refs. check if some other package
368 * references us. If yes, it's safe to ignore this package,
369 * otherwise we need to map the type */
371 /* most of the time there's only one reference, so check it first */
372 q = transaction_obs_pkg(trans, p);
374 if ((mode & SOLVER_TRANSACTION_SHOW_OBSOLETES) == 0)
376 Solvable *sq = pool->solvables + q;
377 if (sq->name != s->name)
379 /* it's a replace but we're not showing replaces. map type. */
380 if (s->repo == pool->installed)
381 return SOLVER_TRANSACTION_ERASE;
382 else if (type == SOLVER_TRANSACTION_MULTIREINSTALL)
383 return SOLVER_TRANSACTION_MULTIINSTALL;
385 return SOLVER_TRANSACTION_INSTALL;
389 /* if there's a match, p will be shown when q
391 if (transaction_obs_pkg(trans, q) == p)
392 return SOLVER_TRANSACTION_IGNORE;
394 /* too bad, a miss. check em all */
397 transaction_all_obs_pkgs(trans, p, &oq);
398 for (i = 0; i < oq.count; i++)
401 if ((mode & SOLVER_TRANSACTION_SHOW_OBSOLETES) == 0)
403 Solvable *sq = pool->solvables + q;
404 if (sq->name != s->name)
407 /* check if we are referenced? */
408 if ((mode & SOLVER_TRANSACTION_SHOW_ALL) != 0)
410 transaction_all_obs_pkgs(trans, q, &rq);
411 for (j = 0; j < rq.count; j++)
412 if (rq.elements[j] == p)
420 else if (transaction_obs_pkg(trans, q) == p)
431 /* we're not referenced. map type */
432 if (s->repo == pool->installed)
433 return SOLVER_TRANSACTION_ERASE;
434 else if (type == SOLVER_TRANSACTION_MULTIREINSTALL)
435 return SOLVER_TRANSACTION_MULTIINSTALL;
437 return SOLVER_TRANSACTION_INSTALL;
439 /* there was a ref, so p is shown with some other package */
440 return SOLVER_TRANSACTION_IGNORE;
446 classify_cmp(const void *ap, const void *bp, void *dp)
448 Transaction *trans = dp;
449 Pool *pool = trans->pool;
459 return a[2] && b[2] ? strcmp(pool_id2str(pool, a[2]), pool_id2str(pool, b[2])) : r;
462 return a[3] && b[3] ? strcmp(pool_id2str(pool, a[3]), pool_id2str(pool, b[3])) : r;
467 classify_cmp_pkgs(const void *ap, const void *bp, void *dp)
469 Transaction *trans = dp;
470 Pool *pool = trans->pool;
475 sa = pool->solvables + a;
476 sb = pool->solvables + b;
477 if (sa->name != sb->name)
478 return strcmp(pool_id2str(pool, sa->name), pool_id2str(pool, sb->name));
479 if (sa->evr != sb->evr)
481 int r = pool_evrcmp(pool, sa->evr, sb->evr, EVRCMP_COMPARE);
489 queue_push4(Queue *q, Id id1, Id id2, Id id3, Id id4)
498 queue_unshift4(Queue *q, Id id1, Id id2, Id id3, Id id4)
500 queue_unshift(q, id4);
501 queue_unshift(q, id3);
502 queue_unshift(q, id2);
503 queue_unshift(q, id1);
507 transaction_classify(Transaction *trans, int mode, Queue *classes)
509 Pool *pool = trans->pool;
510 int ntypes[SOLVER_TRANSACTION_MAXTYPE + 1];
512 Id v, vq, type, p, q;
515 queue_empty(classes);
516 memset(ntypes, 0, sizeof(ntypes));
517 /* go through transaction and classify each step */
518 for (i = 0; i < trans->steps.count; i++)
520 p = trans->steps.elements[i];
521 s = pool->solvables + p;
522 type = transaction_type(trans, p, mode);
524 if (!pool->installed || s->repo != pool->installed)
526 /* don't report vendor/arch changes if we were mapped to erase. */
527 if (type == SOLVER_TRANSACTION_ERASE)
529 /* look at arch/vendor changes */
530 q = transaction_obs_pkg(trans, p);
533 sq = pool->solvables + q;
539 if ((mode & SOLVER_TRANSACTION_MERGE_ARCHCHANGES) != 0)
541 for (j = 0; j < classes->count; j += 4)
542 if (classes->elements[j] == SOLVER_TRANSACTION_ARCHCHANGE && classes->elements[j + 2] == v && classes->elements[j + 3] == vq)
544 if (j == classes->count)
545 queue_push4(classes, SOLVER_TRANSACTION_ARCHCHANGE, 1, v, vq);
547 classes->elements[j + 1]++;
550 v = s->vendor ? s->vendor : 1;
551 vq = sq->vendor ? sq->vendor : 1;
554 if ((mode & SOLVER_TRANSACTION_MERGE_VENDORCHANGES) != 0)
556 for (j = 0; j < classes->count; j += 4)
557 if (classes->elements[j] == SOLVER_TRANSACTION_VENDORCHANGE && classes->elements[j + 2] == v && classes->elements[j + 3] == vq)
559 if (j == classes->count)
560 queue_push4(classes, SOLVER_TRANSACTION_VENDORCHANGE, 1, v, vq);
562 classes->elements[j + 1]++;
565 /* now sort all vendor/arch changes */
566 if (classes->count > 4)
567 solv_sort(classes->elements, classes->count / 4, 4 * sizeof(Id), classify_cmp, trans);
568 /* finally add all classes. put erases last */
569 i = SOLVER_TRANSACTION_ERASE;
571 queue_unshift4(classes, i, ntypes[i], 0, 0);
572 for (i = SOLVER_TRANSACTION_MAXTYPE; i > 0; i--)
576 if (i == SOLVER_TRANSACTION_ERASE)
578 queue_unshift4(classes, i, ntypes[i], 0, 0);
583 transaction_classify_pkgs(Transaction *trans, int mode, Id class, Id from, Id to, Queue *pkgs)
585 Pool *pool = trans->pool;
591 for (i = 0; i < trans->steps.count; i++)
593 p = trans->steps.elements[i];
594 s = pool->solvables + p;
595 if (class <= SOLVER_TRANSACTION_MAXTYPE)
597 type = transaction_type(trans, p, mode);
602 if (!pool->installed || s->repo != pool->installed)
604 q = transaction_obs_pkg(trans, p);
607 sq = pool->solvables + q;
608 if (class == SOLVER_TRANSACTION_ARCHCHANGE)
610 if ((!from && !to) || (s->arch == from && sq->arch == to))
614 if (class == SOLVER_TRANSACTION_VENDORCHANGE)
616 Id v = s->vendor ? s->vendor : 1;
617 Id vq = sq->vendor ? sq->vendor : 1;
618 if ((!from && !to) || (v == from && vq == to))
624 solv_sort(pkgs->elements, pkgs->count, sizeof(Id), classify_cmp_pkgs, trans);
628 create_transaction_info(Transaction *trans, Queue *decisionq)
630 Pool *pool = trans->pool;
631 Queue *ti = &trans->transaction_info;
632 Repo *installed = pool->installed;
638 trans->transaction_installed = solv_free(trans->transaction_installed);
640 return; /* no info needed */
641 for (i = 0; i < decisionq->count; i++)
643 p = decisionq->elements[i];
644 if (p <= 0 || p == SYSTEMSOLVABLE)
646 s = pool->solvables + p;
647 if (!s->repo || s->repo == installed)
649 multi = trans->multiversionmap.size && MAPTST(&trans->multiversionmap, p);
650 FOR_PROVIDES(p2, pp2, s->name)
652 if (!MAPTST(&trans->transactsmap, p2))
654 s2 = pool->solvables + p2;
655 if (s2->repo != installed)
657 if (multi && (s->name != s2->name || s->evr != s2->evr || s->arch != s2->arch))
659 if (!pool->implicitobsoleteusesprovides && s->name != s2->name)
661 if (pool->implicitobsoleteusescolors && !pool_colormatch(pool, s, s2))
663 queue_push2(ti, p, p2);
665 if (s->obsoletes && !multi)
667 Id obs, *obsp = s->repo->idarraydata + s->obsoletes;
668 while ((obs = *obsp++) != 0)
670 FOR_PROVIDES(p2, pp2, obs)
672 if (!MAPTST(&trans->transactsmap, p2))
674 s2 = pool->solvables + p2;
675 if (s2->repo != installed)
677 if (!pool->obsoleteusesprovides && !pool_match_nevr(pool, s2, obs))
679 if (pool->obsoleteusescolors && !pool_colormatch(pool, s, s2))
681 queue_push2(ti, p, p2);
689 solv_sort(ti->elements, ti->count / 2, 2 * sizeof(Id), obsq_sortcmp, pool);
690 for (i = j = 2; i < ti->count; i += 2)
692 if (ti->elements[i] == ti->elements[j - 2] && ti->elements[i + 1] == ti->elements[j - 1])
694 ti->elements[j++] = ti->elements[i];
695 ti->elements[j++] = ti->elements[i + 1];
697 queue_truncate(ti, j);
700 /* create transaction_installed helper */
701 /* entry > 0: exactly one obsoleter, entry < 0: multiple obsoleters, -entry is "best" */
702 trans->transaction_installed = solv_calloc(installed->end - installed->start, sizeof(Id));
703 for (i = 0; i < ti->count; i += 2)
705 j = ti->elements[i + 1] - installed->start;
706 if (!trans->transaction_installed[j])
707 trans->transaction_installed[j] = ti->elements[i];
710 /* more than one package obsoletes us. compare to find "best" */
712 if (trans->transaction_installed[j] > 0)
713 trans->transaction_installed[j] = -trans->transaction_installed[j];
714 q[0] = q[2] = ti->elements[i + 1];
715 q[1] = ti->elements[i];
716 q[3] = -trans->transaction_installed[j];
717 if (obsq_sortcmp(q, q + 2, pool) < 0)
718 trans->transaction_installed[j] = -ti->elements[i];
723 /* create a transaction from the decisionq */
725 transaction_create_decisionq(Pool *pool, Queue *decisionq, Map *multiversionmap)
727 Repo *installed = pool->installed;
733 trans = transaction_create(pool);
734 if (multiversionmap && !multiversionmap->size)
735 multiversionmap = 0; /* ignore empty map */
736 queue_empty(&trans->steps);
737 map_init(&trans->transactsmap, pool->nsolvables);
739 for (i = 0; i < decisionq->count; i++)
741 p = decisionq->elements[i];
742 s = pool->solvables + (p > 0 ? p : -p);
745 if (installed && s->repo == installed && p < 0)
746 MAPSET(&trans->transactsmap, -p);
747 if (!(installed && s->repo == installed) && p > 0)
749 MAPSET(&trans->transactsmap, p);
750 if (multiversionmap && MAPTST(multiversionmap, p))
754 MAPCLR(&trans->transactsmap, SYSTEMSOLVABLE);
756 map_init_clone(&trans->multiversionmap, multiversionmap);
758 create_transaction_info(trans, decisionq);
762 FOR_REPO_SOLVABLES(installed, p, s)
764 if (MAPTST(&trans->transactsmap, p))
765 queue_push(&trans->steps, p);
768 for (i = 0; i < decisionq->count; i++)
770 p = decisionq->elements[i];
771 if (p > 0 && MAPTST(&trans->transactsmap, p))
772 queue_push(&trans->steps, p);
778 transaction_installedresult(Transaction *trans, Queue *installedq)
780 Pool *pool = trans->pool;
781 Repo *installed = pool->installed;
786 queue_empty(installedq);
787 /* first the new installs, than the kept packages */
788 for (i = 0; i < trans->steps.count; i++)
790 p = trans->steps.elements[i];
791 s = pool->solvables + p;
792 if (installed && s->repo == installed)
794 queue_push(installedq, p);
796 cutoff = installedq->count;
799 FOR_REPO_SOLVABLES(installed, p, s)
800 if (!MAPTST(&trans->transactsmap, p))
801 queue_push(installedq, p);
807 transaction_make_installedmap(Transaction *trans, Map *installedmap)
809 Pool *pool = trans->pool;
810 Repo *installed = pool->installed;
815 map_init(installedmap, pool->nsolvables);
816 for (i = 0; i < trans->steps.count; i++)
818 p = trans->steps.elements[i];
819 s = pool->solvables + p;
820 if (!installed || s->repo != installed)
821 MAPSET(installedmap, p);
825 FOR_REPO_SOLVABLES(installed, p, s)
826 if (!MAPTST(&trans->transactsmap, p))
827 MAPSET(installedmap, p);
832 transaction_calc_installsizechange(Transaction *trans)
837 transaction_make_installedmap(trans, &installedmap);
838 change = pool_calc_installsizechange(trans->pool, &installedmap);
839 map_free(&installedmap);
844 transaction_calc_duchanges(Transaction *trans, DUChanges *mps, int nmps)
848 transaction_make_installedmap(trans, &installedmap);
849 pool_calc_duchanges(trans->pool, &installedmap, mps, nmps);
850 map_free(&installedmap);
854 transaction_create(Pool *pool)
856 Transaction *trans = solv_calloc(1, sizeof(*trans));
862 transaction_create_clone(Transaction *srctrans)
864 Transaction *trans = transaction_create(srctrans->pool);
865 queue_init_clone(&trans->steps, &srctrans->steps);
866 queue_init_clone(&trans->transaction_info, &srctrans->transaction_info);
867 if (srctrans->transaction_installed)
869 Repo *installed = srctrans->pool->installed;
870 trans->transaction_installed = solv_memdup2(srctrans->transaction_installed, installed->end - installed->start, sizeof(Id));
872 map_init_clone(&trans->transactsmap, &srctrans->transactsmap);
873 map_init_clone(&trans->multiversionmap, &srctrans->multiversionmap);
874 if (srctrans->orderdata)
875 transaction_clone_orderdata(trans, srctrans);
880 transaction_free(Transaction *trans)
882 queue_free(&trans->steps);
883 queue_free(&trans->transaction_info);
884 trans->transaction_installed = solv_free(trans->transaction_installed);
885 map_free(&trans->transactsmap);
886 map_free(&trans->multiversionmap);
887 if (trans->orderdata)
888 transaction_free_orderdata(trans);