diff --git a/core/config/schema/core.data_types.schema.yml b/core/config/schema/core.data_types.schema.yml
index 1b06282..0c9ad70 100644
--- a/core/config/schema/core.data_types.schema.yml
+++ b/core/config/schema/core.data_types.schema.yml
@@ -449,6 +449,9 @@ field.storage_settings.string:
     max_length:
       type: integer
       label: 'Maximum length'
+    case_sensitive:
+      type: boolean
+      label: 'Case sensitive'
 
 field.field_settings.string:
   type: mapping
@@ -467,6 +470,10 @@ field.value.string:
 field.storage_settings.string_long:
   type: mapping
   label: 'String (long) settings'
+  mapping:
+    case_sensitive:
+      type: boolean
+      label: 'Case sensitive'
 
 field.field_settings.string_long:
   type: mapping
@@ -489,6 +496,9 @@ field.storage_settings.uri:
     max_length:
       type: integer
       label: 'Maximum length'
+    case_sensitive:
+      type: boolean
+      label: 'Case sensitive'
 
 field.field_settings.uri:
   type: mapping
diff --git a/core/config/schema/core.entity.schema.yml b/core/config/schema/core.entity.schema.yml
index 6acd1e6..ae79697 100644
--- a/core/config/schema/core.entity.schema.yml
+++ b/core/config/schema/core.entity.schema.yml
@@ -264,3 +264,4 @@ field.formatter.settings.uri_link:
 field.formatter.settings.timestamp_ago:
   type: mapping
   label: 'Timestamp ago display format settings'
