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

Method open

sql/sql_cursor.cc:243–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

241
242
243int Materialized_cursor::open(JOIN *join __attribute__((unused)))
244{
245 THD *thd= fake_unit.thd;
246 int rc;
247 Query_arena backup_arena;
248
249 thd->set_n_backup_active_arena(this, &backup_arena);
250
251 /* Create a list of fields and start sequential scan. */
252
253 rc= result->prepare(item_list, &fake_unit);
254 rc= !rc && table->file->ha_rnd_init_with_error(TRUE);
255 is_rnd_inited= !rc;
256
257 thd->restore_active_arena(this, &backup_arena);
258
259 /* Commit or rollback metadata in the client-server protocol. */
260
261 if (!rc)
262 {
263 thd->server_status|= SERVER_STATUS_CURSOR_EXISTS;
264 result->send_eof();
265 }
266 else
267 {
268 result->abort_result_set();
269 }
270
271 on_table_fill_finished();
272
273 return rc;
274}
275
276
277/**

Callers 1

mysql_open_cursorFunction · 0.45

Calls 6

restore_active_arenaMethod · 0.80
prepareMethod · 0.45
send_eofMethod · 0.45
abort_result_setMethod · 0.45

Tested by

no test coverage detected