here is copy of schema, is this a bug, or if it is usser error, how do i fix?
nodequeue_roles
indexes {nodequeue_roles}_qid_idx: missing in database
indexes {nodequeue_roles}_rid_idx: missing in database
column rid: key 'not null' not set, ignoring inspected default value
indexes nodequeue_roles_qid_idx: unexpected (not an error)
indexes nodequeue_roles_rid_idx: unexpected (not an error)
nodequeue_types
indexes {nodequeue_types}_qid_idx: missing in database
indexes {nodequeue_types}_type_idx: missing in database
column type: key 'not null' not set, ignoring inspected default value
indexes nodequeue_types_qid_idx: unexpected (not an error)
indexes nodequeue_types_type_idx: unexpected (not an error)
nodequeue_subqueue
indexes {nodequeue_subqueue}_qid_idx: missing in database
indexes {nodequeue_subqueue}_reference_idx: missing in database
indexes {nodequeue_subqueue}_title_idx: missing in database
column reference: key 'not null' not set, ignoring inspected default value
column title: key 'not null' not set, ignoring inspected default value
indexes nodequeue_subqueue_qid_idx: unexpected (not an error)
indexes nodequeue_subqueue_reference_idx: unexpected (not an error)
indexes nodequeue_subqueue_title_idx: unexpected (not an error)
nodequeue_nodes
indexes {nodequeue_nodes}_sqid_idx: missing in database
indexes {nodequeue_subqueue}_nid_idx: missing in database
column nid: key 'not null' not set, ignoring inspected default value
column position: key 'not null' not set, ignoring inspected default value
indexes nodequeue_nodes_sqid_idx: unexpected (not an error)
indexes nodequeue_subqueue_nid_idx: unexpected (not an error)
Comments
Comment #1
merlinofchaos commentedI have no idea what this is.
Comment #2
socki commentedI've run into this problem as well.
I'm not sure what caused it, but it seems that somehow, maybe through uninstall and re-install of the module, the creation of the sequences in Postgres get messed up.
My guess is that if you go look at the sequences that exists, you will find two exist for each. For example:
nodequeue_nodes_sqid_idx
nodequeue_nodes_sqid_idx1
The issue is that the database is probably using 'nodequeue_nodes_sqid_idx1' but drupal is explicitly calling 'nodequeue_nodes_sqid_idx' and hence the problem
The way i was able to fix it was to rename/delete the original sequence... in this case 'nodequeue_nodes_sqid_idx' and then rename the second sequence (ie. 'nodequeue_nodes_sqid_idx1') to be the original name (remove the '1').
Hope this helps!
Comment #3
ezra-g commentedIt would be great to have someone with Postgres experience look at this and offer a patch or more direction towards a solution. @socki: is that something you can do?
Thanks!
Comment #4
cedarm commentedIt's difficult to say what state the database got into without actually looking through a pg_dump, since sequences and indices aren't something usually dealt with directly in Drupal.
If someone can come up with steps to reproduce this problem, or provide a pg_dump of the database in question, I'd be willing to look at it.
... after looking at the code a bit, this is probably only an issue with the D5 version, and possibly updating from D5 to the D6 version.
Comment #5
ezra-g commentedI'm wondering if this could be at least in part a manifestation of the problem fixed in #351886: Auto-increment needed for D6 ?. If checkout nodequeue from CVS (or download the development snapshot when it's been re-rolled with that commit) and run nodequeue_update_6002 (from update.php), does that resolve the issue?
Comment #6
ezra-g commentedComment #7
damienmckennaI'm experiencing the same errors and I'm using MySQL. I've fixed a few small issues in the install file to clarify defaults that triggered some of the lines above, see the file attached.
Comment #8
ezra-g commentedMarking as needs review -- I didn't see this.
Comment #9
ezra-g commentedComment #10
ezra-g commentedThanks for taking the time to roll this patch! On first glance it seems strange that the sqid primary key would have 'not null' => FALSE but indeed the core node.nid column, also a primary key, defaults to null.
This is applied. Thanks again!
Comment #11
cedarm commentedBTW, the whole primary key default null is probably just a mysqlism. They have some pretty screwball concepts when it comes to nulls and default values.
Comment #13
tuffnatty commentedIMHO the real fix for this problem is to change indexes definitions in hook_schema() from
to
as these prefixes and postfixes are added automagically by Drupal. Also, fix db_add_index() calls in the same way. Also, probably the update process should remove indices with wrong name created by older versions of hook_schema(), like "nodequeue_roles_nodequeue_roles_qid_idx_idx", and by db_add_index() calls in older updates, like "nodequeue_roles_nodequeue_roles_qid_idx" (without extra _idx).
Comment #14
ezra-g commentedThanks for pointing this out. Could you submit a patch :)?
Comment #15
manarth commentedI see the bug report's a little old, but it's an issue with my build too, so I thought I'd resurrect it...and here's a patch ;-)
(rolled against 6.x-2.7)
Comment #16
mrshark commentedconfirm that last patch solved issues...
cd /var/www/sites/all/modules/nodequeue/
wget http://drupal.org/files/issues/nodequeue-286918-fix_schema_mismatch.patch
patch -p0 < nodequeue-286918-fix_schema_mismatch.patch
disabled module, uninstalled it, reinstalled, no more mismatches
Nodequeue: 6.x-2.9
Comment #17
zinkzinkzink commentedNoticed the same table mismatch after installing the schema module. I don't want to reinstall nodequeue, so I made a quickfix, just using phpmyadmin.
Comment #18
jaydub commentedApplied patch in #15 and confirmed that patched .install creates indexes as required and Schema module no longer reports mismatches.
Comment #19
jp.stacey commentedNice work tracking down and fixing, manarth. In addition, the patch in 15 needs a hook_update_N added to it, or merely upgrading to the next version of Nodequeue won't fix the site's database.
Please find a combined patch attached, which both fixes the hook_schema() and also adds a hook_update_6006(). This hook deletes the incorrectly named indexes and adds ones as per the #15 patch.
Comment #20
jp.stacey commentedComment #21
ezra-g commentedLooks good. Committed. Thanks! http://drupal.org/cvs?commit=420672
Comment #23
lyricnz commentedI had this issue too. Suggest it's worth rolling a release to get this fix out there.
Comment #24
lyricnz commentedReopening: hook_update_6006() needs to return $results. Renamed it to $ret for consistency.
Comment #25
jaydub commentedPatch looks good and applies cleanly.
Comment #26
ezra-g commentedCommitted - thanks!
http://drupal.org/cvs?commit=463044
Comment #28
barbank commentedNot fixed for 7.0
All tables remain empty and error is generated because the tables cannot be located. I'm going to uninstall nodqueue until the issue is resoved.
{nodequeue_roles}
NODEQUEUE_ROLES
indexes {nodequeue_roles}_qid_idx: missing in database
indexes {nodequeue_roles}_rid_idx: missing in database
indexes nodequeue_roles_qid_idx: unexpected (not an error)
indexes nodequeue_roles_rid_idx: unexpected (not an error)
{nodequeue_types}
indexes {nodequeue_types}_qid_idx: missing in database
indexes {nodequeue_types}_type_idx: missing in database
indexes nodequeue_types_qid_idx: unexpected (not an error)
indexes nodequeue_types_type_idx: unexpected (not an error)
{nodequeue_subqueue}
indexes {nodequeue_subqueue}_qid_idx: missing in database
indexes {nodequeue_subqueue}_reference_idx: missing in database
indexes {nodequeue_subqueue}_title_idx: missing in database
indexes nodequeue_subqueue_qid_idx: unexpected (not an error)
indexes nodequeue_subqueue_reference_idx: unexpected (not an error)
indexes nodequeue_subqueue_title_idx: unexpected (not an error)
{nodequeue_nodes}
indexes {nodequeue_nodes}_sqid_idx: missing in database
indexes {nodequeue_subqueue}_nid_idx: missing in database
indexes {nodequeue_nodes}_qid_nid_idx: missing in database
indexes nodequeue_nodes_qid_nid_idx: unexpected (not an error)
indexes nodequeue_nodes_sqid_idx: unexpected (not an error)
indexes nodequeue_subqueue_nid_idx: unexpected (not an error)
Comment #29
basicmagic.net commentedsubscribe
Comment #30
amateescu commentedPatches from #19 and #24 needs to be ported to 7.x.
Comment #31
lyricnz commentedComment #32
amateescu commented@lyricnz, thanks for the patch :) I renamed the hook_update_N() function to nodequeue_update_7200() as it is the first one in the 7.x-2.x branch and added a check if the indices weren't already renamed by upgrading from 6.x-2.x-dev to 7.x.
Commited attached patch to 7.x.
http://drupalcode.org/project/nodequeue.git/commit/11d0755