Drizzledump conversion of '0000-00-00' date values to NULL can be problematic on NOT NULL columns
Bug #655954 reported by
Patrick Crews
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Drizzle |
Fix Released
|
High
|
Andrew Hutchings | ||
7.0 |
Fix Released
|
High
|
Andrew Hutchings |
Bug Description
Drizzledump converts the value '0000-00-00' into NULL when it encounters them in a MySQL database, however, this can cause problems when we do this conversion on a NOT NULL column:
When attempting to migrate the attached MySQL table (provided in MySQL dump form) to Drizzle via drizzledump, we see errors like:
Error executing query: Column 'col_datetime_
Error executing query: Column 'col_datetime_
Error executing query: Column 'col_datetime_
Error executing query: Column 'col_datetime_
And unpopulated tables.
Related branches
lp://staging/~linuxjedi/drizzle/elliott-bug-655954
- Drizzle Merge Team: Pending requested
-
Diff: 77 lines (+12/-18)2 files modifiedclient/drizzledump_mysql.cc (+11/-17)
client/drizzledump_mysql.h (+1/-1)
Changed in drizzle: | |
importance: | Undecided → High |
milestone: | none → 2010-10-11 |
status: | Confirmed → Triaged |
Changed in drizzle: | |
status: | Triaged → Fix Committed |
Changed in drizzle: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
MySQL dump output for the MySQL table (created on version 5.1) mediumint_ not_null` mediumint(9) NOT NULL, smallint_ not_null_ key` smallint(6) NOT NULL, int_not_ null_key` int(11) NOT NULL, tinyint_ not_null` tinyint(4) NOT NULL, enum_not_ null_key` enum('a' ,'b','c' ,'d','e' ,'f','g' ,'h','i' ,'j','k' ,'l','m' ,'n','o' ,'p','q' ,'r','s' ,'t','u' ,'v','w' ,'x','y' ,'z') NOT NULL, datetime_ key` datetime DEFAULT NULL, timestamp_ key` timestamp NULL DEFAULT '0000-00-00 00:00:00', ,'b','c' ,'d','e' ,'f','g' ,'h','i' ,'j','k' ,'l','m' ,'n','o' ,'p','q' ,'r','s' ,'t','u' ,'v','w' ,'x','y' ,'z') DEFAULT NULL, bigint_ not_null_ key` bigint(20) NOT NULL, smallint_ not_null` smallint(6) NOT NULL, timestamp_ not_null` timestamp NULL DEFAULT '0000-00-00 00:00:00', bigint_ not_null` bigint(20) NOT NULL, mediumint_ key` mediumint(9) DEFAULT NULL, timestamp_ not_null_ key` timestamp NULL DEFAULT '0000-00-00 00:00:00', datetime_ not_null_ key` datetime NOT NULL, char_128_ not_null` char(128) NOT NULL, char_128_ key` char(128) DEFAULT NULL, char_128_ not_null_ key` char(128) NOT NULL, datetime_ not_null` datetime NOT NULL, mediumint_ not_null_ key` mediumint(9) NOT NULL, smallint_ key` smallint(6) DEFAULT NULL, tinyint_ not_null_ key` tinyint(4) NOT NULL, char_10_ not_null_ key` char(10) NOT NULL, not_null_ key` (`col_smallint_ not_null_ key`), not_null_ key` (`col_int_ not_null_ key`), not_null_ key` (`col_enum_ not_null_ key`), key`), _key`), not_null_ key` (`col_bigint_ not_null_ key`), key`), _key`), not_null_ key` (`col_timestamp _not_null_ key`), not_null_ key` (`col_datetime_ not_null_ key`), 128_key` ), 128_not_ null_key` (`col_char_ 128_not_ null_key` ), not_null_ key` (`col_mediumint _not_null_ key`), key`), not_null_ key` (`col_tinyint_ not_null_ key`), 10_not_ null_key` (`col_char_ 10_not_ null_key` ) set_client = @saved_cs_client */; 1013248, 27139,8, 3,8,'x. ..
CREATE TABLE `dump_table1` (
`col_
`col_mediumint` mediumint(9) DEFAULT NULL,
`col_
`col_
`col_bigint` bigint(20) DEFAULT NULL,
`col_
`col_
`col_bigint_key` bigint(20) DEFAULT NULL,
`col_
`pk` int(11) NOT NULL AUTO_INCREMENT,
`col_
`col_enum` enum('a'
`col_
`col_
`col_tinyint_key` tinyint(4) DEFAULT NULL,
`col_
`col_datetime` datetime DEFAULT NULL,
`col_
`col_char_128` char(128) DEFAULT NULL,
`col_
`col_
`col_timestamp` timestamp NULL DEFAULT '0000-00-00 00:00:00',
`col_
`col_char_10` char(10) DEFAULT NULL,
`col_int` int(11) DEFAULT NULL,
`col_
`col_tinyint` tinyint(4) DEFAULT NULL,
`col_
`col_
`col_int_key` int(11) DEFAULT NULL,
`col_
`col_
`col_
`col_
`col_
`col_smallint` smallint(6) DEFAULT NULL,
PRIMARY KEY (`pk`),
KEY `col_smallint_
KEY `col_int_
KEY `col_enum_
KEY `col_bigint_key` (`col_bigint_key`),
KEY `col_datetime_key` (`col_datetime_
KEY `col_timestamp_key` (`col_timestamp
KEY `col_bigint_
KEY `col_tinyint_key` (`col_tinyint_
KEY `col_mediumint_key` (`col_mediumint
KEY `col_timestamp_
KEY `col_datetime_
KEY `col_char_128_key` (`col_char_
KEY `col_char_
KEY `col_int_key` (`col_int_key`),
KEY `col_mediumint_
KEY `col_smallint_key` (`col_smallint_
KEY `col_tinyint_
KEY `col_char_
) ENGINE=MyISAM AUTO_INCREMENT=16 DEFAULT CHARSET=latin1;
/*!40101 SET character_
INSERT INTO `dump_table1` VALUES (-1445632,