dotancohen / squeal

Database explorer with a focus on breadth, not depth.
2 stars 0 forks source link

Crash on illegal SQL queries. #23

Open dotancohen opened 10 years ago

dotancohen commented 10 years ago
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 commented 10 years ago

Likely related to issue #12.

dotancohen commented 8 years ago

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")