Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.1.2
-
Fix Version/s: 2.3
-
Component/s: Schema Managers
-
Security Level: All
-
Labels:None
-
Environment:mysql
Description
Can not set charset options for table creation.
Now I am fix thix problem in patch.
File: doctrine-dbal/lib/Doctrine/DBAL/Schema/Schema.php
#!/usr/bin/php
<?php
/**
- Doctrine DBAL Patch
- fix table creation query encode
- (c) _Nicolay
*/
system ('cp ./vendor/doctrine-dbal/lib/Doctrine/DBAL/Schema/Schema.php ./vendor/doctrine-dbal/lib/Doctrine/DBAL/Schema/Schema.php.Orig');
$data = file_get_contents('./vendor/doctrine-dbal/lib/Doctrine/DBAL/Schema/Schema.php');
$data = str_replace("new Table(\$tableName);",
"new Table(\$tableName,array(),array(),array(),0,array('charset'=>'utf8','collate'=>'utf8_general_ci'));",
$data);
file_put_contents('./vendor/doctrine-dbal/lib/Doctrine/DBAL/Schema/Schema.php', $data);
Activity
Benjamin Eberlei
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Fix Version/s | 2.3 [ 10184 ] | |
| Fix Version/s | 2.1.2 [ 10160 ] | |
| Resolution | Fixed [ 1 ] |
Benjamin Eberlei
made changes -
| Workflow | jira [ 13018 ] | jira-feedback2 [ 17752 ] |
Benjamin Eberlei
made changes -
| Workflow | jira-feedback2 [ 17752 ] | jira-feedback3 [ 20107 ] |
This list may be incomplete, as errors occurred whilst retrieving source from linked applications:
- Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DBAL-166, expand=changesets[-21:-1].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)
Guys, it's real problem for me too! (:
My test suite (in symfony2 project) always creates tables with "latin1_swedish_ci" collation. I want set "utf8_general_ci". But I don't want do it's in mysql.ini.
I tried setting it in MysqlSessionInit __construct, but it's not solved my problem.
In MySqlPlatform I found next code (https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php#L420):
But any options don't set in this call
https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Tools/SchemaTool.php#L133