Upon trying to use the MySQL 5.0 Cluster (ndbcluster engine), it seems that tables that are both using a utf8 charset and that has >1 columns of the type text or mediumtext fails to convert. MySQL reported this as not a bug, but a limitation of the NDB Engine.
CREATE TABLE `menu_router` (
`path` varchar(255) NOT NULL default '',
`load_functions` text NOT NULL,
`to_arg_functions` text NOT NULL,
`access_callback` varchar(255) NOT NULL default '',
`access_arguments` text,
`page_callback` varchar(255) NOT NULL default '',
`page_arguments` text,
`fit` int(11) NOT NULL default '0',
`number_parts` smallint(6) NOT NULL default '0',
`tab_parent` varchar(255) NOT NULL default '',
`tab_root` varchar(255) NOT NULL default '',
`title` varchar(255) NOT NULL default '',
`title_callback` varchar(255) NOT NULL default '',
`title_arguments` varchar(255) NOT NULL default '',
`type` int(11) NOT NULL default '0',
`block_callback` varchar(255) NOT NULL default '',
`description` text NOT NULL,
`position` varchar(255) NOT NULL default '',
`weight` int(11) NOT NULL default '0',
`file` mediumtext,
PRIMARY KEY (`path`),
KEY `fit` (`fit`),
KEY `tab_parent` (`tab_parent`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Suggested fix:
The alter table will work if only one column is of the type text or mediumtext.
Reference:
http://dev.mysql.com/doc/refman/5.0/en/mysql-cluster-limitations-databas...
Comments
Comment #1
alanburke commentedSubscribe...
Hit this as well.
I got it installed by manually creating the table.
It seemed to work well... but then I hit errors like
Comment #2
damien tournoud commentedThat's a pretty harsh limitation of the engine. Can you point me to where it is documented?
Comment #3
SwampcritterCREATE/ALTER TABLE fails when using NDBCLUSTER engine and CHARSET=utf8
http://bugs.mysql.com/bug.php?id=41099
Limits Associated with Database Objects in MySQL Cluster
http://dev.mysql.com/doc/refman/5.0/en/mysql-cluster-limitations-databas...
Comment #4
alanburke commentedComment #5
damien tournoud commentedWe could probably make this table use only one text column. Anyway, this is not a bug, but a feature request. Moving to Drupal 7.
Comment #6
damien tournoud commentedI clarified that Drupal doesn't support NDB tables in the requirements page. [1]
[1] http://drupal.org/node/270/revisions/view/519412/577658
Comment #7
coderintherye commentedCould this be fixed by changing other columns to be tinytext instead of text? Since you didn't mention tinytext not sure if it is a limitation. The link to the mysql ndb limitation page isn't really clear on the limitation.
Comment #8
coderintherye commentedOk so there are two ways to fix this, change schema of menu_router either by changing DEFAULT CHARSET from utf8 to latin1 or you can mess with the sizes of each data type in each column. I explain more in my blog post on setting up Drupal on ndbcluster: http://www.coderintherye.com/drupal-mysql-cluster-ndbcluster-high-availa...
I'm hesitant to provide a patch, cause I don't believe setting to latin1 is going to work as a general solution, because if user used a utf8 character in a menu name then this would probably break. The other solution is also not a general solution because if one was not careful to limit the size of the menu names/function calls/urls/etc. then they would probably overfill the limit.
menu_router is a bloated table, and in some past installs I have had mysql dumps fail to export the menu_router table or to fully import it even on regular MyISAM table.
So here is my proposed solution, let's take a logical look at menu_router and see how we can split it into multiple tables for Drupal 8. Perhaps we could take all the _callback columns and put them into a menu_callbacks table and take all the _arguments columns and put them into a menu_arguments table. Both of those tables would share the path key. This should put us under the 8kb row length limit for ndbcluster and also make menu_router more manageable size for all users. This is just a first suggestion and I hope we can consider doing this. Dries mentioned in his blog this was a possibility, but it will require a lot of work.
Comment #9
coderintherye commentedI'm going to create a separate request but wanted to note here for those doing ndbcluster that you will also need to remove the key of 'source' on locale_sources table if using it because you can't make a KEY of BLOB type in ndbcluster.
Comment #10
SwampcritterMySQL reported this as not a bug, but a limitation of the NDB Engine.