Method: Mysql#get_result

Defined in:
ext/mysql.c

#get_resultObject

get_result



847
848
849
850
851
852
853
854
855
856
857
858
859
860
# File 'ext/mysql.c', line 847

static VALUE get_result(VALUE obj)
{
    MYSQL* m = GetHandler(obj);
    if (GetMysqlStruct(obj)->connection == Qfalse) {
        rb_raise(eMysql, "query: not connected");
    }
    if (mysql_read_query_result(m) != 0)
        mysql_raise(m);
    if (GetMysqlStruct(obj)->query_with_result == Qfalse)
        return obj;
    if (mysql_field_count(m) == 0)
        return Qnil;
    return store_result(obj);
}