diff options
Diffstat (limited to 'mcs')
-rwxr-xr-x | mcs/class/System.Data/System.Data.SqlClient/ChangeLog | 8 | ||||
-rw-r--r-- | mcs/class/System.Data/System.Data.SqlClient/SqlXmlTextReader.cs | 5 |
2 files changed, 12 insertions, 1 deletions
diff --git a/mcs/class/System.Data/System.Data.SqlClient/ChangeLog b/mcs/class/System.Data/System.Data.SqlClient/ChangeLog index b7cd25553a8..059099f5caf 100755 --- a/mcs/class/System.Data/System.Data.SqlClient/ChangeLog +++ b/mcs/class/System.Data/System.Data.SqlClient/ChangeLog @@ -1,3 +1,11 @@ +2003-12-04 John Luke <jluke@cfl.rr.com> + + * SqlXmlTextReader.cs: applied patch from Chris Masters <neeeeeep@bigpond.com> + fix peek so it checks if it is at the end and also to make sure that if Read() + advances the position past the end of the localBuffer array, it makes + a call to GetNextBuffer(). fixes bug #40253 System.IndexOutOfRangeException when + using SqlCommand.ExecuteXmlReader() + 2003-11-20 Joerg Rosenkranz <JoergR@voelcker.com> * SqlConnection (SetDefaultConnectionParameters): diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlXmlTextReader.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlXmlTextReader.cs index 4bd8a6eeea3..908ab0b5058 100644 --- a/mcs/class/System.Data/System.Data.SqlClient/SqlXmlTextReader.cs +++ b/mcs/class/System.Data/System.Data.SqlClient/SqlXmlTextReader.cs @@ -78,7 +78,6 @@ namespace System.Data.SqlClient { else { eof = true; localBuffer = "</results>"; - return false; } return true; } @@ -91,6 +90,8 @@ namespace System.Data.SqlClient { if (!moreResults) return -1; } + if (eof && position >= localBuffer.Length) + return -1; return (int) localBuffer[position]; } @@ -98,6 +99,8 @@ namespace System.Data.SqlClient { { int result = Peek (); position += 1; + if (!eof && position >= localBuffer.Length) + GetNextBuffer (); return result; } |