From ff731ea07dd695fc49dc2e1e158e47867a613379 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Wed, 16 Mar 2016 16:55:19 -0400 Subject: [PATCH] #2814 LOWER() column value within search --- README.md | 2 +- gogs.go | 2 +- models/repo.go | 2 +- models/user.go | 4 ++-- templates/.VERSION | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 027c1a664..780190010 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?bra ![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true) -##### Current version: 0.9.11 +##### Current version: 0.9.12 | Web | UI | Preview | |:-------------:|:-------:|:-------:| diff --git a/gogs.go b/gogs.go index bca4719f1..714218993 100644 --- a/gogs.go +++ b/gogs.go @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.9.11.0316" +const APP_VER = "0.9.12.0316" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/models/repo.go b/models/repo.go index abe67a6d8..2f8019fee 100644 --- a/models/repo.go +++ b/models/repo.go @@ -1520,7 +1520,7 @@ func SearchRepositoryByName(opts *SearchRepoOptions) (repos []*Repository, _ int repos = make([]*Repository, 0, opts.PageSize) // Append conditions - sess := x.Where("lower_name like ?", "%"+opts.Keyword+"%") + sess := x.Where("LOWER(lower_name) LIKE ?", "%"+opts.Keyword+"%") if opts.OwnerID > 0 { sess.And("owner_id = ?", opts.OwnerID) } diff --git a/models/user.go b/models/user.go index a1d1f3b21..e6717aecd 100644 --- a/models/user.go +++ b/models/user.go @@ -1140,8 +1140,8 @@ func SearchUserByName(opts *SearchUserOptions) (users []*User, _ int64, _ error) searchQuery := "%" + opts.Keyword + "%" users = make([]*User, 0, opts.PageSize) // Append conditions - sess := x.Where("lower_name like ?", searchQuery). - Or("full_name like ?", searchQuery). + sess := x.Where("LOWER(lower_name) LIKE ?", searchQuery). + Or("LOWER(full_name) LIKE ?", searchQuery). And("type = ?", opts.Type) var countSess xorm.Session diff --git a/templates/.VERSION b/templates/.VERSION index 80cb769f9..9ae71dfa4 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.9.11.0316 \ No newline at end of file +0.9.12.0316 \ No newline at end of file