1470
1470
thd->lex->set_stmt_unsafe();
1472
assert( (udf->type == UDFTYPE_FUNCTION)
1473
|| (udf->type == UDFTYPE_AGGREGATE));
1475
switch(udf->returns) {
1478
if (udf->type == UDFTYPE_FUNCTION)
1481
func= new (thd->mem_root) Item_func_udf_str(udf, *item_list);
1483
func= new (thd->mem_root) Item_func_udf_str(udf);
1488
func= new (thd->mem_root) Item_sum_udf_str(udf, *item_list);
1490
func= new (thd->mem_root) Item_sum_udf_str(udf);
1496
if (udf->type == UDFTYPE_FUNCTION)
1499
func= new (thd->mem_root) Item_func_udf_float(udf, *item_list);
1501
func= new (thd->mem_root) Item_func_udf_float(udf);
1506
func= new (thd->mem_root) Item_sum_udf_float(udf, *item_list);
1508
func= new (thd->mem_root) Item_sum_udf_float(udf);
1514
if (udf->type == UDFTYPE_FUNCTION)
1517
func= new (thd->mem_root) Item_func_udf_int(udf, *item_list);
1519
func= new (thd->mem_root) Item_func_udf_int(udf);
1524
func= new (thd->mem_root) Item_sum_udf_int(udf, *item_list);
1526
func= new (thd->mem_root) Item_sum_udf_int(udf);
1530
case DECIMAL_RESULT:
1532
if (udf->type == UDFTYPE_FUNCTION)
1535
func= new (thd->mem_root) Item_func_udf_decimal(udf, *item_list);
1537
func= new (thd->mem_root) Item_func_udf_decimal(udf);
1542
func= new (thd->mem_root) Item_sum_udf_decimal(udf, *item_list);
1544
func= new (thd->mem_root) Item_sum_udf_decimal(udf);
1550
my_error(ER_NOT_SUPPORTED_YET, MYF(0), "UDF return type");
1472
func= udf->create_func(thd->mem_root);
1474
func->set_arguments(*item_list);