Per dereine's request on #763650: PDOException: SQLSTATE[42S02], I'm creating an issue for a problem I'm having with the latest dev snapshot (Datestamp: 1270685932, April 8th, 2010). I've been having the issue since at least April 6th, 2010.

When creating a view with a field, I get a dialog box with the following error when I click update after adding the field:

An AJAX HTTP error occurred.
HTTP Result Code: 500
Debugging information follows.
Path: /admin/structure/views/ajax/preview/blog?render=overlay
StatusText: OK
ResponseText: PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= field_data_body.entity_id AND field_data_body.etid = '1'' at line 1: SELECT node.title AS node_title, field_data_body.entity_id AS field_data_body_entity_id, field_data_body.etid AS field_data_body_etid
FROM
{node} node
LEFT OUTER JOIN {field_data_body} field_data_body ON node. = field_data_body.entity_id AND field_data_body.etid = :views_join_condition_0; Array
(
[:views_join_condition_0] => 1
)
in views_plugin_pager->execute_count_query() (line 134 of /Users/mark/Sites/marktrapp.com/sites/all/modules/views/plugins/views_plugin_pager.inc).

I can save the view, but if I create a Page display and go to the view's page, I get the following error:

PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= field_data_body.entity_id AND field_data_body.etid = '1'' at line 1: SELECT node.title AS node_title, field_data_body.entity_id AS field_data_body_entity_id, field_data_body.etid AS field_data_body_etid FROM {node} node LEFT OUTER JOIN {field_data_body} field_data_body ON node. = field_data_body.entity_id AND field_data_body.etid = :views_join_condition_0; Array ( [:views_join_condition_0] => 1 ) in views_plugin_pager->execute_count_query() (line 134 of /Users/mark/Sites/marktrapp.com/sites/all/modules/views/plugins/views_plugin_pager.inc).

In addition, when I save the view, I get the following error 5 times:

Notice: Undefined index: entity keys in field_views_field_default_views_data() (line 66 of /Users/mark/Sites/marktrapp.com/sites/all/modules/views/modules/field.views.inc).

View export:

$view = new view;
$view->name = 'blog';
$view->description = '';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 3.0-alpha1;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */

/* Display: Defaults */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->display->display_options['access']['type'] = 'none';
$handler->display->display_options['cache']['type'] = 'none';
$handler->display->display_options['exposed_form']['type'] = 'basic';
$handler->display->display_options['pager']['type'] = 'full';
$handler->display->display_options['style_plugin'] = 'default';
$handler->display->display_options['row_plugin'] = 'fields';
/* Field: Node: Title */
$handler->display->display_options['fields']['title']['id'] = 'title';
$handler->display->display_options['fields']['title']['table'] = 'node';
$handler->display->display_options['fields']['title']['field'] = 'title';
$handler->display->display_options['fields']['title']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['title']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['title']['alter']['trim'] = 0;
$handler->display->display_options['fields']['title']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['title']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['title']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['title']['alter']['html'] = 0;
$handler->display->display_options['fields']['title']['hide_empty'] = 0;
$handler->display->display_options['fields']['title']['empty_zero'] = 0;
$handler->display->display_options['fields']['title']['link_to_node'] = 0;
/* Field: Fields: body */
$handler->display->display_options['fields']['entity_id']['id'] = 'entity_id';
$handler->display->display_options['fields']['entity_id']['table'] = 'field_data_body';
$handler->display->display_options['fields']['entity_id']['field'] = 'entity_id';
$handler->display->display_options['fields']['entity_id']['alter']['alter_text'] = 0;
$handler->display->display_options['fields']['entity_id']['alter']['make_link'] = 0;
$handler->display->display_options['fields']['entity_id']['alter']['trim'] = 0;
$handler->display->display_options['fields']['entity_id']['alter']['word_boundary'] = 1;
$handler->display->display_options['fields']['entity_id']['alter']['ellipsis'] = 1;
$handler->display->display_options['fields']['entity_id']['alter']['strip_tags'] = 0;
$handler->display->display_options['fields']['entity_id']['alter']['html'] = 0;
$handler->display->display_options['fields']['entity_id']['hide_empty'] = 0;
$handler->display->display_options['fields']['entity_id']['empty_zero'] = 0;

/* Display: Page */
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->display->display_options['path'] = 'blog'; 

Let me know if any other information would be helpful.

Comments

dawehner’s picture

Status: Active » Postponed (maintainer needs more info)

Please try out this with the latest drupal version.

I bet this is the problem, there was a case about changing something.

Mark Trapp’s picture

Status: Postponed (maintainer needs more info) » Fixed

Sorry for the late feedback; I finally had a chance to test this out. Updated to the latest dev snapshot of d7 and Views 3, and the problem went away. Thanks!

Status: Fixed » Closed (fixed)

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