| 424 | */ |
| 425 | |
| 426 | bool table_value_constr::exec(SELECT_LEX *sl) |
| 427 | { |
| 428 | DBUG_ENTER("table_value_constr::exec"); |
| 429 | List_iterator_fast<List_item> li(lists_of_values); |
| 430 | List_item *elem; |
| 431 | THD *cur_thd= sl->parent_lex->thd; |
| 432 | ha_rows send_records= 0; |
| 433 | int rc=0; |
| 434 | |
| 435 | if (select_options & SELECT_DESCRIBE) |
| 436 | DBUG_RETURN(false); |
| 437 | |
| 438 | if (result->send_result_set_metadata(sl->item_list, |
| 439 | Protocol::SEND_NUM_ROWS | |
| 440 | Protocol::SEND_EOF)) |
| 441 | { |
| 442 | DBUG_RETURN(true); |
| 443 | } |
| 444 | |
| 445 | fix_rownum_pointers(sl->parent_lex->thd, sl, &send_records); |
| 446 | |
| 447 | while ((elem= li++)) |
| 448 | { |
| 449 | cur_thd->get_stmt_da()->inc_current_row_for_warning(); |
| 450 | if (send_records >= sl->master_unit()->lim.get_select_limit()) |
| 451 | break; |
| 452 | rc= result->send_data_with_check(*elem, sl->master_unit(), send_records); |
| 453 | if (!rc) |
| 454 | send_records++; |
| 455 | else if (rc > 0) |
| 456 | DBUG_RETURN(true); |
| 457 | } |
| 458 | |
| 459 | if (result->send_eof()) |
| 460 | DBUG_RETURN(true); |
| 461 | |
| 462 | DBUG_RETURN(false); |
| 463 | } |
| 464 | |
| 465 | |
| 466 | /** |
no test coverage detected