Getting this error on different installations. I think it happened after I created a 2nd view. Tried upgrading

user warning: Unknown column 'max_allowed_packet' in 'where clause' query: SHOW VARIABLES WHERE variable_name = max_allowed_packet in /home/examplesite/public_html/sites/all/modules/views_data_export/views_data_export.install on line 150.

version = "6.x-2.0-beta6+18-dev"

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

carlodimartino’s picture

Yes. I just noticed the same thing but only when I view admin/reports/status
6.x-2.0-beta6

dpw’s picture

+1 I am getting this error also. I was trying to figure out where max_allowed_packet is set in the VARIABLES table since it appears absent in most of my Drupal sites (some which use views_data_export).

cdale’s picture

It's a bug created by issue #1421828: Warn if max allowed packet is too small, and commit http://cgit.drupalcode.org/views_data_export/commit/?h=6.x-2.x&id=26887a....

It's not looking at the Drupal variables table, it's looking for variables defined in mysql/maraidb (Don't know if it works in postgres or sqlite...)

To fix the warning, change

$max_allowed_packet = db_result(db_query('SHOW VARIABLES WHERE variable_name = %s', array('max_allowed_packet')));

to

$max_allowed_packet = db_result(db_query("SHOW VARIABLES WHERE variable_name = '%s'", array('max_allowed_packet')));
Steven Jones’s picture

Status: Active » Needs review
FileSize
751 bytes

Here's a patch for consideration.

Steven Jones’s picture

FileSize
751 bytes

Meh, that patch was wrong.

Steven Jones’s picture

Status: Needs review » Fixed

Committed #5. Thanks everyone!

  • Steven Jones committed b1481f4 on 6.x-2.x
    Issue #2246913 by Steven Jones | Garry Egan: Fixed Unknown column '...

Status: Fixed » Needs work

The last submitted patch, 5: unknown_column-2246913-5.patch, failed testing.

Steven Jones’s picture

Status: Needs work » Fixed

Nah, that's fine testbot, I already committed it.

Status: Fixed » Closed (fixed)

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