Ticket #3107 (closed enhancement: fixed)

Opened 4 years ago

Last modified 4 years ago

patch for oci bind variables and 4d data (x,y,z,m) data support

Reported by: msmitherdc Owned by: aboudreault
Priority: normal Milestone: 5.6 release
Component: Input - Native Oracle Spatial Support Version: unspecified
Severity: normal Keywords: oracle, bind, 4d, measure
Cc: bartvde, dmorissette, hobu

Description

This is a combined patch that includes support for 4d geometry types (x,y,z,m) and also changes the srid, and ordinates from strings to bind values to support sql statement reuse (soft parsing).

This includes/replaces ticket #2830

Attachments

mapserver_4dbind.patch Download (22.9 KB) - added by msmitherdc 4 years ago.
patch file for maporaclespatial.c

Change History

Changed 4 years ago by msmitherdc

patch file for maporaclespatial.c

Changed 4 years ago by bartvde

  • cc bartvde added

Changed 4 years ago by dmorissette

  • cc dmorissette, hobu added
  • owner changed from hobu to aboudreault

Thanks for the patch Mike. In discussions with Howard, we agreed that Alan would try to take care of it. The idea is that we'd like him to eventually become maintainer for the maporaclespatial.c driver.

Changed 4 years ago by aboudreault

The patch works great. However, I've noticed the following behavior with bind values and wondering if it could be a problem.

If in our oracle data, there is no SRID set for a table, we will obtain an binding error. The code try to bind a number and fails with the NULL value. I presume that there is certainly someone who doesn't use the SRID from oracle and let mapserver handle the geometries as they are. What do you think?

Example:

DATA "ORA_GEOMETRY FROM popplace4d"

instead of

DATA "ORA_GEOMETRY FROM popplace4d USING SRID 42304"

Changed 4 years ago by msmitherdc

I think just seting the value_sz parameter to 0, Oracle will treat the bind variable as a NULL. I thought the sizeof(srid) would return 0 when SRID is null but perhaps it needs to be explicitly set to 0.

Changed 4 years ago by aboudreault

Ok, the SRID have to be set to -1 to get the NULL binding. So I've added a simple line to check if the srid value in the mapfile is set explicitly to the string "NULL" or isn't set at all, then change it to "-1".

Changed 4 years ago by aboudreault

To make binding work properly and remove some warnings, I modified a few things:

  • Added this code to get the NULL binding working (at line ~1849):
        /* If no SRID is provided, set it to -1 (NULL) for binding */
        if (strcmp(srid,"NULL") == 0)
            strcpy(srid,"-1");
    
  • Changed two call to strcpy:
        strcpy( hand->last_oci_error, ...)
    
    to
       strcpy( (char *)hand->last_oci_error,
    
  • Modified the following code (in the get_tdo function):
        if (success) 
        	return tdoe;
    
    to
        if (success) 
        	return tdoe;
    
       /* if failure, return NULL*/
       return NULL;
    

msmitherdc, could you confirm me that everything looks good to you please ?

Changed 4 years ago by msmitherdc

aboudrealt,

looks very good. thanks for the clean up.

Changed 4 years ago by aboudreault

  • status changed from new to closed
  • resolution set to fixed

Committed in r9295. Thanks again for the patch msmitherdc.

Note: See TracTickets for help on using tickets.