diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-04-05 19:34:16 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-04-06 13:33:13 +0200 |
| commit | db49def5fc03757048d6725097d4c3da44e7ea84 (patch) | |
| tree | 26633c0feb83bc0c3b7845d31d8254a24096c0e6 /tests/postgres_tests | |
| parent | dece89df81c30f917162b13277b71fca13d9a2a3 (diff) | |
[4.2.x] Fixed #34459 -- Fixed SearchVector() crash for parameters with % symbol.
Thanks Patryk Zawadzki for the report.
Regression in 09ffc5c1212d4ced58b708cbbf3dfbfb77b782ca.
Backport of 4bf4222010fd8e413963c6c873e4088614332ef9 from main
Diffstat (limited to 'tests/postgres_tests')
| -rw-r--r-- | tests/postgres_tests/test_search.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/postgres_tests/test_search.py b/tests/postgres_tests/test_search.py index fa7d885221..6f6318899c 100644 --- a/tests/postgres_tests/test_search.py +++ b/tests/postgres_tests/test_search.py @@ -160,6 +160,12 @@ class SearchVectorFieldTest(GrailTestData, PostgreSQLTestCase): ) self.assertNotIn("COALESCE(COALESCE", str(searched.query)) + def test_values_with_percent(self): + searched = Line.objects.annotate( + search=SearchVector(Value("This week everything is 10% off")) + ).filter(search="10 % off") + self.assertEqual(len(searched), 9) + class SearchConfigTests(PostgreSQLSimpleTestCase): def test_from_parameter(self): |
