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

Crash on illegal SQL queries. #23

Open
dotancohen opened this issue May 2, 2014 · 2 comments
Open

Crash on illegal SQL queries. #23

dotancohen opened this issue May 2, 2014 · 2 comments
Labels

Comments

@dotancohen
Copy link
Owner

query> love;
Traceback (most recent call last):
  File "./squeal.py", line 388, in <module>
    main()
  File "./squeal.py", line 166, in main
    run_arbitrary_queries(query_prompt, conn, cursor)
  File "./squeal.py", line 381, in run_arbitrary_queries
    output_table_from_sql(conn, cursor, user_input)
  File "./squeal.py", line 317, in output_table_from_sql
    cursor.execute(sql, data)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
_mysql_exceptions.ProgrammingError: (1064, "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 'love' at line 1")
@dotancohen dotancohen added the bug label May 2, 2014
@dotancohen
Copy link
Owner Author

Likely related to issue #12.

@dotancohen
Copy link
Owner Author

The application also crashes if the SQL is legal but the table is not found:

>> q
query> select * from records;
Traceback (most recent call last):
  File "./squeal.py", line 387, in <module>
    main()
  File "./squeal.py", line 167, in main
    run_arbitrary_queries(query_prompt, conn, cursor)
  File "./squeal.py", line 380, in run_arbitrary_queries
    output_table_from_sql(conn, cursor, user_input)
  File "./squeal.py", line 318, in output_table_from_sql
    cursor.execute(sql, data)
  File "/usr/lib64/python2.7/site-packages/MySQLdb/cursors.py", line 174, in execute
    self.errorhandler(self, exc, value)
  File "/usr/lib64/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
_mysql_exceptions.ProgrammingError: (1146, "Table 'foo.records' doesn't exist")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant