Skip to content

Commit 77d5ef2

Browse files
removing dead code
1 parent cd4a90a commit 77d5ef2

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

oracle/query.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ import (
4646
)
4747

4848
// Identifies the table name alias provided as
49-
// "\"users\" \"u\"" and "\"users\" u" and "\"users\"". Gorm already handles
49+
// "\"users\" \"u\"" and "\"users\" u". Gorm already handles
5050
// the other formats like "users u", "users AS u" etc.
51-
var tableRegexp = regexp.MustCompile(`^"(\w+)"(?:\s+"?(\w+)"?)?$`)
51+
var tableRegexp = regexp.MustCompile(`^"(\w+)"\s+"?(\w+)"?$`)
5252

5353
func BeforeQuery(db *gorm.DB) {
5454
if db == nil || db.Statement == nil || db.Statement.TableExpr == nil {
@@ -59,12 +59,9 @@ func BeforeQuery(db *gorm.DB) {
5959
if results := tableRegexp.FindStringSubmatch(name); len(results) == 3 {
6060
if results[2] != "" {
6161
db.Statement.Table = results[2]
62-
} else {
63-
db.Statement.Table = results[1]
6462
}
6563
}
6664
}
67-
return
6865
}
6966

7067
// MismatchedCaseHandler handles Oracle Case Insensitivity.

0 commit comments

Comments
 (0)