Skip to content

HasRows doesn't work with preload reader #223

Closed

Description

@hellower

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.

Activity

  1. franciscojunior commented on May 3, 2014

    @franciscojunior
    Member

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

    Thanks for your feedback!

  2. t-oka commented on May 21, 2014

    @t-oka

    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

  3. franciscojunior commented on May 21, 2014

    @franciscojunior
    Member

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

  4. t-oka commented on May 22, 2014

    @t-oka

    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?

  5. franciscojunior commented on May 22, 2014

    @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?

  6. t-oka commented on May 23, 2014

    @t-oka

    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.

  7. franciscojunior commented on May 25, 2014

    @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.

  8. t-oka commented on Jun 6, 2014

    @t-oka

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

  9. added this to the milestone on Jul 17, 2014
  10. reopened this on Aug 8, 2014
  11. changed the title [-]HasRows property's bug[/-] [+]HasRows doesn't work with preload reader[/+] on Aug 8, 2014
  12. roji commented on Aug 8, 2014

    @roji
    Member

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

  13. modified the milestones: , on Aug 14, 2014
  14. roji commented on Aug 14, 2014

    @roji
    Member

    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...

  15. roji commented on Sep 3, 2014

    @roji
    Member

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

  16. removed this from the milestone on Sep 4, 2014
  17. added theissue type on Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions