Uploaded image for project: 'Islandora'
  1. Islandora
  2. ISLANDORA-1800

Mysql islandora_solr.install - $schema['islandora_solr_collection_sort_strings']


    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 7.x-1.8
    • Fix Version/s: None
    • Component/s: Solr Search
    • Labels:


      When running tests for the module - Islandora Solr with Mysql 5.7, the following issue occurs. I am assuming this issue is isolated to mysql 5.7+ from forum posts similar to this issue.

      PDOException: SQLSTATE[42000]: Syntax error or access violation: 1171 All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead: CREATE TABLE {islandora_solr_collection_sort_strings} ( `collection_pid` VARCHAR(255) DEFAULT NULL COMMENT 'The collection PID', `sort_string` MEDIUMTEXT DEFAULT NULL COMMENT 'Sort string for the collection', PRIMARY KEY (`collection_pid`) ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COMMENT 'Table that stores sort strings for collection objects.'; Array ( ) in db_create_table() (line 2720 of /var/www/islandora/includes/database/database.inc).	Uncaught exception	database.inc	2171	PDOStatement->execute()	Exception

      If there are modules that depend on islandora_solr, a general AJAX 200 error may be thrown when running tests for those modules.

      The issue is possibly due to the schema definition in islandora_solr.install for islandora_solr_collection_sort_strings.

      Unable to find source-code formatter for language: php. Available languages are: actionscript, html, java, javascript, none, sql, xhtml, xml
        $schema['islandora_solr_collection_sort_strings'] = array(
          'description' => 'Table that stores sort strings for collection objects.',
          'fields' => array(
            'collection_pid' => array(
              'type' => 'varchar',
              'length' => 255,
              'not_null' => TRUE,
              'description' => 'The collection PID Test 1',
            'sort_string' => array(
              'type' => 'text',
              'size' => 'medium',
              'not_null' => TRUE,
              'description' => 'Sort string for the collection Test2',
          'primary key' => array('collection_pid'),

      The current definition does state that the primary key should be not null. However, for some reason the default is being set to be null (as in the error). Explicitly setting the default to '0' ( 'default' => '0') resolves this issue.




            • Assignee:
              nat Nat Kanthan
            • Votes:
              0 Vote for this issue
              1 Start watching this issue


              • Created: