From c083b333d89906168f34e07899d499c4e918b0d1 Mon Sep 17 00:00:00 2001 From: John Guo Date: Fri, 26 Aug 2022 14:30:33 +0800 Subject: [PATCH] fix field type check for package gdb (#2086) * CI updates * fix field type check for package gdb --- database/gdb/gdb_core_structure.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/database/gdb/gdb_core_structure.go b/database/gdb/gdb_core_structure.go index 0a7f97282..b45ca615d 100644 --- a/database/gdb/gdb_core_structure.go +++ b/database/gdb/gdb_core_structure.go @@ -132,7 +132,7 @@ func (c *Core) CheckLocalTypeForField(ctx context.Context, fieldType string, fie typeName = gstr.Trim(match[1]) typePattern = gstr.Trim(match[2]) } else { - typeName = fieldType + typeName = gstr.Split(fieldType, " ")[0] } typeName = strings.ToLower(typeName) switch typeName { @@ -234,6 +234,9 @@ func (c *Core) CheckLocalTypeForField(ctx context.Context, fieldType string, fie return LocalTypeBytes, nil case strings.Contains(typeName, "int"): + if gstr.ContainsI(fieldType, "unsigned") { + return LocalTypeUint, nil + } return LocalTypeInt, nil case strings.Contains(typeName, "time"):