Subject Re: [firebird-support] Firebird 2.1.x and SUBSTRING
Author Helen Borrie
At 05:12 AM 10/07/2010, sboydlns wrote:
>I ran into an interesting problem this morning. I upgraded a database from 1.5.x to 2.1.x and the SUBSTRING started returning a different result. I was using SUBSTRING to convert a blob to a VARCHAR like this:
>
>SUBSTRING(blob from 1 for 1000)
>
>In 1.5.x and 2.0.x this returns a VARCHAR(1000). In 2.1.x this returns another BLOB, which broke my application. I now have to do this:
>
>CAST(SUBSTRING(blob from 1 for 1000) AS VARCHAR(1000))
>
>One wonders why this was changed????

You have correctly observed the change which, AFAIU, was done in the interests first of standards compliance along with other factors like the size limit for strings, the enablement of internal functions (including string functions) that came with 2.1 and the application of many of these string functions to work with subtype 1 blobs.

If you want a fuller run-down of the rationale for the change, please ask on firebird-devel.

^ heLen ^