Opened 15 years ago

Closed 15 years ago

#3107 closed enhancement (fixed)

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 (1)

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

Download all attachments as: .zip

Change History (9)

by msmitherdc, 15 years ago

Attachment: mapserver_4dbind.patch added

patch file for maporaclespatial.c

comment:1 by bartvde, 15 years ago

Cc: bartvde added

comment:2 by dmorissette, 15 years ago

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.

comment:3 by aboudreault, 15 years ago

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"

comment:4 by msmitherdc, 15 years ago

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.

comment:5 by aboudreault, 15 years ago

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".

comment:6 by aboudreault, 15 years ago

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 ?

comment:7 by msmitherdc, 15 years ago

aboudrealt,

looks very good. thanks for the clean up.

comment:8 by aboudreault, 15 years ago

Resolution: fixed
Status: newclosed

Committed in r9295. Thanks again for the patch msmitherdc.

Note: See TracTickets for help on using tickets.