On SqlServer queries of nvarchar(max) declared fields receive two extra bytes in the buffer. So strings cannot be concatenated.
See the example. On SP3 and older the buffer length is always length * 2 + 2 but on EMP5361 the buffer length is length * 2 + 4!!!
Tested on SqlServer 2008 R2
Testcase: Enter the connection informations and
click Connect
click Create Table
Enter a content into the text field at the bottom or leave it blank
click Fill
click query and see that the buffer length is wrong.
TD-15968: Critical bug on SqlServer
TD-15968: Critical bug on SqlServer
You do not have the required permissions to view the files attached to this post.
Re: TD-15968: Critical bug on SqlServer
With EMP 5361 the problem with long string / nvarchar and wrong buffer length (now two bytes too much) seems to be relevant for nearly all databases.
Only with SqlBase 11.6 it's now o.k., with that version the buffer was earlier too bytes too short.
But with ALL these other databases it's now wrong: SqlBase 11.5, 8.5, SqlServer, Oracle (there even worse, the string is truncated) !
A workaround, only for the two bytes too much (for Oracle I don't know one - besides to go back to e.g. SP2 EMP 5347), could be to correct the buffer after fetching the Long String by such as :
Set sLongString = SalStrLeftX( sLongString, SalStrLength( sLongString ) )
But it can be a lot of work to identify all relevant TD-programs and build it in, we need a new corrected EMP anyway, especially for the Oracle-problem.
Regards
Guenter
Only with SqlBase 11.6 it's now o.k., with that version the buffer was earlier too bytes too short.
But with ALL these other databases it's now wrong: SqlBase 11.5, 8.5, SqlServer, Oracle (there even worse, the string is truncated) !
A workaround, only for the two bytes too much (for Oracle I don't know one - besides to go back to e.g. SP2 EMP 5347), could be to correct the buffer after fetching the Long String by such as :
Set sLongString = SalStrLeftX( sLongString, SalStrLength( sLongString ) )
But it can be a lot of work to identify all relevant TD-programs and build it in, we need a new corrected EMP anyway, especially for the Oracle-problem.
Regards
Guenter
Re: TD-15968: Critical bug on SqlServer
Hi Nils,
I have added your testcase and report of the SQL Server problem to TD-15968.
Best regards,
Mike
I have added your testcase and report of the SQL Server problem to TD-15968.
Best regards,
Mike
Re: TD-15968: Critical bug on SqlServer
Hi There,
we also ran into this issue ... right after we created a new version for our customers and started to deploy!!!!
That gave us some "red heads" here ...
Hope to get a solution for this urgently!
Cheers from Vienna,
Alex
we also ran into this issue ... right after we created a new version for our customers and started to deploy!!!!
That gave us some "red heads" here ...
Hope to get a solution for this urgently!
Cheers from Vienna,
Alex
Re: TD-15968: Critical bug on SqlServer
Alex: FYI, I just checked and see that a fix for TD-15968 is scheduled to be released with EMP5363, due out in in a week or so.
Who is online
Users browsing this forum: [Ccbot] and 0 guests