When adding taxonomy terms to nodes with a publish date before 1970 mysql throws an error. The taxonomy_index.created field attributes differ from those of node.created. Node.created supports unsigned integers where as taxonomy.index does not. I can not think of a valid reason for this discrepancy. Attached is a patch.

Comments

scor’s picture

Status: Needs review » Needs work

you'll need an update function as well.

ngmaloney’s picture

Status: Needs work » Needs review
StatusFileSize
new1.61 KB

Attached is patch containing update function as well.

scor’s picture

Priority: Normal » Major
Status: Needs review » Needs work
StatusFileSize
new1.56 KB

bumping to major. attaching a test to reproduce this bug programmatically (not that it should be committed, I'm not sure where this test should live, really).

There is a minor doxygen issue.

+++ modules/taxonomy/taxonomy.install	30 Nov 2010 16:14:20 -0000
@@ -806,3 +805,16 @@ function taxonomy_update_7009() {
+/**
+ * Change {taxonomy_index}.created to support signed int.
+**/

should be

/**
 *
 */
ngmaloney’s picture

StatusFileSize
new1.6 KB

Attached is patch resolving doxygen issue.

scor’s picture

Status: Needs work » Needs review

looks good now. reproduced bug, applied patch and ran update.php and the bug was solved. I'd like another set of eyes looking at this before RTBC.

vgarvardt’s picture

Confirm PDOException: SQLSTATE[22003] when saving node with the year before 1970.

Applied patch from #4, run update.php and tried to create node with publish date before 1970 again - works fine now.

jbrown’s picture

Status: Needs review » Needs work

The test needs to be in the patch.

bfroehle’s picture

StatusFileSize
new2.92 KB

Here is the patch in #4 together with the unit test in #3.

bfroehle’s picture

Status: Needs work » Needs review

CNR to trigger the bot.

bojanz’s picture

Status: Needs review » Reviewed & tested by the community

Looks like we're good to go.

webchick’s picture

Version: 7.x-dev » 6.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Thanks for the bug fix, and the test. I added a line of doxygen to that testX function and Committed to HEAD.

This looks like it could use a D6 backport too, no?

scor’s picture

Version: 6.x-dev » 7.x-dev
Status: Patch (to be ported) » Fixed

The taxonomy_index table was added in Drupal 7.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.