Ignore | characters in postgres channel search (#9019)
Этот коммит содержится в:
коммит произвёл
Jesús Espino
родитель
4245797cb2
Коммит
2362a5b7f7
@@ -1617,6 +1617,8 @@ func (s SqlChannelStore) buildFulltextClause(term string) (fulltextClause, fullt
|
|||||||
|
|
||||||
// Prepare the FULLTEXT portion of the query.
|
// Prepare the FULLTEXT portion of the query.
|
||||||
if s.DriverName() == model.DATABASE_DRIVER_POSTGRES {
|
if s.DriverName() == model.DATABASE_DRIVER_POSTGRES {
|
||||||
|
fulltextTerm = strings.Replace(fulltextTerm, "|", "", -1)
|
||||||
|
|
||||||
splitTerm := strings.Fields(fulltextTerm)
|
splitTerm := strings.Fields(fulltextTerm)
|
||||||
for i, t := range strings.Fields(fulltextTerm) {
|
for i, t := range strings.Fields(fulltextTerm) {
|
||||||
if i == len(splitTerm)-1 {
|
if i == len(splitTerm)-1 {
|
||||||
|
|||||||
@@ -2028,6 +2028,19 @@ func testChannelStoreSearchInTeam(t *testing.T, ss store.Store) {
|
|||||||
t.Fatal("wrong channel returned")
|
t.Fatal("wrong channel returned")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if result := <-search(o1.TeamId, "town square |"); result.Err != nil {
|
||||||
|
t.Fatal(result.Err)
|
||||||
|
} else {
|
||||||
|
channels := result.Data.(*model.ChannelList)
|
||||||
|
if len(*channels) != 1 {
|
||||||
|
t.Fatal("should return 1 channel")
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*channels)[0].Name != o9.Name {
|
||||||
|
t.Fatal("wrong channel returned")
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user