I'm getting a strange MySQL error when filling date field with a repeat option. Please see the attached PDF as the error is very long.

I've only been able to reproduce this error when the repeating rule is set to daily and the number of days exceeds 14 days.

Example:
- date: March 1, 2012
- repeats: daily
- repeats every: 1 days
- stop repeating: March 16, 2012

When the error doesn't occur, the page takes a very long time to load.

I can't figure out what the SQL statement is for.

Any help is highly appreciated.

CommentFileSizeAuthor
DateRepeat_TooManyTables_Error.pdf1.9 MBsemiaddict
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

semiaddict’s picture

Project: Date » Unique field
Version: 7.x-2.2 » 7.x-1.0-rc1
Priority: Major » Normal

After a lot of searching, I managed to find out the actual module that was causing this error.
I thought it was the Date module, but it's actually the Unique Field module.

It seems that if a repeating date field is used in a unique field configuration, the query to check for uniqueness can get very complex.

I've simply deactivated the Unique Field module for now until I, or someone else, finds a better solution.

czigor’s picture

Same here. Just to help google (I spent an hour to get here) I attach the beginning of the error message:

PDOException: SQLSTATE[HY000]: General error: 1116 Too many tables; MySQL can only use 61 tables in a join:

czigor’s picture

Priority: Normal » Major

It seems that if unique field is checking for 61 fields it throws this PDOException. 61 fields is not usual but with date repeat this can happen very easily: each rule for a repeat counts for 3 fields (value, value2 and rrule). So adding a date field to a node with a repeat rule generating altogether 21 dates hangs the site.

I know this is a narrow use case but I mark this as major, since it makes the module unusable for those who don't know the origin of the problem.

czigor’s picture

The problem is with EFQ in unique_field_match_value(), it has more than 60 fieldConditions.
I'm planning to make a patch.