Additional CREATE TABLE/SEQUENCE checks for Galera cluster. @param thd thread handle @param wsrep_ctas CREATE TABLE AS SELECT ? @param used_engine CREATE TABLE ... ENGINE = ? @param create_info Create information @retval false Galera cluster does support used clause @retval true Galera cluster does not support used clause */
| 5165 | @retval true Galera cluster does not support used clause |
| 5166 | */ |
| 5167 | static |
| 5168 | bool wsrep_check_support(THD* thd, |
| 5169 | const bool wsrep_ctas, |
| 5170 | const bool used_engine, |
| 5171 | const HA_CREATE_INFO* create_info) |
| 5172 | { |
| 5173 | /* CREATE TABLE ... AS SELECT */ |
| 5174 | if (wsrep_ctas && |
| 5175 | thd->variables.wsrep_trx_fragment_size > 0) |
| 5176 | { |
| 5177 | my_message(ER_NOT_ALLOWED_COMMAND, |
| 5178 | "CREATE TABLE AS SELECT is not supported with streaming replication", |
| 5179 | MYF(0)); |
| 5180 | return true; |
| 5181 | } |
| 5182 | /* CREATE TABLE .. WITH SYSTEM VERSIONING AS SELECT |
| 5183 | is not supported in Galera cluster. |
| 5184 | */ |
| 5185 | if (wsrep_ctas && |
| 5186 | create_info->versioned()) |
| 5187 | { |
| 5188 | my_error(ER_NOT_SUPPORTED_YET, MYF(0), |
| 5189 | "SYSTEM VERSIONING AS SELECT in Galera cluster"); |
| 5190 | return true; |
| 5191 | } |
| 5192 | /* |
| 5193 | CREATE TABLE ... ENGINE=SEQUENCE is not supported in |
| 5194 | Galera cluster. |
| 5195 | CREATE SEQUENCE ... ENGINE=xxx Galera cluster supports |
| 5196 | only InnoDB-sequences. |
| 5197 | */ |
| 5198 | if (((used_engine && create_info->db_type && |
| 5199 | (create_info->db_type->db_type == DB_TYPE_SEQUENCE || |
| 5200 | create_info->db_type->db_type >= DB_TYPE_FIRST_DYNAMIC)) || |
| 5201 | thd->lex->sql_command == SQLCOM_CREATE_SEQUENCE) && |
| 5202 | wsrep_check_sequence(thd, create_info->seq_create_info, used_engine)) |
| 5203 | return true; |
| 5204 | |
| 5205 | return false; |
| 5206 | } |
| 5207 | #endif /* WITH_WSREP */ |
| 5208 | |
| 5209 | /** |
no test coverage detected