DapperLib / DapperLib/Dapper

Firebird: Insert with blob.Length > 4000 fails with System.ArgumentOutOfRangeException

Open
#2,134 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-triage
Dominant language
C#
Stars
18.4k
Forks
3.7k
Avg merge
5h 8m
Merged PRs (30d)
1

Description

Hello,

I am using Dapper with Firebird for some time and its like a charm. Unfortunatly I am facing a problem, when I try to Insert a record with text into a blob, when the length of the text > 4000.

I loaded the lastest version of Dapper and the Firebird .net provider and included the debug symbols.

  • .net 4.8
  • Dapper 2.1.35
  • Firebird .net provider 10.3.1

When I hit this line in my code baustelle.BaustellenID = fbCon.QuerySingle(insertorupdateBaustellen, baustelle); I step into the Daper code.

grafik

grafik

The final exception is this:
at FirebirdSql.Data.FirebirdClient.FbParameter.set_Size(Int32 value) in //src/FirebirdSql.Data.FirebirdClient/FirebirdClient/FbParameter.cs:line 77
at Dapper.CommandDefinition.SetupCommand(IDbConnection cnn, Action2 paramReader) in /_/Dapper/CommandDefinition.cs:line 144 at Dapper.SqlMapper.QueryRowImpl[T](IDbConnection cnn, Row row, CommandDefinition& command, Type effectiveType) in /_/Dapper/SqlMapper.cs:line 1271 at Dapper.SqlMapper.QuerySingle[T](IDbConnection cnn, String sql, Object param, IDbTransaction transaction, Nullable1 commandTimeout, Nullable`1 commandType) in /
/Dapper/SqlMapper.cs:line 878
at fbTest.Program.Main(String[] args) in D:\Software Test\fbTest\Program.cs:line 70

When I use ADO standard method with command and parameters it works without problems.

Check your library version, and try updating
To help, we're going to need to know your library version. If it isn't the latest: go do that - it might
fix the problem, and even if it doesn't: you're going to need to update if we find a problem and fix it,
so you might as well get ready for that now.

How to reproduce: Insert a new record into the database with a text for the blob, where the text has a length > 4000

The actual behavoir: exception as described above
The needed behavior: successfull insert

Thanks

Niko

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Dapper/CommandDefinition.cs at SetupCommand line 144 and compare its parameter setup with the Firebird FbParameter.Size exception cited in the report. Reproduce an insert of text longer than 4000 into a Firebird blob, then verify that the insert succeeds without the ArgumentOutOfRangeException.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.