Hello,

This small patch permits that the user add some custom column in the aspsessionstate table when using sqlserver mode for storing session in ASP.NET. (This is useful for us because we want to add tracability to the session in the database). Therefore i think it's better to do a  "SELECT timeout,staticobjectsdata,sessiondata" than SELECT * (with select * the order of the column, you've specified when you create the table is important...).
This patch corrects a bug too in ReadBytes. The index parameter was not properly used when calculating the size of the data...

Could someone commit?

Thanks!


--
Hubert FONGARNAND <[EMAIL PROTECTED]>
Fiducial
_______________________________________________
Ce message et les éventuels documents joints peuvent contenir des informations confidentielles.
Au cas où il ne vous serait pas destiné, nous vous remercions de bien vouloir le supprimer et en aviser immédiatement l'expéditeur. Toute utilisation de ce message non conforme à sa destination, toute diffusion ou publication, totale ou partielle et quel qu'en soit le moyen est formellement interdite.
Les communications sur internet n'étant pas sécurisées, l'intégrité de ce message n'est pas assurée et la société émettrice ne peut être tenue pour responsable de son contenu.
Index: System.Web.SessionState/SessionSQLServerHandler.cs
===================================================================
--- System.Web.SessionState/SessionSQLServerHandler.cs	(révision 66591)
+++ System.Web.SessionState/SessionSQLServerHandler.cs	(copie de travail)
@@ -50,7 +50,7 @@
                 
 		const string defaultParamPrefix = ":";
 		string paramPrefix;
-		string selectCommand = "SELECT * FROM ASPStateTempSessions WHERE SessionID = :SessionID AND Expires > :Expires";
+		string selectCommand = "SELECT timeout,staticobjectsdata,sessiondata FROM ASPStateTempSessions WHERE SessionID = :SessionID AND Expires > :Expires";
 		string insertCommand = "INSERT INTO ASPStateTempSessions VALUES (:SessionID, :Created, :Expires, :Timeout, :StaticObjectsData, :SessionData)";
 		string updateCommand = "UPDATE ASPStateTempSessions SET expires = :Expires, timeout = :Timeout, SessionData = :SessionData WHERE SessionId = :SessionID";
 		string deleteCommand = "DELETE FROM ASPStateTempSessions WHERE SessionId = :SessionID";
@@ -348,7 +348,7 @@
 
 		private byte [] ReadBytes (IDataReader reader, int index)
 		{
-			int len = (int) reader.GetBytes (reader.FieldCount-1, 0, null, 0, 0);
+			int len = (int) reader.GetBytes (index, 0, null, 0, 0);
 			byte [] data = new byte [len];
 			reader.GetBytes (index, 0, data, 0, len);
 			return data;
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to