@@ -463,9 +463,19 @@ public function walkFullTextSearchConstraint(QOM\FullTextSearchInterface $constr
463
463
throw new NotImplementedException ('Expected full text search expression to be of type Literal, but got ' .get_class ($ expression ));
464
464
}
465
465
466
+ if (null === $ constraint ->getPropertyName ()) {
467
+ return sprintf ('%s LIKE %s ' ,
468
+ $ this ->sqlXpathExtractValueWithNullProperty ($ this ->getTableAlias ($ constraint ->getSelectorName ())),
469
+ $ this ->conn ->quote ('% ' . $ expression ->getLiteralValue () . '% ' )
470
+ );
471
+ }
472
+
466
473
return sprintf ('%s LIKE %s ' ,
467
- $ this ->sqlXpathExtractValue ($ this ->getTableAlias ($ constraint ->getSelectorName ()), $ constraint ->getPropertyName ()),
468
- $ this ->conn ->quote ('% ' .$ expression ->getLiteralValue ().'% ' )
474
+ $ this ->sqlXpathExtractValue (
475
+ $ this ->getTableAlias ($ constraint ->getSelectorName ()),
476
+ $ constraint ->getPropertyName ()
477
+ ),
478
+ $ this ->conn ->quote ('% ' . $ expression ->getLiteralValue () . '% ' )
469
479
);
470
480
}
471
481
@@ -841,6 +851,29 @@ private function sqlXpathExtractValue(string $alias, string $property, string $c
841
851
throw new NotImplementedException (sprintf ("Xpath evaluations cannot be executed with '%s' yet. " , $ this ->platform ->getName ()));
842
852
}
843
853
854
+ private function sqlXpathExtractValueWithNullProperty (string $ alias ): string
855
+ {
856
+ if ($ this ->platform instanceof AbstractMySQLPlatform) {
857
+ return sprintf ("EXTRACTVALUE(%s.props, '//sv:value') " , $ alias );
858
+ }
859
+
860
+ if ($ this ->platform instanceof PostgreSQL94Platform || $ this ->platform instanceof PostgreSQLPlatform) {
861
+ return sprintf (
862
+ "(xpath('/sv:value/text()', CAST(%s.props AS xml), %s))[1]::text " ,
863
+ $ alias ,
864
+ $ this ->sqlXpathPostgreSQLNamespaces ()
865
+ );
866
+ }
867
+
868
+ if ($ this ->platform instanceof SqlitePlatform) {
869
+ return sprintf ("EXTRACTVALUE(%s.props, '//sv:value') " , $ alias );
870
+ }
871
+
872
+ throw new NotImplementedException (
873
+ sprintf ("Xpath evaluations cannot be executed with '%s' yet. " , $ this ->platform ->getName ())
874
+ );
875
+ }
876
+
844
877
private function sqlXpathExtractNumValue (string $ alias , string $ property ): string
845
878
{
846
879
if ($ this ->platform instanceof PostgreSQL94Platform || $ this ->platform instanceof PostgreSQLPlatform) {
0 commit comments