-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add Mysql per-column charset support #881
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -199,6 +199,25 @@ public function testColumnCollation() | |
$this->assertEquals('utf8_general_ci', $columns['bar']->getPlatformOption('collation')); | ||
} | ||
|
||
public function testColumnCharset() | ||
{ | ||
$table = new Table('test_charset'); | ||
$table->addOption('collate', $collation = 'latin1_swedish_ci'); | ||
$table->addOption('charset', 'latin1'); | ||
$table->addColumn('id', 'integer'); | ||
$table->addColumn('text', 'text'); | ||
$table->addColumn('foo', 'text')->setPlatformOption('charset', 'latin1'); | ||
$table->addColumn('bar', 'text')->setPlatformOption('charset', 'utf8'); | ||
$this->_sm->dropAndCreateTable($table); | ||
|
||
$columns = $this->_sm->listTableColumns('test_charset'); | ||
|
||
$this->assertArrayNotHasKey('charset', $columns['id']->getPlatformOptions()); | ||
$this->assertEquals('latin1', $columns['text']->getPlatformOption('charset')); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks wrong. The charset is set implicit here through the table's default charset. However why is it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nevermind, somehow didn't see that you're using custom table collation here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I've set the default table charset to |
||
$this->assertEquals('latin1', $columns['foo']->getPlatformOption('charset')); | ||
$this->assertEquals('utf8', $columns['bar']->getPlatformOption('charset')); | ||
} | ||
|
||
/** | ||
* @group DBAL-843 | ||
*/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the option named
characterset
instead ofcharset
?Hint: if I'm asking this, it means that at least a comment in the code is needed.