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

[tools] added back ticks to avoid sql error on table names with "-" #3168

Merged
merged 2 commits into from
Oct 10, 2017

Conversation

ridz1208
Copy link
Collaborator

@ridz1208 ridz1208 commented Oct 4, 2017

This pull request adds backticks where backticks should be added

before:

UPDATE ccna_laptop.Clinical_Biosamples_CBSR SET Date_taken=NULL, Testdate=Testdate WHERE CAST(Date_taken AS CHAR(20))='0000-00-00';

after

UPDATE `ccna_laptop`.`Clinical_Biosamples_CBSR` SET `Date_taken`=NULL, `Testdate`=Testdate WHERE CAST(`Date_taken` AS CHAR(20))='0000-00-00';

@ridz1208 ridz1208 added Category: Bug PR or issue that aims to report or fix a bug Language: SQL PR or issue that update SQL code [branch] bugfix labels Oct 4, 2017
@ridz1208 ridz1208 added this to the 18.0.1 milestone Oct 4, 2017
@ridz1208 ridz1208 requested a review from driusan October 4, 2017 20:51
Copy link
Collaborator

@driusan driusan left a comment

Choose a reason for hiding this comment

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

These escapes should all be changed to use the $db->escape function, which is more robust than hardcoding the '`' and centralizes where the logic lives..

@kongtiaowang kongtiaowang added the Passed manual tests PR has been successfully tested by at least one peer label Oct 6, 2017
@driusan driusan merged commit dc5d005 into aces:bugfix Oct 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Bug PR or issue that aims to report or fix a bug Language: SQL PR or issue that update SQL code Passed manual tests PR has been successfully tested by at least one peer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants