For row-based replication, the CREATE-SELECT statement is written in two pieces: the first one contain the CREATE TABLE statement necessary to create the table and the second part contain the rows that should go into the table. For non-temporary tables, the start of the CREATE-SELECT implicitly commits the previous transaction, and all events forming the statement will be stored the t
| 5147 | statement until the statement has finished. |
| 5148 | */ |
| 5149 | int select_create::postlock(THD *thd, TABLE **tables) |
| 5150 | { |
| 5151 | /* |
| 5152 | NOTE: for row format CREATE TABLE must be logged before row data. |
| 5153 | */ |
| 5154 | int error; |
| 5155 | TABLE_LIST *save_next_global= table_list->next_global; |
| 5156 | table_list->next_global= select_tables; |
| 5157 | error= thd->decide_logging_format(table_list); |
| 5158 | table_list->next_global= save_next_global; |
| 5159 | |
| 5160 | if (unlikely(error)) |
| 5161 | return error; |
| 5162 | |
| 5163 | TABLE const *const table = *tables; |
| 5164 | if (thd->is_current_stmt_binlog_format_row() && |
| 5165 | !table->s->tmp_table) |
| 5166 | return binlog_show_create_table(thd, *tables, create_info); |
| 5167 | return 0; |
| 5168 | } |
| 5169 | |
| 5170 | |
| 5171 | int |
nothing calls this directly
no test coverage detected