Skip to content

Add escaping string literal in sql for copy&pasting in dbshell #224

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

Merged
merged 1 commit into from
Jan 13, 2012

Conversation

Apkawa
Copy link
Contributor

@Apkawa Apkawa commented Oct 27, 2011

as example
before

mysql> SELECT `django_session`.`session_key`, `django_session`.`session_data`, `django_session`.`expire_date` FROM `django_session` WHERE (`django_session`.`session_key` = 00064e3d3c013cdaaace09a1981b1393 AND `django_session`.`expire_date` > 2011-10-28 00:23:20 );
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'd3c013cdaaace09a1981b1393 AND `django_session`.`expire_date` > 2011-10-28 00:23:' at line 1

after

mysql> SELECT `django_session`.`session_key`, `django_session`.`session_data`, `django_session`.`expire_date` FROM `django_session` WHERE (`django_session`.`session_key` = '00064e3d3c013cdaaace09a1981b1393' AND `django_session`.`expire_date` > '2011-10-28 00:23:20' );
+----------------------------------+-------------------------------------------------------------------+---------------------+
| session_key                      | session_data                                                      | expire_date         |
+----------------------------------+-------------------------------------------------------------------+---------------------+
| 00064e3d3c013cdaaace09a1981b1393 |  N2I0NWMwYTI1MTdmZWUwMmZjOWM0ZWNkMmE2MjZhNjNjMDQyZjhiNTqAAn1xAS4=
| 2011-11-10 23:19:27 |
+----------------------------------+-------------------------------------------------------------------+---------------------+
1 row in set (0.00 sec)

dcramer added a commit that referenced this pull request Jan 13, 2012
Add escaping string literal in sql for copy&pasting in dbshell
@dcramer dcramer merged commit d346f30 into django-commons:master Jan 13, 2012
ryneeverett pushed a commit to ryneeverett/django-debug-toolbar that referenced this pull request Oct 2, 2016
Add escaping string literal in sql for copy&pasting in dbshell
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.

2 participants