You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When introspecting a schema from an SqlServer database a nvarchar(max) a TypeError is raised.
Apparently this happens because the length of an nvarchar is divided by two in the SQLServerSchemaManager::getPortableTableColunmnDefinition. As the MAX length is read as -1 this leads to a float length (-0.5).
This can be simply reproduced by introspecting a SqlServer database schema containing a nvarchar(max) column.
The text was updated successfully, but these errors were encountered:
<!-- Fill in the relevant information below to help triage your pull
request. -->
| Q | A
|------------- | -----------
| Type | bug
| Fixed issues | #6038
#### Summary
As described in the mentioned issue, `-0.5` from `-1 / 2` will raise
type error when trying to `setLength`
```
Argument #1 ($length) must be of type ?int, float given
```
https://github.com/doctrine/dbal/blob/8bc0d9ae42f20af54120396ef7a1b3248479c2b5/src/Schema/Column.php#L78
This PR check if length is `-1` and keep it as is before perform
division.
Bug Report
When introspecting a schema from an SqlServer database a nvarchar(max) a TypeError is raised.
Apparently this happens because the length of an nvarchar is divided by two in the SQLServerSchemaManager::getPortableTableColunmnDefinition. As the MAX length is read as -1 this leads to a float length (-0.5).
This can be simply reproduced by introspecting a SqlServer database schema containing a nvarchar(max) column.
The text was updated successfully, but these errors were encountered: