HasRows doesn't work with preload reader #223

Closed
hellower opened this Issue May 2, 2014 · 11 comments

Projects

None yet

4 participants

@hellower
hellower commented May 2, 2014

At Npgsql.dll version 2.1.xx,
HasRows property always return "FALSE" when "PreloadReader=true" .

version 2.0.x HasRows property - good ( PreloaderReader=True/False)
version 2.1.x HasRows property - good( PreloaderReader=False)
version 2.1.x HasRows property - bad(always return false) ( PreloaderReader=true) !!!

sorry for my poor english.

@franciscojunior franciscojunior added the bug label May 3, 2014
@franciscojunior
Member

I've marked this issue as a bug. We will check that.

Thanks for your feedback!

@t-oka
t-oka commented May 21, 2014

Hello,
I have a question still. (2013-12-02)
http://pgfoundry.org/forum/forum.php?thread_id=15708&forum_id=519&group_id=1000140

The value of HasRows changes by a row position. (Npgsql 2.0.12)
Is it Npgsql's specification or bug?

create table chkhasrows
(
linenum int
);
insert into chkhasrows values(1);
insert into chkhasrows values(2);
insert into chkhasrows values(3);

NpgsqlCommand command = conn.CreateCommand();
command.CommandText = "select * from chkhasrows";

NpgsqlDataReader reader;
reader = command.ExecuteReader();

while (reader.Read())
{
Debug.WriteLine(reader.HasRows);
}
reader.Close();

Result of PostgreSQL:
True
True
False

Result of SQL Server and Oracle:
True
True
True

@franciscojunior
Member

Can you try latest version of Npgsql 2.1.3? We have some fixes for the HasRows property.
#181

@t-oka
t-oka commented May 22, 2014

Thank you for your reply.

I'm trying Npgsql 2.1.3.

If preloadreader is false, then the result is right.
If preloadreader is true, then the result is not right. The return value of HasRows has been always False.

I am troubled by these two bugs.
When is this bug fixed?
When is other bug(SSPI authentication#162) fixed?

@franciscojunior
Member

#162 should already have been fixed by #170 . Can you give it a try and let us know if it works ok for you?

@t-oka
t-oka commented May 23, 2014

I'm trying SSPI on Npgsql 2.1.3. again.

It is the same procedure as before.
http://pgfoundry.org/forum/forum.php?thread_id=15711&forum_id=519&group_id=1000140

The result was the same.
FATAL: could not accept SSPI security context
Detail:The token supplied to the function is invalid
(80090308)

As for a HasRows problem, my application has to connect the preloadread option by true.It is because multiple DataReaders are opened.

I hope Npgsql to support MARS.

I am troubled by the bug of SSPI and HasRows.

@franciscojunior
Member

I'm trying SSPI on Npgsql 2.1.3. again.

Sorry. This bug is fixed in master branch. Are you able to try it?

As for a HasRows problem, my application has to connect the preloadread option by true.It is because multiple DataReaders are opened.
I hope Npgsql to support MARS.

I see. I'll have a look at this HasRows problem.

@t-oka
t-oka commented Jun 6, 2014

I tried the master branch.
It has connected by SSPI authentication.
I appreciate it.

@roji roji added this to the 2.2 milestone Jul 17, 2014
@roji roji closed this Jul 17, 2014
@roji roji reopened this Aug 8, 2014
@roji roji changed the title from HasRows property's bug to HasRows doesn't work with preload reader Aug 8, 2014
@roji
Member
roji commented Aug 8, 2014

It seems I closed this by mistake. I can confirm that when the preloader is in use HasRows returns false.

@roji roji modified the milestone: 2.2, 2.3 Aug 14, 2014
@roji
Member
roji commented Aug 14, 2014

There's a good chance we'll be removing the preloader support in version 3.0, in which case this issue will no longer be relevant. Keeping open to wait on final decision in #312...

@roji
Member
roji commented Sep 3, 2014

We've voted to drop the preload reader in version 3.0 (see #312), closing this issue as no longer relevant.

@roji roji closed this Sep 3, 2014
@roji roji removed this from the 3.0 milestone Sep 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment