From 035c803ae9955126bd236d0c96a9909447065509 Mon Sep 17 00:00:00 2001 From: renlongfei Date: Fri, 24 May 2024 17:24:42 +0800 Subject: [PATCH 1/5] Add support for int64 and int32 in mysql parser The mysql 8.0.34 parser has been updated to handle int64 types. Previously, it could only handle uint32 and uint64 types. Now, it can also cast int64 and int32 types to uint64, in the case where CHARACTER_OCTET_LENGTH is of these types. --- Bristol/mysql/parser.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Bristol/mysql/parser.go b/Bristol/mysql/parser.go index c0bfaea..a75f42b 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 } From 59a99e01e14d37c9adbc85e10cbd2eff654ecad4 Mon Sep 17 00:00:00 2001 From: jc3wish <> Date: Wed, 16 Oct 2024 20:25:53 +0800 Subject: [PATCH 2/5] =?UTF-8?q?output=20kafka=20tableMap=20=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E8=BE=93=E5=87=BA=E6=96=B0=E5=A2=9E=20binlog=5Ftimest?= =?UTF-8?q?amp=20=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/driver/table_map_json.go | 1 + 1 file changed, 1 insertion(+) diff --git a/plugin/driver/table_map_json.go b/plugin/driver/table_map_json.go index 99c07f9..836163a 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 From ca4da4ae05f66613da402acefa9aed7b043feec5 Mon Sep 17 00:00:00 2001 From: jc3wish <> Date: Wed, 16 Oct 2024 20:31:09 +0800 Subject: [PATCH 3/5] v2.3.7 --- changelog.txt | 4 ++++ config/version.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index d10c77c..988ee2c 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,7 @@ +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 8903f7f..e3348bc 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.7-beta" From a20342bb822b4a2c18cfdbf06cd5193b3d7c1b84 Mon Sep 17 00:00:00 2001 From: jc3wish <> Date: Tue, 5 Nov 2024 22:16:29 +0800 Subject: [PATCH 4/5] fix mysql select tinyint(1) , value > 1 , transfer to bool ,result false bug --- Bristol/mysql/packets.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Bristol/mysql/packets.go b/Bristol/mysql/packets.go index 10bc7d0..095be94 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 From b0d9d165f530d1ea30b4ae72e4751abcbfe33b2d Mon Sep 17 00:00:00 2001 From: jc3wish <> Date: Tue, 5 Nov 2024 22:29:48 +0800 Subject: [PATCH 5/5] v2.3.8 --- changelog.txt | 3 +++ config/version.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index 988ee2c..8f61dd5 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,6 @@ +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 diff --git a/config/version.go b/config/version.go index e3348bc..c9fe70f 100755 --- a/config/version.go +++ b/config/version.go @@ -16,4 +16,4 @@ limitations under the License. package config -const VERSION = "v2.3.7-beta" +const VERSION = "v2.3.8-beta"