MCPcopy Create free account
hub / github.com/Tencent/phxsql / decide_logging_format

Method decide_logging_format

phx_percona/percona/sql/binlog.cc:8349–8877  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8347*/
8348
8349int THD::decide_logging_format(TABLE_LIST *tables)
8350{
8351 DBUG_ENTER("THD::decide_logging_format");
8352 DBUG_PRINT("info", ("query: %s", query()));
8353 DBUG_PRINT("info", ("variables.binlog_format: %lu",
8354 variables.binlog_format));
8355 DBUG_PRINT("info", ("lex->get_stmt_unsafe_flags(): 0x%x",
8356 lex->get_stmt_unsafe_flags()));
8357
8358 reset_binlog_local_stmt_filter();
8359
8360 /*
8361 We should not decide logging format if the binlog is closed or
8362 binlogging is off, or if the statement is filtered out from the
8363 binlog by filtering rules.
8364 */
8365 if (mysql_bin_log.is_open() && (variables.option_bits & OPTION_BIN_LOG) &&
8366 !(variables.binlog_format == BINLOG_FORMAT_STMT &&
8367 !binlog_filter->db_ok(db)))
8368 {
8369 /*
8370 Compute one bit field with the union of all the engine
8371 capabilities, and one with the intersection of all the engine
8372 capabilities.
8373 */
8374 handler::Table_flags flags_write_some_set= 0;
8375 handler::Table_flags flags_access_some_set= 0;
8376 handler::Table_flags flags_write_all_set=
8377 HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE;
8378
8379 /*
8380 If different types of engines are about to be updated.
8381 For example: Innodb and Falcon; Innodb and MyIsam.
8382 */
8383 my_bool multi_write_engine= FALSE;
8384 /*
8385 If different types of engines are about to be accessed
8386 and any of them is about to be updated. For example:
8387 Innodb and Falcon; Innodb and MyIsam.
8388 */
8389 my_bool multi_access_engine= FALSE;
8390 /*
8391 bug 1313901 : Track if statement creates or drops a temporary table
8392 and log in ROW if it does.
8393 */
8394 my_bool create_drop_temp_table= FALSE;
8395 /*
8396 Identifies if a table is changed.
8397 */
8398 my_bool is_write= FALSE;
8399 /*
8400 A pointer to a previous table that was changed.
8401 */
8402 TABLE* prev_write_table= NULL;
8403 /*
8404 A pointer to a previous table that was accessed.
8405 */
8406 TABLE* prev_access_table= NULL;

Callers

nothing calls this directly

Tested by

no test coverage detected