drupal_write_record() cuts off data I have some pretty straightforward code that combines some string values together and then writes them to the db using drupal_write_record(), and it seems that the values are getting cut off for some reason when actually written to the database.

$keys_string = str_replace('|', '', $product-&gt;attribute_keys);
$values_string = str_replace('|', '', $product-&gt;attribute_values);

$keys = array_filter(explode('~', $keys_string));
$values = array_filter(explode('~', $values_string));

$description = '';
foreach ($keys as $key =&gt; $data) {
    $description .= $keys[$key] . ' : ' . $values[$key] . "\n";
}

$description .= "\n" . $product-&gt;group_text; 
....

// Write record to database.
$table = 'ridethis_combined';
$record = new stdClass();
$record-&gt;title = $title;
$record-&gt;description = $description;
$record-&gt;short_description = $product-&gt;group_text;
$record-&gt;upc = $product-&gt;upc;
$record-&gt;sku = $product-&gt;vendor_item_id;
$record-&gt;cost = $price;
$record-&gt;price = $price;
$record-&gt;bti_quantity = $product-&gt;available;
$record-&gt;hawley_quantity = NULL;
$record-&gt;weight = NULL;
$record-&gt;manufacturer = $product-&gt;manufacturer_name;
$record-&gt;image = $image_url;
$record-&gt;meta_description = $product-&gt;group_text;
$record-&gt;meta_keyword = $product-&gt;group_text;
$record-&gt;meta_title = $title;

drupal_write_record($table, $record);


When stepping through the code in a debugger, I can see that prior to drupal_write_record, the full concatenated value is is stored in $record->description.  However, when I view the data in MySQL, only the concatenated values from $product->attribute_keys and $product->attribute_values is there; it's as if the $product->group_text data was never there.  The size of the db field is not an issue, since it has plenty of space for the content I'm writing to it.

Do you have any thought on what could be cutting this text off?
The function drupal_write_record() uses the database schema defined from the module. Check your hook_schema(), and see if it has the right length.

Post your hook_schema() implementation too, if this doesn't help.