1 | /***************************************************************************** |
2 | |
3 | Copyright (c) 2012, 2016, Oracle and/or its affiliates. All Rights Reserved. |
4 | Copyright (c) 2017, 2018, MariaDB Corporation. |
5 | |
6 | This program is free software; you can redistribute it and/or modify it under |
7 | the terms of the GNU General Public License as published by the Free Software |
8 | Foundation; version 2 of the License. |
9 | |
10 | This program is distributed in the hope that it will be useful, but WITHOUT |
11 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
12 | FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
13 | |
14 | You should have received a copy of the GNU General Public License along with |
15 | this program; if not, write to the Free Software Foundation, Inc., |
16 | 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA |
17 | |
18 | *****************************************************************************/ |
19 | |
20 | /**************************************************//** |
21 | @file include/row0import.h |
22 | Header file for import tablespace functions. |
23 | |
24 | Created 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 |
34 | struct trx_t; |
35 | struct dict_table_t; |
36 | struct row_prebuilt_t; |
37 | |
38 | /*****************************************************************//** |
39 | Imports a tablespace. The space id in the .ibd file must match the space id |
40 | of the table in the data dictionary. |
41 | @return error code or DB_SUCCESS */ |
42 | dberr_t |
43 | row_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 */ |
55 | dberr_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 | /*****************************************************************//** |
60 | Update the (space, root page) of a table's indexes from the values |
61 | in the data dictionary. |
62 | @return DB_SUCCESS or error code */ |
63 | dberr_t |
64 | row_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 | |