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

DB quoteIdentifiers => true doesnt work for integer column names #9391

Closed
1 of 3 tasks
mo86 opened this issue Sep 1, 2016 · 2 comments
Closed
1 of 3 tasks

DB quoteIdentifiers => true doesnt work for integer column names #9391

mo86 opened this issue Sep 1, 2016 · 2 comments
Assignees
Labels
Milestone

Comments

@mo86
Copy link

mo86 commented Sep 1, 2016

This is a (multiple allowed):

  • bug
  • enhancement
  • feature-discussion (RFC)
  • CakePHP Version: 3.3
  • Platform and Target: XAMPP

What you did

Trying to save data to a table which has integers as column names while setting 'quoteIdentifiers' => true

Expected Behavior

'quoteIdentifiers' => true should quote ALL column names.

Actual Behavior

'quoteIdentifiers' => true wraps the column names only for string names.

@mo86
Copy link
Author

mo86 commented Sep 1, 2016

Its because of this method in IdentifierQuoter. Only string names are quoted:

protected function _quoteInsert($query)
    {
        list($table, $columns) = $query->clause('insert');
        $table = $this->_driver->quoteIdentifier($table);
        foreach ($columns as &$column) {
            if (is_string($column)) {
                $column = $this->_driver->quoteIdentifier($column);
            }
        }
        $query->insert($columns)->into($table);
    }

@dereuromark dereuromark added this to the 3.3.3 milestone Sep 1, 2016
@markstory markstory self-assigned this Sep 1, 2016
markstory added a commit that referenced this issue Sep 2, 2016
Quote numeric column names as we would quote string column names.

Refs #9391
@markstory
Copy link
Member

Closing as a pull request is open now to fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants