+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
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";
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;