The function of forcing the replacement engine to be tianmu only takes effect in the slave library
Step 1: First, you need to determine whether it is a slave database. This can be determined by whether (thread ->slave_thread) is true
According to the configuration of forced replacement: (sql_mode='MANDATORY_TIANMU ') and (default_storage_engine=tianmu)
Step 2: Determine whether the (sql_mode) and default engine are tianmu, and add (MANDATORY_TIANMU) this (sql_mode)
The above conditions can be judged in (mysql_execute_command)
[summary]
1. NULL-->nullptr
2. namespace "DBHandler"-->"handler"
3. class TianmuHandler-->ha_tianmu
4. sdb-->tianmu
5. functions in ha_my_tianmu.cpp all renamed with prefix "ha_my_tianmu_xxx"
6. add new enum 'QueryRouteTo' to replace magic number '0/1'
7. add new enum 'TableStatus' to replace magic number '0/1/-2'
[summary]
NULL-->nullptr
namespace "DBHandler"-->"handler"
class TianmuHandler-->ha_tianmu
sdb-->tianmu
functions in ha_my_tianmu.cpp all renamed with prefix "ha_my_tianmu_xxx"