[Mono-dev] Bug in mono 2.6.1 SessionSQLServerHandler.cs

quandary quandary82 at hailmail.net
Sat Nov 5 09:28:12 EDT 2011


Hi,

I was just creating a custom database session handler.
There were some examples on codeproject.com and MSDN, but they were all 
buggy (worked fine as long as timeout="1", but booom when timeout="480"...)

So after 3 hours of debugging, I was fed-up and took the mono 
SqlSessionHandler for reference, in the hope that this one would work.

I was just using this file:
mono-2.10.6/mcs/class/System.Web/System.Web.SessionState_2.0/SessionSQLServerHandler.cs

and after 15 minutes, everything worked perfectly !

There was one very wonderful YSOD bug, however:
On line 451 (of said file), there is this SQL statement:
DELETE * FROM Session WHERE ...

this should be
DELETE FROM Session WHERE ...

(no star), because else, on Session.Abandon() (also called logout)
--> Booom, YSOD ! Wrong syntax near *...

I'm not going to waste another 15 minutes by adding a bug report, 
deleting a * should be a 20-seconds no-brainer for somebody with git 
write-access.

You might also want to add a unit-test for session.abandon(), for that 
this never happens again.



More information about the Mono-devel-list mailing list