| 241 | |
| 242 | |
| 243 | int 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 | /** |
no test coverage detected