Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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.
Comment | File | Size | Author |
---|---|---|---|
DateRepeat_TooManyTables_Error.pdf | 1.9 MB | semiaddict |
Comments
Comment #1
semiaddict CreditAttribution: semiaddict commentedAfter 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.
Comment #2
czigor CreditAttribution: czigor commentedSame 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:
Comment #3
czigor CreditAttribution: czigor commentedIt 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.
Comment #4
czigor CreditAttribution: czigor commentedThe problem is with EFQ in unique_field_match_value(), it has more than 60 fieldConditions.
I'm planning to make a patch.