Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove error context handling from string literal hook #2736

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions contrib/babelfishpg_tsql/src/pltsql_coerce.c
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,7 @@ tsql_func_select_candidate(int nargs,
}

static Node *
tsql_coerce_string_literal_hook(ParseCallbackState *pcbstate, Oid targetTypeId,
tsql_coerce_string_literal_hook(Oid targetTypeId,
int32 targetTypeMod, int32 baseTypeMod,
Const *newcon, char *value,
CoercionContext ccontext, CoercionForm cformat,
Expand Down Expand Up @@ -1062,8 +1062,6 @@ tsql_coerce_string_literal_hook(ParseCallbackState *pcbstate, Oid targetTypeId,
false));
errFunc = makeFuncExpr(errFuncOid, targetTypeId, args, 0, 0, COERCE_EXPLICIT_CALL);

cancel_parser_errposition_callback(pcbstate);

result = (Node *) errFunc;

/* If target is a domain, apply constraints. */
Expand Down
14 changes: 14 additions & 0 deletions test/JDBC/expected/babel_726.out
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,20 @@ x
~~END~~


-- check that duplicate view with varbinary cast does not cause crash (#2693)
create view babel_726_v1 as select cast('a' as varbinary)
go

create view babel_726_v1 as select cast('a' as varbinary)
go
~~ERROR (Code: 2714)~~

~~ERROR (Message: relation "babel_726_v1" already exists)~~


drop view babel_726_v1
go

drop table babel_726_t1
go

Expand Down
10 changes: 10 additions & 0 deletions test/JDBC/input/datatypes/babel_726.sql
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,16 @@ go
select coalesce(CAST('x'AS VARBINARY), CAST('x' AS NVARCHAR(4000)), 'x')
go

-- check that duplicate view with varbinary cast does not cause crash (#2693)
create view babel_726_v1 as select cast('a' as varbinary)
go

create view babel_726_v1 as select cast('a' as varbinary)
go

drop view babel_726_v1
go

drop table babel_726_t1
go

Expand Down
Loading