Bug #41099 CREATE/ALTER TABLE fails when using NDBCLUSTER engine and CHARSET=utf8
Description:
mysqld Ver 5.1.23-ndb-6.2.15-cluster-gpl for redhat-linux-gnu on i686 (MySQL Cluster Server (GPL))
MySQL distrib mysql-5.1.23 ndb-6.2.15, for redhat-linux-gnu (i686)
We cannot create a table with the ndbcluster engine and utf8 charset that has >1 columns of the type text or mediumtext.
How to repeat:
CREATE DATABASE example;
use example;
DROP TABLE IF EXISTS `menu_router`;
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=NDBCLUSTER DEFAULT CHARSET=utf8;
produces the following error:
ERROR 1005 (HY000): Can't create table 'example.menu_router' (errno: 140)
Suggested fix:
It creates the table if only one column is of the type text or mediumtext.
e.g.
CREATE DATABASE example;
use example;
DROP TABLE IF EXISTS `menu_router`;
CREATE TABLE `menu_router` (
`path` varchar(255) NOT NULL default '',
`load_functions` text NOT NULL,
`access_callback` varchar(255) NOT NULL default '',
`page_callback` varchar(255) NOT NULL default '',
`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 '',
`position` varchar(255) NOT NULL default '',
`weight` int(11) NOT NULL default '0',
PRIMARY KEY (`path`),
KEY `fit` (`fit`),
KEY `tab_parent` (`tab_parent`)
) ENGINE=NDBCLUSTER DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (3.89 sec)
Other workaround is to change ENGINE to MyISAM or change DEFAULT CHARSET to latin1.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.050 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.