1/*****************************************************************************
2
3Copyright (c) 2012, 2016, Oracle and/or its affiliates. All Rights Reserved.
4Copyright (c) 2017, 2018, MariaDB Corporation.
5
6This program is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free Software
8Foundation; version 2 of the License.
9
10This program is distributed in the hope that it will be useful, but WITHOUT
11ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License along with
15this program; if not, write to the Free Software Foundation, Inc.,
1651 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
17
18*****************************************************************************/
19
20/**************************************************//**
21@file include/row0import.h
22Header file for import tablespace functions.
23
24Created 2012-02-08 by Sunny Bains
25*******************************************************/
26
27#ifndef row0import_h
28#define row0import_h
29
30#include "univ.i"
31#include "dict0types.h"
32
33// Forward declarations
34struct trx_t;
35struct dict_table_t;
36struct row_prebuilt_t;
37
38/*****************************************************************//**
39Imports a tablespace. The space id in the .ibd file must match the space id
40of the table in the data dictionary.
41@return error code or DB_SUCCESS */
42dberr_t
43row_import_for_mysql(
44/*=================*/
45 dict_table_t* table, /*!< in/out: table */
46 row_prebuilt_t* prebuilt) /*!< in: prebuilt struct
47 in MySQL */
48 MY_ATTRIBUTE((nonnull, warn_unused_result));
49
50/** Update the DICT_TF2_DISCARDED flag in SYS_TABLES.MIX_LEN.
51@param[in,out] trx dictionary transaction
52@param[in] table_id table identifier
53@param[in] discarded whether to set or clear the flag
54@return DB_SUCCESS or error code */
55dberr_t row_import_update_discarded_flag(trx_t* trx, table_id_t table_id,
56 bool discarded)
57 MY_ATTRIBUTE((nonnull, warn_unused_result));
58
59/*****************************************************************//**
60Update the (space, root page) of a table's indexes from the values
61in the data dictionary.
62@return DB_SUCCESS or error code */
63dberr_t
64row_import_update_index_root(
65/*=========================*/
66 trx_t* trx, /*!< in/out: transaction that
67 covers the update */
68 const dict_table_t* table, /*!< in: Table for which we want
69 to set the root page_no */
70 bool reset, /*!< in: if true then set to
71 FIL_NUL */
72 bool dict_locked) /*!< in: Set to true if the
73 caller already owns the
74 dict_sys_t:: mutex. */
75 MY_ATTRIBUTE((nonnull, warn_unused_result));
76
77#endif /* row0import_h */
78