+
diff --git a/core/includes/database.inc b/core/includes/database.inc
index 44863df..477be32 100644
--- a/core/includes/database.inc
+++ b/core/includes/database.inc
@@ -527,6 +527,13 @@ function db_escape_field($field) {
  * Backslash is defined as escape character for LIKE patterns in
  * DatabaseCondition::mapConditionOperator().
  *
+ * Drupal considers LIKE case insensitive and the following is often used
+ * to tell the database that case insensitive equivalence is desired:
+ * @code
+ * db_select('users')
+ *  ->condition('name', db_like($name), 'LIKE')
+ * @endcode
+ *
  * @param $string
  *   The string to escape.
  *
diff --git a/core/lib/Drupal/Core/Database/Connection.php b/core/lib/Drupal/Core/Database/Connection.php
index e0c1714..d345d6c 100644
--- a/core/lib/Drupal/Core/Database/Connection.php
+++ b/core/lib/Drupal/Core/Database/Connection.php
@@ -844,6 +844,13 @@ public function escapeAlias($field) {
    * Backslash is defined as escape character for LIKE patterns in
    * Drupal\Core\Database\Query\Condition::mapConditionOperator().
    *
+   * Drupal considers LIKE case insensitive and the following is often used
+   * to tell the database that case insensitive equivalence is desired:
+   * @code
+   * $this->connection->select('users')
+   * ->condition('name', $this->connection->escapeLike($name), 'LIKE')
+   * @encode
+   *
    * @param $string
    *   The string to escape.
    *
diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php b/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php
index 98b7a6b..cacae24 100644
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php
+++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php
@@ -229,6 +229,7 @@ public function mapConditionOperator($operator) {
       // In PostgreSQL, 'LIKE' is case-sensitive. For case-insensitive LIKE
       // statements, we need to use ILIKE instead.
       'LIKE' => array('operator' => 'ILIKE'),
+      'LIKE BINARY' => array('operator' => 'LIKE'),
       'NOT LIKE' => array('operator' => 'NOT ILIKE'),
       'REGEXP' => array('operator' => '~*'),
     );
diff --git a/core/lib/Drupal/Core/Database/Query/Select.php b/core/lib/Drupal/Core/Database/Query/Select.php
index 3c687da..d369b64 100644
--- a/core/lib/Drupal/Core/Database/Query/Select.php
+++ b/core/lib/Drupal/Core/Database/Query/Select.php
@@ -501,6 +501,13 @@ public function &getUnion() {
   /**
    * {@inheritdoc}
    */
+  public function escapeLike($string) {
+    return $this->connection->escapeLike($string);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
   public function getArguments(PlaceholderInterface $queryPlaceholder = NULL) {
     if (!isset($queryPlaceholder)) {
       $queryPlaceholder = $this;
@@ -984,4 +991,5 @@ public function __clone() {
       $this->union[$key]['query'] = clone($aggregate['query']);
     }
   }
+
 }
diff --git a/core/lib/Drupal/Core/Database/Query/SelectExtender.php b/core/lib/Drupal/Core/Database/Query/SelectExtender.php
index 9a378d2..dec70fd 100644
--- a/core/lib/Drupal/Core/Database/Query/SelectExtender.php
+++ b/core/lib/Drupal/Core/Database/Query/SelectExtender.php
@@ -171,6 +171,13 @@ public function &getUnion() {
     return $this->query->getUnion();
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function escapeLike($string) {
+    return $this->query->escapeLike($string);
+  }
+
   public function getArguments(PlaceholderInterface $queryPlaceholder = NULL) {
     return $this->query->getArguments($queryPlaceholder);
   }
diff --git a/core/lib/Drupal/Core/Database/Query/SelectInterface.php b/core/lib/Drupal/Core/Database/Query/SelectInterface.php
index b784610..0d98285 100644
--- a/core/lib/Drupal/Core/Database/Query/SelectInterface.php
+++ b/core/lib/Drupal/Core/Database/Query/SelectInterface.php
@@ -126,6 +126,19 @@ public function &getTables();
   public function &getUnion();
 
   /**
+   * Escapes characters that work as wildcard characters in a LIKE pattern.
+   *
+   * @param $string
+   *   The string to escape.
+   *
+   * @return string
+   *   The escaped string.
+   *
+   * @see \Drupal\Core\Database\Connection::escapeLike()
+   */
+  public function escapeLike($string);
+
+  /**
    * Compiles and returns an associative array of the arguments for this prepared statement.
    *
    * @param $queryPlaceholder
diff --git a/core/lib/Drupal/Core/Entity/Query/QueryInterface.php b/core/lib/Drupal/Core/Entity/Query/QueryInterface.php
index caadc37..0fad28c 100644
--- a/core/lib/Drupal/Core/Entity/Query/QueryInterface.php
+++ b/core/lib/Drupal/Core/Entity/Query/QueryInterface.php
@@ -54,7 +54,7 @@ public function getEntityTypeId();
    *   same delta within that field.
    * @param $value
    *   The value for $field. In most cases, this is a scalar and it's treated as
-   *   case-insensitive. For more complex options, it is an array. The meaning
+   *   case-insensitive. For more complex operators, it is an array. The meaning
    *   of each element in the array is dependent on $operator.
    * @param $operator
    *   Possible values:
diff --git a/core/lib/Drupal/Core/Entity/Query/Sql/Condition.php b/core/lib/Drupal/Core/Entity/Query/Sql/Condition.php
index 1067db3..82a2ee2 100644
--- a/core/lib/Drupal/Core/Entity/Query/Sql/Condition.php
+++ b/core/lib/Drupal/Core/Entity/Query/Sql/Condition.php
@@ -33,20 +33,21 @@ public function compile($conditionContainer) {
     // SQL query object is only necessary to pass to Query::addField() so it
     // can join tables as necessary. On the other hand, conditions need to be
     // added to the $conditionContainer object to keep grouping.
-    $sqlQuery = $conditionContainer instanceof SelectInterface ? $conditionContainer : $conditionContainer->sqlQuery;
-    $tables = $this->query->getTables($sqlQuery);
+    $sql_query = $conditionContainer instanceof SelectInterface ? $conditionContainer : $conditionContainer->sqlQuery;
+    $tables = $this->query->getTables($sql_query);
     foreach ($this->conditions as $condition) {
       if ($condition['field'] instanceOf ConditionInterface) {
-        $sqlCondition = new SqlCondition($condition['field']->getConjunction());
+        $sql_condition = new SqlCondition($condition['field']->getConjunction());
         // Add the SQL query to the object before calling this method again.
-        $sqlCondition->sqlQuery = $sqlQuery;
-        $condition['field']->compile($sqlCondition);
-        $sqlQuery->condition($sqlCondition);
+        $sql_condition->sqlQuery = $sql_query;
+        $condition['field']->compile($sql_condition);
+        $sql_query->condition($sql_condition);
       }
       else {
         $type = strtoupper($this->conjunction) == 'OR' || $condition['operator'] == 'IS NULL' ? 'LEFT' : 'INNER';
-        $this->translateCondition($condition);
-        $field = $tables->addField($condition['field'], $type, $condition['langcode']);
+        $case_sensitive = FALSE;
+        $field = $tables->addField($condition['field'], $type, $condition['langcode'], $case_sensitive);
+        static::translateCondition($condition, $sql_query, $case_sensitive);
         $conditionContainer->condition($field, $condition['value'], $condition['operator']);
       }
     }
@@ -70,24 +71,62 @@ public function notExists($field, $langcode = NULL) {
    * Translates the string operators to SQL equivalents.
    *
    * @param array $condition
+   *   The condition array.
+   * @param \Drupal\Core\Database\Query\SelectInterface $sql_query
+   *   Select query instance.
+   * @param bool $case_sensitive
+   *   If the condition should be case sensitive or not.
    */
-  protected function translateCondition(&$condition) {
+  public static function translateCondition(&$condition, SelectInterface $sql_query, $case_sensitive) {
+    // There is nothing we can do for IN ().
+    if (is_array($condition['value'])) {
+      return;
+    }
     switch ($condition['operator']) {
+      case '=':
+        if ($case_sensitive) {
+          $condition['value'] = $sql_query->escapeLike($condition['value']);
+          $condition['operator'] = 'LIKE';
+        }
+        break;
+      case '<>':
+        if ($case_sensitive) {
+          $condition['value'] = $sql_query->escapeLike($condition['value']);
+          $condition['operator'] = 'NOT LIKE';
+        }
+        break;
       case 'STARTS_WITH':
+        if ($case_sensitive) {
+          $condition['value'] = $sql_query->escapeLike($condition['value']);
+          $condition['operator'] = 'LIKE BINARY';
+        }
+        else {
+          $condition['operator'] = 'LIKE';
+        }
         $condition['value'] .= '%';
-        $condition['operator'] = 'LIKE';
         break;
 
       case 'CONTAINS':
+        if ($case_sensitive) {
+          $condition['value'] = $sql_query->escapeLike($condition['value']);
+          $condition['operator'] = 'LIKE BINARY';
+        }
+        else {
+          $condition['operator'] = 'LIKE';
+        }
         $condition['value'] = '%' . $condition['value'] . '%';
-        $condition['operator'] = 'LIKE';
         break;
 
       case 'ENDS_WITH':
+        if ($case_sensitive) {
+          $condition['value'] = $sql_query->escapeLike($condition['value']);
+          $condition['operator'] = 'LIKE BINARY';
+        }
+        else {
+          $condition['operator'] = 'LIKE';
+        }
         $condition['value'] = '%' . $condition['value'];
-        $condition['operator'] = 'LIKE';
         break;
-
     }
   }
 
diff --git a/core/lib/Drupal/Core/Entity/Query/Sql/ConditionAggregate.php b/core/lib/Drupal/Core/Entity/Query/Sql/ConditionAggregate.php
index cd83691..f969f53 100644
--- a/core/lib/Drupal/Core/Entity/Query/Sql/ConditionAggregate.php
+++ b/core/lib/Drupal/Core/Entity/Query/Sql/ConditionAggregate.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Database\Query\SelectInterface;
 use Drupal\Core\Entity\Query\ConditionAggregateBase;
 use Drupal\Core\Entity\Query\ConditionAggregateInterface;
+use Drupal\Core\Database\Query\Condition as SqlCondition;
 
 /**
  * Defines the aggregate condition for sql based storage.
@@ -29,7 +30,7 @@ public function compile($conditionContainer) {
     $tables = new Tables($sql_query);
     foreach ($this->conditions as $condition) {
       if ($condition['field'] instanceOf ConditionAggregateInterface) {
-        $sql_condition = new Condition($condition['field']->getConjunction());
+        $sql_condition = new SqlCondition($condition['field']->getConjunction());
         // Add the SQL query to the object before calling this method again.
         $sql_condition->sqlQuery = $sql_query;
         $condition['field']->compile($sql_condition);
@@ -37,8 +38,9 @@ public function compile($conditionContainer) {
       }
       else {
         $type = ((strtoupper($this->conjunction) == 'OR') || ($condition['operator'] == 'IS NULL')) ? 'LEFT' : 'INNER';
-        $this->translateCondition($condition);
-        $field = $tables->addField($condition['field'], $type, $condition['langcode']);
+        $case_sensitive = FALSE;
+        $field = $tables->addField($condition['field'], $type, $condition['langcode'], $case_sensitive);
+        Condition::translateCondition($condition, $sql_query, $case_sensitive);
         $function = $condition['function'];
         $placeholder = ':db_placeholder_' . $conditionContainer->nextPlaceholder();
         $conditionContainer->having("$function($field) {$condition['operator']} $placeholder", array($placeholder => $condition['value']));
@@ -60,29 +62,4 @@ public function notExists($field, $function, $langcode = NULL) {
     return $this->condition($field, $function, NULL, 'IS NULL', $langcode);
   }
 
-  /**
-   * Translates the string operators to SQL equivalents.
-   *
-   * @param array $condition
-   *   An associative array containing the following keys:
-   *     - value: The value to filter by
-   *     - operator: The operator to use for comparison, for example "=".
-   */
-  protected function translateCondition(&$condition) {
-    switch ($condition['operator']) {
-      case 'STARTS_WITH':
-        $condition['value'] .= '%';
-        $condition['operator'] = 'LIKE';
-        break;
-      case 'CONTAINS':
-        $condition['value'] = '%' . $condition['value'] . '%';
-        $condition['operator'] = 'LIKE';
-        break;
-      case 'ENDS_WITH':
-        $condition['value'] = '%' . $condition['value'];
-        $condition['operator'] = 'LIKE';
-        break;
-    }
-  }
-
 }
diff --git a/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php b/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php
index 270c312..8412145 100644
--- a/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php
+++ b/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php
@@ -59,7 +59,7 @@ public function __construct(SelectInterface $sql_query) {
   /**
    * {@inheritdoc}
    */
-  public function addField($field, $type, $langcode) {
+  public function addField($field, $type, $langcode, &$case_sensitive = FALSE) {
     $entity_type_id = $this->sqlQuery->getMetaData('entity_type');
     $age = $this->sqlQuery->getMetaData('age');
     // This variable ensures grouping works correctly. For example:
@@ -139,6 +139,9 @@ public function addField($field, $type, $langcode) {
         }
         $table = $this->ensureFieldTable($index_prefix, $field_storage, $type, $langcode, $base_table, $entity_id_field, $field_id_field);
         $sql_column = $table_mapping->getFieldColumnName($field_storage, $column);
+        if (isset($propertyDefinitions[$column])) {
+          $case_sensitive = $propertyDefinitions[$column]->getSetting('case_sensitive');
+        }
       }
       // The field is stored in a shared table.
       else {
@@ -155,6 +158,17 @@ public function addField($field, $type, $langcode) {
         $entity_tables[$entity_base_table] = $this->getTableMapping($entity_base_table, $entity_type_id);
         $sql_column = $specifier;
         $table = $this->ensureEntityTable($index_prefix, $specifier, $type, $langcode, $base_table, $entity_id_field, $entity_tables);
+
+        // If there is a field storage (some specifiers are not, like
+        // default_langcode), check for case sensitivity.
+        if ($field_storage) {
+          $column = $field_storage->getMainPropertyName();
+          $base_field_property_definitions = $field_storage->getPropertyDefinitions();
+          if (isset($base_field_property_definitions[$column])) {
+            $case_sensitive = $base_field_property_definitions[$column]->getSetting('case_sensitive');
+          }
+        }
+
       }
       // If there are more specifiers to come, it's a relationship.
       if ($field_storage && $key < $count) {
diff --git a/core/lib/Drupal/Core/Entity/Query/Sql/TablesInterface.php b/core/lib/Drupal/Core/Entity/Query/Sql/TablesInterface.php
index 50e5655..16d239b 100644
--- a/core/lib/Drupal/Core/Entity/Query/Sql/TablesInterface.php
+++ b/core/lib/Drupal/Core/Entity/Query/Sql/TablesInterface.php
@@ -20,8 +20,11 @@
    *   then entity property name.
    * @param string $type
    *   Join type, can either be INNER or LEFT.
-   * @param $langcode
-   *   The language code the field values are to be shown in.
+   * @param string $langcode
+   *   The language code the field values are to be queried in.
+   * @param bool &$case_sensitive
+   *   (optional) Allows the implementation to decide if the condition for this
+   *   field needs to be case sensitive or not.
    *
    * @throws \Drupal\Core\Entity\Query\QueryException
    *   If $field specifies an invalid relationship.
@@ -31,6 +34,6 @@
    *   and the appropriate SQL column as passed in. This allows the direct use
    *   of this in a query for a condition or sort.
    */
-  public function addField($field, $type, $langcode);
+  public function addField($field, $type, $langcode, &$case_sensitive = FALSE);
 
 }
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItem.php
index 3f641e5..400422e 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItem.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItem.php
@@ -31,6 +31,7 @@ class StringItem extends StringItemBase {
   public static function defaultStorageSettings() {
     return array(
       'max_length' => 255,
+      'case_sensitive' => FALSE,
     ) + parent::defaultStorageSettings();
   }
 
@@ -44,6 +45,7 @@ public static function schema(FieldStorageDefinitionInterface $field_definition)
           'type' => 'varchar',
           'length' => (int) $field_definition->getSetting('max_length'),
           'not null' => FALSE,
+          'binary' => $field_definition->getSetting('case_sensitive'),
         ),
       ),
     );
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringLongItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringLongItem.php
index 64f8690..3a13d35 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringLongItem.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringLongItem.php
@@ -31,7 +31,7 @@ public static function schema(FieldStorageDefinitionInterface $field_definition)
     return array(
       'columns' => array(
         'value' => array(
-          'type' => 'text',
+          'type' => $field_definition->getSetting('case_sensitive') ? 'blob' : 'text',
           'size' => 'big',
         ),
       ),
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/UriItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/UriItem.php
index a50696b..0c08eaf 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/UriItem.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/UriItem.php
@@ -33,6 +33,7 @@ class UriItem extends StringItem {
   public static function defaultStorageSettings() {
     return array(
       'max_length' => 2048,
+      'case_sensitive' => FALSE,
     ) + parent::defaultStorageSettings();
   }
 
@@ -56,6 +57,7 @@ public static function schema(FieldStorageDefinitionInterface $field_definition)
           'type' => 'varchar',
           'length' => (int) $field_definition->getSetting('max_length'),
           'not null' => TRUE,
+          'binary' => $field_definition->getSetting('case_sensitive'),
         ),
       ),
     );
diff --git a/core/modules/file/src/Entity/File.php b/core/modules/file/src/Entity/File.php
index b21a182..d1ae4f6 100644
--- a/core/modules/file/src/Entity/File.php
+++ b/core/modules/file/src/Entity/File.php
@@ -260,7 +260,8 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
     $fields['uri'] = BaseFieldDefinition::create('uri')
       ->setLabel(t('URI'))
       ->setDescription(t('The URI to access the file (either local or remote).'))
-      ->setSetting('max_length', 255);
+      ->setSetting('max_length', 255)
+      ->setSetting('case_sensitive', TRUE);
 
     $fields['filemime'] = BaseFieldDefinition::create('string')
       ->setLabel(t('File MIME type'))
diff --git a/core/modules/file/src/FileStorageSchema.php b/core/modules/file/src/FileStorageSchema.php
index 9c66e66..f253020 100644
--- a/core/modules/file/src/FileStorageSchema.php
+++ b/core/modules/file/src/FileStorageSchema.php
@@ -31,9 +31,6 @@ protected function getSharedTableFieldSchema(FieldStorageDefinitionInterface $st
 
         case 'uri':
           $this->addSharedTableFieldUniqueKey($storage_definition, $schema, TRUE);
-          // @todo There should be a 'binary' field type or setting:
-          //   https://www.drupal.org/node/2068655.
-          $schema['fields'][$field_name]['binary'] = TRUE;
           break;
       }
     }
diff --git a/core/modules/file/src/Tests/SaveTest.php b/core/modules/file/src/Tests/SaveTest.php
index ee6c1a3..cc12515 100644
--- a/core/modules/file/src/Tests/SaveTest.php
+++ b/core/modules/file/src/Tests/SaveTest.php
@@ -7,7 +7,7 @@
 
 namespace Drupal\file\Tests;
 
-use Drupal\Core\Language\LanguageInterface;
+use Drupal\file\Entity\File;
 
 /**
  * File saving tests.
@@ -17,7 +17,7 @@
 class SaveTest extends FileManagedUnitTestBase {
   function testFileSave() {
     // Create a new file entity.
-    $file = entity_create('file', array(
+    $file = File::create(array(
       'uid' => 1,
       'filename' => 'druplicon.txt',
       'uri' => 'public://druplicon.txt',
@@ -59,7 +59,7 @@ function testFileSave() {
 
     // Try to insert a second file with the same name apart from case insensitivity
     // to ensure the 'uri' index allows for filenames with different cases.
-    $file = entity_create('file', array(
+    $uppercase_file = File::create(array(
       'uid' => 1,
       'filename' => 'DRUPLICON.txt',
       'uri' => 'public://DRUPLICON.txt',
@@ -68,7 +68,16 @@ function testFileSave() {
       'changed' => 1,
       'status' => FILE_STATUS_PERMANENT,
     ));
-    file_put_contents($file->getFileUri(), 'hello world');
-    $file->save();
+    file_put_contents($uppercase_file->getFileUri(), 'hello world');
+    $uppercase_file->save();
+
+    // Ensure that file URI entity queries are case sensitive.
+    $fids = \Drupal::entityQuery('file')
+      ->condition('uri', $uppercase_file->getFileUri())
+      ->execute();
+
+    $this->assertEqual(1, count($fids));
+    $this->assertEqual(array($uppercase_file->id() => $uppercase_file->id()), $fids);
+
   }
 }
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldInstanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldInstanceTest.php
index df97d24..1a4cbed 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldInstanceTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldInstanceTest.php
@@ -95,7 +95,7 @@ public function testFieldInstanceSettings() {
     // Test a text field.
     $field = FieldConfig::load('node.story.field_test');
     $this->assertEqual($field->label(), 'Text Field');
-    $expected = array('max_length' => 255);
+    $expected = array('max_length' => 255, 'case_sensitive' => FALSE);
     $this->assertEqual($field->getSettings(), $expected);
     $this->assertEqual('text for default value', $entity->field_test->value);
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldTest.php
index 2f1c179..6d61713 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateFieldTest.php
@@ -46,7 +46,7 @@ public function testFields() {
     // Text field.
     /** @var \Drupal\field\Entity\FieldStorageConfig $field_storage */
     $field_storage = entity_load('field_storage_config', 'node.field_test');
-    $expected = array('max_length' => 255);
+    $expected = array('max_length' => 255, 'case_sensitive' => FALSE);
     $this->assertEqual($field_storage->type, "text",  t('Field type is @fieldtype. It should be text.', array('@fieldtype' => $field_storage->type)));
     $this->assertEqual($field_storage->status(), TRUE, "Status is TRUE");
     $this->assertEqual($field_storage->settings, $expected, "Field type text settings are correct");
diff --git a/core/modules/system/src/Tests/Entity/EntityQueryAggregateTest.php b/core/modules/system/src/Tests/Entity/EntityQueryAggregateTest.php
index 1df6c88..24ee9d5 100644
--- a/core/modules/system/src/Tests/Entity/EntityQueryAggregateTest.php
+++ b/core/modules/system/src/Tests/Entity/EntityQueryAggregateTest.php
@@ -45,7 +45,7 @@ class EntityQueryAggregateTest extends EntityUnitTestBase {
   protected function setUp() {
     parent::setUp();
 
-    $this->entityStorage = $this->container->get('entity.manager')->getStorage('entity_test');
+    $this->entityStorage = $this->entityManager->getStorage('entity_test');
     $this->factory = $this->container->get('entity.query');
 
     // Add some fieldapi fields to be used in the test.
diff --git a/core/modules/system/src/Tests/Entity/EntityQueryTest.php b/core/modules/system/src/Tests/Entity/EntityQueryTest.php
index 422bfa7..84549a7 100644
--- a/core/modules/system/src/Tests/Entity/EntityQueryTest.php
+++ b/core/modules/system/src/Tests/Entity/EntityQueryTest.php
@@ -9,6 +9,7 @@
 
 use Drupal\Component\Utility\Unicode;
 use Drupal\Core\Entity\EntityStorageInterface;
+use Drupal\entity_test\Entity\EntityTestMulRev;
 use Drupal\language\Entity\ConfigurableLanguage;
 use Symfony\Component\HttpFoundation\Request;
 
@@ -490,7 +491,7 @@ protected function assertBundleOrder($order) {
    *
    * The tags and metadata should propagate to the SQL query object.
    */
-  function testMetaData() {
+  public function testMetaData() {
     $query = \Drupal::entityQuery('entity_test_mulrev');
     $query
       ->addTag('efq_metadata_test')
@@ -500,4 +501,102 @@ function testMetaData() {
     global $efq_test_metadata;
     $this->assertEqual($efq_test_metadata, 'bar', 'Tag and metadata propagated to the SQL query object.');
   }
+
+  /**
+   * Test case sensitive and in-sensitive query conditions.
+   */
+  public function testCaseSensitivity() {
+    $bundle = $this->randomMachineName();
+
+    $field_storage = entity_create('field_storage_config', array(
+      'field_name' => 'field_ci',
+      'entity_type' => 'entity_test_mulrev',
+      'type' => 'string',
+      'cardinality' => 1,
+      'translatable' => FALSE,
+      'settings' => array(
+        'case_sensitive' => FALSE,
+      )
+    ));
+    $field_storage->save();
+
+    entity_create('field_config', array(
+      'field_storage' => $field_storage,
+      'bundle' => $bundle,
+    ))->save();
+
+    $field_storage = entity_create('field_storage_config', array(
+      'field_name' => 'field_cs',
+      'entity_type' => 'entity_test_mulrev',
+      'type' => 'string',
+      'cardinality' => 1,
+      'translatable' => FALSE,
+      'settings' => array(
+        'case_sensitive' => TRUE,
+      ),
+    ));
+    $field_storage->save();
+
+    entity_create('field_config', array(
+      'field_storage' => $field_storage,
+      'bundle' => $bundle,
+    ))->save();
+
+    $fixtures = array();
+
+    for ($i = 0; $i < 2; $i++) {
+      $string = $this->randomString();
+      $fixtures[] = array(
+        'original' => $string,
+        'uppercase' => Unicode::strtoupper($string),
+        'lowercase' => Unicode::strtolower($string),
+      );
+    }
+
+    EntityTestMulRev::create(array(
+      'type' => $bundle,
+      'name' => $this->randomMachineName(),
+      'langcode' => 'en',
+      'field_ci' => $fixtures[0]['uppercase'] . $fixtures[1]['lowercase'],
+      'field_cs' => $fixtures[0]['uppercase'] . $fixtures[1]['lowercase']
+    ))->save();
+
+    $result = \Drupal::entityQuery('entity_test_mulrev')->condition(
+      'field_ci', $fixtures[0]['lowercase'] . $fixtures[1]['lowercase']
+    )->execute();
+
+    $this->assertIdentical(count($result), 1, 'Case insensitive, lowercase');
+
+    $result = \Drupal::entityQuery('entity_test_mulrev')->condition(
+      'field_ci', $fixtures[0]['uppercase'] . $fixtures[1]['uppercase']
+    )->execute();
+
+    $this->assertIdentical(count($result), 1, 'Case insensitive, uppercase');
+
+    $result = \Drupal::entityQuery('entity_test_mulrev')->condition(
+      'field_ci', $fixtures[0]['uppercase'] . $fixtures[1]['lowercase']
+    )->execute();
+
+    $this->assertIdentical(count($result), 1, 'Case insensitive, mixed.');
+
+    $result = \Drupal::entityQuery('entity_test_mulrev')->condition(
+      'field_cs', $fixtures[0]['lowercase'] . $fixtures[1]['lowercase']
+    )->execute();
+
+    $this->assertIdentical(count($result), 0, 'Case sensitive, lowercase.');
+
+    $result = \Drupal::entityQuery('entity_test_mulrev')->condition(
+      'field_cs', $fixtures[0]['uppercase'] . $fixtures[1]['uppercase']
+    )->execute();
+
+    $this->assertIdentical(count($result), 0, 'Case sensitive, uppercase.');
+
+    $result = \Drupal::entityQuery('entity_test_mulrev')->condition(
+      'field_cs', $fixtures[0]['uppercase'] . $fixtures[1]['lowercase']
+    )->execute();
+
+    $this->assertIdentical(count($result), 1, 'Case sensitive, exact match.');
+  }
+
+
 }
diff --git a/core/modules/taxonomy/src/TermStorage.php b/core/modules/taxonomy/src/TermStorage.php
index c686f11..32c3643 100644
--- a/core/modules/taxonomy/src/TermStorage.php
+++ b/core/modules/taxonomy/src/TermStorage.php
@@ -84,17 +84,6 @@ public function create(array $values = array()) {
   /**
    * {@inheritdoc}
    */
-  protected function buildPropertyQuery(QueryInterface $entity_query, array $values) {
-    if (isset($values['name'])) {
-      $entity_query->condition('name', $values['name'], 'LIKE');
-      unset($values['name']);
-    }
-    parent::buildPropertyQuery($entity_query, $values);
-  }
-
-  /**
-   * {@inheritdoc}
-   */
   public function resetCache(array $ids = NULL) {
     drupal_static_reset('taxonomy_term_count_nodes');
     $this->parents = array();
diff --git a/core/modules/text/config/schema/text.schema.yml b/core/modules/text/config/schema/text.schema.yml
index 03d9969..88b311d 100644
--- a/core/modules/text/config/schema/text.schema.yml
+++ b/core/modules/text/config/schema/text.schema.yml
@@ -12,6 +12,9 @@ field.storage_settings.text:
   type: mapping
   label: 'Text (formatted) settings'
   mapping:
+    case_sensitive:
+      type: boolean
+      label: 'Case sensitive'
     max_length:
       type: integer
       label: 'Maximum length'
@@ -34,6 +37,10 @@ field.value.text:
 field.storage_settings.text_long:
   label: 'Text (formatted, long) settings'
   type: mapping
+  mapping:
+    case_sensitive:
+      type: boolean
+      label: 'Case sensitive'
 
 field.field_settings.text_long:
   label: 'Text (formatted, long) settings'
@@ -53,6 +60,10 @@ field.value.text_long:
 field.storage_settings.text_with_summary:
   label: 'Text (formatted, long, with summary) settings'
   type: mapping
+  mapping:
+    case_sensitive:
+      type: boolean
+      label: 'Case sensitive'
 
 field.field_settings.text_with_summary:
   type: mapping
diff --git a/core/modules/text/src/Plugin/Field/FieldType/TextItem.php b/core/modules/text/src/Plugin/Field/FieldType/TextItem.php
index 2585177..77fb2f9 100644
--- a/core/modules/text/src/Plugin/Field/FieldType/TextItem.php
+++ b/core/modules/text/src/Plugin/Field/FieldType/TextItem.php
@@ -42,6 +42,7 @@ public static function schema(FieldStorageDefinitionInterface $field_definition)
           'type' => 'varchar',
           'length' => $field_definition->getSetting('max_length'),
           'not null' => FALSE,
+          'binary' => $field_definition->getSetting('case_sensitive'),
         ),
         'format' => array(
           'type' => 'varchar',
@@ -91,6 +92,7 @@ public function storageSettingsForm(array &$form, FormStateInterface $form_state
       '#min' => 1,
       '#disabled' => $has_data,
     );
+    $element += parent::storageSettingsForm($form, $form_state, $has_data);
 
     return $element;
   }
diff --git a/core/modules/text/src/Plugin/Field/FieldType/TextItemBase.php b/core/modules/text/src/Plugin/Field/FieldType/TextItemBase.php
index e08f951..c2ef066 100644
--- a/core/modules/text/src/Plugin/Field/FieldType/TextItemBase.php
+++ b/core/modules/text/src/Plugin/Field/FieldType/TextItemBase.php
@@ -21,6 +21,15 @@
   /**
    * {@inheritdoc}
    */
+  public static function defaultStorageSettings() {
+    return array(
+      'case_sensitive' => FALSE,
+    ) + parent::defaultStorageSettings();
+  }
+
+  /**
+   * {@inheritdoc}
+   */
   public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
     $properties['value'] = DataDefinition::create('string')
       ->setLabel(t('Text'));
diff --git a/core/modules/text/src/Plugin/Field/FieldType/TextLongItem.php b/core/modules/text/src/Plugin/Field/FieldType/TextLongItem.php
index bf1054f..98ad050 100644
--- a/core/modules/text/src/Plugin/Field/FieldType/TextLongItem.php
+++ b/core/modules/text/src/Plugin/Field/FieldType/TextLongItem.php
@@ -29,7 +29,7 @@ public static function schema(FieldStorageDefinitionInterface $field_definition)
     return array(
       'columns' => array(
         'value' => array(
-          'type' => 'text',
+          'type' => $field_definition->getSetting('case_sensitive') ? 'blob' : 'text',
           'size' => 'big',
           'not null' => FALSE,
         ),
diff --git a/core/modules/text/src/Plugin/Field/FieldType/TextWithSummaryItem.php b/core/modules/text/src/Plugin/Field/FieldType/TextWithSummaryItem.php
index e0ba0c8..bbfabe9 100644
--- a/core/modules/text/src/Plugin/Field/FieldType/TextWithSummaryItem.php
+++ b/core/modules/text/src/Plugin/Field/FieldType/TextWithSummaryItem.php
@@ -59,12 +59,12 @@ public static function schema(FieldStorageDefinitionInterface $field_definition)
     return array(
       'columns' => array(
         'value' => array(
-          'type' => 'text',
+          'type' => $field_definition->getSetting('case_sensitive') ? 'blob' : 'text',
           'size' => 'big',
           'not null' => FALSE,
         ),
         'summary' => array(
-          'type' => 'text',
+          'type' => $field_definition->getSetting('case_sensitive') ? 'blob' : 'text',
           'size' => 'big',
           'not null' => FALSE,
         ),
