Subject: | Does not handle MS SQL Server xml columns properly |
create table mje (a int primary key, b xml);
insert into mje values (1,
'<xx>zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz</xx>');
select * from mje
On Windows with the original MS ODBC Driver you will data truncation
errors because the column type is reported as SQL_WLONGVARCHAR (and a
display size of 1073741823) and this gets restricted to LongReadLen by
default. - OK
On Windows with the MS native client driver you get data truncation
errors too but for the wrong reason. The column type is reported -152
(which DBD::ODBC does not know) and a column size of 0. DBD::ODBC adds 1
(for the trailing nul) and attempts to bind the xml type with a buffer
of 1. Changing LongReadLen does not fix this.
A similar issue happens on non-Windows platforms where the column is
reported as type -152 (xml).
Martin
--
Martin J. Evans
Wetherby, UK