As case mentioned in http://drupal.org/node/147947, this patch remap {node_revisions}.body and {node_revisions}.teaser as BLOB type. Also merge with http://drupal.org/node/300219 for correct schema definition. Since node INSERT/UPDATE is already wrapped with drupal_write_record(), we don't need db_insert() or db_update() here (for update drupal_write_record() with db_insert() and db_update(), please refer to http://drupal.org/node/299088).

MySQL:

  • update.php: pass.
  • INSERT/UPDATE: pass.

PostgreSQL:

  • update.php: FAILED. Seems PostgreSQL schema don't handle change field correctly.
  • INSERT/UPDATE: pass.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hswong3i’s picture

Update based on http://drupal.org/node/316095 founding. Revamp BLOB field with nullable.

Tested with MySQL and PostgreSQL:

P.S. According to recent comments, seems we are scheduled to revamp {node_revisions}.body and {node_revisions}.teaser as nullable. Should we include within this issue, too?

    // For the same reasons, make sure we have $node->teaser and
    // $node->body.  We should consider making these fields nullable
    // in a future version since node types are not required to use them.
    if (!isset($node->teaser)) {
      $node->teaser = '';
    }
    if (!isset($node->body)) {
      $node->body = '';
    }
hswong3i’s picture

Title: Remap field as BLOB: {node_revisions}.body and {node_revisions}.teaser » [DBTNG + BLOB]: remap {node_revisions}.body and {node_revisions}.teaser
FileSize
1.31 KB

Since #316095: Raise PHP requirement to 5.2.12 for PostgreSQL only already figure out the solution for PostgreSQL + BLOB + NULL + INSERT/UPDATE bug, this patch is now safe for using both null or nullable BLOB field.

Patch reroll via CVS HEAD. Only change field type from TEXT to BLOB. P.S. We MUST have PHP newer than snapshot php5.2-200810130030.tar.gz for PostgreSQL or else will buggy!

Simpletest for both MySQL and PostgreSQL are now pass as CVS HEAD.

P.S. Actually, I would like to add default value for "variables" as it is 'not null' => TRUE by default. But since MySQL will buggy with #300219: [DBTNG]: MySQL should remove TEXT/BLOB default value so I would like to wait and handle this with another issue.

Status: Needs review » Needs work

The last submitted patch failed testing.

hswong3i’s picture

Status: Needs work » Closed (duplicate)