[freetds] [PATCH] Fix segfault when triggering a foreignkeyviolation

ZIGLIO Frediano Frediano.Ziglio at vodafone.com
Mon Jan 12 17:56:44 EST 2004


> 
> On Mon, 12 Jan 2004, "ZIGLIO Frediano" <Frediano.Ziglio at vodafone.com>
> wrote:
> > > When such an aforementioned error is triggered the database
> > > sends a EED token which gets processed by tds_process_msg(). 
> > > When the status byte of the EED message is set to 1, 
> > > additional error data follows; freetds fails to read this 
> > > data from wire - which appears to let sqsh think it must read 
> > > data and thus causing it to segfault.
> > > 
> > > The attached patch fixes this bug
> > 
> > this patch was included in 0.62 however I do not agree... 
> the reason 
> > is that tds_process_trailing_tokens all tokens till IDLE state so 
> > client do not receive DONE token...
> 
> Ach.  I don't know why, Freddy; I thought you had seen it.  
> Alex is fixing a real problem, which he tested.  I suppose if 
> our unit tests were more rigorous, they would have exposed 
> the state problem you refer to.  
> 
> What to do?  It seems we need to read the extended error data 
> AND leave the stream in IDLE state.  If we come up with a way 
> to do that fairly soon, we can apply it to the 0.62 branch as 
> well as the trunk.  At some future point -- depending on how 
> critical this is (not clear, to me) -- we can release 0.62.1, 
> with or without other fixes.  
> 

Well, there are alreays less test cases than needed :)

However now some dblib tests now fails (I used a mssql2k server):
- t0001 fails
- any other test that cause a error hangs...

freddy77


More information about the FreeTDS mailing list