2 * See the file LICENSE for redistribution information.
4 * Copyright (c) 1996-2009 Oracle. All rights reserved.
12 INCLUDE #include "db_int.h"
13 INCLUDE #include "dbinc/crypto.h"
14 INCLUDE #include "dbinc/db_page.h"
15 INCLUDE #include "dbinc/db_am.h"
16 INCLUDE #include "dbinc/btree.h"
17 INCLUDE #include "dbinc/log.h"
18 INCLUDE #include "dbinc/txn.h"
22 * BTREE-split: used to log a page split.
24 * left: the page number for the low-order contents.
25 * llsn: the left page's original LSN.
26 * right: the page number for the high-order contents.
27 * rlsn: the right page's original LSN.
28 * indx: the number of entries that went to the left page.
29 * npgno: the next page number
30 * nlsn: the next page's original LSN (or 0 if no next page).
31 * pgno: the parent page number
32 * plsn: the parent page's original LSN.
33 * pg: the split page's contents before the split.
34 * opflags: SPL_NRECS: if splitting a tree that maintains a record count.
35 * pindx: index of new record in parent page.
40 POINTER llsn DB_LSN * lu
41 ARG right db_pgno_t lu
42 POINTER rlsn DB_LSN * lu
44 ARG npgno db_pgno_t lu
45 POINTER nlsn DB_LSN * lu
46 ARG ppgno db_pgno_t lu
47 POINTER plsn DB_LSN * lu
48 ARG pindx u_int32_t lu
52 ARG opflags u_int32_t lu
55 BEGIN_COMPAT split 42 62
58 POINTER llsn DB_LSN * lu
59 ARG right db_pgno_t lu
60 POINTER rlsn DB_LSN * lu
62 ARG npgno db_pgno_t lu
63 POINTER nlsn DB_LSN * lu
64 ARG root_pgno db_pgno_t lu
66 ARG opflags u_int32_t lu
70 * BTREE-rsplit: used to log a reverse-split
72 * pgno: the page number of the page copied over the root.
73 * pgdbt: the page being copied on the root page.
74 * root_pgno: the root page number.
75 * nrec: the tree's record count.
76 * rootent: last entry on the root page.
77 * rootlsn: the root page's original lsn.
83 ARG root_pgno db_pgno_t lu
86 POINTER rootlsn DB_LSN * lu
90 * BTREE-adj: used to log the adjustment of an index.
92 * pgno: the page modified.
93 * lsn: the page's original lsn.
94 * indx: the index adjusted.
95 * indx_copy: the index to copy if inserting.
96 * is_insert: 0 if a delete, 1 if an insert.
100 ARG pgno db_pgno_t lu
101 POINTER lsn DB_LSN * lu
102 ARG indx u_int32_t lu
103 ARG indx_copy u_int32_t lu
104 ARG is_insert u_int32_t lu
108 * BTREE-cadjust: used to adjust the count change in an internal page.
110 * pgno: the page modified.
111 * lsn: the page's original lsn.
112 * indx: the index to be adjusted.
113 * adjust: the signed adjustment.
114 * opflags: CAD_UPDATEROOT: if root page count was adjusted.
118 ARG pgno db_pgno_t lu
119 POINTER lsn DB_LSN * lu
120 ARG indx u_int32_t lu
121 ARG adjust int32_t ld
122 ARG opflags u_int32_t lu
126 * BTREE-cdel: used to log the intent-to-delete of a cursor record.
128 * pgno: the page modified.
129 * lsn: the page's original lsn.
130 * indx: the index to be deleted.
134 ARG pgno db_pgno_t lu
135 POINTER lsn DB_LSN * lu
136 ARG indx u_int32_t lu
140 * BTREE-repl: used to log the replacement of an item.
142 * pgno: the page modified.
143 * lsn: the page's original lsn.
144 * indx: the index to be replaced.
145 * isdeleted: set if the record was previously deleted.
146 * orig: the original data.
147 * repl: the replacement data.
148 * prefix: the prefix of the replacement that matches the original.
149 * suffix: the suffix of the replacement that matches the original.
153 ARG pgno db_pgno_t lu
154 POINTER lsn DB_LSN * lu
155 ARG indx u_int32_t lu
156 ARG isdeleted u_int32_t lu
159 ARG prefix u_int32_t lu
160 ARG suffix u_int32_t lu
164 * BTREE-root: log the assignment of a root btree page.
168 ARG meta_pgno db_pgno_t lu
169 ARG root_pgno db_pgno_t lu
170 POINTER meta_lsn DB_LSN * lu
174 * BTREE-curadj: undo cursor adjustments on txn abort.
175 * Should only be processed during DB_TXN_ABORT.
176 * NOTE: the first_indx field gets used to hold
177 * signed index adjustment in one case.
178 * care should be taken if its size is changed.
181 /* Fileid of db affected. */
183 /* Which adjustment. */
184 ARG mode db_ca_mode ld
185 /* Page entry is from. */
186 ARG from_pgno db_pgno_t lu
187 /* Page entry went to. */
188 ARG to_pgno db_pgno_t lu
189 /* Left page of root split. */
190 ARG left_pgno db_pgno_t lu
191 /* First index of dup set. Also used as adjustment. */
192 ARG first_indx u_int32_t lu
193 /* Index entry is from. */
194 ARG from_indx u_int32_t lu
195 /* Index where entry went. */
196 ARG to_indx u_int32_t lu
200 * BTREE-rcuradj: undo cursor adjustments on txn abort in
201 * renumbering recno trees.
202 * Should only be processed during DB_TXN_ABORT.
205 /* Fileid of db affected. */
207 /* Which adjustment. */
208 ARG mode ca_recno_arg ld
209 /* Root page number. */
210 ARG root db_pgno_t ld
211 /* Recno of the adjustment. */
212 ARG recno db_recno_t ld
213 /* Order number of the adjustment. */
214 ARG order u_int32_t lu
218 * BTREE-relink -- Handles relinking around a deleted leaf page.
221 BEGIN_COMPAT relink 43 147
222 /* Fileid of db affected. */
224 /* The page being removed. */
225 ARG pgno db_pgno_t lu
226 /* The page's original lsn. */
227 POINTER lsn DB_LSN * lu
228 /* The previous page. */
229 ARG prev db_pgno_t lu
230 /* The previous page's original lsn. */
231 POINTER lsn_prev DB_LSN * lu
233 ARG next db_pgno_t lu
234 /* The previous page's original lsn. */
235 POINTER lsn_next DB_LSN * lu
239 /* Fileid of db affected. */
241 /* The page being removed. */
242 ARG pgno db_pgno_t lu
243 /* The new page number, if any. */
244 ARG new_pgno db_pgno_t lu
245 /* The previous page. */
246 ARG prev db_pgno_t lu
247 /* The previous page's original lsn. */
248 POINTER lsn_prev DB_LSN * lu
250 ARG next db_pgno_t lu
251 /* The previous page's original lsn. */
252 POINTER lsn_next DB_LSN * lu
256 * BTREE-merge -- Handles merging of pages during a compaction.
258 BEGIN_COMPAT merge 44 148
260 ARG pgno db_pgno_t lu
261 POINTER lsn DB_LSN * lu
262 ARG npgno db_pgno_t lu
263 POINTER nlsn DB_LSN * lu
271 ARG pgno db_pgno_t lu
272 POINTER lsn DB_LSN * lu
273 ARG npgno db_pgno_t lu
274 POINTER nlsn DB_LSN * lu
277 ARG pg_copy int32_t lu
281 * BTREE-pgno -- Handles replacing a page number in the record
282 * reference on pgno by indx.
286 ARG pgno db_pgno_t lu
287 POINTER lsn DB_LSN * lu
288 ARG indx u_int32_t lu
289 ARG opgno db_pgno_t lu
290 ARG npgno db_pgno_t lu