Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #6695 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

[PATCH] MySQL 5.0 BLOB/TEXT columns cannot have default values

Reported by: dkubb Assigned to: David
Priority: normal Milestone: 1.x
Component: ActiveRecord Version: edge
Severity: normal Keywords: MySQL 5 BLOB TEXT default
Cc:

Description

MySQL 5.x BLOB/TEXT columns cannot have default values any longer.

As of MysQL 5.0.2, when in strict mode adding a default value to BLOB/TEXT columns will cause an error, otherwise it will return a warning.

When ActiveRecord does introspection on the column's attributes, it can specify an empty string for the default when there is none, which will prevent fixture loading from occuring.

Attachments

mysql_adapter_with_no_default_for_blob_and_text.patch (1.9 kB) - added by dkubb on 11/23/06 21:05:22.
mysql_adapter_with_no_default_for_blob_and_text2.patch (3.9 kB) - added by dkubb on 01/16/07 19:11:24.
Updated patch with test cases

Change History

11/23/06 21:05:22 changed by dkubb

  • attachment mysql_adapter_with_no_default_for_blob_and_text.patch added.

01/15/07 00:44:46 changed by bitsweat

  • keywords changed from ActiveRecord MySQL 5 BLOB TEXT default to MySQL 5 BLOB TEXT default.
  • milestone changed from 1.x to 1.2.

another patch at #6986

01/16/07 19:11:24 changed by dkubb

  • attachment mysql_adapter_with_no_default_for_blob_and_text2.patch added.

Updated patch with test cases

01/16/07 19:14:10 changed by dkubb

  • owner changed from David to dkubb.

Added test cases similar to #6986 and adjusted mysql DML file to work with MySQL 5 in strict mode. (strict mode does not allow invalid dates like 0000-00-00 00:00:00)

01/16/07 19:14:40 changed by dkubb

  • owner changed from dkubb to David.

01/28/07 15:45:07 changed by bitsweat

  • status changed from new to closed.
  • resolution set to fixed.

(In [6074]) MySQL: blob and text columns may not have defaults in 5.x. Update fixtures schema for strict mode. Closes #6695.

01/28/07 15:46:52 changed by bitsweat

  • milestone changed from 1.2 to 1.x.