When SQLFetch() reach SQL_NO_DATA_FOUND, It will return error when SQLFetch() is called again.

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Critical - P2
    • odbc-2.0.7
    • Affects Version/s: None
    • Component/s: None
    • None
    • Atlas SQL

      Summary

      sqlFetch() returns error when it reach the end of rowset, and we  call sqlFetch() again.

      Environment

      The mongo odbc driver we use is 2.0.5

      How to Reproduce

      We use mongo DB Atlas SQL odbc driver 2.0.01

       

      1) call SQLTableW(“qualifiername”,“”,“”,“”)

      2) call SQLFetch() to fetch all the data

      3) when SQLFetch() returns SQL_NO_DATA_FOUND, we call SQLFetch() again, it will returns below error:

      2026-01-16 07:16:57 - ERROR: [Env_0x13bf5080][Conn_0x13bf5920][Stmt_0x13bf4220] SQLFetch:: [MongoDB][API] Caught panic: called Option::unwrap() on a None value

       

      Ok(“in file ‘core\src\collections.rs’ at line 230”)

      4) the issue only occurs on sqlTableW() to fetch table list. If we run a sql query "select * from city", then we use SQLFetch() to get data. When cursor reaches the end , SQL_NO_DATA_FOUND is returned SQLFetch() is called again.

            Assignee:
            Natacha Bagnard
            Reporter:
            qin liu (EXT)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: