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

Already on GitHub? Sign in to your account

doctrine:database:create not set charset #49

Closed
ivan1986 opened this Issue Mar 30, 2012 · 13 comments

Comments

Projects
None yet
8 participants

when create database not set default charset, and by default set to latin1

not use
CREATE DATABASE
use
CREATE DATABASE DEFAULT CHARACTER SET ;

Same for schema:create
Database and tables are not configured with dbal charset.

I think it's a bug. Because data are inserted with the config charset. And this is not normal to have data in UTF-8 in Latin schema.

I really want a feedback about that from the Doctrine community, before investigate.

Member

stof commented Apr 19, 2012

Which version of Doctrine are you using ? IIRC, DBAL now sets the charset when creating tables instead of relying on the default value of the server (not sure if it is in 2.2.1 or only in master)

I use the last version of dev/master

My database is created with default mysql charset

arnaugm commented Jun 1, 2012

I have the same issue, database and tables created in Latin.
I'm using the deps of Symfony 2.0.15

arnaugm commented Jun 28, 2012

I'm playing with Symfony 2.1.0-beta1 and I'm not sure witch version of doctrine uses, the composer.json file says "doctrine/orm": "2.2.*".
The problem is still there.

doctrine/common 2.3.x-dev bb0aebb
doctrine/dbal 2.3.x-dev 292d5ed
doctrine/doctrine-bundle dev-master 4fa47ca

The problem is still there.

i use my solution for deb-based distrs
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=321505#57
this bug have 8 years :)

nmeirik commented Feb 20, 2014

Hehe - great tip!

Contributor

jrobeson commented Aug 9, 2014

not sure, but it is any way related to this issue also? #210

Member

kimhemsoe commented Aug 9, 2014

@nmeirik the part you link is for creating a table and charset is should be set there.
https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php#L472

For creating database you want to take a look at https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php#L373

@jrobeson No, they are not related. #210 is "just" normal distro / php / PDO fun.

Member

deeky666 commented Aug 11, 2014

@kimhemsoe I think this is completely a DBAL issue and should be closed here, no? Setting the character set for tables is already supported for some time now in MySQL, setting it for databases to be created it is not supported. Not sure if we even can / should support it as it is a rather MySQL specific issue and the platform API won't let us do it anyways without changing method signature and breaking BC here.

Member

kimhemsoe commented Aug 11, 2014

@deeky666 Maybe it can be done with a optional options array, do not know if that is something we should do though.
Closing, not a bundle issue until support is in dbal, Workarounds exists by changing server config and charset is set correctly on tables, which is only reason i can remember why you want charset to set on database (I may be wrong).

@kimhemsoe kimhemsoe closed this Aug 11, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment