Skip to content

Commit

Permalink
Revert "Block cross-db 'SELECT ... INTO table FROM ...' statement (#2744
Browse files Browse the repository at this point in the history
)" (#3109)

This reverts commit 1570cc6.

Task: BABEL-4934 

Co-authored-by: ANJU BHARTI <[email protected]>
  • Loading branch information
2 people authored and shardgupta committed Nov 25, 2024
1 parent 3154e13 commit 8a4fe0a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 704 deletions.
16 changes: 0 additions & 16 deletions contrib/babelfishpg_tsql/src/tsqlIface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1920,22 +1920,6 @@ class tsqlBuilder : public tsqlCommonMutator
if (is_schema_specified)
stmt->is_schema_specified = true;

if (is_cross_db)
{
if (ctx->select_statement_standalone() &&
ctx->select_statement_standalone()->select_statement() &&
ctx->select_statement_standalone()->select_statement()->query_expression() &&
ctx->select_statement_standalone()->select_statement()->query_expression()->query_specification() &&
ctx->select_statement_standalone()->select_statement()->query_expression()->query_specification()->INTO() &&
ctx->select_statement_standalone()->select_statement()->query_expression()->query_specification()->table_name())
{
throw PGErrorWrapperException(ERROR,
ERRCODE_FEATURE_NOT_SUPPORTED,
"cross-db 'SELECT INTO' statement is not supported in Babelfish. As a workaround, consider running CREATE TABLE and INSERT-SELECT statements.",
getLineAndPos(ctx->select_statement_standalone()));
}
}

if (is_compiling_create_function())
{
/* select without destination should be blocked. We can use already information about desitnation, which is already processed. */
Expand Down
Loading

0 comments on commit 8a4fe0a

Please sign in to comment.