/* fetch_field_direct(nr) */
static VALUE fetch_field_direct(VALUE obj, VALUE nr)
{
MYSQL_RES* res;
unsigned int max;
unsigned int n;
check_free(obj);
res = GetMysqlRes(obj);
max = mysql_num_fields(res);
n = NUM2INT(nr);
if (n >= max)
#if RUBY_VERSION_CODE < 160
Raise(eMysql, "%d: out of range (max: %d)", n, max-1);
#else
rb_raise(eMysql, "%d: out of range (max: %d)", n, max-1);
#endif
#if MYSQL_VERSION_ID >= 32226
return make_field_obj(mysql_fetch_field_direct(res, n));
#else
return make_field_obj(&mysql_fetch_field_direct(res, n));
#endif
}