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