[DBTNG + BLOB]: remap {node_revisions}.body and {node_revisions}.teaser

hswong3i - August 27, 2008 - 21:33
Project:Drupal
Version:7.x-dev
Component:node.module
Category:feature request
Priority:critical
Assigned:hswong3i
Status:duplicate
Description

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.

AttachmentSizeStatusTest resultOperations
node_revisions-body-teaser.patch2.67 KBIdleFailed: Failed to apply patch.View details | Re-test

#1

hswong3i - October 8, 2008 - 19:47

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?

<?php
   
// 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 = '';
    }
?>

AttachmentSizeStatusTest resultOperations
node_revisions-body-teaser-1223494702.patch1.4 KBIdleFailed: Failed to apply patch.View details | Re-test

#2

hswong3i - October 14, 2008 - 18:00
Title:Remap field as BLOB: {node_revisions}.body and {node_revisions}.teaser» [DBTNG + BLOB]: remap {node_revisions}.body and {node_revisions}.teaser

Since #316095: [DBTNG + pgsql] db_insert/db_update buggy with empty string input and BLOB field 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.

AttachmentSizeStatusTest resultOperations
dbtng-node_revisions-body-teaser-1224006155.patch1.31 KBIdleFailed: Failed to apply patch.View details | Re-test

#3

System Message - November 16, 2008 - 21:50
Status:needs review» needs work

The last submitted patch failed testing.

#4

hswong3i - November 24, 2008 - 18:59
Status:needs work» duplicate

duplicate with #147947: [DBTNG + XDB] Replace some TEXT:BIG with BLOB

 
 

Drupal is a registered trademark of Dries Buytaert.