Bug #7340 Problem for inserting data into the Text field on utf8
Submitted: 16 Dec 2004 1:52 Modified: 22 Dec 2004 13:20
Reporter: Brian Leung Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S2 (Serious)
Version:4.1.7-max OS:Linux (Red Hat Lunix Enterprise)
Assigned to: Pekka Nousiainen CPU Architecture:Any

[16 Dec 2004 1:52] Brian Leung
Description:
I installed the cluster 4.1.7 version and running in the following configuration :
machine a :
1 ndb_mgmd
1 ndbd
1 mysqld
machine b:
1 ndbd
1 mysqld

I created 14 tables in the database and migrated the existing data
from the current single node mysql into the cluster. And I found out that one of the tables in which
the structure is follows :

CREATE TABLE `enquiry_temp` (
  `ENQ_ID` int(11) unsigned NOT NULL auto_increment,
  `E_SUBJECT` varchar(200) NOT NULL default '',
  `E_FROM_DEPT` int(11) NOT NULL default '0',
  `E_TO_DEPT` int(11) NOT NULL default '0',
  `E_ENTRY_TS` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
  `E_MESSAGE` text NOT NULL,
  `M_ID` varchar(20) NOT NULL default '',
  `ENQ_READF` tinyint(1) NOT NULL default '0',
  PRIMARY KEY  (`ENQ_ID`)
) ENGINE=ndbcluster DEFAULT CHARSET=utf8;

When I attempted insert the record as follows; the database got hang and no responsed at all
INSERT INTO `enquiry_temp` (`ENQ_ID`,`E_SUBJECT`,`E_FROM_DEPT`,`E_TO_DEPT`,`E_ENTRY_TS`,`E_MESSAGE`,`M_ID`,`ENQ_READF`) VALUES
(254,'Enquiry','CEDD','CSB','2004-09-01 07:51:00',
'Dear Sirs,\n\nI\'ve sent you an enquiry yesterday on the requirement of reporting of private investment.\n\nPlease send your reply to me at the following email address:\n\ncfchow1962@yahoo.com.hk\n\nThanks.',
'cfchow',1);

I found out that if I inserted this record into the single node mysql, there is no problem. And also if the E_Message field is varchar(255), there is no problem to insert into this cluster table.

I wonder if there is issues on inserting data into the "Text" field in mysql clustering. Or if there is something I can do to get around this problem.

How to repeat:
the config.ini is as follows :

[ndbd default]
NoOfReplicas= 2
MaxNoOfOrderedIndexes=1000
DataMemory=1024M
IndexMemory=512M

[mysqld default]
[ndb_mgmd default]
[tcp default]

[ndbd]
HostName= a
DataDir: /var/lib/mysql-cluster/

[ndbd]
HostName= b
DataDir: /var/lib/mysql-cluster/

[ndb_mgmd]
HostName= a

[mysqld]
[mysqld]
[mysqld]

and I set the characterset database variables as follows :

------------+
| Variable_name            | Value                                                          |
+--------------------------+----------------------------------------------------------------+
| character_set_client     | utf8                                                           |
| character_set_connection | utf8                                                           |
| character_set_database   | utf8                                                           |
| character_set_results    | utf8                                                           |
| character_set_server     | utf8                                                           |
| character_set_system     | utf8                                                           |
| character_sets_dir       | /usr/local/mysql-max-4.1.7-pc-linux-i686/share/mysql/charsets/ |
+--------------------------+----------------------------------------------------------------+
[22 Dec 2004 13:20] Pekka Nousiainen
This is a bug with TEXT fields and certain multi-byte character sets.
It is now fixed in 4.1 source.