List:Internals« Previous MessageNext Message »
From:Sergei Golubchik Date:May 14 2009 9:15am
View as plain text  
Hi, Vyacheslav!

On May 13, Vyacheslav Akhmechet wrote:
> Hi,
> In my storage engine, when the server calls write_row, I read the
> first field of the row in order to index on this field. I do it in the
> following way:
>     Field **field = table->field;
>     long index = (*field)->val_int();
> It works perfectly in release mode, but in debug mode val_int
> generates ASSERT_COLUMN_MARKED_FOR_READ assertion (which is: "(!table
> || (!table->read_set || bitmap_is_set(table->read_set, field_index))),
> function val_int, file, line 3682.")
> What am I doing wrong? Do I need to mark the column for reading first?
> Why? How does this affect the behavior of the server?

Usually, it's server that decides what columns need to be read.
The engine is not required to fill in values for columns that aren't in
the read_set map.

The goal of this assert is to ensure that server only uses values of
columns it has requested.

Of course, it doesn't exactly work that way in your case, when the
engine reads additional columns and needs their values.

But I think you can simply set the necessary bit:

  bitmap_set_bit(table->read_set, 0);

That should do the trick.
Regards / Mit vielen Grüßen,

   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik <serg@stripped>
 / /|_/ / // /\ \/ /_/ / /__  Principal Software Engineer/Server Architect
/_/  /_/\_, /___/\___\_\___/  Sun Microsystems GmbH, HRB München 161028
       <___/                  Sonnenallee 1, 85551 Kirchheim-Heimstetten
Geschäftsführer: Thomas Schroeder, Wolfgang Engels, Wolf Frenkel
Vorsitzender des Aufsichtsrates: Martin Häring
ASSERT_COLUMN_MARKED_FOR_READ questionVyacheslav Akhmechet14 May
  • Re: ASSERT_COLUMN_MARKED_FOR_READ questionKristian Nielsen14 May
  • Re: ASSERT_COLUMN_MARKED_FOR_READ questionSergei Golubchik14 May
    • Re: ASSERT_COLUMN_MARKED_FOR_READ questionVyacheslav Akhmechet15 May