MYSQL Syntax error on installation with pre-filled tables

alexanderpas - September 13, 2008 - 12:43
Project:Drupal
Version:6.x-dev
Component:install system
Category:bug report
Priority:normal
Assigned:Unassigned
Status:duplicate
Description
  • user warning: 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 fit DESC LIMIT 0, 1' at line 1 query: SELECT * FROM dev_menu_router WHERE path IN () ORDER BY fit DESC LIMIT 0, 1 in /path/to/drupal-6.4/includes/menu.inc on line 315.
  • user warning: 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 fit DESC LIMIT 0, 1' at line 1 query: SELECT * FROM dev_menu_router WHERE path IN () ORDER BY fit DESC LIMIT 0, 1 in /path/to/drupal-6.4/includes/menu.inc on line 315.

how to replicate:

  1. instal site normally
  2. remove all tables except users, roles and watchdog
  3. start re-installing site by going to example.com/install.php
  4. click "Install Drupal in English"
  5. Ignore the following errors, they're normal with this kind of installation.
    • table already exists
    • duplicate entry for key
    • headers already sent
  6. refresh page
  7. Voila! Error!

#1

alexanderpas - September 13, 2008 - 20:41

note that the table names are menu_router, i've prefixed them with dev_ in my development installation

#2

Damien Tournoud - September 13, 2008 - 23:34
Priority:critical» normal

That's really an edge case, so it cannot be critical.

I don't know anything about this case itself, and it will probably require more investigation.

#3

alexanderpas - September 14, 2008 - 18:57
Title:PHP error (MYSQL Syntax!) on install with pre-filled tables (multisite)» MYSQL Syntax error on installation with pre-filled tables
Priority:normal» critical

it may be an edge case, based on it only appearing on re-install with keeping database tables.

however, I consider it critical on the following basis:
- Completely and Consistently BREAKS the creation of new multisite sites with shared tables. (on already existing multisites!)
- Effectively BREAKS the ability to create any new multisite with shared database tables from drupal. (new multisites)
- This even happens when all tables are availble, except the variable table. (including non-multisites)
- It is a non-recoverable error!

#4

Damien Tournoud - September 14, 2008 - 19:35
Version:6.4» 6.x-dev
Priority:critical» normal

There is a simple workaround: install the new site first without any prefix, and then only set up the table sharing. As far as I know it's the only way that really works.

Thus, this can't be critical.

#5

alexanderpas - September 14, 2008 - 21:34

are you truly suggesting the following install path if you wish to keep certain tables?

first site:
0) setup database connection string
1) setup tables prefixes before install.
2) setup drupal as usual.
all following sites:
0) setup database connection string
1) do not setup tables prefixes before install.
2) install with a free table prefix.
3) setup tables prefixes after install.
4) remove unneeded tables
- if you remove one table too much, restart from 1

however, in drupal 5 the following was enough for all setups.
0) setup database connection string
1) setup tables prefixes before install.
2) setup drupal as usual (ignoring errors).

remember, this (semi-)functionality was already availble in a previous version of drupal, and has not been removed, therefor it should be critical, however, leaving it on normal for now, until consencus has been reached on the severity of this issue.

#6

alexanderpas - September 14, 2008 - 22:22
Status:active» duplicate

okay, this froblem is solved with patch patch #1 of #261148: Menu first rebuild does not happen, marking this one as duplicate

 
 

Drupal is a registered trademark of Dries Buytaert.