Closed (fixed)
Project:
Drush
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Apr 2010 at 17:47 UTC
Updated:
30 Jun 2010 at 13:00 UTC
Jump to comment: Most recent file
Hi guys.
I just bumped into error mentioned above, here is complete debug data:
% drush dis views -d
Drush bootstrap phase : _drush_bootstrap_drupal_root() [0.03 sec, 2.67 MB] [bootstrap]
Initialized Drupal 6.16 root directory at /www/sites/www.example.com [0.04 sec, 3.42 MB] [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_site() [0.05 sec, 3.46 MB] [bootstrap]
Initialized Drupal site default at sites/default [0.06 sec, 3.56 MB] [notice]
Drush bootstrap phase : _drush_bootstrap_drupal_configuration() [0.07 sec, 3.59 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_database() [0.08 sec, 3.6 MB] [bootstrap]
Successfully connected to the Drupal database. [0.08 sec, 3.6 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_full() [0.09 sec, 3.82 MB] [bootstrap]
Drush bootstrap phase : _drush_bootstrap_drupal_login() [0.24 sec, 17.07 MB] [bootstrap]
Found command: pm-disable (commandfile=pm) [0.25 sec, 17.25 MB] [bootstrap]
Including version specific file : /home/users/mm/opt/drush/commands/core/drupal/environment_6.inc [0.25 sec, 17.26 MB] [notice]
The following projects will be disabled: views, views_export, views_ui
Do you really want to continue? (y/n): y
Including version specific file : /home/users/mm/opt/drush/commands/core/drupal/environment_6.inc [9.01 sec, 24.4 MB] [notice]
WD php: 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 '_export, 'views'_ui)' at lin1 [error]
query: SELECT name, status FROM system WHERE name IN ('views', 'views'_export, 'views'_ui) in /home/users/mm/opt/drush/includes/drush.inc on line 349. [9.01 sec, 24.41 MB]
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 '_export, 'views'_ui)' at line 1 [error]
query: SELECT name, status FROM system WHERE name IN ('views', 'views'_export, 'views'_ui) in
/home/users/mm/opt/drush/includes/drush.inc on line 349. [9.01 sec, 24.18 MB]
An error occurred at function : drush_pm_disable [9.01 sec, 24.18 MB] [error]
Command dispatch complete [9.01 sec, 24.17 MB] [notice]
Timer Cum (sec) Count Avg (msec)
page 8.941 1 8940.57
Peak memory usage was 25.63 MB [9.01 sec, 24.17 MB] [memory]This also occur when you run drush en views views_export views_ui command.
Modules are actually disabled / enabled, but you still get this ugly error. :(
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 764800.patch | 1.2 KB | jonhattan |
| #3 | 764800.patch | 695 bytes | jonhattan |
Comments
Comment #1
xurizaemonMore debug output from enabling a (custom, features-generated) module with dependencies on several other contrib modules today.
Complains about detected recursion in array_merge_recursive() (it appears this aspect may be unrelated to underscores, as I see this when enabling modules without underscores).
Then produces SQL of the form
SELECT name, status FROM main_system WHERE name IN ('aug_features', 'activitystream', 'emvideo', 'features', 'imagecache', 'imagefield', 'kml', 'location_cck', 'views_coda', 'viewscarousel', 'emfield', 'emvideo'0, 'emvideo'1, 'emvideo'2, 'emvideo'3)Full output:
I am in a good position to replicate this issue if further information is required.
@mariomaric, what led you to the conclusion that underscores are part of the issue here? (The above example appears to support this assertion.)
Comment #2
izkreny commentedOops, sorry, wrong assumption.
As I can see from now (after little bit more testing and yours feedback), it is related to enabling / disabling modules that has dependencies on other modules (so I changed issue title).
I can also confirm that this problem is not present in 6.x-3.0-rc1, it occurs in 6.x-3.0-rc2 version (and above).
Comment #3
jonhattanI've traced down the bug to happen when the final list of projects to en/dis contain projects whose name is a prefix of another project(s) in the list. That is
drush pm-enable views views_uiassuming both modules are disabled (or viceversa).The bug can be reproduced on its basis with:
It happens because the $args passed from pm_enable/disable to drush_db_select() has a form with key = value:
Attached is a fix based on forcing to use always numeric keys.
Comment #4
moshe weitzman commentednice research ... could we rephrase '# grant $i is not a prefix of $value'. not sure what that means.
Comment #5
jonhattanIn fact the comment is wrong.
New comment:
I'm not good enough with english. Alter it if you consider so.
Comment #6
jonhattanIn fact the comment is wrong.
New comment:
I'm not good enough with english. Alter it if you consider so.
Comment #7
moshe weitzman commentedcomitted. thx.
Comment #9
guidot commentedI still get these errors with latest HEAD:
In this case the list does not contain projects whose name is a prefix of another project in that list.
Comment #10
jonhattanIt happens when the number of projects is greater than 10.
Attached patch enforces unique keys by zero-padding the keys on the left so they will be 00..09,10 instead of 0..9,10.
Comment #11
guidot commentedPatch in #10 works as advertised with more than 10 projects. Thanks jonhattan!
Comment #12
moshe weitzman commentedcommitted. thanks.