1/*- 2 * See the file LICENSE for redistribution information. 3 * 4 * Copyright (c) 2010, 2013 Oracle and/or its affiliates. All rights reserved. 5 * 6 * $Id$ 7 */ 8 9DBPRIVATE 10PREFIX __heap 11 12INCLUDE #include "db_int.h" 13INCLUDE #include "dbinc/crypto.h" 14INCLUDE #include "dbinc/db_page.h" 15INCLUDE #include "dbinc/db_am.h" 16INCLUDE #include "dbinc/heap.h" 17INCLUDE #include "dbinc/txn.h" 18INCLUDE 19 20/* 21 * addrem -- Add or remove an entry from a heap db. 22 * 23 * opcode: identifies if this is an add or delete. 24 * fileid: file identifier of the file being modified. 25 * pgno: page number. 26 * indx: location at which to insert or delete. 27 * nbytes: number of bytes added/removed to/from the page. 28 * hdr: header for the data item. 29 * dbt: data that is to be added or deleted. 30 * pagelsn: former lsn of the page. 31 */ 32BEGIN addrem 49 151 33ARG opcode u_int32_t lu 34DB fileid int32_t ld 35ARG pgno db_pgno_t lu 36ARG indx u_int32_t lu 37ARG nbytes u_int32_t lu 38DBT hdr DBT s 39DBT dbt DBT s 40POINTER pagelsn DB_LSN * lu 41END 42 43/* 44 * pg_alloc: used to record allocating a new page in a heap database. 45 * 46 * meta_lsn: the lsn of the metadata page 47 * meta_pgno the metadata page 48 * page_lsn: the allocated page's original lsn. 49 * pgno: the page allocated. 50 * ptype: the type of the page allocated. 51 * last_pgno: the last page in the file after this op (4.3+). 52 */ 53BEGIN pg_alloc 49 152 54DB fileid int32_t ld 55POINTER meta_lsn DB_LSN * lu 56ARG meta_pgno db_pgno_t lu 57ARG pgno db_pgno_t lu 58ARG ptype u_int32_t lu 59ARG last_pgno db_pgno_t lu 60END 61 62/* 63 * trunc_meta -- Used to record truncation of a heap database's meta page 64 * 65 * fileid: file identifier of the file being modified. 66 * pgno: page number. 67 * last_pgno: value of last_pgno on meta page 68 * key_count: value of key_count on meta page 69 * record_count: value of record_count on meta page 70 * curregion: value of curregion on meta page 71 * nregions: value of nregions on meta page 72 * pagelsn: former lsn of the page. 73 */ 74BEGIN trunc_meta 49 153 75DB fileid int32_t ld 76ARG pgno db_pgno_t lu 77ARG last_pgno u_int32_t lu 78ARG key_count u_int32_t lu 79ARG record_count u_int32_t lu 80ARG curregion u_int32_t lu 81ARG nregions u_int32_t lu 82POINTER pagelsn DB_LSN * lu 83END 84 85/* 86 * trunc_page -- Used to record truncation of a heap database's region page 87 * 88 * fileid: file identifier of the file being modified. 89 * pgno: page number. 90 * old_data: the contents of the page before truncation 91 * pagelsn: former lsn of the page. 92 */ 93BEGIN trunc_page 49 154 94DB fileid int32_t ld 95ARG pgno db_pgno_t lu 96DBT old_data DBT s 97ARG is_region u_int32_t lu 98POINTER pagelsn DB_LSN * lu 99END 100 101 102