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

Remove escape() and escape_string() from MySQLdb. #511

Merged
merged 1 commit into from
Oct 19, 2021
Merged

Conversation

methane
Copy link
Member

@methane methane commented Oct 19, 2021

No description provided.

@codecov
Copy link

codecov bot commented Oct 19, 2021

Codecov Report

Merging #511 (6c2845a) into main (3ee07a0) will increase coverage by 1.77%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #511      +/-   ##
==========================================
+ Coverage   83.99%   85.76%   +1.77%     
==========================================
  Files           6        6              
  Lines         556      583      +27     
==========================================
+ Hits          467      500      +33     
+ Misses         89       83       -6     
Impacted Files Coverage Δ
MySQLdb/__init__.py 85.00% <ø> (ø)
MySQLdb/connections.py 86.62% <0.00%> (+6.62%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3ee07a0...6c2845a. Read the comment docs.

@aelous
Copy link

aelous commented Jan 14, 2022

why Remove escape() and escape_string() ?

@dattran2346
Copy link

why Remove escape() and escape_string() ?

Same question.

@methane
Copy link
Member Author

methane commented Jul 12, 2022

  • Unrecommended
  • Unsafe
  • Do not want to maintain

gnodar01 added a commit to CellProfiler/CellProfiler that referenced this pull request Feb 7, 2024
MySQLdb.escape_string was removed in v2.1.0, here: PyMySQL/mysqlclient#511

mysqlclient still allows escape_string to be used via the connection
object

really we should be using parameterized queries: https://pynative.com/python-mysql-execute-parameterized-query-using-prepared-statement/

that would require more substantial changes however
gnodar01 added a commit to CellProfiler/CellProfiler that referenced this pull request Feb 7, 2024
MySQLdb.escape_string was removed in v2.1.0, here: PyMySQL/mysqlclient#511

we can still access `escape_string` via the underlying `_mysql` object
that mysqlclient wraps

really we should be using parameterized queries: https://pynative.com/python-mysql-execute-parameterized-query-using-prepared-statement/

that would require more substantial changes however
gnodar01 added a commit to CellProfiler/CellProfiler that referenced this pull request Feb 7, 2024
MySQLdb.escape_string was removed in v2.1.0, here: PyMySQL/mysqlclient#511

mysqlclient still allows escape_string to be used via the connection
object

really we should be using parameterized queries: https://pynative.com/python-mysql-execute-parameterized-query-using-prepared-statement/

that would require more substantial changes however
gnodar01 added a commit to CellProfiler/CellProfiler that referenced this pull request Feb 7, 2024
MySQLdb.escape_string was removed in v2.1.0, here: PyMySQL/mysqlclient#511

we can still access `escape_string` via the underlying `_mysql` object
that mysqlclient wraps

really we should be using parameterized queries: https://pynative.com/python-mysql-execute-parameterized-query-using-prepared-statement/

that would require more substantial changes however
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants