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

[CBRD-24597] fix coerce strict with char to numeric (#4016) #4051

Merged
merged 2 commits into from
Jan 17, 2023
Merged
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
17 changes: 15 additions & 2 deletions src/object/object_domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -6261,9 +6261,22 @@ tp_value_coerce_strict (const DB_VALUE * src, DB_VALUE * dest, const TP_DOMAIN *
case DB_TYPE_NCHAR:
case DB_TYPE_VARNCHAR:
{
if (tp_atonumeric (src, target) != NO_ERROR)
DB_VALUE temp;

if (tp_atonumeric (src, &temp) != NO_ERROR)
{
err = ER_FAILED;
if (er_errid () != NO_ERROR)
{
err = DOMAIN_ERROR;
}
else
{
err = DOMAIN_INCOMPATIBLE;
}
}
else
{
err = tp_value_coerce (&temp, target, desired_domain);
}
break;
}
Expand Down