Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

IndexOutOfRangeException when invoking a stored procedure

Aberta
#877 1 comentário 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
55/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
fsharp, sql
Domínio
databases

Direção de pesquisa

The payload names no source files, so begin by searching the MsSql provider for where stored procedure parameters are filtered by direction (ReturnValue) and mapped to supplied values. Reproduce with a procedure that has an output result set and no matching input value, then confirm the IndexOutOfRangeException. Done means the call succeeds, the result set is returned, and the existing stored procedure tests still pass.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Describe the bug
When using InvokeAsync on a stored procedure while using SqlProvider.MsSql the list of input parameters include all of the input parameters defined by the stored procedure given a direction of Input as well as the result set given a direction of Output. The list of values provided match the number of input parameters marked with a direction of Input. When the input parameters are processed in order to map them to values and create command parameters, the input parameters are filtered to remove those with a direction of ReturnValue, then attempt to map over the values. In my specific situation where I have a stored procedure with five parameters and one result set, I have six input parameters and five values. After filtering out direction of ReturnValue there are still six input parameters, and after processing the first five input parameters commands are created mapped to the five values provided, but then the sixth input parameter which has a direction of Output results in an IndexOutOfRangeException when it attempts to map to the nonexistent sixth value.

To Reproduce
Steps to reproduce the behavior:

  1. Call InvokeAsync on a stored procedure using SqlProvider.MsSql
  2. Get IndexOutOfRangeException before the procedure is called

Expected behavior
The stored procedure is called with the given values and the result set is retrieved.

Environment (please complete the following information):

  • Database: MsSql
  • Nuget Package and version: SQLProvider.MsSql 1.5.7
  • OS: Windows
  • .NET 10

Additional context
This error was introduced in my project when I upgraded from SqlProvider 1.3.19 to SqlProvider.MsSql 1.5.7. I don't know exactly what it was doing internally previously, but I would assume either the result set was not being created as an input parameter, or it was being created as an input parameter with a direction of ReturnValue which was being filtered out when creating command parameters. My naïve solution to this would be to also filter out Output direction, or perhaps only keep Input direction, though I don't know what that would do in other situations.

Linguagem predominante
F#
Estrelas
627
Forks
148
Merge médio
2h 2min
PRs com merge (30d)
1

Preparar o ambiente

Abrir no Codespaces

Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.

  • Sem Dockerfile nem arquivo Docker Compose
  • Tem um modelo de pull request
  • Sem guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de fsprojects/SQLProvider

Todas as issues de fsprojects/SQLProvider

Issues semelhantes

Mais issues de Databases

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.