  from django.contrib.gis.db.backends.base.adapter import WKTAdapter
  from django.contrib.gis.db.backends.base.operations import \
      BaseSpatialOperations
  from django.contrib.gis.db.backends.utils import SpatialOperator
  from django.contrib.gis.db.models import aggregates
  from django.db.backends.mysql.operations import DatabaseOperations
  from django.utils.functional import cached_property
  
  
  class MySQLOperations(BaseSpatialOperations, DatabaseOperations):
 
</s> remove             if spatialite or mysql or oracle:
 </s> add             if spatialite or (mysql and not connection.ops.uses_invalid_empty_geometry_collection) or oracle:
from django.contrib.gis.db.models import GeometryField, aggregates
  from django.contrib.gis.db.backends.base.adapter import WKTAdapter
  from django.contrib.gis.db.backends.base.operations import \
      BaseSpatialOperations
  from django.contrib.gis.db.backends.utils import SpatialOperator
from django.contrib.gis.db.models import GeometryField, aggregates
  from django.db.backends.mysql.operations import DatabaseOperations
  from django.utils.functional import cached_property
  
  
  class MySQLOperations(BaseSpatialOperations, DatabaseOperations):
keep keep keep keep replace keep keep keep keep keep
 Refs #26657 -- Fixed a crash induced by invalid WKT returned by MySQL 5.7.5+. 
django/contrib/gis/db/backends/mysql/operations.py