| 1961 | */ |
| 1962 | |
| 1963 | bool JOIN_CACHE::read_referenced_field(CACHE_FIELD *copy, |
| 1964 | uchar *rec_ptr, |
| 1965 | uint *len) |
| 1966 | { |
| 1967 | uchar *ptr; |
| 1968 | uint offset; |
| 1969 | if (copy < field_descr || copy >= field_descr+fields) |
| 1970 | return FALSE; |
| 1971 | if (!*len) |
| 1972 | { |
| 1973 | /* Get the total length of the record fields */ |
| 1974 | uchar *len_ptr= rec_ptr; |
| 1975 | if (prev_cache) |
| 1976 | len_ptr-= prev_cache->get_size_of_rec_offset(); |
| 1977 | *len= get_rec_length(len_ptr-size_of_rec_len); |
| 1978 | } |
| 1979 | |
| 1980 | ptr= rec_ptr-(prev_cache ? prev_cache->get_size_of_rec_offset() : 0); |
| 1981 | offset= get_fld_offset(ptr+ *len - |
| 1982 | size_of_fld_ofs* |
| 1983 | (referenced_fields+1-copy->referenced_field_no)); |
| 1984 | bool is_null= FALSE; |
| 1985 | Field *field= copy->field; |
| 1986 | if (offset == 0 && flag_fields) |
| 1987 | is_null= TRUE; |
| 1988 | if (is_null) |
| 1989 | { |
| 1990 | field->set_null(); |
| 1991 | if (!field->real_maybe_null()) |
| 1992 | field->table->null_row= 1; |
| 1993 | } |
| 1994 | else |
| 1995 | { |
| 1996 | uchar *save_pos= pos; |
| 1997 | field->set_notnull(); |
| 1998 | if (!field->real_maybe_null()) |
| 1999 | field->table->null_row= 0; |
| 2000 | pos= rec_ptr+offset; |
| 2001 | read_record_field(copy, blob_data_is_in_rec_buff(rec_ptr)); |
| 2002 | pos= save_pos; |
| 2003 | } |
| 2004 | return TRUE; |
| 2005 | } |
| 2006 | |
| 2007 | |
| 2008 | /* |
no test coverage detected