Opened 18 years ago

Last modified 18 years ago

#1073 closed defect (duplicate)

ODBC linestring features limited to 512 bytes

Reported by: amagnum2@… Owned by: warmerdam
Priority: high Milestone:
Component: default Version: unspecified
Severity: blocker Keywords:
Cc:

Description

We use MapServer and OGR.
When we tried to enable OGR ODBC driver and pull a layer from SQL Server it 
would not work although the WKT linestring definitions we put in were good.
I found that cpl_odbc.cpp function CPLODBCStatement::Fetch  which was 
processing the SQLFetch response was copying strings into a 512 bytes buffer 
and chopping it in case it was longer. So the end result was that we got a bad 
WKT string and no exceptions that would suggest what is the problem.
I extended 512 to 8000 which I beleive is the limit for varchar on both SQL 
Server and Oracle. From that point everything worked great.
I suggest extending the buffer to 8000 since it is unrisky and I already 
tested it. In the future it should be good if the function would trigger an 
error report instead of chopping the text.

Change History (2)

comment:1 by warmerdam, 18 years ago

Ariel,

I suspect you are running into the same problem reported in Bug 990.

Could you try with the code in:

  http://www.gdal.org/srctree/port/cpl_odbc.cpp

It includes a fix for #990 which can cause premature truncation of
long string fields in multi-byte enabled fields. 

comment:2 by amagnum2@…, 18 years ago


*** This bug has been marked as a duplicate of 990 ***
Note: See TracTickets for help on using tickets.