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

[Task]: Verfiy identifyer quoting for sql queries #75

Merged
merged 1 commit into from
Jan 17, 2023

Conversation

kingjia90
Copy link
Contributor

Related #64

For MariaDB, CHANNEL is not a reserved keyword, but it is for MySQL, maybe should be considered as potential bug?

@kingjia90 kingjia90 changed the base branch from 5.x to 4.1 January 13, 2023 12:23
@@ -33,7 +33,7 @@ public function load()

$params = array_column($this->model->getConditionParams() ?: [], 'value');

$unitIds = $this->db->fetchAll('SELECT o_id, id, o_classId, channel FROM ' . OutputDefinition\Dao::TABLE_NAME .
$unitIds = $this->db->fetchAll('SELECT o_id, id, o_classId, ' . $this->db->quoteIdentifier('channel') . ' FROM ' . OutputDefinition\Dao::TABLE_NAME .

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What will happen if we remove the o_prefixes here too?
Than there would be two id's right?

Copy link
Contributor Author

@kingjia90 kingjia90 Jan 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not very consistent then if we keep the o_prefixes here. @fashxp wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The getter/setters were renamed to objectId, so i would vote for that.
It may be out of the scope of this PR and task, need to open a followup issue/PR for 5.x

@mattamon mattamon merged commit 9c114b0 into 4.1 Jan 17, 2023
@mattamon mattamon deleted the fix_column_identifier branch January 17, 2023 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants