2006-10-12 Hubert FONGARNAND <informatique.internet@fiducial.fr>
authorMiguel de Icaza <miguel@gnome.org>
Thu, 12 Oct 2006 14:48:21 +0000 (14:48 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Thu, 12 Oct 2006 14:48:21 +0000 (14:48 -0000)
        Patch from Hubert FONGARNAND

        * SessionSQLServerHandler.cs (selectCommand): Instead of using
        SELECT * for pulling the data out of the ASPStateTempSessions,
use
        the explicit column names.  This allows users to change the
table
        and not have any undesired side effects for our code.

        (ReadBytes): This patch corrects a bug too in ReadBytes. The
index parameter
        was not properly used when calculating the size of the data.

svn path=/trunk/mcs/; revision=66601

mcs/class/System.Web/System.Web.SessionState/ChangeLog
mcs/class/System.Web/System.Web.SessionState/SessionSQLServerHandler.cs

index 9d0533c0bbdd66d283340295cab3bd36a9816d64..8a77874d8d7af9c56c73a4c6ebf57d48f243c78b 100644 (file)
@@ -1,3 +1,15 @@
+2006-10-12 Hubert FONGARNAND <informatique.internet@fiducial.fr>
+
+       Patch from Hubert FONGARNAND
+       
+       * SessionSQLServerHandler.cs (selectCommand): Instead of using
+       SELECT * for pulling the data out of the ASPStateTempSessions, use
+       the explicit column names.  This allows users to change the table
+       and not have any undesired side effects for our code.
+
+       (ReadBytes): This patch corrects a bug too in ReadBytes. The index parameter
+       was not properly used when calculating the size of the data.
+       
 2006-09-03  Robert Jordan  <robertj@gmx.net>
 
        * SessionSQLServerHandler.cs: persist and handle the "timeout" and
index 6a282c107e016a9e3031647415b27cd2988496f2..f933bce0d1f138bcd55e3d0c770325a473648cf2 100644 (file)
@@ -50,7 +50,7 @@ namespace System.Web.SessionState {
                 
                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 @@ namespace System.Web.SessionState {
 
                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;