Upon the creation of a new user account, post-login and on every single page afterwards the following error is displayed:
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 ') ORDER BY n.nid DESC LIMIT 0, 7' at line 1 query: SELECT n.nid, n.status, n.type, u.uid, u.name, n.created, n.title FROM 463_suckit_node n INNER JOIN 463_users u ON n.uid = u.uid WHERE n.status = 1 AND n.uid IN () ORDER BY n.nid DESC LIMIT 0, 7 in /home/public_html/includes/database.mysql.inc on line 108.
The prefixes listed here:
463_ is the primary site
463_suckit_ is the secondary site.
What's going on? Any fixes/suggestions/ideas, anyone?
Comments
Comment #1
SpriteGF commentedI've tried reproducing your bug with a fresh install of Drupal 4.7-beta3 on a system running MySQL 4.1.14-standard. The table prefix "463_" seems to be a legal name accepted in MySQL, and I do not get the same error that you do. I'm baffled as to why underscores were left out in your SQL query, and thought it might have been a MySQL issue.
How can I reproduce this bug? Can you include details such as what you modified in database.mysql, your MySQL version, etc.?
Thank you!
Comment #2
flufftronix commentedI was able to alleviate the error by commenting out line 108. I don't think this is a long-term fix, but it works for now.
To reproduce it this bug, you'd have to create two Drupal sites sharing roles, users, sessions, etc. Then create a user on the secondary site, and upon logging in there are problems on every page, I believe having to do with synching the mainsite_users and subsite_users tables. The version of MYSQL being used is MySQL 4.0.24_Debian-10sarge1
Comment #3
diroussel commentedI don't this is directly a drupal bug, buy mysql. Note this:
"Unquoted names can consist of any alphanumeric characters in the server's default character set, plus the characters '_' and '$'. Names can start with any character that is legal in a name, including a digit. However, a name cannot consist entirely of digits because that would make it indistinguishable from a number. MySQL's support for names that begin with a number is somewhat unusual among database systems. If you use such a name, be particularly careful of names containing an 'E' or 'e' because those characters can lead to ambiguous expressions. For example, the expression 23e + 14 (with spaces surrounding the '+' sign) means column 23e plus the number 14, but what about 23e+14? Does it mean the same thing, or is it a number in scientific notation?"
from http://www.informit.com/articles/article.asp?p=30875&rl=1
A possible fix would be to quote every table name before querying.
A better solution would be to start your table prefix with an a-z char.
Comment #4
Egon Bianchet commentedDid you you try the fix suggested by diroussel? Re-open the issue if it doesn't work