Subject Re: [IBO] Code branching incorrectly in procedure TIB_Column.SetAsVariant( const NewValue: Variant ); in IB_Components
Author Jason Wharton
> I see you are no longer on skype.

I just had to step away from my desk for a while. I left my speakers off so
I didn't hear the notice of your post.


> The problem arises due to an omitted; in the above procedure:
> IB_Components...
> procedure TIB_Column.SetAsVariant( const NewValue: Variant ); ...
>
> Lines: 42610 - 42622 reads as follows:
>
> SQL_BLOB,
> SQL_BLOB_: if AsString <> NewValue then
> begin
> WasChanged := true;
> AsString := NewValue;
> end
> // SQL_ARRAY,
> // SQL_ARRAY_: {should be overridden} ;
> else
> raise EIB_Error.CreateWithSender( Statement,
> Format( E_UNSUPPORTED_COLUMN,
> [ SQLType ]));
> end;
>
> And should read:
>
> SQL_BLOB,
> SQL_BLOB_: if AsString <> NewValue then
> begin
> WasChanged := true;
> AsString := NewValue;
> end;//*****************************************;Added here to branch
> out correctly ******************************
> // SQL_ARRAY,
> // SQL_ARRAY_: {should be overridden} ;
> else
> raise EIB_Error.CreateWithSender( Statement,
> Format( E_UNSUPPORTED_COLUMN,
> [ SQLType ]));
> end;

Very interesting. This suggests that the PASCAL parsing for D2009 has been
altered. Seems to me it should have raised an exception of some kind at
compile time rather than outright changing the behavior in a manner this is
non-intuitive.

Now I wonder if I should audit all of my case statements for any other
occurences of this issue.

Thanks for spotting this! It will be fixed in my next release.

Jason Wharton