Skip to content

MDEV-40553: unprintable gis ranges in trace and context - #5493

Open
bsrikanth-mariadb wants to merge 1 commit into
bb-12.3-MDEV-39368-test-replay-preview-treefrom
13.2-MDEV-40553-unprintable_gis-ranges-in-trace-and-context
Open

MDEV-40553: unprintable gis ranges in trace and context#5493
bsrikanth-mariadb wants to merge 1 commit into
bb-12.3-MDEV-39368-test-replay-preview-treefrom
13.2-MDEV-40553-unprintable_gis-ranges-in-trace-and-context

Conversation

@bsrikanth-mariadb

@bsrikanth-mariadb bsrikanth-mariadb commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

When ranges were specified in a query for GIS types, the recorded trace
and context couldn't print the range information. Instead, it only
showed unprintable_geometry_value.

This PR extends the geometric field type Field_geom to print appropriate
key value, along with the comparison operator when printed in the range.
Key value is decoded from binary if applicable, and is recorded in WKT
format. For spatial indexes, the operators like MDRWITHIN, MDRCONTAINS, etc...
are stored appropriately, and for normal indexes, operators like
<, <=, >, >=, etc... are recorded appropriately.

Implementation Details: -

  1. overwrite print_key_value() for Field_geom to print the decoded
    binary value in WKT format. If binary value can't be decoded
    appropriately to WKT format, then the binary value itself is recorded.
  2. Add an argument imagetype to Field::print_key_part_value(), to determine
    if an index key part value is to be printed in WKT or binary format.
    For Geometric type, imagetype is set to itMBR. When printing ranges,
    the MBR operators are printed as well, as implemented in
    print_mbr_range_operator().

@bsrikanth-mariadb
bsrikanth-mariadb force-pushed the 13.2-MDEV-40553-unprintable_gis-ranges-in-trace-and-context branch 2 times, most recently from 75e9279 to 0bb4fe0 Compare August 7, 2026 10:26
When ranges were specified in a query for GIS types, the recorded trace
and context couldn't print the range information. Instead, it only
showed unprintable_geometry_value.

This PR extends the geometric field type Field_geom to print appropriate
key value, along with the comparison operator when printed in the range.
Key value is decoded from binary if applicable, and is recorded in WKT
format. For spatial indexes, the operators like MDRWITHIN, MDRCONTAINS, etc...
are stored appropriately, and for normal indexes, operators like
<, <=, >, >=, etc... are recorded appropriately.

Implementation Details: -
1. overwrite print_key_value() for Field_geom to print the decoded
   binary value in WKT format. If binary value can't be decoded
   appropriately to WKT format, then the binary value itself is recorded.
2. Add an argument imagetype to Field::print_key_part_value(), to determine
   if an index key part value is to be printed in WKT or binary format.
   For Geometric type, imagetype is set to itMBR. When printing ranges,
   the MBR operators are printed as well, as implemented in
   print_mbr_range_operator().
@bsrikanth-mariadb
bsrikanth-mariadb force-pushed the 13.2-MDEV-40553-unprintable_gis-ranges-in-trace-and-context branch from 0bb4fe0 to a5a2383 Compare August 7, 2026 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant