summaryrefslogtreecommitdiffstats
path: root/store/sql_user_store.go
diff options
context:
space:
mode:
authorSaturnino Abril <saturnino.abril@gmail.com>2017-08-31 01:54:16 +0800
committerJoram Wilander <jwawilander@gmail.com>2017-08-30 13:54:16 -0400
commit651dd33b29b7b8b296cc5a12479684fa836867b1 (patch)
tree60d4f385f50ab7f6b8aa75bdb6de2d98508c8784 /store/sql_user_store.go
parent4c1f4674425ffeb430aa07f3fccbb09837f36a34 (diff)
downloadchat-651dd33b29b7b8b296cc5a12479684fa836867b1.tar.gz
chat-651dd33b29b7b8b296cc5a12479684fa836867b1.tar.bz2
chat-651dd33b29b7b8b296cc5a12479684fa836867b1.zip
set to default value with config is missing (#7320)
Diffstat (limited to 'store/sql_user_store.go')
-rw-r--r--store/sql_user_store.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/store/sql_user_store.go b/store/sql_user_store.go
index 64079c8d3..23c852d89 100644
--- a/store/sql_user_store.go
+++ b/store/sql_user_store.go
@@ -1431,9 +1431,9 @@ func (us SqlUserStore) performSearch(searchQuery string, term string, options ma
originalTerm := term
postgresUseOriginalTerm := false
if strings.Contains(term, "@") && strings.Contains(term, ".") {
- if utils.Cfg.SqlSettings.DriverName == model.DATABASE_DRIVER_POSTGRES {
+ if *utils.Cfg.SqlSettings.DriverName == model.DATABASE_DRIVER_POSTGRES {
postgresUseOriginalTerm = true
- } else if utils.Cfg.SqlSettings.DriverName == model.DATABASE_DRIVER_MYSQL {
+ } else if *utils.Cfg.SqlSettings.DriverName == model.DATABASE_DRIVER_MYSQL {
lastIndex := strings.LastIndex(term, ".")
term = term[0:lastIndex]
}
@@ -1461,7 +1461,7 @@ func (us SqlUserStore) performSearch(searchQuery string, term string, options ma
if term == "" {
searchQuery = strings.Replace(searchQuery, "SEARCH_CLAUSE", "", 1)
- } else if utils.Cfg.SqlSettings.DriverName == model.DATABASE_DRIVER_POSTGRES {
+ } else if *utils.Cfg.SqlSettings.DriverName == model.DATABASE_DRIVER_POSTGRES {
if postgresUseOriginalTerm {
term = originalTerm
// these chars will break the query and must be removed
@@ -1484,7 +1484,7 @@ func (us SqlUserStore) performSearch(searchQuery string, term string, options ma
searchType = convertMySQLFullTextColumnsToPostgres(searchType)
searchClause := fmt.Sprintf("AND (%s) @@ to_tsquery('simple', :Term)", searchType)
searchQuery = strings.Replace(searchQuery, "SEARCH_CLAUSE", searchClause, 1)
- } else if utils.Cfg.SqlSettings.DriverName == model.DATABASE_DRIVER_MYSQL {
+ } else if *utils.Cfg.SqlSettings.DriverName == model.DATABASE_DRIVER_MYSQL {
splitTerm := strings.Fields(term)
for i, t := range strings.Fields(term) {
splitTerm[i] = "+" + t + "*"