mysql binlog_format和臨時表
mysql binlog_format和臨時表
mysql 5.7.12
mysql> show variables like '%binlog_f%';
+---------------+-----------+
| Variable_name | Value |
+---------------+-----------+
| binlog_format | STATEMENT |
+---------------+-----------+
1 row in set (0.00 sec)
mysql> flush logs;
Query OK, 0 rows affected (0.01 sec)
mysql> use tt;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> CREATE TEMPORARY TABLE `p` (
-> `id` int(11) DEFAULT NULL
-> ) ;
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql> insert into p value (3);
Query OK, 1 row affected (0.00 sec)
[root@10-13-38-7 data]# mysqlbinlog -vvv 1.000013
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
#160604 23:10:35 server id 1 end_log_pos 123 CRC32 0x0148f7c9 Start: binlog v 4, server v 5.7.12-log created 160604 23:10:35
# Warning: this binlog is either in use or was not closed properly.
BINLOG '
a+9SVw8BAAAAdwAAAHsAAAABAAQANS43LjEyLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAEzgNAAgAEgAEBAQEEgAAXwAEGggAAAAICAgCAAAACgoKKioAEjQA
Acn3SAE=
'/*!*/;
# at 123
#160604 23:10:35 server id 1 end_log_pos 194 CRC32 0x8fa11a9f Previous-GTIDs
# 14a1fb07-23e8-11e6-a7f0-52540055799f:1-31
# at 194
#160604 23:12:02 server id 1 end_log_pos 259 CRC32 0x768925a3 GTID last_committed=0 sequence_number=1
SET @@SESSION.GTID_NEXT= '14a1fb07-23e8-11e6-a7f0-52540055799f:32'/*!*/;
# at 259
#160604 23:12:02 server id 1 end_log_pos 387 CRC32 0x8ecbb506 Query thread_id=12 exec_time=0 error_code=0
use `tt`/*!*/;
SET TIMESTAMP=1465053122/*!*/;
SET @@session.pseudo_thread_id=12/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=1436549152/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8 *//*!*/;
SET @@session.character_set_client=33,@@session.collation_connection=33,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
CREATE TEMPORARY TABLE `p` (
`id` int(11) DEFAULT NULL
)
/*!*/;
# at 387
#160604 23:12:11 server id 1 end_log_pos 452 CRC32 0xd3338855 GTID last_committed=1 sequence_number=2
SET @@SESSION.GTID_NEXT= '14a1fb07-23e8-11e6-a7f0-52540055799f:33'/*!*/;
# at 452
#160604 23:12:11 server id 1 end_log_pos 527 CRC32 0x30c92812 Query thread_id=12 exec_time=0 error_code=0
SET TIMESTAMP=1465053131/*!*/;
BEGIN
/*!*/;
# at 527
#160604 23:12:11 server id 1 end_log_pos 620 CRC32 0x8c0550c9 Query thread_id=12 exec_time=0 error_code=0
SET TIMESTAMP=1465053131/*!*/;
insert into p value (3)
/*!*/;
# at 620
#160604 23:12:11 server id 1 end_log_pos 696 CRC32 0xe82c1eae Query thread_id=12 exec_time=0 error_code=0
SET TIMESTAMP=1465053131/*!*/;
COMMIT
/*!*/;
SET @@SESSION.GTID_NEXT= 'AUTOMATIC' /* added by mysqlbinlog */ /*!*/;
DELIMITER ;
# End of log file
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
mysql> show variables like '%binlog_f%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| binlog_format | ROW |
+---------------+-------+
1 row in set (0.00 sec)
mysql> flush logs;
Query OK, 0 rows affected (0.00 sec)
mysql> use tt;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> CREATE TEMPORARY TABLE `p` (
-> `id` int(11) DEFAULT NULL
-> );
Query OK, 0 rows affected (0.00 sec)
mysql> insert into p value (3);
Query OK, 1 row affected (0.00 sec)
mysqlbinlog -vvv 1.000014
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
#160604 23:14:16 server id 1 end_log_pos 123 CRC32 0xa1b90e78 Start: binlog v 4, server v 5.7.12-log created 160604 23:14:16
# Warning: this binlog is either in use or was not closed properly.
BINLOG '
SPBSVw8BAAAAdwAAAHsAAAABAAQANS43LjEyLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAEzgNAAgAEgAEBAQEEgAAXwAEGggAAAAICAgCAAAACgoKKioAEjQA
AXgOuaE=
'/*!*/;
# at 123
#160604 23:14:16 server id 1 end_log_pos 194 CRC32 0xafe00a46 Previous-GTIDs
# 14a1fb07-23e8-11e6-a7f0-52540055799f:1-35
SET @@SESSION.GTID_NEXT= 'AUTOMATIC' /* added by mysqlbinlog */ /*!*/;
DELIMITER ;
# End of log file
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
當binlog_format=statement時 臨時表的所有操作都會被記錄下來
當binlog_format=row時 臨時表的所有操作都不會被記錄下來
轉載請註明源出處
QQ 273002188 歡迎一起學習
QQ 群 236941212
oracle,mysql,PG 相互交流
mysql 5.7.12
mysql> show variables like '%binlog_f%';
+---------------+-----------+
| Variable_name | Value |
+---------------+-----------+
| binlog_format | STATEMENT |
+---------------+-----------+
1 row in set (0.00 sec)
mysql> flush logs;
Query OK, 0 rows affected (0.01 sec)
mysql> use tt;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> CREATE TEMPORARY TABLE `p` (
-> `id` int(11) DEFAULT NULL
-> ) ;
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql> insert into p value (3);
Query OK, 1 row affected (0.00 sec)
[root@10-13-38-7 data]# mysqlbinlog -vvv 1.000013
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
#160604 23:10:35 server id 1 end_log_pos 123 CRC32 0x0148f7c9 Start: binlog v 4, server v 5.7.12-log created 160604 23:10:35
# Warning: this binlog is either in use or was not closed properly.
BINLOG '
a+9SVw8BAAAAdwAAAHsAAAABAAQANS43LjEyLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAEzgNAAgAEgAEBAQEEgAAXwAEGggAAAAICAgCAAAACgoKKioAEjQA
Acn3SAE=
'/*!*/;
# at 123
#160604 23:10:35 server id 1 end_log_pos 194 CRC32 0x8fa11a9f Previous-GTIDs
# 14a1fb07-23e8-11e6-a7f0-52540055799f:1-31
# at 194
#160604 23:12:02 server id 1 end_log_pos 259 CRC32 0x768925a3 GTID last_committed=0 sequence_number=1
SET @@SESSION.GTID_NEXT= '14a1fb07-23e8-11e6-a7f0-52540055799f:32'/*!*/;
# at 259
#160604 23:12:02 server id 1 end_log_pos 387 CRC32 0x8ecbb506 Query thread_id=12 exec_time=0 error_code=0
use `tt`/*!*/;
SET TIMESTAMP=1465053122/*!*/;
SET @@session.pseudo_thread_id=12/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=1436549152/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8 *//*!*/;
SET @@session.character_set_client=33,@@session.collation_connection=33,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
CREATE TEMPORARY TABLE `p` (
`id` int(11) DEFAULT NULL
)
/*!*/;
# at 387
#160604 23:12:11 server id 1 end_log_pos 452 CRC32 0xd3338855 GTID last_committed=1 sequence_number=2
SET @@SESSION.GTID_NEXT= '14a1fb07-23e8-11e6-a7f0-52540055799f:33'/*!*/;
# at 452
#160604 23:12:11 server id 1 end_log_pos 527 CRC32 0x30c92812 Query thread_id=12 exec_time=0 error_code=0
SET TIMESTAMP=1465053131/*!*/;
BEGIN
/*!*/;
# at 527
#160604 23:12:11 server id 1 end_log_pos 620 CRC32 0x8c0550c9 Query thread_id=12 exec_time=0 error_code=0
SET TIMESTAMP=1465053131/*!*/;
insert into p value (3)
/*!*/;
# at 620
#160604 23:12:11 server id 1 end_log_pos 696 CRC32 0xe82c1eae Query thread_id=12 exec_time=0 error_code=0
SET TIMESTAMP=1465053131/*!*/;
COMMIT
/*!*/;
SET @@SESSION.GTID_NEXT= 'AUTOMATIC' /* added by mysqlbinlog */ /*!*/;
DELIMITER ;
# End of log file
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
mysql> show variables like '%binlog_f%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| binlog_format | ROW |
+---------------+-------+
1 row in set (0.00 sec)
mysql> flush logs;
Query OK, 0 rows affected (0.00 sec)
mysql> use tt;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> CREATE TEMPORARY TABLE `p` (
-> `id` int(11) DEFAULT NULL
-> );
Query OK, 0 rows affected (0.00 sec)
mysql> insert into p value (3);
Query OK, 1 row affected (0.00 sec)
mysqlbinlog -vvv 1.000014
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
#160604 23:14:16 server id 1 end_log_pos 123 CRC32 0xa1b90e78 Start: binlog v 4, server v 5.7.12-log created 160604 23:14:16
# Warning: this binlog is either in use or was not closed properly.
BINLOG '
SPBSVw8BAAAAdwAAAHsAAAABAAQANS43LjEyLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAEzgNAAgAEgAEBAQEEgAAXwAEGggAAAAICAgCAAAACgoKKioAEjQA
AXgOuaE=
'/*!*/;
# at 123
#160604 23:14:16 server id 1 end_log_pos 194 CRC32 0xafe00a46 Previous-GTIDs
# 14a1fb07-23e8-11e6-a7f0-52540055799f:1-35
SET @@SESSION.GTID_NEXT= 'AUTOMATIC' /* added by mysqlbinlog */ /*!*/;
DELIMITER ;
# End of log file
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
當binlog_format=statement時 臨時表的所有操作都會被記錄下來
當binlog_format=row時 臨時表的所有操作都不會被記錄下來
轉載請註明源出處
QQ 273002188 歡迎一起學習
QQ 群 236941212
oracle,mysql,PG 相互交流
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25099483/viewspace-2114165/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL臨時表MySql
- MySQL之臨時表MySql
- mysql 建立臨時表MySql
- MySQL 中的臨時表MySql
- MySQL 5.7 新特性 共享臨時表空間及臨時表改進MySql
- MySQL InnoDB臨時表空間配置MySql
- mysql臨時表,臨時表空間,ibtmp1表空間暴增原因初探MySql
- mysql關於臨時表的總結MySql
- MySQL-37:記憶體臨時表MySql記憶體
- MySQL什麼時候會使用內部臨時表?MySql
- MySQL8.0新特性-臨時表的改善MySql
- MySQL基礎和SQL入門【臨時】MySql
- MYSQL造資料佔用臨時表空間MySql
- mysql複製中臨時表的運用技巧MySql
- PostgreSQL:臨時表SQL
- Sqlserver 關於臨時表和表變數的總結SQLServer變數
- Oracle臨時表空間檢視、新增臨時表空間資料檔案、修改預設臨時表空間 方法!Oracle
- ORACLE臨時表總結Oracle
- oracle 臨時表的使用Oracle
- SQLServer臨時表的使用SQLServer
- 故障分析 | MySQL 5.7 使用臨時表導致資料庫 CrashMySql資料庫
- 你好奇過 MySQL 內部臨時表存了什麼嗎?MySql
- SQLSERVER 臨時表和表變數到底有什麼區別?SQLServer變數
- Oracle 臨時表 OracleDataAdapter 批次更新OracleAPT
- oracle建立臨時表空間和資料表空間以及刪除Oracle
- 臨時表空間和回滾表空間使用率查詢
- oracle11g 查詢臨時表空間的使用率和正在使用臨時表空間的使用者Oracle
- [20181108]with temp as 建立臨時表嗎.txt
- Oracle臨時表使用注意事項Oracle
- oracle臨時表空間相關Oracle
- 4.2.1.8規劃臨時表空間
- 刪除臨時表空間組
- mysql建立表的時候對欄位和表新增COMMENTMySql
- 【MySQL】你所不知道的行復制(binlog_format=row)MySqlORM
- 2.5.7 建立預設臨時表空間
- 清理臨時表規範以及指令碼指令碼
- Oracle臨時表的用法總結FLOracle
- 消除臨時表空間暴漲的方法
- 關於with 臨時表 as的一些用法