You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/06/01 08:16:02 UTC

[GitHub] [shardingsphere] VeejaLiu opened a new issue, #18127: Python - pymysql: Does not support placeholder in SQL?

VeejaLiu opened a new issue, #18127:
URL: https://github.com/apache/shardingsphere/issues/18127

   ## Bug Report
   Sharding-sphere Proxy 5.1.1
   
   Python pymysql:
   <img width="1391" alt="image" src="https://user-images.githubusercontent.com/22064617/171359203-8a967b89-8773-4cad-9a87-4688a4f1f746.png">
   In addition, no information is printed in the proxy log. No information is printed. It is completely blank


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] TeslaCN commented on issue #18127: Python - pymysql: Does not support placeholder in SQL?

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on issue #18127:
URL: https://github.com/apache/shardingsphere/issues/18127#issuecomment-1143306581

   PyMySQL may escape given values, which may make column name or table name in incorrect format.
   https://github.com/PyMySQL/PyMySQL/blob/b9e07c5bb56806a167003ced8d3c5e704657e503/pymysql/cursors.py#L105-L113


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] VeejaLiu commented on issue #18127: Python - pymysql: Does not support placeholder in SQL?

Posted by GitBox <gi...@apache.org>.
VeejaLiu commented on issue #18127:
URL: https://github.com/apache/shardingsphere/issues/18127#issuecomment-1143312583

   @TeslaCN 
   Thank you. It should be pymysql, not shardingsphere. I have solved this problem.
   Thanks again!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] VeejaLiu commented on issue #18127: Python - pymysql: Does not support placeholder in SQL?

Posted by GitBox <gi...@apache.org>.
VeejaLiu commented on issue #18127:
URL: https://github.com/apache/shardingsphere/issues/18127#issuecomment-1143309664

   Change writting:
   ```python
   sql = "select %s, count(*) from %s group by %s" % (filed, table, filed)
   cursor.execute(sql)
   result = cursor.fetchall()
   ```
   Solved this problem.
   
   Pymysql automatically quotes placeholders. So there will be some SQL statement problems.
   This problem occurs when we use the table name or field name as a placeholder, so we need to use the above method.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] VeejaLiu closed issue #18127: Python - pymysql: Does not support placeholder in SQL?

Posted by GitBox <gi...@apache.org>.
VeejaLiu closed issue #18127: Python - pymysql: Does not support placeholder in SQL?
URL: https://github.com/apache/shardingsphere/issues/18127


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org