@brief Check if partition is exchangable with table by checking table options @param table_create_info Table options from table. @param part_elem All the info of the partition. @retval FALSE if they are equal, otherwise TRUE. @note Any differences that would cause a change in the frm file is prohibited. Such options as data_file_name, index_file_name, min_rows, max_rows etc. a
| 4795 | not allowed to differ. But comment is allowed to differ. |
| 4796 | */ |
| 4797 | bool compare_partition_options(HA_CREATE_INFO *table_create_info, |
| 4798 | partition_element *part_elem) |
| 4799 | { |
| 4800 | #define MAX_COMPARE_PARTITION_OPTION_ERRORS 5 |
| 4801 | const char *option_diffs[MAX_COMPARE_PARTITION_OPTION_ERRORS + 1]; |
| 4802 | int i, errors= 0; |
| 4803 | DBUG_ENTER("compare_partition_options"); |
| 4804 | |
| 4805 | /* |
| 4806 | Note that there are not yet any engine supporting tablespace together |
| 4807 | with partitioning. TODO: when there are, add compare. |
| 4808 | */ |
| 4809 | if (part_elem->part_max_rows != table_create_info->max_rows) |
| 4810 | option_diffs[errors++]= "MAX_ROWS"; |
| 4811 | if (part_elem->part_min_rows != table_create_info->min_rows) |
| 4812 | option_diffs[errors++]= "MIN_ROWS"; |
| 4813 | |
| 4814 | for (i= 0; i < errors; i++) |
| 4815 | my_error(ER_PARTITION_EXCHANGE_DIFFERENT_OPTION, MYF(0), |
| 4816 | option_diffs[i]); |
| 4817 | DBUG_RETURN(errors != 0); |
| 4818 | } |
| 4819 | |
| 4820 | |
| 4821 | /** |
no test coverage detected