The query created by content_db_index_exists() in content.module is not valid SQL (according to the MySQL manual, the "SHOW INDEX" command does not have a WHERE clause).

This causes errors when I attempt to create ANY node reference field with CCK 6.x-2.5.

I feel that this needs to be fixed ASAP.

CommentFileSizeAuthor
#2 content_db_index_exists-mysql_4.patch950 bytesGuyPaddock
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

GuyPaddock’s picture

Title: content_db_index_exists produces SQL errors when creating node reference fields » content_db_index_exists produces SQL errors when creating node reference fields for MySQL 4

Correction, our server is MySQL 4.1.20, and it looks like the extended SHOW syntax that does support a WHERE clause was added in MySQL 5.

GuyPaddock’s picture

The attached patch should fix this issue.

markus_petrux’s picture

Status: Active » Needs work

Could you please provide a patch in Unified diff format?

markus_petrux’s picture

Status: Needs work » Fixed

Committed an slight vairation of the patch to CVS (branches CCK2 and CCK3) - patch.

Thank you! :)

Status: Fixed » Closed (fixed)

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