| 1620 | */ |
| 1621 | |
| 1622 | int Statement_map::insert(THD *thd, Statement *statement) |
| 1623 | { |
| 1624 | if (my_hash_insert(&st_hash, (uchar*) statement)) |
| 1625 | { |
| 1626 | /* |
| 1627 | Delete is needed only in case of an insert failure. In all other |
| 1628 | cases hash_delete will also delete the statement. |
| 1629 | */ |
| 1630 | delete statement; |
| 1631 | my_error(ER_OUT_OF_RESOURCES, MYF(0)); |
| 1632 | goto err_st_hash; |
| 1633 | } |
| 1634 | if (statement->name.str && my_hash_insert(&names_hash, (uchar*) statement)) |
| 1635 | { |
| 1636 | my_error(ER_OUT_OF_RESOURCES, MYF(0)); |
| 1637 | goto err_names_hash; |
| 1638 | } |
| 1639 | |
| 1640 | last_found_statement= statement; |
| 1641 | return 0; |
| 1642 | |
| 1643 | err_names_hash: |
| 1644 | my_hash_delete(&st_hash, (uchar*) statement); |
| 1645 | err_st_hash: |
| 1646 | return 1; |
| 1647 | } |
| 1648 | |
| 1649 | |
| 1650 | void Statement_map::close_transient_cursors() |
no test coverage detected