Documentation Home
MySQL Internals Manual
Download this Manual
EPUB - 0.8Mb

22.18.27 write_row


Adds a new row to a table.


virtual int write_row (


byte *

buf ;


This is the write_row method.

write_row() inserts a row. No [custom-engine.html#custom-engine-api-reference-extra extra()] hint is given currently if a bulk load is happening. buf is a byte array of data with a size of table->s->reclength

You can use the field information to extract the data from the native byte array type. Example of this would be: for (Field **field=table->field ; *field ; field++) { ... }

BLOBs must be handled specially:

for (ptr= table->s->blob_field, end= ptr + table->s->blob_fields ; ptr != end ; ptr++)
        char *data_ptr;
        uint32 size= ((Field_blob*)table->field[*ptr])->get_length();

See for an example of extracting all of the data as strings.

See the note for update_row() on auto_increments and timestamps. This case also applied to write_row().

Called from,,,,,,,, and


  • buf byte array of data

Return Values

There are no return values.


This section is still to be written.

Default Implementation

 { return HA_ERR_WRONG_COMMAND; } 

Download this Manual
EPUB - 0.8Mb
User Comments
Sign Up Login You must be logged in to post a comment.