| 335 | */ |
| 336 | |
| 337 | static bool is_split_materialized_allowed(THD *thd, |
| 338 | const TABLE_LIST *derived, |
| 339 | hint_state *hint) |
| 340 | { |
| 341 | if (!derived) |
| 342 | { |
| 343 | *hint= hint_state::DISABLED; // there is no derived table to hint on |
| 344 | return false; |
| 345 | } |
| 346 | |
| 347 | *hint= hint_table_state(thd, |
| 348 | derived, |
| 349 | SPLIT_MATERIALIZED_HINT_ENUM); |
| 350 | |
| 351 | const bool opt_flag= optimizer_flag(thd, OPTIMIZER_SWITCH_SPLIT_MATERIALIZED); |
| 352 | const bool allow_split= (*hint == hint_state::ENABLED || |
| 353 | (*hint == hint_state::NOT_PRESENT && opt_flag)); |
| 354 | |
| 355 | return allow_split; |
| 356 | } |
| 357 | |
| 358 | |
| 359 | /* This structure is auxiliary and used only in the function that follows it */ |
no test coverage detected