Comment 15 for bug 1384568

Revision history for this message
George Ormond Lorch III (gl-az) wrote : Re: EXPLAIN crashes server

OK, so this bogus value of ptr is getting set from table.cc:open_table_from_share during the call to move_field_offset:

2217 /* Setup copy of fields from share, but use the right alias and record */
2218 for (i=0 ; i < share->fields; i++, field_ptr++)
2219 {
2220 Field *new_field= share->field[i]->clone(&outparam->mem_root);
2221 *field_ptr= new_field;
2222 if (new_field == NULL)
2223 goto err;
2224 new_field->init(outparam);
2225 new_field->move_field_offset((my_ptrdiff_t) (outparam->record[0] -
2226 outparam->s->default_values));
2227 }

I don't know if this is valid or not but

(my_ptrdiff_t) (outparam->record[0] - outparam->s->default_values))

is calculating to

(gdb) p (my_ptrdiff_t)(outparam->record[0] - outparam->s->default_values)
$167 = -305392

which seems like a _really_ odd value to be moving an offset within a buffer.