diff --git a/distribution/lib/Standard/Database/0.0.0-dev/src/Connection/Connection.enso b/distribution/lib/Standard/Database/0.0.0-dev/src/Connection/Connection.enso index 03e0fccbb589..97dbf130a404 100644 --- a/distribution/lib/Standard/Database/0.0.0-dev/src/Connection/Connection.enso +++ b/distribution/lib/Standard/Database/0.0.0-dev/src/Connection/Connection.enso @@ -220,22 +220,21 @@ type Connection table_naming_helper.verify_table_name name <| make_table_for_name self name alias SQL_Query.Raw_SQL raw_sql -> handle_sql_errors <| alias.if_not_error <| - self.jdbc_connection.ensure_query_has_no_holes raw_sql . if_not_error <| - columns = self.fetch_columns raw_sql Statement_Setter.null - name = if alias == "" then (UUID.randomUUID.to_text) else alias - ctx = Context.for_query raw_sql name - ## Any problems are treated as errors - e.g. if the query - contains clashing column names, it may very likely lead to - data corruption. Our renaming mechanism is used to fix issues - with existing tables with problematic names, but that - mechanism will only provide a false-sense of security in case - of a query, whereas a query like `SELECT 1 AS "A", 2 AS "A"` - will actually result in both columns `A` and `A 1` containing - the value 1; and value 2 being lost. That is why such queries - must fail. - r = DB_Table_Module.make_table self name columns ctx on_problems=Problem_Behavior.Report_Error - r.catch Any error-> - Error.throw (Illegal_Argument.Error "The provided custom SQL query is invalid and may suffer data corruption when being processed, especially if it contains aliased column names, it may not be interpreted correctly. Please ensure the names are unique. The original error was: "+error.to_display_text cause=error) + columns = self.fetch_columns raw_sql Statement_Setter.null + name = if alias == "" then (UUID.randomUUID.to_text) else alias + ctx = Context.for_query raw_sql name + ## Any problems are treated as errors - e.g. if the query + contains clashing column names, it may very likely lead to + data corruption. Our renaming mechanism is used to fix issues + with existing tables with problematic names, but that + mechanism will only provide a false-sense of security in case + of a query, whereas a query like `SELECT 1 AS "A", 2 AS "A"` + will actually result in both columns `A` and `A 1` containing + the value 1; and value 2 being lost. That is why such queries + must fail. + r = DB_Table_Module.make_table self name columns ctx on_problems=Problem_Behavior.Report_Error + r.catch Any error-> + Error.throw (Illegal_Argument.Error "The provided custom SQL query is invalid and may suffer data corruption when being processed, especially if it contains aliased column names, it may not be interpreted correctly. Please ensure the names are unique. The original error was: "+error.to_display_text cause=error) ## PRIVATE Execute the query and load the results into memory as a Table.