MySQL 8.4.2
Source Code Documentation
zlob0read.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (c) 2016, 2024, Oracle and/or its affiliates.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License, version 2.0, as published by the
7Free Software Foundation.
8
9This program is designed to work with certain software (including
10but not limited to OpenSSL) that is licensed under separate terms,
11as designated in a particular file or component or in included license
12documentation. The authors of MySQL hereby grant you an additional
13permission to link the program and your derivative works with the
14separately licensed software that they have either included with
15the program or referenced in the documentation.
16
17This program is distributed in the hope that it will be useful, but WITHOUT
18ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
20for more details.
21
22You should have received a copy of the GNU General Public License along with
23this program; if not, write to the Free Software Foundation, Inc.,
2451 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
26*****************************************************************************/
27#ifndef zlob0read_h
28#define zlob0read_h
29
30#include "zlob0index.h"
31
32namespace lob {
33
34/** Read one data chunk associated with one index entry.
35@param[in] index The clustered index containing the LOB.
36@param[in] entry Pointer to the index entry
37@param[in] offset The offset from which to read the chunk.
38@param[in,out] len The length of the output buffer. This length can
39 be greater than the chunk size.
40@param[in,out] buf The output buffer.
41@param[in] mtr Mini-transaction context.
42@return number of bytes copied into the output buffer. */
43ulint z_read_chunk(dict_index_t *index, z_index_entry_t &entry, ulint offset,
44 ulint &len, byte *&buf, mtr_t *mtr);
45
46/** Read one zlib stream fully, given its index entry.
47@param[in] index The index dictionary object.
48@param[in] entry The index entry (memory copy).
49@param[in,out] zbuf The output buffer
50@param[in] zbuf_size The size of the output buffer.
51@param[in,out] mtr Mini-transaction.
52@return the size of the zlib stream.*/
53ulint z_read_strm(dict_index_t *index, z_index_entry_t &entry, byte *zbuf,
54 ulint zbuf_size, mtr_t *mtr);
55
56/** Fetch a compressed large object (ZLOB) from the system.
57@param[in] ctx the read context information.
58@param[in] trx the transaction that is doing the read.
59@param[in] ref the LOB reference identifying the LOB.
60@param[in] offset read the LOB from the given offset.
61@param[in] len the length of LOB data that needs to be fetched.
62@param[out] buf the output buffer (owned by caller) of minimum len bytes.
63@return the amount of data (in bytes) that was actually read. */
65 ulint len, byte *buf);
66
67#ifdef UNIV_DEBUG
68/** Validate one zlib stream, given its index entry.
69@param[in] index The index dictionary object.
70@param[in] entry The index entry (memory copy).
71@param[in] mtr Mini-transaction.
72@return true if validation passed.
73@return does not return if validation failed.*/
75#endif /* UNIV_DEBUG */
76
77} /* namespace lob */
78
79#endif /* zlob0read_h */
Definition: buf0block_hint.cc:30
PT & ref(PT *tp)
Definition: tablespace_impl.cc:359
Provides the large objects (LOB) module.
Definition: lob0del.h:32
ulint z_read_chunk(dict_index_t *index, z_index_entry_t &entry, ulint offset, ulint &len, byte *&buf, mtr_t *mtr)
Read one data chunk associated with one index entry.
Definition: zlob0read.cc:192
ulint z_read_strm(dict_index_t *index, z_index_entry_t &entry, byte *zbuf, ulint zbuf_size, mtr_t *mtr)
Read one zlib stream fully, given its index entry.
Definition: zlob0read.cc:261
bool z_validate_strm(dict_index_t *index, z_index_entry_t &entry, mtr_t *mtr)
Validate one zlib stream, given its index entry.
Definition: zlob0read.cc:341
ulint z_read(lob::ReadContext *ctx, lob::ref_t ref, ulint offset, ulint len, byte *buf)
Fetch a compressed large object (ZLOB) from the system.
Definition: zlob0read.cc:47
Definition: completion_hash.h:35
Data structure for an index.
Definition: dict0mem.h:1046
The context information for reading a single BLOB.
Definition: lob0lob.h:1208
The struct 'lob::ref_t' represents an external field reference.
Definition: lob0lob.h:198
An index entry pointing to one zlib stream.
Definition: zlob0index.h:87
Mini-transaction handle and buffer.
Definition: mtr0mtr.h:177
Definition: trx0trx.h:684
unsigned long int ulint
Definition: univ.i:406