@@ -2747,13 +2747,18 @@ type DB_Table
2747
2747
Some operations, like writing to tables, require their target to be a
2748
2748
trivial query.
2749
2749
is_trivial_query self -> Boolean ! Table_Not_Found =
2750
- trivial_counterpart = self.connection.query (SQL_Query.Table_Name self.name)
2751
- if trivial_counterpart.is_error then False else
2752
- if self.context != trivial_counterpart.context then False else
2753
- column_descriptor internal_column = [internal_column.name, internal_column.expression]
2754
- my_columns = self.internal_columns.map column_descriptor
2755
- trivial_columns = trivial_counterpart.internal_columns.map column_descriptor
2756
- my_columns == trivial_columns
2750
+ case self.context.from_spec of
2751
+ From_Spec.Table internal_table_name _ _ ->
2752
+ if self.name != internal_table_name then False else
2753
+ trivial_counterpart = self.connection.query (SQL_Query.Table_Name self.name)
2754
+ # If the table spec seems trivial, but the underlying table does not exist, we propagate the Table_Not_Found error.
2755
+ trivial_counterpart.if_not_error <|
2756
+ if self.context != trivial_counterpart.context then False else
2757
+ column_descriptor internal_column = [internal_column.name, internal_column.expression]
2758
+ my_columns = self.internal_columns.map column_descriptor
2759
+ trivial_columns = trivial_counterpart.internal_columns.map column_descriptor
2760
+ my_columns == trivial_columns
2761
+ _ -> False
2757
2762
2758
2763
## PRIVATE
2759
2764
Provides a simplified text representation for display in the REPL and errors.
0 commit comments