| 785 | */ |
| 786 | |
| 787 | void TABLE_LIST::hide_view_error(THD *thd) |
| 788 | { |
| 789 | if (thd->killed || thd->get_internal_handler()) |
| 790 | return; |
| 791 | /* Hide "Unknown column" or "Unknown function" error */ |
| 792 | DBUG_ASSERT(thd->is_error()); |
| 793 | |
| 794 | switch (thd->get_stmt_da()->sql_errno()) { |
| 795 | case ER_BAD_FIELD_ERROR: |
| 796 | case ER_SP_DOES_NOT_EXIST: |
| 797 | case ER_FUNC_INEXISTENT_NAME_COLLISION: |
| 798 | case ER_PROCACCESS_DENIED_ERROR: |
| 799 | case ER_COLUMNACCESS_DENIED_ERROR: |
| 800 | case ER_TABLEACCESS_DENIED_ERROR: |
| 801 | case ER_TABLE_NOT_LOCKED: |
| 802 | case ER_NO_SUCH_TABLE: |
| 803 | { |
| 804 | TABLE_LIST *top= top_table(); |
| 805 | thd->clear_error(); |
| 806 | my_error(ER_VIEW_INVALID, MYF(0), |
| 807 | top->view_db.str, top->view_name.str); |
| 808 | break; |
| 809 | } |
| 810 | |
| 811 | case ER_NO_DEFAULT_FOR_FIELD: |
| 812 | { |
| 813 | TABLE_LIST *top= top_table(); |
| 814 | thd->clear_error(); |
| 815 | // TODO: make correct error message |
| 816 | my_error(ER_NO_DEFAULT_FOR_VIEW_FIELD, MYF(0), |
| 817 | top->view_db.str, top->view_name.str); |
| 818 | break; |
| 819 | } |
| 820 | } |
| 821 | } |
| 822 | |
| 823 | |
| 824 |
no test coverage detected