Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Running
D7
Views 7.x-3.x-dev (2011-May-08)
Chaos tool suite 7.x-1.x-dev (2011-May-06)
the following debug message is displayed on every page:
'Exception: SQLSTATE[21000]: Cardinality violation: 1241 Operand should contain 1 column(s)'
in views_plugin_query_default->execute() (line 1362 of /usr/www/users/pminty/clients/niin/sites/all/modules/views/plugins/views_plugin_query_default.inc).
Comments
Comment #1
dawehnerCan you try to find out which view causes this problem and post it here?
Additional the full sql query would help, foo.
It's hard to fix such problems if you can't give us informations how to reproduce it.
Comment #2
drupalboy001 CreditAttribution: drupalboy001 commentedMore details.
The debug message is on every page of the website (even the login page). It appeared after upgrading to the DEV versions of Ctools, Views, Date and Calendar. No view was re-configured after the upgrade. This bug does not appear to be associated with any specific view. Clearing all Caches has no effect.
Turning on DEVEL tracking gives the following information for the site home page:
and
Comment #3
esmerel CreditAttribution: esmerel commentedComment #4
merlinofchaos CreditAttribution: merlinofchaos commentedYou need to figure out which view is doing that and paste the query available in the view preview. You may need to enable showing the query in the settings. Unfortunately we are not going to be able to sift through all the queries on a page and figure out which one might or might not have been generated when that error was printed. Worse, if the query wasn't actually executed it may not appear in the list anyway.
Comment #5
Stephane Bouillet CreditAttribution: Stephane Bouillet commentedHello
as for me (same problem), I've just gone in the edit page of my different views, and check some filters (no double for ex.), and gone in some filter, re-reccord ("apply") the filter, reccord the view, and check if it works.
It usually works for me after this.
[EDIT]= for me, it was the filter applied on the date (working with the date module) that needed to be reccorded one time.
Comment #6
esmerel CreditAttribution: esmerel commentedComment #7
mgiffordI'm getting multiple queries with
SELECT filename FROM registry WHERE name = :name AND type = :type
when looking at devel's query display.I don't know where the problem lies, but finding it quite difficult to track down the loops.
How many times should one see code like I've included be loaded in a single page? I'd hope only once or twice.
Comment #8
JThan CreditAttribution: JThan commentedI am getting this error, too.
I have node type with a list field. The list field has the values 1,2,3,4. I added an exposed grouped filter, where one can choose between showing the results for value 1 or the results for values 2, 3 and 4. Only if you choose the second option, the above error is shown.
The relevant SQL Part is
WHERE field_data_field_number.field_number_value = '2', '3', '4'
Guessing:
Should this be rewritten to
WHERE field_data_field_number.field_number_value IN ('2', '3', '4')
Comment #9
ylys CreditAttribution: ylys commentedI am getting this error too.
... AND (field_data_field_projectstatus.field_projectstatus_tid = '4', '5', '6', '7', '8', '9', '32', '10', '11', '12', '13') ...
JThan offers a good solution. but where we have to change it?
Comment #10
m1n0 CreditAttribution: m1n0 as a volunteer commentedI had the same issue as described in #8 and #9, but I just had to enable "allow multiple selections", save the view, disable that option again, save the view and the query is now correctly using "IN" operator. Seems like when the filter was created something went wrong.
Comment #11
eugis CreditAttribution: eugis commented#10 solution worked for me, thanks!
Comment #12
MLZRyes, #10 solution worked for me, thanks!!
Comment #13
viveksr2 CreditAttribution: viveksr2 as a volunteer commentedI am having the same issue, however i am having this while 'Allow Multiples' is enabled. I tried #10 but no luck. Also my issue is inconsistent i.e. sometimes it works perfectly fine and sometimes it throws errors. I have not put any query_alter hooks in my code.
Any help is appreciated!!
Comment #14
risforrocket CreditAttribution: risforrocket commented#10 worked for me!
Comment #15
nitheesh CreditAttribution: nitheesh at O8 commented#10 works fine for me.