You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
MCOL-641 This commit enables CS to return a warning on non-supported ZEROFILL
keyword. The change potentially replaces tabs with spaces in the bison's ddl.y file.
This commit is contained in:
@ -63,7 +63,6 @@ char* copy_string(const char *str);
|
||||
%pure-parser
|
||||
%lex-param {void * scanner}
|
||||
%parse-param {struct ddlpackage::pass_to_bison * x}
|
||||
%debug
|
||||
|
||||
/* Bison uses this to generate a C union definition. This is used to
|
||||
store the application created values associated with syntactic
|
||||
@ -1007,7 +1006,7 @@ exact_numeric_type:
|
||||
$2->fLength = DDLDatatypeLength[DDL_UNSIGNED_NUMERIC];
|
||||
$$ = $2;
|
||||
}
|
||||
| DECIMAL opt_precision_scale opt_signed opt_zerofill
|
||||
| DECIMAL opt_precision_scale opt_signed
|
||||
{
|
||||
$2->fType = DDL_DECIMAL;
|
||||
$$ = $2;
|
||||
|
@ -2299,6 +2299,22 @@ static bool get_field_default_value(THD *thd, Field *field, String *def_value,
|
||||
return has_default;
|
||||
}
|
||||
|
||||
/*
|
||||
Utility function search for ZEROFILL
|
||||
*/
|
||||
|
||||
bool hasZerofillDecimal(TABLE *table_arg)
|
||||
{
|
||||
for (Field **field= table_arg->field; *field; field++)
|
||||
{
|
||||
if (((*field)->flags & ZEROFILL_FLAG)
|
||||
&& typeid (**field) == typeid(Field_new_decimal))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int ha_mcs_impl_create_(const char* name, TABLE* table_arg, HA_CREATE_INFO* create_info, cal_connection_info& ci)
|
||||
{
|
||||
#ifdef MCS_DEBUG
|
||||
@ -2578,6 +2594,14 @@ int ha_mcs_impl_create_(const char* name, TABLE* table_arg, HA_CREATE_INFO* crea
|
||||
cout << "ha_mcs_impl_create_: ProcessDDL error, now in state NOT_ALTER" << endl;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
if (hasZerofillDecimal(table_arg))
|
||||
{
|
||||
push_warning(thd, Sql_condition::WARN_LEVEL_WARN,
|
||||
WARN_OPTION_IGNORED, "ZEROFILL is ignored in ColumnStore");
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
Reference in New Issue
Block a user