Skip to content

System.Data.Odbc - SQLLEN does not handle -1 #115389

Open
@TonyValenti

Description

@TonyValenti

Description

Hi .NET Team
When querying Filemaker Pro ODBC databases through .NET ODBC, we're running into some issues.
(This does not affect Java ODBC connectors)

Specifically, it seems that some fields represent their length as 0x00000000ffffffff (-1).

This is causing overflow errors in SQLLEN.cs when trying to parse the field at this code:

	public static implicit operator int(SQLLEN value)
	{
		return ((IntPtr)value._value).ToInt32();
	}

Instead of:

return ((IntPtr)value._value).ToInt32();

I think the code should be:

return (int)value.ToInt64();

Reproduction Steps

I can provide a sample database if contacted

Expected behavior

No Error occurs

Actual behavior

An overflow exception occurs.

Regression?

No response

Known Workarounds

I can wrap the access and return null if this happens.

Configuration

.NET 9.0 on Windows.

Other information

Java ODBC libraries are not affected by this issue.

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions