极简设计

mycat

mycat

分布式任务调度 lts连mycat时,log一直报

[WARN ][$_NIOREACTOR-0-RW] ServerConnection [id=14, schema=lts, host=172.20.30.117, user=lts,txIsolation=3, autocommit=true, schema=lts]set session transaction read only is not recoginized and ignored (io.mycat.server.handler.SetHandler:SetHandler.java:159)

io.mycat.server.handler.SetHandler

default:            
    boolean ignore = SetIgnoreUtil.isIgnoreStmt(stmt);
    if ( !ignore ) {             
        StringBuilder s = new StringBuilder();
        logger.warn(s.append(c).append(stmt).append(" is not recoginized and ignored").toString());
    }
    c.write(c.writeToBuffer(OkPacket.OK, c.allocate()));

io.mycat.util.SetIgnoreUtil

加几句 "(?i)set (session transaction read write)", "(?i)set (session transaction read only)", "(?i)set (sql_select_limit)"

//TODO: 忽略部分 SET 指令, 避免WARN 不断的刷日志
        String[] ignores = new String[] {
            "(?i)set (session transaction read write)",
            "(?i)set (session transaction read only)",
            "(?i)set (sql_select_limit)",
            "(?i)set (sql_mode)",
            "(?i)set (interactive_timeout|wait_timeout|net_read_timeout|net_write_timeout|lock_wait_timeout|slave_net_timeout)",
            "(?i)set (connect_timeout|delayed_insert_timeout|innodb_lock_wait_timeout|innodb_rollback_on_timeout)",
            "(?i)set (profiling|profiling_history_size)"
        };

with :