diff --git a/statement.go b/statement.go index 79e29915..aa5c2993 100644 --- a/statement.go +++ b/statement.go @@ -650,7 +650,7 @@ func (stmt *Statement) Changed(fields ...string) bool { return false } -var nameMatcher = regexp.MustCompile(`^(?:[\W]?(?:[a-z_0-9]+?)[\W]?\.)?[\W]?([a-z_0-9]+?)[\W]?$`) +var nameMatcher = regexp.MustCompile(`^(?:[\W]?(?:[A-Za-z_0-9]+?)[\W]?\.)?[\W]?([A-Za-z_0-9]+?)[\W]?$`) // SelectAndOmitColumns get select and omit columns, select -> true, omit -> false func (stmt *Statement) SelectAndOmitColumns(requireCreate, requireUpdate bool) (map[string]bool, bool) { diff --git a/statement_test.go b/statement_test.go index 4432cda4..19ab38f7 100644 --- a/statement_test.go +++ b/statement_test.go @@ -47,6 +47,8 @@ func TestNameMatcher(t *testing.T) { "'table23'.name1": "name1", "'name1'": "name1", "`name_1`": "name_1", + "`Name_1`": "Name_1", + "`Table`.`nAme`": "nAme", } { if matches := nameMatcher.FindStringSubmatch(k); len(matches) < 2 || matches[1] != v { t.Errorf("failed to match value: %v, got %v, expect: %v", k, matches, v)