Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
beyondykk9 committed Jan 6, 2025
1 parent e85745f commit 2af6334
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
16 changes: 4 additions & 12 deletions src/compat/db_macro.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,18 +189,10 @@ db_value_domain_init (DB_VALUE * value, const DB_TYPE type, const int precision,
}
if (IS_INVALID_PRECISION (precision, DB_MAX_NUMERIC_PRECISION) || precision == 0)
{
if (precision == 0)
{
value->domain.numeric_info.precision = DB_DEFAULT_NUMERIC_PRECISION;
}
else
{
error = ER_INVALID_PRECISION;
er_set (ER_WARNING_SEVERITY, ARG_FILE_LINE, ER_INVALID_PRECISION, 3, precision, 0,
DB_MAX_NUMERIC_PRECISION);
value->domain.numeric_info.precision = DB_DEFAULT_NUMERIC_PRECISION;
value->domain.numeric_info.scale = DB_DEFAULT_NUMERIC_SCALE;
}
error = ER_INVALID_PRECISION;
er_set (ER_WARNING_SEVERITY, ARG_FILE_LINE, ER_INVALID_PRECISION, 3, precision, 0, DB_MAX_NUMERIC_PRECISION);
value->domain.numeric_info.precision = DB_DEFAULT_NUMERIC_PRECISION;
value->domain.numeric_info.scale = DB_DEFAULT_NUMERIC_SCALE;
}
break;

Expand Down
5 changes: 0 additions & 5 deletions src/parser/parse_dbi.c
Original file line number Diff line number Diff line change
Expand Up @@ -2294,11 +2294,6 @@ pt_node_to_db_domain (PARSER_CONTEXT * parser, PT_NODE * node, const char *class

default:
retval = pt_data_type_to_db_domain (parser, node->data_type, class_name);
if (domain_type == DB_TYPE_NUMERIC)
{
retval->precision = 0;
retval->scale = 0;
}
break;
}
}
Expand Down
6 changes: 6 additions & 0 deletions src/parser/xasl_generation.c
Original file line number Diff line number Diff line change
Expand Up @@ -2261,6 +2261,12 @@ pt_xasl_node_to_domain (PARSER_CONTEXT * parser, const PT_NODE * node)
TP_DOMAIN *dom;

dom = pt_node_to_db_domain (parser, (PT_NODE *) node, NULL);
if (dom && dom->type->id == DB_TYPE_NUMERIC)
{
dom->precision = dom->scale = 0;
return dom;
}

if (dom)
{
return tp_domain_cache (dom);
Expand Down

0 comments on commit 2af6334

Please sign in to comment.