Skip to content
  • Ajo Robert's avatar
    261a9548
    Bug#27330634 ASSERTION `LENGTH > 0' FAILED · 261a9548
    Ajo Robert authored
    Problem: Debug builds fail an assertion when trying to do ALTER
    TABLE on an ARCHIVE engine table with a GEOMETRY NOT NULL
    column containing empty strings. Release builds return an error.
    
    GEOMETRY columns should never hold empty strings as it is not
    a valid geometric object. This is enforced by
    Field_geom::store_internal(). However, in non-strict mode,
    it is possible to trick the server into storing empty strings
    in GEOMETRY NOT NULL columns by inserting NULL, which is then
    converted to an empty string.
    
    Later, when doing ALTER TABLE, these empty string values fail
    an assertion in Field_geom::store_internal().
    
    Fix: Remove the failing assertion, as such invalid values may
    exist, and strengthen the check for too short geometry values
    in Field_geom::store_internal(). Raise an error if trying to
    insert a NULL value to a GEOMETRY NOT NULL column, regardless
    of strict mode settings.
    
    Note: This is the backport of Bug#85059
    Change-Id: I8a0a5da8c46f2755d4bf6e0c6ab0fa3d7e2d5048
    261a9548
    Bug#27330634 ASSERTION `LENGTH > 0' FAILED
    Ajo Robert authored
    Problem: Debug builds fail an assertion when trying to do ALTER
    TABLE on an ARCHIVE engine table with a GEOMETRY NOT NULL
    column containing empty strings. Release builds return an error.
    
    GEOMETRY columns should never hold empty strings as it is not
    a valid geometric object. This is enforced by
    Field_geom::store_internal(). However, in non-strict mode,
    it is possible to trick the server into storing empty strings
    in GEOMETRY NOT NULL columns by inserting NULL, which is then
    converted to an empty string.
    
    Later, when doing ALTER TABLE, these empty string values fail
    an assertion in Field_geom::store_internal().
    
    Fix: Remove the failing assertion, as such invalid values may
    exist, and strengthen the check for too short geometry values
    in Field_geom::store_internal(). Raise an error if trying to
    insert a NULL value to a GEOMETRY NOT NULL column, regardless
    of strict mode settings.
    
    Note: This is the backport of Bug#85059
    Change-Id: I8a0a5da8c46f2755d4bf6e0c6ab0fa3d7e2d5048
Loading