[DBTNG]: MySQL should remove TEXT/BLOB default value

hswong3i - August 26, 2008 - 17:26
Project:Drupal
Version:7.x-dev
Component:database system
Category:bug report
Priority:critical
Assigned:hswong3i
Status:won't fix
Description

By common programming logic, DB field with 'not null' => TRUE should always come with its default value, in order to prevent careless typing mistake or query implementation. But in case of MySQL, TEXT/BLOB don't support for default value (http://dev.mysql.com/doc/refman/5.1/en/blob.html):

BLOB and TEXT columns cannot have DEFAULT values.

According to our CVS HEAD implementation, we escape from this exceptional case within schema definition (bad). This patch try to catch the MySQL-specific requirement within its driver implementation (seems better), where keep the overall schema definition as simple as possible.

AttachmentSize
mysql-schema-default.patch908 bytes

#1

hswong3i - October 14, 2008 - 15:30
Title:MySQL can't handle TEXT/BLOB with default value» [DBTNG]: MySQL should remove TEXT/BLOB with default value
Priority:normal» critical

Patch reroll via CVS HEAD.

AttachmentSize
dbtng-mysql-schema-default-1223998209.patch 903 bytes

#2

hswong3i - October 14, 2008 - 15:31
Title:[DBTNG]: MySQL should remove TEXT/BLOB with default value» [DBTNG]: MySQL should remove TEXT/BLOB default value

#3

earnie - October 15, 2008 - 12:58
Status:needs review» won't fix

@hswong3i: I think this is a "won't fix" based on the fact that you're adding what others call baby sitting code. The originator of the schema should fix his code so it should just fail.

 
 

Drupal is a registered trademark of Dries Buytaert.