Skip to content

Commit

Permalink
Fix MySQL columns introspection when PDO::ATTR_CASE != PDO::CASE_LOWER
Browse files Browse the repository at this point in the history
  • Loading branch information
xak2000 committed Oct 29, 2019
1 parent aa7f78a commit 81b902b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/adapters/MysqlAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public function query_for_tables()

public function create_column(&$column)
{
// A workaround for a case when $PDO_OPTIONS[PDO::ATTR_CASE] = PDO::CASE_NATURAL or PDO::CASE_UPPER
$column = array_change_key_case($column, CASE_LOWER);

$c = new Column();
$c->inflected_name = Inflector::instance()->variablize($column['field']);
$c->name = $column['field'];
Expand Down

0 comments on commit 81b902b

Please sign in to comment.