diff --git a/Bristol/mysql/packets.go b/Bristol/mysql/packets.go index 10bc7d06..095be946 100755 --- a/Bristol/mysql/packets.go +++ b/Bristol/mysql/packets.go @@ -810,10 +810,13 @@ func (mc *mysqlConn) readBinaryRows(rc *rowsContent) (e error) { b := int8(byteToUint8(data[pos])) //length == 1 是 tinyint(1) bool值 if rc.columns[i].length == 1 { - if b == 1 { + switch b { + case 1: row[i] = true - } else { + case 0: row[i] = false + default: + row[i] = b } } else { row[i] = b diff --git a/Bristol/mysql/parser.go b/Bristol/mysql/parser.go index c0bfaea2..a75f42b5 100644 --- a/Bristol/mysql/parser.go +++ b/Bristol/mysql/parser.go @@ -485,6 +485,11 @@ func (parser *eventParser) GetTableSchemaByName(tableId uint64, database string, CHARACTER_OCTET_LENGTH = uint64(dest[9].(uint32)) case uint64: CHARACTER_OCTET_LENGTH = dest[9].(uint64) + case int64: + CHARACTER_OCTET_LENGTH = uint64(dest[9].(int64)) + case int32: + CHARACTER_OCTET_LENGTH = uint64(dest[9].(int32)) + default: CHARACTER_OCTET_LENGTH = 0 } diff --git a/changelog.txt b/changelog.txt index d10c77c1..8f61dd5b 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,10 @@ +v2.3.8-beta 2024-11-05 +1. fix mysql select tinyint(1) , value > 1 , transfer to bool ,result false bug + +v2.3.7-beta 2024-10-16 +1. output kakfa tableMap add binlog_timestamp field +2. CHARACTER_OCTET_LENGTH add support for int64 and int32 in mysql parser + v2.3.6-beta 2024-04-21 1. input varchar(255) to output starrocks varchar(765) diff --git a/config/version.go b/config/version.go index 8903f7fb..c9fe70fc 100755 --- a/config/version.go +++ b/config/version.go @@ -16,4 +16,4 @@ limitations under the License. package config -const VERSION = "v2.3.6-beta" +const VERSION = "v2.3.8-beta" diff --git a/plugin/driver/table_map_json.go b/plugin/driver/table_map_json.go index 99c07f9c..836163a3 100644 --- a/plugin/driver/table_map_json.go +++ b/plugin/driver/table_map_json.go @@ -19,6 +19,7 @@ func (c *PluginDataType) ToTableMapObject() (data map[string]interface{}, err er } else { data["bifrost_query"] = c.Query } + data["binlog_timestamp"] = fmt.Sprint(c.Timestamp) data["binlog_event_type"] = c.EventType data["bifrost_pri"] = strings.Join(c.Pri, ",") data["bifrost_database"] = c.SchemaName