I have a content type with a date field using the default rule that is installed with resource conflict.
When creating content with any duration, the following error message is shown:
PDOException: SQLSTATE[07002]: [Microsoft][SQL Server Native Client 11.0]COUNT field incorrect or syntax error: SELECT DISTINCT {node}.nid FROM {node} INNER JOIN {field_data_field_time_model_date} date_table ON {node}.vid = date_table.revision_id WHERE(BINARY :date_start >= BINARY date_table.field_time_model_date_value AND BINARY :date_start < BINARY date_table.field_time_model_date_value2) OR(BINARY :date_end > BINARY date_table.field_time_model_date_value AND BINARY :date_end <= BINARY date_table.field_time_model_date_value2) OR(BINARY :date_start <= BINARY date_table.field_time_model_date_value AND BINARY :date_end >= BINARY date_table.field_time_model_date_value2); Array ( [:date_start] => 2013-08-07 00:00:00 [:date_end] => 2013-08-08 00:00:00 ) in _resource_conflict_get_overlaps() (line 160 of C:\inetpub\wwwroot\sites\all\modules\resource_conflict\resource_conflict.module).
Is it possible that MSSQL isn't compatible with Resource Conflicts?
Thanks in advance for any help.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | resource_conflict.mssql_.patch | 2.91 KB | nwom |
| #3 | resource_conflict.mssql_.patch | 1.9 KB | nwom |
Comments
Comment #1
ohthehugemanatee commentedYes, it's perfectly possible that this is not compatible with MSSQL. The SQL statements in the D7 version still use the old fashioned query functions, and are built for MySQL specifically. It would not be terribly difficult to replace them with engine-agnostic D7 query functions... but I won't have time to do it probably until Drupalcon Prague. Patches welcome!
Comment #2
nwom commentedOh ok. I understand. If I could make a patch I would. In the meantime I'll keep my fingers crossed that someone with the know-how comes across this thread.
Thanks for the quick response.
Comment #3
nwom commentedI hired someone to patch it over for me. I'm not sure if it's Drupal standard, but it works perfectly. Any edits to the patch for drupal conformity are welcome. I hope this helps others.
Edit: I just realized the patch that I uploaded does not include mysql support. I will upload the new one that works with both databases asap.
Comment #4
nwom commentedHere is the new one with both mysql and mssql support.
Comment #5
bkosborneLooks like the only thing that was changed to make it MSSQL compatible was removing the BINARY operator. This was removed in a recent commit once the entire query was moved to the dynamic query API. If you get a chance please test this again with the latest dev. If not, no worries, I'm confident this shouldn't be an issue anymore.