Skip to content

[Flight SQL ODBC] HY010 Function sequence error during schema discovery using ExecuteReader(CommandBehavior.SchemaOnly) #50578

Closed

Description

@srinivasan-30

Describe the bug, including details regarding any error messages, version, and platform.

When using Apache Arrow Flight SQL ODBC Driver against InfluxDB 3, dataset preview succeeds. However schema discovery fails because Bold Reports invokes:

command.ExecuteReader(CommandBehavior.SchemaOnly)

which results in:

HY010 [Apache Arrow][Flight SQL] (100) Function sequence error

Normal ExecuteReader() works successfully.
Does the Metadata retrieval fully supported?
Windows
64 bit driver
Language code: C#
Net core platform

Component(s)

Other, C#

Activity

  1. github-actions commented on Jul 21, 2026

    @github-actions

    Thanks for your report! The C# implementation has moved to https://github.com/apache/arrow-dotnet.

    This issue has been closed automatically - please open a new issue there.

  2. amoeba commented on Jul 22, 2026

    @amoeba
    Member

    Hi @srinivasan-30, the bot automatically closed your issue because you marked C# as the component but this issue looks like a possible bug in the ODBC FlightSQL driver and not with arrow-dotnet. If that's the case, could you fill in more detail in your issue?

    • Version of the ODBC FlightSQL driver
    • Your dotnet version
    • A reproducible code example

    cc @alinaliBQ @justing-bq

  3. srinivasan-30 commented on Jul 23, 2026

    @srinivasan-30
    Author

    Hi @amoeba ,

    Please find the details below.

    1. Version of the Arrow Flight SQL ODBC driver : 0.9.7.1195
    2. Your dotnet version : 10.0
    3. Inflex db version : influxdb3-core-3.10.0-windows_amd64

    Reproducible Code Example :

    We have attached the core sample below. Please modify the connection string for the Arrow Flight SQL ODBC Driver and the corresponding InfluxDB query in the sample and execute.

    ConsoleApp.zip

  4. srinivasan-30 commented on Jul 24, 2026

    @srinivasan-30
    Author

    Hi @amoeba ,

    Kindly can you reopen this issue.

  5. reopened this on Jul 24, 2026
  6. amoeba commented on Jul 24, 2026

    @amoeba
    Member

    Hi @srinivasan-30, can you put the code here in the issue, in a gist, or in a repo so maintainers don't have to download a zip?

  7. srinivasan-30 commented on Jul 27, 2026

    @srinivasan-30
    Author

    Hi @amoeba ,

    Please find the gist link: https://gist.github.com/srinivasan-30/4b3ee7d6e4bfcece199092009d29fbcc .

    Kindly replace the :

    1. Update the connection string to use the Apache Arrow Flight SQL ODBC Driver configured in your environment.
    2. Replace the sample query with a valid InfluxDB query.
    3. Build and run the console application.

    Please find the environment details below.

    1. Version of the Arrow Flight SQL ODBC driver : 0.9.7.1195
    2. Your dotnet version : 10.0
    3. Inflex db version : influxdb3-core-3.10.0-windows_amd64
  8. amoeba commented on Jul 27, 2026

    @amoeba
    Member

    Hi @srinivasan-30, based on your driver version, it looks like you're using the Dremio version of the driver and not the one developed in the Arrow project. Can you try with https://github.com/apache/arrow/releases/download/apache-arrow-25.0.0/Apache-Arrow-Flight-SQL-ODBC-25.0.0-win64.msi? (You may have to work around Windows Defender to get the driver to load).

  9. amoeba commented on Jul 27, 2026

    @amoeba
    Member

    I seem to be able to reproduce the issue on Windows but not on macOS with the Apache driver so that must be a place where the driver managers differ between platforms.

  10. srinivasan-30 commented on Jul 28, 2026

    @srinivasan-30
    Author

    Hi @amoeba ,

    We have installed the provided driver, but we are still facing the same error: HY010 [Apache Arrow][Flight SQL] (100) Function sequence error.

  11. alinaliBQ commented on Jul 28, 2026

    @alinaliBQ
    Collaborator

    Does the Metadata retrieval fully supported?

    hi @srinivasan-30 the Apache driver hasn't been tested with metadata retrieval from C#, so there is a possibility that it is not fully supported. I agree with @amoeba that this might be caused by a driver manager difference between platforms, as macOS (iODBC) and Windows ODBC driver managers may have different sequence of ODBC API calls to the Apache driver.

    In case it might help, there are 2 possible places where the HY010 error could have been thrown:

    1. SQLMoreResults is a no-op and errors on HY010 if there is no open cursor.

      throw DriverException("Function sequence error", "HY010");

    2. SQLExecute errors on HY010 if SQLPrepare hasn't been called first. The chance of driver manager not calling SQLPrepare first is small.

      throw DriverException("Function sequence error", "HY010");

  12. amoeba commented on Jul 29, 2026

    @amoeba
    Member

    I reproduced this on my Windows machine and, with ODBC tracing turned on, I get,

    ...snip...
    OdbcRepro       599c-368	ENTER SQLMoreResults 
    		HSTMT               0x00000279C6A8E8E0
    
    OdbcRepro       599c-368	EXIT  SQLMoreResults  with return code -1 (SQL_ERROR)
    		HSTMT               0x00000279C6A8E8E0
    
    		DIAG [HY010] [Apache Arrow][Flight SQL] (100) Function sequence error (100) 
    

    So it looks like the call triggering the exception is SQLMoreResults.

    I'm new to this stuff so I had an LLM take a look and it pulled up https://learn.microsoft.com/en-us/sql/odbc/reference/appendixes/statement-transitions?view=sql-server-ver17#sqlmoreresults as a reference. From my reading of that, the Statement in this case is probably in the prepared state and so should always return SQL_NO_DATA. Should the implementation just always return SQL_NO_DATA since the driver doesn't support it?

  13. srinivasan-30 commented on Jul 29, 2026

    @srinivasan-30
    Author

    Hi @amoeba ,

    The issue has been reproduced on your end. Could you please let us know when the fix will be merged into a release and when the setup containing the fix will be available for use?

  14. alinaliBQ commented on Jul 29, 2026

    @alinaliBQ
    Collaborator

    Should the implementation just always return SQL_NO_DATA since the driver doesn't support it?

    According to the table, the implementation should return SQL_NO_DATA when the statement is allocated, prepared, or executed. So yes it makes sense for the driver to always return SQL_NO_DATA. Because the statement has to be allocated first for SQLMoreResults to reach the odbc_statement.cc functions.

  15. amoeba commented on Jul 29, 2026

    @amoeba
    Member

    Thanks @alinaliBQ. I'll finish up #50700 and tag you for a review.

    @srinivasan-30: This might be able to go in a patch release which could be done in August but it might have to wait until later in the year. Because of the way this repo does releases, this component has to get released with everything else at once and it's not possible to release just an updated version of the driver. There will be nightly builds but the usual caveats would apply to using those.

  16. added a commit that references this issue on Jul 31, 2026
  17. added this to the 26.0.0 milestone on Jul 31, 2026
  18. amoeba commented on Jul 31, 2026

    @amoeba
    Member

    Issue resolved by pull request 50700
    #50700

  19. modified the milestones: 26.0.0, 25.0.1 on Aug 4, 2026
  20. srinivasan-30 commented on Oct 8, 2026

    @srinivasan-30
    Author

    Hi @amoeba,

    Whether the above fix is moved in the public release. If not kindly share the release date.

  21. amoeba commented on Oct 8, 2026

    @amoeba
    Member

    Hi @srinivasan-30, this fix is in the 25.0.1 release and you can find the latest MSI at https://github.com/apache/arrow/releases/tag/apache-arrow-25.0.1. Let us know if the issue is or isn't fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions