Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions oracle/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ import (
)

// Identifies the table name alias provided as
// "\"users\" \"u\"" and "\"users\" u". Gorm already handles
// "\"users\" \"u\"" and "\"users\" u" and "\"users\"". Gorm already handles
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for retracting the approval at last minute.
I’m wondering why we need to specifically handle the case "users" without an alias.
It also looks like issue #71 still remains. Line 60 still appears to be unreachable.

// the other formats like "users u", "users AS u" etc.
var tableRegexp = regexp.MustCompile(`^"(\w+)"\s+"?(\w+)"?$`)
var tableRegexp = regexp.MustCompile(`^"(\w+)"(?:\s+"?(\w+)"?)?$`)

func BeforeQuery(db *gorm.DB) {
if db == nil || db.Statement == nil || db.Statement.TableExpr == nil {
Expand All @@ -64,6 +64,7 @@ func BeforeQuery(db *gorm.DB) {
}
}
}
return
}

// MismatchedCaseHandler handles Oracle Case Insensitivity.
Expand Down
Loading