@@ -1071,38 +1071,7 @@ bool ValidateAndConvertVDFArguments(THD *thd, const char *func_name,
10711071 continue ;
10721072 }
10731073
1074- // Case 3: Argument is a column reference (Item_field) without type context
1075- // yet. This happens during functional index creation: the table is being
1076- // created, so MaybeInjectCustomType hasn't run yet. The field's underlying
1077- // Create_field_wrapper (set by replace_field_processor) lets us check
1078- // whether the column will actually be a custom type.
1079- // We match on qualified_base_name() (extension.type, no parameters),
1080- // consistent with Case 1, because VDF signatures cannot express type
1081- // parameterization - a VDF declared with param("TVECTOR") must accept any
1082- // TVECTOR(N) column.
1083- if (args[i]->type () == Item::FIELD_ITEM) {
1084- auto *item_field = down_cast<Item_field *>(args[i]);
1085- if (item_field->field != nullptr &&
1086- item_field->field ->is_wrapper_field ()) {
1087- auto *wrapper =
1088- down_cast<const Create_field_wrapper *>(item_field->field );
1089- const Create_field *cf = wrapper->get_create_field ();
1090- if (cf->custom_type_context != nullptr ) {
1091- if (cf->custom_type_context ->qualified_base_name () != expected_qbn) {
1092- villagesql_error (
1093- " Cannot initialize function '%s': argument %u type mismatch "
1094- " (expected %s, got %s)" ,
1095- MYF (0 ), func_name, i + 1 , expected_qbn.c_str (),
1096- cf->custom_type_context ->qualified_base_name ().c_str ());
1097- return true ;
1098- }
1099- continue ;
1100- }
1101- }
1102- // Column has no custom type context - fall through
1103- }
1104-
1105- // Case 4: Argument is not a custom type and not a constant string
1074+ // Case 3: Argument is not a custom type and not a constant string
11061075 villagesql_error (
11071076 " Cannot initialize function '%s': argument %u must be a custom type "
11081077 " or string constant" ,
0 commit comments