MCPcopy Create free account
hub / github.com/MariaDB/server / ResetTableOpt

Method ResetTableOpt

storage/connect/tabfix.cpp:137–179  ·  view source on GitHub ↗

/ Remake the indexes after the table was modified. */ /

Source from the content-addressed store, hash-verified

135/* Remake the indexes after the table was modified. */
136/***********************************************************************/
137int TDBFIX::ResetTableOpt(PGLOBAL g, bool dop, bool dox)
138 {
139 int prc, rc = RC_OK;
140
141 To_Filter = NULL; // Disable filtering
142//To_BlkIdx = NULL; // and block filtering
143 To_BlkFil = NULL; // and index filtering
144 Cardinality(g); // If called by create
145 RestoreNrec(); // May have been modified
146 MaxSize = -1; // Size must be recalculated
147 Cardinal = -1; // as well as Cardinality
148
149 // After the table was modified the indexes
150 // are invalid and we should mark them as such...
151 rc = ((PDOSDEF)To_Def)->InvalidateIndex(g);
152
153 if (dop) {
154 Columns = NULL; // Not used anymore
155 Txfp->Reset();
156// OldBlk = CurBlk = -1;
157// ReadBlks = CurNum = Rbuf = Modif = 0;
158 Use = USE_READY; // So the table can be reopened
159 Mode = MODE_ANY; // Just to be clean
160 rc = MakeBlockValues(g); // Redo optimization
161 } // endif dop
162
163 if (dox && (rc == RC_OK || rc == RC_INFO)) {
164 // Remake eventual indexes
165 Columns = NULL; // Not used anymore
166 Txfp->Reset(); // New start
167 Use = USE_READY; // So the table can be reopened
168 Mode = MODE_READ; // New mode
169 prc = rc;
170
171 if (PlgGetUser(g)->Check & CHK_OPT)
172 // We must remake indexes.
173 rc = MakeIndex(g, NULL, FALSE);
174
175 rc = (rc == RC_INFO) ? prc : rc;
176 } // endif dox
177
178 return rc;
179 } // end of ResetTableOpt
180
181/***********************************************************************/
182/* Reset the Nrec and BlkSize values that can have been modified. */

Callers

nothing calls this directly

Calls 6

PlgGetUserFunction · 0.85
MakeIndexFunction · 0.85
InvalidateIndexMethod · 0.80
CardinalityFunction · 0.70
RestoreNrecFunction · 0.70
ResetMethod · 0.45

Tested by

no test coverage detected