| 1 | /***************************************************************************** |
| 2 | |
| 3 | Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved. |
| 4 | Copyright (c) 2016, 2023, 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, Fifth Floor, Boston, MA 02110-1335 USA |
| 17 | |
| 18 | *****************************************************************************/ |
| 19 | |
| 20 | /**************************************************//** |
| 21 | @file dict/dict0boot.cc |
| 22 | Data dictionary creation and booting |
| 23 | |
| 24 | Created 4/18/1996 Heikki Tuuri |
| 25 | *******************************************************/ |
| 26 | |
| 27 | #include "dict0boot.h"cxx . . $ `<file>/storage/innobase/include/dict0boot.h`/ |
| 28 | #include "dict0crea.h"cxx . . $ `<file>/storage/innobase/include/dict0crea.h`/ |
| 29 | #include "btr0btr.h"cxx . . $ `<file>/storage/innobase/include/btr0btr.h`/ |
| 30 | #include "dict0load.h"cxx . . $ `<file>/storage/innobase/include/dict0load.h`/ |
| 31 | #include "trx0trx.h"cxx . . $ `<file>/storage/innobase/include/trx0trx.h`/ |
| 32 | #include "srv0srv.h"cxx . . $ `<file>/storage/innobase/include/srv0srv.h`/ |
| 33 | #include "buf0flu.h"cxx . . $ `<file>/storage/innobase/include/buf0flu.h`/ |
| 34 | #include "log0recv.h"cxx . . $ `<file>/storage/innobase/include/log0recv.h`/ |
| 35 | #include "os0file.h"cxx . . $ `<file>/storage/innobase/include/os0file.h`/ |
| 36 | |
| 37 | /** The DICT_HDR page identifier */ |
| 38 | static constexpr page_id_tcxx . . $ page_id_t# hdr_page_idcxx . . $ hdr_page_id.{DICT_HDR_SPACEcxx . . $ `storage/innobase/include/dict0boot.h:71:9`!, DICT_HDR_PAGE_NOcxx . . $ `storage/innobase/include/dict0boot.h:72:9`!}; |
| 39 | |
| 40 | /** @return the DICT_HDR block, x-latched */ |
| 41 | static buf_block_tcxx . . $ buf_block_t# *dict_hdr_getcxx . . $ dict_hdr_get(e3f32dc991aa5b79).(mtr_tcxx . . $ mtr_t# *mtr) |
| 42 | { |
| 43 | /* We assume that the DICT_HDR page is always readable and available. */ |
| 44 | buf_block_tcxx . . $ buf_block_t# *b= |
| 45 | buf_page_get_gencxx . . $ buf_page_get_gen(4cc82125c68d4d05).(hdr_page_idcxx . . $ hdr_page_id., 0, RW_X_LATCHcxx . . $ RW_X_LATCH., nullptr, BUF_GETcxx . . $ `storage/innobase/include/buf0buf.h:53:9`!, mtr); |
| 46 | buf_page_make_young_if_neededcxx . . $ buf_page_make_young_if_needed(12ea16e51c748147).(&b->pagecxx . . $ buf_block_t#page.); |
| 47 | return b; |
| 48 | } |
| 49 | |
| 50 | /**********************************************************************//** |
| 51 | Returns a new table, index, or space id. */ |
| 52 | void |
| 53 | dict_hdr_get_new_idcxx . . $ dict_hdr_get_new_id(619bc0377e318a05).( |
| 54 | /*================*/ |
| 55 | trx_tcxx . . $ trx_t#* trx, /*!< in/out: transaction */ |
| 56 | table_id_tcxx . . $ table_id_t#* table_id, /*!< out: table id |
| 57 | (not assigned if NULL) */ |
| 58 | index_id_tcxx . . $ index_id_t#* index_id, /*!< out: index id |
| 59 | (not assigned if NULL) */ |
| 60 | uint32_tcxx . . $ uint32_t#* space_id) /*!< out: space id |
| 61 | (not assigned if NULL) */ |
| 62 | { |
| 63 | ib_id_tcxx . . $ ib_id_t# id; |
| 64 | mtr_tcxx . . $ mtr_t# mtrcxx . . $ mtr_t#mtr_t(a6968fd0d8f26912).{trx}; |
| 65 | |
| 66 | mtr.startcxx . . $ mtr_t#start(49f6e7a06ebc5aa8).(); |
| 67 | buf_block_tcxx . . $ buf_block_t#* dict_hdr = dict_hdr_getcxx . . $ dict_hdr_get(e3f32dc991aa5b79).(&mtr); |
| 68 | |
| 69 | if (table_id) { |
| 70 | id = mach_read_from_8cxx . . $ mach_read_from_8(b191ace3c5bffbd9).(DICT_HDRcxx . . $ `storage/innobase/include/dict0boot.h:83:9`! + DICT_HDR_TABLE_IDcxx . . $ `storage/innobase/include/dict0boot.h:88:9`! |
| 71 | + dict_hdr->pagecxx . . $ buf_block_t#page..framecxx . . $ buf_page_t#frame.); |
| 72 | id++; |
| 73 | mtr.writecxx . . $ mtr_t#write(4888ddbfa94c5eeb).<8>(*dict_hdr, DICT_HDRcxx . . $ `storage/innobase/include/dict0boot.h:83:9`! + DICT_HDR_TABLE_IDcxx . . $ `storage/innobase/include/dict0boot.h:88:9`! |
| 74 | + dict_hdr->pagecxx . . $ buf_block_t#page..framecxx . . $ buf_page_t#frame., id); |
| 75 | *table_id = id; |
| 76 | } |
| 77 | |
| 78 | if (index_id) { |
| 79 | id = mach_read_from_8cxx . . $ mach_read_from_8(b191ace3c5bffbd9).(DICT_HDRcxx . . $ `storage/innobase/include/dict0boot.h:83:9`! + DICT_HDR_INDEX_IDcxx . . $ `storage/innobase/include/dict0boot.h:89:9`! |
| 80 | + dict_hdr->pagecxx . . $ buf_block_t#page..framecxx . . $ buf_page_t#frame.); |
| 81 | id++; |
| 82 | mtr.writecxx . . $ mtr_t#write(4888ddbfa94c5eeb).<8>(*dict_hdr, DICT_HDRcxx . . $ `storage/innobase/include/dict0boot.h:83:9`! + DICT_HDR_INDEX_IDcxx . . $ `storage/innobase/include/dict0boot.h:89:9`! |
| 83 | + dict_hdr->pagecxx . . $ buf_block_t#page..framecxx . . $ buf_page_t#frame., id); |
| 84 | *index_id = id; |
| 85 | } |
| 86 | |
| 87 | if (space_id) { |
| 88 | *space_id = mach_read_from_4cxx . . $ mach_read_from_4(ca1608e2c87725e2).(DICT_HDRcxx . . $ `storage/innobase/include/dict0boot.h:83:9`! + DICT_HDR_MAX_SPACE_IDcxx . . $ `storage/innobase/include/dict0boot.h:90:9`! |
| 89 | + dict_hdr->pagecxx . . $ buf_block_t#page..framecxx . . $ buf_page_t#frame.); |
| 90 | if (fil_assign_new_space_idcxx . . $ fil_assign_new_space_id(f4db574767150238).(space_id)) { |
| 91 | mtr.writecxx . . $ mtr_t#write(4888ddbfa94c5eeb).<4>(*dict_hdr, |
| 92 | DICT_HDRcxx . . $ `storage/innobase/include/dict0boot.h:83:9`! + DICT_HDR_MAX_SPACE_IDcxx . . $ `storage/innobase/include/dict0boot.h:90:9`! |
| 93 | + dict_hdr->pagecxx . . $ buf_block_t#page..framecxx . . $ buf_page_t#frame., *space_id); |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | mtr.commitcxx . . $ mtr_t#commit(49f6e7a06ebc5aa8).(); |
| 98 | } |
| 99 | |
| 100 | /** Create the DICT_HDR page on database initialization. |
| 101 | @return error code */ |
| 102 | dberr_tcxx . . $ dberr_t# dict_createcxx . . $ dict_create(629d9d73bf1a44e9).() |
| 103 | { |
| 104 | ulintcxx . . $ ulint# root_page_no; |
| 105 | |
| 106 | dberr_tcxx . . $ dberr_t# err; |
| 107 | mtr_tcxx . . $ mtr_t# mtrcxx . . $ mtr_t#mtr_t(a6968fd0d8f26912).{nullptr}; |
| 108 | mtr.startcxx . . $ mtr_t#start(49f6e7a06ebc5aa8).(); |
| 109 | compile_time_assertcxx . . $ `include/my_global.h:377:9`!(DICT_HDR_SPACEcxx . . $ `storage/innobase/include/dict0boot.h:71:9`! == 0); |
| 110 | |
| 111 | /* Create the dictionary header file block in a new, allocated file |
| 112 | segment in the system tablespace */ |
| 113 | buf_block_tcxx . . $ buf_block_t#* d = fseg_createcxx . . $ fseg_create(8bc949c6f95c6eb1).(fil_systemcxx . . $ fil_system..sys_spacecxx . . $ fil_system_t#sys_space., |
| 114 | DICT_HDRcxx . . $ `storage/innobase/include/dict0boot.h:83:9`! + DICT_HDR_FSEG_HEADERcxx . . $ `storage/innobase/include/dict0boot.h:98:9`!, &mtr, |
| 115 | &err); |
| 116 | if (!d) { |
| 117 | goto func_exit; |
| 118 | } |
| 119 | ut_acxx . . $ `storage/innobase/include/ut0dbg.h:50:9`!(d->page.id() == hdr_page_id); |
| 120 | |
| 121 | /* Start counting table, index, and tree ids from |
| 122 | DICT_HDR_FIRST_ID */ |
| 123 | mtr.writecxx . . $ mtr_t#write(4888ddbfa94c5eeb).<8>(*d, DICT_HDRcxx . . $ `storage/innobase/include/dict0boot.h:83:9`! + DICT_HDR_TABLE_IDcxx . . $ `storage/innobase/include/dict0boot.h:88:9`! + d->pagecxx . . $ buf_block_t#page..framecxx . . $ buf_page_t#frame., |
| 124 | DICT_HDR_FIRST_IDcxx . . $ DICT_HDR_FIRST_ID.); |
| 125 | mtr.writecxx . . $ mtr_t#write(4888ddbfa94c5eeb).<8>(*d, DICT_HDRcxx . . $ `storage/innobase/include/dict0boot.h:83:9`! + DICT_HDR_INDEX_IDcxx . . $ `storage/innobase/include/dict0boot.h:89:9`! + d->pagecxx . . $ buf_block_t#page..framecxx . . $ buf_page_t#frame., |
| 126 | DICT_HDR_FIRST_IDcxx . . $ DICT_HDR_FIRST_ID.); |
| 127 | |
| 128 | ut_adcxx . . $ `storage/innobase/include/ut0dbg.h:62:9`!(!mach_read_from_4(DICT_HDR + DICT_HDR_MAX_SPACE_ID |
| 129 | + d->page.frame)); |
| 130 | |
| 131 | /* Obsolete, but we must initialize it anyway. */ |
| 132 | mtr.writecxx . . $ mtr_t#write(4888ddbfa94c5eeb).<4>(*d, DICT_HDRcxx . . $ `storage/innobase/include/dict0boot.h:83:9`! + DICT_HDR_MIX_ID_LOWcxx . . $ `storage/innobase/include/dict0boot.h:91:9`! + d->pagecxx . . $ buf_block_t#page..framecxx . . $ buf_page_t#frame., |
| 133 | DICT_HDR_FIRST_IDcxx . . $ DICT_HDR_FIRST_ID.); |
| 134 | |
| 135 | /* Create the B-tree roots for the clustered indexes of the basic |
| 136 | system tables */ |
| 137 | |
| 138 | /*--------------------------*/ |
| 139 | root_page_no = btr_createcxx . . $ btr_create(3d74a30862055473).(DICT_CLUSTEREDcxx . . $ `storage/innobase/include/dict0mem.h:65:9`! | DICT_UNIQUEcxx . . $ `storage/innobase/include/dict0mem.h:68:9`!, |
| 140 | fil_systemcxx . . $ fil_system..sys_spacecxx . . $ fil_system_t#sys_space., DICT_TABLES_IDcxx . . $ `storage/innobase/include/dict0boot.h:75:9`!, |
| 141 | nullptr, &mtr, &err); |
| 142 | if (root_page_no == FIL_NULLcxx . . $ `storage/innobase/include/fil0fil.h:1175:9`!) { |
| 143 | goto func_exit; |
| 144 | } |
| 145 | |
| 146 | mtr.writecxx . . $ mtr_t#write(4888ddbfa94c5eeb).<4>(*d, DICT_HDRcxx . . $ `storage/innobase/include/dict0boot.h:83:9`! + DICT_HDR_TABLEScxx . . $ `storage/innobase/include/dict0boot.h:92:9`! + d->pagecxx . . $ buf_block_t#page..framecxx . . $ buf_page_t#frame., |
| 147 | root_page_no); |
| 148 | /*--------------------------*/ |
| 149 | root_page_no = btr_createcxx . . $ btr_create(3d74a30862055473).(DICT_UNIQUEcxx . . $ `storage/innobase/include/dict0mem.h:68:9`!, |
| 150 | fil_systemcxx . . $ fil_system..sys_spacecxx . . $ fil_system_t#sys_space., DICT_TABLE_IDS_IDcxx . . $ `storage/innobase/include/dict0boot.h:80:9`!, |
| 151 | nullptr, &mtr, &err); |
| 152 | if (root_page_no == FIL_NULLcxx . . $ `storage/innobase/include/fil0fil.h:1175:9`!) { |
| 153 | goto func_exit; |
| 154 | } |
| 155 | |
| 156 | mtr.writecxx . . $ mtr_t#write(4888ddbfa94c5eeb).<4>(*d, DICT_HDRcxx . . $ `storage/innobase/include/dict0boot.h:83:9`! + DICT_HDR_TABLE_IDScxx . . $ `storage/innobase/include/dict0boot.h:93:9`! + d->pagecxx . . $ buf_block_t#page..framecxx . . $ buf_page_t#frame., |
| 157 | root_page_no); |
| 158 | /*--------------------------*/ |
| 159 | root_page_no = btr_createcxx . . $ btr_create(3d74a30862055473).(DICT_CLUSTEREDcxx . . $ `storage/innobase/include/dict0mem.h:65:9`! | DICT_UNIQUEcxx . . $ `storage/innobase/include/dict0mem.h:68:9`!, |
| 160 | fil_systemcxx . . $ fil_system..sys_spacecxx . . $ fil_system_t#sys_space., DICT_COLUMNS_IDcxx . . $ `storage/innobase/include/dict0boot.h:76:9`!, |
| 161 | nullptr, &mtr, &err); |
| 162 | if (root_page_no == FIL_NULLcxx . . $ `storage/innobase/include/fil0fil.h:1175:9`!) { |
| 163 | goto func_exit; |
| 164 | } |
| 165 | |
| 166 | mtr.writecxx . . $ mtr_t#write(4888ddbfa94c5eeb).<4>(*d, DICT_HDRcxx . . $ `storage/innobase/include/dict0boot.h:83:9`! + DICT_HDR_COLUMNScxx . . $ `storage/innobase/include/dict0boot.h:94:9`! + d->pagecxx . . $ buf_block_t#page..framecxx . . $ buf_page_t#frame., |
| 167 | root_page_no); |
| 168 | /*--------------------------*/ |
| 169 | root_page_no = btr_createcxx . . $ btr_create(3d74a30862055473).(DICT_CLUSTEREDcxx . . $ `storage/innobase/include/dict0mem.h:65:9`! | DICT_UNIQUEcxx . . $ `storage/innobase/include/dict0mem.h:68:9`!, |
| 170 | fil_systemcxx . . $ fil_system..sys_spacecxx . . $ fil_system_t#sys_space., DICT_INDEXES_IDcxx . . $ `storage/innobase/include/dict0boot.h:77:9`!, |
| 171 | nullptr, &mtr, &err); |
| 172 | if (root_page_no == FIL_NULLcxx . . $ `storage/innobase/include/fil0fil.h:1175:9`!) { |
| 173 | goto func_exit; |
| 174 | } |
| 175 | |
| 176 | mtr.writecxx . . $ mtr_t#write(4888ddbfa94c5eeb).<4>(*d, DICT_HDRcxx . . $ `storage/innobase/include/dict0boot.h:83:9`! + DICT_HDR_INDEXEScxx . . $ `storage/innobase/include/dict0boot.h:95:9`! + d->pagecxx . . $ buf_block_t#page..framecxx . . $ buf_page_t#frame., |
| 177 | root_page_no); |
| 178 | /*--------------------------*/ |
| 179 | root_page_no = btr_createcxx . . $ btr_create(3d74a30862055473).(DICT_CLUSTEREDcxx . . $ `storage/innobase/include/dict0mem.h:65:9`! | DICT_UNIQUEcxx . . $ `storage/innobase/include/dict0mem.h:68:9`!, |
| 180 | fil_systemcxx . . $ fil_system..sys_spacecxx . . $ fil_system_t#sys_space., DICT_FIELDS_IDcxx . . $ `storage/innobase/include/dict0boot.h:78:9`!, |
| 181 | nullptr, &mtr, &err); |
| 182 | if (root_page_no == FIL_NULLcxx . . $ `storage/innobase/include/fil0fil.h:1175:9`!) { |
| 183 | goto func_exit; |
| 184 | } |
| 185 | |
| 186 | mtr.writecxx . . $ mtr_t#write(4888ddbfa94c5eeb).<4>(*d, DICT_HDRcxx . . $ `storage/innobase/include/dict0boot.h:83:9`! + DICT_HDR_FIELDScxx . . $ `storage/innobase/include/dict0boot.h:96:9`! + d->pagecxx . . $ buf_block_t#page..framecxx . . $ buf_page_t#frame., |
| 187 | root_page_no); |
| 188 | func_exit: |
| 189 | mtr.commitcxx . . $ mtr_t#commit(49f6e7a06ebc5aa8).(); |
| 190 | return err ? err : dict_bootcxx . . $ dict_boot(629d9d73bf1a44e9).(); |
| 191 | } |
| 192 | |
| 193 | /*****************************************************************//** |
| 194 | Initializes the data dictionary memory structures when the database is |
| 195 | started. This function is also called when the data dictionary is created. |
| 196 | @return DB_SUCCESS or error code. */ |
| 197 | dberr_tcxx . . $ dberr_t# dict_bootcxx . . $ dict_boot(629d9d73bf1a44e9).() |
| 198 | { |
| 199 | dict_table_tcxx . . $ dict_table_t#* table; |
| 200 | dict_index_tcxx . . $ dict_index_t#* index; |
| 201 | mem_heap_tcxx . . $ mem_heap_t#* heap; |
| 202 | mtr_tcxx . . $ mtr_t# mtrcxx . . $ mtr_t#mtr_t(a6968fd0d8f26912).{nullptr}; |
| 203 | |
| 204 | static_assert(DICT_NUM_COLS__SYS_TABLEScxx . . $ DICT_NUM_COLS__SYS_TABLES. == 8, "compatibility"); |
| 205 | static_assert(DICT_NUM_FIELDS__SYS_TABLEScxx . . $ DICT_NUM_FIELDS__SYS_TABLES. == 10, "compatibility"); |
| 206 | static_assert(DICT_NUM_FIELDS__SYS_TABLE_IDScxx . . $ DICT_NUM_FIELDS__SYS_TABLE_IDS. == 2, "compatibility"); |
| 207 | static_assert(DICT_NUM_COLS__SYS_COLUMNScxx . . $ DICT_NUM_COLS__SYS_COLUMNS. == 7, "compatibility"); |
| 208 | static_assert(DICT_NUM_FIELDS__SYS_COLUMNScxx . . $ DICT_NUM_FIELDS__SYS_COLUMNS. == 9, "compatibility"); |
| 209 | static_assert(DICT_NUM_COLS__SYS_INDEXEScxx . . $ DICT_NUM_COLS__SYS_INDEXES. == 8, "compatibility"); |
| 210 | static_assert(DICT_NUM_FIELDS__SYS_INDEXEScxx . . $ DICT_NUM_FIELDS__SYS_INDEXES. == 10, "compatibility"); |
| 211 | static_assert(DICT_NUM_COLS__SYS_FIELDScxx . . $ DICT_NUM_COLS__SYS_FIELDS. == 3, "compatibility"); |
| 212 | static_assert(DICT_NUM_FIELDS__SYS_FIELDScxx . . $ DICT_NUM_FIELDS__SYS_FIELDS. == 5, "compatibility"); |
| 213 | static_assert(DICT_NUM_COLS__SYS_FOREIGNcxx . . $ DICT_NUM_COLS__SYS_FOREIGN. == 4, "compatibility"); |
| 214 | static_assert(DICT_NUM_FIELDS__SYS_FOREIGNcxx . . $ DICT_NUM_FIELDS__SYS_FOREIGN. == 6, "compatibility"); |
| 215 | static_assert(DICT_NUM_FIELDS__SYS_FOREIGN_FOR_NAMEcxx . . $ DICT_NUM_FIELDS__SYS_FOREIGN_FOR_NAME. == 2, |
| 216 | "compatibility"); |
| 217 | static_assert(DICT_NUM_COLS__SYS_FOREIGN_COLScxx . . $ DICT_NUM_COLS__SYS_FOREIGN_COLS. == 4, "compatibility"); |
| 218 | static_assert(DICT_NUM_FIELDS__SYS_FOREIGN_COLScxx . . $ DICT_NUM_FIELDS__SYS_FOREIGN_COLS. == 6, "compatibility"); |
| 219 | |
| 220 | mtr.startcxx . . $ mtr_t#start(49f6e7a06ebc5aa8).(); |
| 221 | /* Create the hash tables etc. */ |
| 222 | dict_syscxx . . $ dict_sys..createcxx . . $ dict_sys_t#create(ced63f7c635d850d).(); |
| 223 | |
| 224 | dberr_tcxx . . $ dberr_t# err; |
| 225 | const buf_block_tcxx . . $ buf_block_t# *d = recv_syscxx . . $ recv_sys..recovercxx . . $ recv_sys_t#recover(f8d552174319aa25).(hdr_page_idcxx . . $ hdr_page_id., &mtr ,&err); |
| 226 | DBUG_EXECUTE_IFcxx . . $ `include/my_dbug.h:172:9`!("hdr_page_corrupt", |
| 227 | err= DB_CORRUPTION; |
| 228 | d= nullptr;); |
| 229 | if (!d) { |
| 230 | mtr.commitcxx . . $ mtr_t#commit(49f6e7a06ebc5aa8).(); |
| 231 | return err; |
| 232 | } |
| 233 | |
| 234 | heap = mem_heap_createcxx . . $ `storage/innobase/include/mem0mem.h:85:10`!(450); |
| 235 | |
| 236 | dict_syscxx . . $ dict_sys..lockcxx . . $ dict_sys_t#lock(9bb8261ff8654062).(SRW_LOCK_CALLcxx . . $ `storage/innobase/include/srw_lock.h:44:10`!); |
| 237 | |
| 238 | const bytecxx . . $ byte#* dict_hdr = &d->pagecxx . . $ buf_block_t#page..framecxx . . $ buf_page_t#frame.[DICT_HDRcxx . . $ `storage/innobase/include/dict0boot.h:83:9`!]; |
| 239 | |
| 240 | if (uint32_tcxx . . $ uint32_t# max_space_id |
| 241 | = mach_read_from_4cxx . . $ mach_read_from_4(ca1608e2c87725e2).(dict_hdr + DICT_HDR_MAX_SPACE_IDcxx . . $ `storage/innobase/include/dict0boot.h:90:9`!)) { |
| 242 | max_space_id--; |
| 243 | fil_assign_new_space_idcxx . . $ fil_assign_new_space_id(f4db574767150238).(&max_space_id); |
| 244 | } |
| 245 | |
| 246 | /* Insert into the dictionary cache the descriptions of the basic |
| 247 | system tables */ |
| 248 | /*-------------------------*/ |
| 249 | table = dict_table_tcxx . . $ dict_table_t#::createcxx . . $ dict_table_t#create(3c27cf8a971d66c7).(dict_syscxx . . $ dict_sys..SYS_TABLEcxx . . $ dict_sys_t#SYS_TABLE.[dict_syscxx . . $ dict_sys..SYS_TABLEScxx . . $ dict_sys_t#SYS_TABLES.], |
| 250 | fil_systemcxx . . $ fil_system..sys_spacecxx . . $ fil_system_t#sys_space., |
| 251 | DICT_NUM_COLS__SYS_TABLEScxx . . $ DICT_NUM_COLS__SYS_TABLES., 0, 0, 0); |
| 252 | dict_mem_table_add_colcxx . . $ dict_mem_table_add_col(d1893c21bc74da17).(table, heap, "NAME", DATA_BINARYcxx . . $ `storage/innobase/include/data0type.h:59:9`!, 0, |
| 253 | MAX_FULL_NAME_LENcxx . . $ `storage/innobase/include/univ.i:260:9`!); |
| 254 | dict_mem_table_add_colcxx . . $ dict_mem_table_add_col(d1893c21bc74da17).(table, heap, "ID", DATA_BINARYcxx . . $ `storage/innobase/include/data0type.h:59:9`!, 0, 8); |
| 255 | /* ROW_FORMAT = (N_COLS >> 31) ? COMPACT : REDUNDANT */ |
| 256 | dict_mem_table_add_colcxx . . $ dict_mem_table_add_col(d1893c21bc74da17).(table, heap, "N_COLS", DATA_INTcxx . . $ `storage/innobase/include/data0type.h:66:9`!, 0, 4); |
| 257 | /* The low order bit of TYPE is always set to 1. If ROW_FORMAT |
| 258 | is not REDUNDANT or COMPACT, this field matches table->flags. */ |
| 259 | dict_mem_table_add_colcxx . . $ dict_mem_table_add_col(d1893c21bc74da17).(table, heap, "TYPE", DATA_INTcxx . . $ `storage/innobase/include/data0type.h:66:9`!, 0, 4); |
| 260 | dict_mem_table_add_colcxx . . $ dict_mem_table_add_col(d1893c21bc74da17).(table, heap, "MIX_ID", DATA_BINARYcxx . . $ `storage/innobase/include/data0type.h:59:9`!, 0, 0); |
| 261 | /* MIX_LEN may contain additional table flags when |
| 262 | ROW_FORMAT!=REDUNDANT. */ |
| 263 | dict_mem_table_add_colcxx . . $ dict_mem_table_add_col(d1893c21bc74da17).(table, heap, "MIX_LEN", DATA_INTcxx . . $ `storage/innobase/include/data0type.h:66:9`!, 0, 4); |
| 264 | dict_mem_table_add_colcxx . . $ dict_mem_table_add_col(d1893c21bc74da17).(table, heap, "CLUSTER_NAME", DATA_BINARYcxx . . $ `storage/innobase/include/data0type.h:59:9`!, 0, 0); |
| 265 | dict_mem_table_add_colcxx . . $ dict_mem_table_add_col(d1893c21bc74da17).(table, heap, "SPACE", DATA_INTcxx . . $ `storage/innobase/include/data0type.h:66:9`!, 0, 4); |
| 266 | |
| 267 | table->idcxx . . $ dict_table_t#id. = DICT_TABLES_IDcxx . . $ `storage/innobase/include/dict0boot.h:75:9`!; |
| 268 | |
| 269 | dict_table_add_system_columnscxx . . $ dict_table_add_system_columns(f54c2afd6563a66e).(table, heap); |
| 270 | table->add_to_cachecxx . . $ dict_table_t#add_to_cache(49f6e7a06ebc5aa8).(); |
| 271 | dict_syscxx . . $ dict_sys..sys_tablescxx . . $ dict_sys_t#sys_tables. = table; |
| 272 | mem_heap_emptycxx . . $ mem_heap_empty(5231cf397463bfab).(heap); |
| 273 | |
| 274 | index = dict_mem_index_createcxx . . $ dict_mem_index_create(e48d716bb01ae4e7).(table, "CLUST_IND", |
| 275 | DICT_UNIQUEcxx . . $ `storage/innobase/include/dict0mem.h:68:9`! | DICT_CLUSTEREDcxx . . $ `storage/innobase/include/dict0mem.h:65:9`!, 1); |
| 276 | |
| 277 | dict_mem_index_add_fieldcxx . . $ dict_mem_index_add_field(61ed6e1a807d1641).(index, "NAME", 0); |
| 278 | |
| 279 | index->idcxx . . $ dict_index_t#id. = DICT_TABLES_IDcxx . . $ `storage/innobase/include/dict0boot.h:75:9`!; |
| 280 | err = dict_index_add_to_cachecxx . . $ dict_index_add_to_cache(3d07a3b14c80f9f5).( |
| 281 | index, mach_read_from_4cxx . . $ mach_read_from_4(ca1608e2c87725e2).(dict_hdr + DICT_HDR_TABLEScxx . . $ `storage/innobase/include/dict0boot.h:92:9`!)); |
| 282 | ut_acxx . . $ `storage/innobase/include/ut0dbg.h:50:9`!(err == DB_SUCCESS); |
| 283 | ut_adcxx . . $ `storage/innobase/include/ut0dbg.h:62:9`!(!table->is_instant()); |
| 284 | table->indexescxx . . $ dict_table_t#indexes..startcxx . . $ ut_list_base#start.->n_core_null_bytescxx . . $ dict_index_t#n_core_null_bytes. = static_cast<uint8_tcxx . . $ uint8_t#>( |
| 285 | UT_BITS_IN_BYTEScxx . . $ `storage/innobase/include/ut0ut.h:93:9`!(unsigned(table->indexes.start->n_nullable))); |
| 286 | |
| 287 | /*-------------------------*/ |
| 288 | index = dict_mem_index_createcxx . . $ dict_mem_index_create(e48d716bb01ae4e7).(table, "ID_IND", DICT_UNIQUEcxx . . $ `storage/innobase/include/dict0mem.h:68:9`!, 1); |
| 289 | dict_mem_index_add_fieldcxx . . $ dict_mem_index_add_field(61ed6e1a807d1641).(index, "ID", 0); |
| 290 | |
| 291 | index->idcxx . . $ dict_index_t#id. = DICT_TABLE_IDS_IDcxx . . $ `storage/innobase/include/dict0boot.h:80:9`!; |
| 292 | err = dict_index_add_to_cachecxx . . $ dict_index_add_to_cache(3d07a3b14c80f9f5).( |
| 293 | index, mach_read_from_4cxx . . $ mach_read_from_4(ca1608e2c87725e2).(dict_hdr + DICT_HDR_TABLE_IDScxx . . $ `storage/innobase/include/dict0boot.h:93:9`!)); |
| 294 | ut_acxx . . $ `storage/innobase/include/ut0dbg.h:50:9`!(err == DB_SUCCESS); |
| 295 | |
| 296 | /*-------------------------*/ |
| 297 | table = dict_table_tcxx . . $ dict_table_t#::createcxx . . $ dict_table_t#create(3c27cf8a971d66c7).(dict_syscxx . . $ dict_sys..SYS_TABLEcxx . . $ dict_sys_t#SYS_TABLE.[dict_syscxx . . $ dict_sys..SYS_COLUMNScxx . . $ dict_sys_t#SYS_COLUMNS.], |
| 298 | fil_systemcxx . . $ fil_system..sys_spacecxx . . $ fil_system_t#sys_space., |
| 299 | DICT_NUM_COLS__SYS_COLUMNScxx . . $ DICT_NUM_COLS__SYS_COLUMNS., 0, 0, 0); |
| 300 | dict_mem_table_add_colcxx . . $ dict_mem_table_add_col(d1893c21bc74da17).(table, heap, "TABLE_ID", DATA_BINARYcxx . . $ `storage/innobase/include/data0type.h:59:9`!, 0, 8); |
| 301 | dict_mem_table_add_colcxx . . $ dict_mem_table_add_col(d1893c21bc74da17).(table, heap, "POS", DATA_INTcxx . . $ `storage/innobase/include/data0type.h:66:9`!, 0, 4); |
| 302 | dict_mem_table_add_colcxx . . $ dict_mem_table_add_col(d1893c21bc74da17).(table, heap, "NAME", DATA_BINARYcxx . . $ `storage/innobase/include/data0type.h:59:9`!, 0, 0); |
| 303 | dict_mem_table_add_colcxx . . $ dict_mem_table_add_col(d1893c21bc74da17).(table, heap, "MTYPE", DATA_INTcxx . . $ `storage/innobase/include/data0type.h:66:9`!, 0, 4); |
| 304 | dict_mem_table_add_colcxx . . $ dict_mem_table_add_col(d1893c21bc74da17).(table, heap, "PRTYPE", DATA_INTcxx . . $ `storage/innobase/include/data0type.h:66:9`!, 0, 4); |
| 305 | dict_mem_table_add_colcxx . . $ dict_mem_table_add_col(d1893c21bc74da17).(table, heap, "LEN", DATA_INTcxx . . $ `storage/innobase/include/data0type.h:66:9`!, 0, 4); |
| 306 | dict_mem_table_add_colcxx . . $ dict_mem_table_add_col(d1893c21bc74da17).(table, heap, "PREC", DATA_INTcxx . . $ `storage/innobase/include/data0type.h:66:9`!, 0, 4); |
| 307 | |
| 308 | table->idcxx . . $ dict_table_t#id. = DICT_COLUMNS_IDcxx . . $ `storage/innobase/include/dict0boot.h:76:9`!; |
| 309 | |
| 310 | dict_table_add_system_columnscxx . . $ dict_table_add_system_columns(f54c2afd6563a66e).(table, heap); |
| 311 | table->add_to_cachecxx . . $ dict_table_t#add_to_cache(49f6e7a06ebc5aa8).(); |
| 312 | dict_syscxx . . $ dict_sys..sys_columnscxx . . $ dict_sys_t#sys_columns. = table; |
| 313 | mem_heap_emptycxx . . $ mem_heap_empty(5231cf397463bfab).(heap); |
| 314 | |
| 315 | index = dict_mem_index_createcxx . . $ dict_mem_index_create(e48d716bb01ae4e7).(table, "CLUST_IND", |
| 316 | DICT_UNIQUEcxx . . $ `storage/innobase/include/dict0mem.h:68:9`! | DICT_CLUSTEREDcxx . . $ `storage/innobase/include/dict0mem.h:65:9`!, 2); |
| 317 | |
| 318 | dict_mem_index_add_fieldcxx . . $ dict_mem_index_add_field(61ed6e1a807d1641).(index, "TABLE_ID", 0); |
| 319 | dict_mem_index_add_fieldcxx . . $ dict_mem_index_add_field(61ed6e1a807d1641).(index, "POS", 0); |
| 320 | |
| 321 | index->idcxx . . $ dict_index_t#id. = DICT_COLUMNS_IDcxx . . $ `storage/innobase/include/dict0boot.h:76:9`!; |
| 322 | err = dict_index_add_to_cachecxx . . $ dict_index_add_to_cache(3d07a3b14c80f9f5).( |
| 323 | index, mach_read_from_4cxx . . $ mach_read_from_4(ca1608e2c87725e2).(dict_hdr + DICT_HDR_COLUMNScxx . . $ `storage/innobase/include/dict0boot.h:94:9`!)); |
| 324 | ut_acxx . . $ `storage/innobase/include/ut0dbg.h:50:9`!(err == DB_SUCCESS); |
| 325 | ut_adcxx . . $ `storage/innobase/include/ut0dbg.h:62:9`!(!table->is_instant()); |
| 326 | table->indexescxx . . $ dict_table_t#indexes..startcxx . . $ ut_list_base#start.->n_core_null_bytescxx . . $ dict_index_t#n_core_null_bytes. = static_cast<uint8_tcxx . . $ uint8_t#>( |
| 327 | UT_BITS_IN_BYTEScxx . . $ `storage/innobase/include/ut0ut.h:93:9`!(unsigned(table->indexes.start->n_nullable))); |
| 328 | |
| 329 | /*-------------------------*/ |
| 330 | table = dict_table_tcxx . . $ dict_table_t#::createcxx . . $ dict_table_t#create(3c27cf8a971d66c7).(dict_syscxx . . $ dict_sys..SYS_TABLEcxx . . $ dict_sys_t#SYS_TABLE.[dict_syscxx . . $ dict_sys..SYS_INDEXEScxx . . $ dict_sys_t#SYS_INDEXES.], |
| 331 | fil_systemcxx . . $ fil_system..sys_spacecxx . . $ fil_system_t#sys_space., |
| 332 | DICT_NUM_COLS__SYS_INDEXEScxx . . $ DICT_NUM_COLS__SYS_INDEXES., 0, 0, 0); |
| 333 | |
| 334 | dict_mem_table_add_colcxx . . $ dict_mem_table_add_col(d1893c21bc74da17).(table, heap, "TABLE_ID", DATA_BINARYcxx . . $ `storage/innobase/include/data0type.h:59:9`!, 0, 8); |
| 335 | dict_mem_table_add_colcxx . . $ dict_mem_table_add_col(d1893c21bc74da17).(table, heap, "ID", DATA_BINARYcxx . . $ `storage/innobase/include/data0type.h:59:9`!, 0, 8); |
| 336 | dict_mem_table_add_colcxx . . $ dict_mem_table_add_col(d1893c21bc74da17).(table, heap, "NAME", DATA_BINARYcxx . . $ `storage/innobase/include/data0type.h:59:9`!, 0, 0); |
| 337 | dict_mem_table_add_colcxx . . $ dict_mem_table_add_col(d1893c21bc74da17).(table, heap, "N_FIELDS", DATA_INTcxx . . $ `storage/innobase/include/data0type.h:66:9`!, 0, 4); |
| 338 | dict_mem_table_add_colcxx . . $ dict_mem_table_add_col(d1893c21bc74da17).(table, heap, "TYPE", DATA_INTcxx . . $ `storage/innobase/include/data0type.h:66:9`!, 0, 4); |
| 339 | /* SYS_INDEXES.SPACE is only read by in dict_drop_index_tree() */ |
| 340 | dict_mem_table_add_colcxx . . $ dict_mem_table_add_col(d1893c21bc74da17).(table, heap, "SPACE", DATA_INTcxx . . $ `storage/innobase/include/data0type.h:66:9`!, 0, 4); |
| 341 | dict_mem_table_add_colcxx . . $ dict_mem_table_add_col(d1893c21bc74da17).(table, heap, "PAGE_NO", DATA_INTcxx . . $ `storage/innobase/include/data0type.h:66:9`!, 0, 4); |
| 342 | dict_mem_table_add_colcxx . . $ dict_mem_table_add_col(d1893c21bc74da17).(table, heap, "MERGE_THRESHOLD", DATA_INTcxx . . $ `storage/innobase/include/data0type.h:66:9`!, 0, 4); |
| 343 | |
| 344 | table->idcxx . . $ dict_table_t#id. = DICT_INDEXES_IDcxx . . $ `storage/innobase/include/dict0boot.h:77:9`!; |
| 345 | |
| 346 | dict_table_add_system_columnscxx . . $ dict_table_add_system_columns(f54c2afd6563a66e).(table, heap); |
| 347 | /* The column SYS_INDEXES.MERGE_THRESHOLD was "instantly" |
| 348 | added in MySQL 5.7 and MariaDB 10.2.2. Assign it DEFAULT NULL. |
| 349 | Because of file format compatibility, we must treat SYS_INDEXES |
| 350 | as a special case, relaxing some debug assertions |
| 351 | for DICT_INDEXES_ID. */ |
| 352 | dict_table_get_nth_colcxx . . $ `storage/innobase/include/dict0dict.h:737:9`!(table, DICT_COL__SYS_INDEXES__MERGE_THRESHOLD) |
| 353 | ->def_valcxx . . $ dict_col_t#def_val..lencxx . . $ dict_col_t#def_t#len. = UNIV_SQL_NULLcxx . . $ `storage/innobase/include/univ.i:372:9`!; |
| 354 | table->add_to_cachecxx . . $ dict_table_t#add_to_cache(49f6e7a06ebc5aa8).(); |
| 355 | dict_syscxx . . $ dict_sys..sys_indexescxx . . $ dict_sys_t#sys_indexes. = table; |
| 356 | mem_heap_emptycxx . . $ mem_heap_empty(5231cf397463bfab).(heap); |
| 357 | |
| 358 | index = dict_mem_index_createcxx . . $ dict_mem_index_create(e48d716bb01ae4e7).(table, "CLUST_IND", |
| 359 | DICT_UNIQUEcxx . . $ `storage/innobase/include/dict0mem.h:68:9`! | DICT_CLUSTEREDcxx . . $ `storage/innobase/include/dict0mem.h:65:9`!, 2); |
| 360 | |
| 361 | dict_mem_index_add_fieldcxx . . $ dict_mem_index_add_field(61ed6e1a807d1641).(index, "TABLE_ID", 0); |
| 362 | dict_mem_index_add_fieldcxx . . $ dict_mem_index_add_field(61ed6e1a807d1641).(index, "ID", 0); |
| 363 | |
| 364 | index->idcxx . . $ dict_index_t#id. = DICT_INDEXES_IDcxx . . $ `storage/innobase/include/dict0boot.h:77:9`!; |
| 365 | err = dict_index_add_to_cachecxx . . $ dict_index_add_to_cache(3d07a3b14c80f9f5).( |
| 366 | index, mach_read_from_4cxx . . $ mach_read_from_4(ca1608e2c87725e2).(dict_hdr + DICT_HDR_INDEXEScxx . . $ `storage/innobase/include/dict0boot.h:95:9`!)); |
| 367 | ut_acxx . . $ `storage/innobase/include/ut0dbg.h:50:9`!(err == DB_SUCCESS); |
| 368 | ut_adcxx . . $ `storage/innobase/include/ut0dbg.h:62:9`!(!table->is_instant()); |
| 369 | table->indexescxx . . $ dict_table_t#indexes..startcxx . . $ ut_list_base#start.->n_core_null_bytescxx . . $ dict_index_t#n_core_null_bytes. = static_cast<uint8_tcxx . . $ uint8_t#>( |
| 370 | UT_BITS_IN_BYTEScxx . . $ `storage/innobase/include/ut0ut.h:93:9`!(unsigned(table->indexes.start->n_nullable))); |
| 371 | |
| 372 | /*-------------------------*/ |
| 373 | table = dict_table_tcxx . . $ dict_table_t#::createcxx . . $ dict_table_t#create(3c27cf8a971d66c7).(dict_syscxx . . $ dict_sys..SYS_TABLEcxx . . $ dict_sys_t#SYS_TABLE.[dict_syscxx . . $ dict_sys..SYS_FIELDScxx . . $ dict_sys_t#SYS_FIELDS.], |
| 374 | fil_systemcxx . . $ fil_system..sys_spacecxx . . $ fil_system_t#sys_space., |
| 375 | DICT_NUM_COLS__SYS_FIELDScxx . . $ DICT_NUM_COLS__SYS_FIELDS., 0, 0, 0); |
| 376 | dict_mem_table_add_colcxx . . $ dict_mem_table_add_col(d1893c21bc74da17).(table, heap, "INDEX_ID", DATA_BINARYcxx . . $ `storage/innobase/include/data0type.h:59:9`!, 0, 8); |
| 377 | dict_mem_table_add_colcxx . . $ dict_mem_table_add_col(d1893c21bc74da17).(table, heap, "POS", DATA_INTcxx . . $ `storage/innobase/include/data0type.h:66:9`!, 0, 4); |
| 378 | dict_mem_table_add_colcxx . . $ dict_mem_table_add_col(d1893c21bc74da17).(table, heap, "COL_NAME", DATA_BINARYcxx . . $ `storage/innobase/include/data0type.h:59:9`!, 0, 0); |
| 379 | |
| 380 | table->idcxx . . $ dict_table_t#id. = DICT_FIELDS_IDcxx . . $ `storage/innobase/include/dict0boot.h:78:9`!; |
| 381 | |
| 382 | dict_table_add_system_columnscxx . . $ dict_table_add_system_columns(f54c2afd6563a66e).(table, heap); |
| 383 | table->add_to_cachecxx . . $ dict_table_t#add_to_cache(49f6e7a06ebc5aa8).(); |
| 384 | dict_syscxx . . $ dict_sys..sys_fieldscxx . . $ dict_sys_t#sys_fields. = table; |
| 385 | mem_heap_freecxx . . $ mem_heap_free(5231cf397463bfab).(heap); |
| 386 | |
| 387 | index = dict_mem_index_createcxx . . $ dict_mem_index_create(e48d716bb01ae4e7).(table, "CLUST_IND", |
| 388 | DICT_UNIQUEcxx . . $ `storage/innobase/include/dict0mem.h:68:9`! | DICT_CLUSTEREDcxx . . $ `storage/innobase/include/dict0mem.h:65:9`!, 2); |
| 389 | |
| 390 | dict_mem_index_add_fieldcxx . . $ dict_mem_index_add_field(61ed6e1a807d1641).(index, "INDEX_ID", 0); |
| 391 | dict_mem_index_add_fieldcxx . . $ dict_mem_index_add_field(61ed6e1a807d1641).(index, "POS", 0); |
| 392 | |
| 393 | index->idcxx . . $ dict_index_t#id. = DICT_FIELDS_IDcxx . . $ `storage/innobase/include/dict0boot.h:78:9`!; |
| 394 | err = dict_index_add_to_cachecxx . . $ dict_index_add_to_cache(3d07a3b14c80f9f5).( |
| 395 | index, mach_read_from_4cxx . . $ mach_read_from_4(ca1608e2c87725e2).(dict_hdr + DICT_HDR_FIELDScxx . . $ `storage/innobase/include/dict0boot.h:96:9`!)); |
| 396 | ut_acxx . . $ `storage/innobase/include/ut0dbg.h:50:9`!(err == DB_SUCCESS); |
| 397 | ut_adcxx . . $ `storage/innobase/include/ut0dbg.h:62:9`!(!table->is_instant()); |
| 398 | table->indexescxx . . $ dict_table_t#indexes..startcxx . . $ ut_list_base#start.->n_core_null_bytescxx . . $ dict_index_t#n_core_null_bytes. = static_cast<uint8_tcxx . . $ uint8_t#>( |
| 399 | UT_BITS_IN_BYTEScxx . . $ `storage/innobase/include/ut0ut.h:93:9`!(unsigned(table->indexes.start->n_nullable))); |
| 400 | |
| 401 | mtr.commitcxx . . $ mtr_t#commit(49f6e7a06ebc5aa8).(); |
| 402 | dict_syscxx . . $ dict_sys..unlockcxx . . $ dict_sys_t#unlock(ced63f7c635d850d).(); |
| 403 | return err; |
| 404 | } |