void var_set_convert_error(struct st_command *command,VAR *var)
{
  char *last;
  char *first=command->query;
  const char *err_name;
    
  DBUG_ENTER("var_set_convert_error");

  DBUG_PRINT("info", ("query: %s", command->query));

  /* the command->query contains the statement convert_error(1234) */ 
  first=strchr(command->query,'(') + 1;
  last=strchr(command->query,')');


  if( last == first )  /* denoting an empty string */
  {
    eval_expr(var,"0",0);
    DBUG_VOID_RETURN;
  }
  

  /* if the string is an error string , it starts with 'E' as is the norm*/
  if ( *first == 'E')    
  {
    char str[100];
    uint num;
    num=get_errcode_from_name(first, last);
    sprintf(str,"%i",num);
    eval_expr(var,str,0);
  }
  else  if (my_isdigit(charset_info, *first ))/* if the error is a number */
  {
    long int err;

    err=strtol(first,&last,0);
    err_name = get_errname_from_code(err);
    eval_expr(var,err_name,0);
  }
  else
  {
    die("Invalid error in input");
  }

  DBUG_VOID_RETURN;
}
void var_set_convert_error(struct st_command *command,VAR *var)
{
  char *last;
  char *first=command->query;
  const char *err_name;
    
  DBUG_ENTER("var_set_convert_error");

  DBUG_PRINT("info", ("query: %s", command->query));

    
  first=strchr(command->query,'(') + 1;
  last=strchr(command->query,')');


  if( last == first )   
  {
    eval_expr(var,"0",0);
    DBUG_VOID_RETURN;
  }
  

   
  if ( *first == 'E')    
  {
    char str[100];
    uint num;
    num=get_errcode_from_name(first, last);
    sprintf(str,"%i",num);
    eval_expr(var,str,0);
  }
  else  if (my_isdigit(charset_info, *first )) 
  {
    long int err;

    err=strtol(first,&last,0);
    err_name = get_errname_from_code(err);
    eval_expr(var,err_name,0);
  }
  else
  {
    die("Invalid error in input");
  }

  DBUG_VOID_RETURN;
}