I had successfully installed and configured a site to use Views data export 6.x-2.0-beta3. Then I performed a series of updates to PHP, MySQL, Drupal Core, Views, and a couple other possibly related modules. But I did not update views_data_export. The updates appeared to go smoothly, the sites worked fine, we moved everything to production.
Then I discovered that the batch exports weren't working, and were stopping with a PHP error: "Field 'fid' doesn't have a default value". And the browser was getting dumped to an error page. In my database, this is true, the field 'fid' in the views_data_export table does not have a default value. And I checked in the views_data_export.install files of both 6.x-2.0-beta3 and in 6.x-2.x-dev (which I've now got installed), and neither of them define a default value.
I manually set the default for the fid field to be 0. And then the batch proceeded correctly.
It is unclear to me if my various PHP/MySQL updates may have modified the default behaviour of the database, or otherwise messed around with the schema, or the error-handling. But it is possible this is a bug that may be encountered in edge cases somewhere.
Did I mention that the site is on an IIS server? I know there are some MySQL defaults that are slightly different under IIS than under Apache. Maybe that's at play here?
Obviously, I'm not at all clear now if the fid field should actually require a default value or if this suggests some other error elsewhere in the code. Or if this is all just unique to some weird, one-time quirk in our system.
Phil.
Comments
Comment #1
pkiff commentedA bit more info on this. Here is an example of one of the queries that would generate an error:
query: INSERT INTO views_data_export (view_name, view_display_id, time_stamp, batch_state, sandbox) VALUES ('reports_firms', 'views_data_export_1', 1302119351, 'header', 'a:0:{}') in [***server folder info removed***]\includes\common.inc on line 3538.I'm now thinking that this is indeed related to default values for integer fields and whether or not you are running MySQL in strict mode or not. And possibly it is also related to variations in how different 5.x versions of MySQL handle missing defaults for integers.
Some info on the Drupal recommendations in MySQL peculiarities with implicit defaults:
http://drupal.org/node/159330
Phil.
Comment #2
steven jones commentedThanks, we've tracked this one down and fixed it in both version of the 6.x module.
Comment #3
pkiff commentedThank YOU, Steven.
This is an awesome module for folks who find themselves with a request to produce an exportable file for large databases where other Views options are just not possible.
Phil.