Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-20848

PDOException: SQLSTATE[42000]: Syntax error or access violation: when trying to search with API using a Field criterion on a XML block fieldtype

    Details

      Description

      While testing the issue https://jira.ez.no/browse/EZP-20768 if you try to search a word on XML block you'll get the following error

      RuntimeException: Database error
       
      /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/ExceptionConversion.php:61
      /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Handler.php:103
      /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Repository/SearchService.php:90
      /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/SignalSlot/SearchService.php:65
      /var/www/apache2php53/ezp/ezpublish_testsystem/extension/ezpublishapitests/tests/ezpublishapi/ezpublishapi/kanban/ezp20768/ezpublishapiezp20768.php:64
      /var/www/apache2php53/ezp/ezpublish_testsystem/extension/selenium/classes/ezpselenesetest.php:743
      /var/www/apache2php53/ezp/ezpublish_testsystem/extension/ezpublishapitests/tests/ezpublishapi/ezpublishapi/kanban/ezp20768/ezpublishapiezp20768.php:24
      /var/www/apache2php53/ezp/ezpublish_testsystem/extension/selenium/classes/ezpselenesetest.php:772
      /var/www/apache2php53/ezp/ezpublish_testsystem/tests/toolkit/ezptestrunner.php:372
      

      After a little debugging, adding an Exception $e to public function find( Criterion $criterion, $offset = 0, $limit = null, array $sort = null, array $translations = null ) function on vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/ExceptionConversion.php file I got a more specific error

      1) eZPublishAPIEzp20768::testTC1593SearchingWithAPIUsingAFieldCriterionLeadsToAFatalError
      PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ) AND ezcontentobject_version.status = 1 )' at line 1
       
      /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/EzcDatabase.php:206
      /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/EzcDatabase.php:116
      /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/ExceptionConversion.php:53
      /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Handler.php:103
      /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Repository/SearchService.php:90
      /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/SignalSlot/SearchService.php:65
      /var/www/apache2php53/ezp/ezpublish_testsystem/extension/ezpublishapitests/tests/ezpublishapi/ezpublishapi/kanban/ezp20768/ezpublishapiezp20768.php:63
      /var/www/apache2php53/ezp/ezpublish_testsystem/extension/selenium/classes/ezpselenesetest.php:743
      /var/www/apache2php53/ezp/ezpublish_testsystem/extension/ezpublishapitests/tests/ezpublishapi/ezpublishapi/kanban/ezp20768/ezpublishapiezp20768.php:24
      /var/www/apache2php53/ezp/ezpublish_testsystem/extension/selenium/classes/ezpselenesetest.php:772
      /var/www/apache2php53/ezp/ezpublish_testsystem/tests/toolkit/ezptestrunner.php:372
      

      Steps:

      Add a folder named "News"
      Add an article with the name "foo" and the intro with "test"
      Make the following search with the Public API

              $criteria = array(
                  new Criterion\ContentTypeIdentifier( 'article' ),
                  new Criterion\Field( 'intro', '=', 'test' )
              );
              
              $query = new \eZ\Publish\API\Repository\Values\Content\Query(
                  array(
                       'criterion' => new Criterion\LogicalAnd( $criteria )
                  )
              );
              
              $searchService = $this->repo->getSearchService();
              $result = $searchService->findContent( $query );
              
              echo( 'Found ' . $result->totalCount . ' items' );
              foreach ( $result->searchHits as $searchHit )
              {
                  echo( $searchHit->valueObject->contentInfo->name );
              }
      

        Issue Links

          Activity

          Show
          Petar Spanja (Inactive) added a comment - Pull request: https://github.com/ezsystems/ezpublish-kernel/pull/366
          Show
          Petar Spanja (Inactive) added a comment - Fixed in ezpublish-kernel/master in: https://github.com/ezsystems/ezpublish-kernel/commit/e2378b83f530b915fec10ed22c2a3a8ed13afbf9
          Hide
          Pedro Resende (Inactive) added a comment -

          While testing this I get the following error message:

          1) eZPublishAPIEzp20768::testTC1593SearchingWithAPIUsingAFieldCriterionLeadsToAFatalError
          eZ\Publish\API\Repository\Exceptions\NotImplementedException: Intentionally not implemented: A field of type 'ezxmltext' is not searchable in the legacy search engine.
           
          /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/CriterionHandler/Field.php:169
          /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/CriteriaConverter.php:56
          /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/CriterionHandler/LogicalAnd.php:50
          /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/CriteriaConverter.php:56
          /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/EzcDatabase.php:141
          /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/EzcDatabase.php:201
          /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/EzcDatabase.php:115
          /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/ExceptionConversion.php:53
          /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Handler.php:104
          /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Repository/SearchService.php:92
          /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/SignalSlot/SearchService.php:67
          /var/www/apache2php53/ezp/ezpublish_testsystem/extension/ezpublishapitests/tests/ezpublishapi/ezpublishapi/searchservice/ezpublishapiezp20768.php:61
          /var/www/apache2php53/ezp/ezpublish_testsystem/extension/selenium/classes/ezpselenesetest.php:743
          /var/www/apache2php53/ezp/ezpublish_testsystem/extension/ezpublishapitests/tests/ezpublishapi/ezpublishapi/searchservice/ezpublishapiezp20768.php:22
          /var/www/apache2php53/ezp/ezpublish_testsystem/extension/selenium/classes/ezpselenesetest.php:772
          /var/www/apache2php53/ezp/ezpublish_testsystem/tests/toolkit/ezptestrunner.php:372
           

          Show
          Pedro Resende (Inactive) added a comment - While testing this I get the following error message: 1) eZPublishAPIEzp20768::testTC1593SearchingWithAPIUsingAFieldCriterionLeadsToAFatalError eZ\Publish\API\Repository\Exceptions\NotImplementedException: Intentionally not implemented: A field of type 'ezxmltext' is not searchable in the legacy search engine.   /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/CriterionHandler/Field.php:169 /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/CriteriaConverter.php:56 /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/CriterionHandler/LogicalAnd.php:50 /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/CriteriaConverter.php:56 /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/EzcDatabase.php:141 /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/EzcDatabase.php:201 /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/EzcDatabase.php:115 /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/ExceptionConversion.php:53 /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Persistence/Legacy/Content/Search/Handler.php:104 /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/Repository/SearchService.php:92 /var/www/apache2php53/ezp/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/SignalSlot/SearchService.php:67 /var/www/apache2php53/ezp/ezpublish_testsystem/extension/ezpublishapitests/tests/ezpublishapi/ezpublishapi/searchservice/ezpublishapiezp20768.php:61 /var/www/apache2php53/ezp/ezpublish_testsystem/extension/selenium/classes/ezpselenesetest.php:743 /var/www/apache2php53/ezp/ezpublish_testsystem/extension/ezpublishapitests/tests/ezpublishapi/ezpublishapi/searchservice/ezpublishapiezp20768.php:22 /var/www/apache2php53/ezp/ezpublish_testsystem/extension/selenium/classes/ezpselenesetest.php:772 /var/www/apache2php53/ezp/ezpublish_testsystem/tests/toolkit/ezptestrunner.php:372  

            People

            • Assignee:
              Unassigned
              Reporter:
              Pedro Resende (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 days, 2 hours, 10 minutes
                2d 2h 10m