commas in CONNECTION string cause MapServer to fail

Frank Warmerdam warmerdam at POBOX.COM
Thu Apr 20 15:11:45 EDT 2006


Mark Adams wrote:
> Like I said, if I put this in the OVF file instead of including it 
> inline, it works. Inline, it craps out at the first comma. I can test 
> this by removing the tablename from the SrcDataSource element for 
> example, and then it craps out at SrcSQL instead – first comma it finds. 
> Here is the LAYER definition:
> 
>  
> 
> LAYER
> 
>  NAME 'References'
> 
>  CONNECTIONTYPE OGR
> 
>  #CONNECTION 
> "ODBC:MINFWHSE_P1/MINFWHSE_P1 at MINFWHSE_P1,MINFT_WH2_REFER_REFERENCE"
> 
>  #CONNECTION "REFERENCES_minf_read.ovf"
> 
>  CONNECTION "<OGRVRTDataSource>

Mark,

The OGR code in mapserver expects to split CONNECTION strings into a
datasource name, and a layer # (or name) and it does this based on a comma
in the connection string.

It seems that you do nothing to select the layer to be used.  I guess
mapserver must implicitly choose the 1st.   The "new" approach to specifying
the layer is to put the name in the DATA keyword.

I would really like to remove support from mapserver for the old
"datasource,layer" support in the connection string but this is likely to
cause non-trivial amounts of breakage.

/me checks the code.

Wonderful news!  If you define the layer in a DATA keyword, then MapServer
won't try and parse it out of your connection string and things should work!

So try:

   CONNECTION '<OGR...'
   DATA 'Reference_Query'

If this fixes the problem, could you try and add some relative comments for
updates to the appropriate documents on the web site?  At least the OGR howto
and the OVF example document.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGF, http://osgeo.org



More information about the mapserver-users mailing list