Java Code Examples for com.taobao.tddl.dbsync.binlog.LogEvent#MYSQL_TYPE_STRING

The following examples show how to use com.taobao.tddl.dbsync.binlog.LogEvent#MYSQL_TYPE_STRING . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TableMapLogEvent.java    From canal-1.1.3 with Apache License 2.0 6 votes vote down vote up
private int getRealType(int type, int meta) {
    if (type == LogEvent.MYSQL_TYPE_STRING) {
        if (meta >= 256) {
            int byte0 = meta >> 8;
            if ((byte0 & 0x30) != 0x30) {
                /* a long CHAR() field: see #37426 */
                type = byte0 | 0x30;
            } else {
                switch (byte0) {
                    case LogEvent.MYSQL_TYPE_SET:
                    case LogEvent.MYSQL_TYPE_ENUM:
                    case LogEvent.MYSQL_TYPE_STRING:
                        type = byte0;
                }
            }
        }
    }

    return type;
}
 
Example 2
Source File: TableMapLogEvent.java    From canal with Apache License 2.0 6 votes vote down vote up
private int getRealType(int type, int meta) {
    if (type == LogEvent.MYSQL_TYPE_STRING) {
        if (meta >= 256) {
            int byte0 = meta >> 8;
            if ((byte0 & 0x30) != 0x30) {
                /* a long CHAR() field: see #37426 */
                type = byte0 | 0x30;
            } else {
                switch (byte0) {
                    case LogEvent.MYSQL_TYPE_SET:
                    case LogEvent.MYSQL_TYPE_ENUM:
                    case LogEvent.MYSQL_TYPE_STRING:
                        type = byte0;
                }
            }
        }
    }

    return type;
}