Skip to content

Commit

Permalink
Merge pull request #2456 from lanzagar/sql
Browse files Browse the repository at this point in the history
[FIX] owsql: Fixes for Custom SQL option
  • Loading branch information
astaric authored Jul 10, 2017
2 parents 84762b4 + f88f2fd commit 95fe731
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Orange/data/sql/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def __init__(
if table_or_sql is not None:
if isinstance(table_or_sql, TableDesc):
table = table_or_sql.sql
elif "SELECT" in table_or_sql:
elif "select" in table_or_sql.lower():
table = "(%s) as my_table" % table_or_sql.strip("; ")
else:
table = self.backend.quote_identifier(table_or_sql)
Expand Down
2 changes: 1 addition & 1 deletion Orange/widgets/data/owsql.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def get_table(self):
with self.backend.execute_sql_query("ANALYZE " + self.materialize_table_name):
pass
self.table = self.materialize_table_name
except psycopg2.ProgrammingError as ex:
except (psycopg2.ProgrammingError, BackendError) as ex:
self.Error.connection(str(ex))
return

Expand Down

0 comments on commit 95fe731

Please sign in to comment.