Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update AbstractPlatform.php #921

Closed
wants to merge 1 commit into from
Closed

Conversation

szekeresa
Copy link

trim $dbType

@doctrinebot
Copy link

Hello,

thank you for creating this pull request. I have automatically opened an issue
on our Jira Bug Tracker for you. See the issue link:

http://www.doctrine-project.org/jira/browse/DBAL-1779

We use Jira to track the state of pull requests and the versions they got
included in.

@deeky666
Copy link
Member

Why is this necessary? Please explain the actual issue.

@deeky666
Copy link
Member

@szekeresa ping

@szekeresa
Copy link
Author

Hi!

I have sqlite database, but when the get schema then run out error:

DBALException in AbstractPlatform.php line 423:
Unknown database type nvarchar requested, Doctrine\DBAL\Platforms\SqlitePlatform may not support it.
in AbstractPlatform.php line 423
at AbstractPlatform->getDoctrineTypeMapping('nvarchar ') in SqliteSchemaManager.php line 288
at SqliteSchemaManager->_getPortableTableColumnDefinition(array('cid' => '3', 'name' => 'CimzettPartnerKod', 'type' => 'nvarchar (64)', 'notnull' => '0', 'dflt_value' => null, 'pk' => '0')) in AbstractSchemaManager.php line 820

Work around:
registerDoctrineTypeMapping('nvarchar ', 'string'); // space in type name....

Other:

DBALException in AbstractPlatform.php line 423:
Unknown database type text requested, Doctrine\DBAL\Platforms\SqlitePlatform may not support it.
in AbstractPlatform.php line 423
at AbstractPlatform->getDoctrineTypeMapping('text ') in SqliteSchemaManager.php line 288
at SqliteSchemaManager->_getPortableTableColumnDefinition(array('cid' => '17', 'name' => 'Szolgaltatasok', 'type' => 'text (1073741823)', 'notnull' => '0', 'dflt_value' => null, 'pk' => '0')) in AbstractSchemaManager.php line 820

Work around:
registerDoctrineTypeMapping(’text ', 'string'); // space in type name....

In the database exists other nvarchar fileds, but not run error...

@deeky666
Copy link
Member

deeky666 commented Jan 5, 2016

@szekeresa found the issue. This can only occur if the underlying table was not created by DBAL and contains whitespaces in the column type declarations for string typed columns.

Provided a patch in #2272

@deeky666 deeky666 closed this in 954b277 Jan 5, 2016
deeky666 added a commit that referenced this pull request Jan 5, 2016
@deeky666 deeky666 added the Bug label Jan 5, 2016
@deeky666 deeky666 self-assigned this Jan 5, 2016
bburnichon pushed a commit to bburnichon/dbal that referenced this pull request Jun 16, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants