Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: get middle part of string (#8161)

h3n4lfc8e975098e2
diff --git a/backend/plugin/db/util/driverutil.go b/backend/plugin/db/util/driverutil.go
index 3940616fd2..9487cfdf7d 100644
--- a/backend/plugin/db/util/driverutil.go
+++ b/backend/plugin/db/util/driverutil.go
@@ -424,6 +424,10 @@ func getMiddlePartOfString(stmt string) string {
if len(stmt) == 0 || len(stmt) == 1 {
return ""
}
+ if len(stmt) == 2 || len(stmt) == 3 {
+ return string(stmt[1])
+ }
+
s := []rune(stmt)
if len(s)%4 != 0 {
s = s[:len(s)/4*4]