Re: NDB tables with character primary key replicate only partially

Jonas Oreland <[email protected]> Wed, 13 Oct 2004 21:15:06 +0200
Newsgroups gmane.comp.db.mysql.bugs
Message-ID <[email protected]>
Hi,

I've tried to reproduce you problem, but I can't.

How long time does pass between mysql1-commit and mysql2-select?

/Jonas

Giuseppe Maxia wrote:
> I was testing transactions in NDB tables, and I came across this problem.
> 
> Bug observed using MySQL 4.1.4-max, with the simple configuration shown 
> in MySQL manual
> (http://dev.mysql.com/doc/mysql/en/MySQL_Cluster_quick.html)
> 
> Summary: With two MySQL nodes open, create one table in the first node, 
> giving it
> a primary key of type CHAR.
> In the second node, the table is replicated.
> Then open a transaction, and insert two records in the table.
> When the transaction is committed, the second node will only see one 
> record.
> 
> If you close the second session and reopen it, then all the records are 
> shown.
> 
> To repeat, follow this timeline, issuing the commands in node1 and node2
> in the same order they are shown.
> 
> (NODE 1)                                 (NODE 2)
> 
> mysql1> set autocommit = 0;              mysql2> set autocommit = 0;
> Query OK, 0 rows affected (0.00 sec)     Query OK, 0 rows affected (0.00 
> sec)
> 
> mysql1> create table uno (c char(10)
>      -> not null primary key)
>      -> engine=ndb;
> Query OK, 0 rows affected (0.55 sec)
>                                          mysql2> show create table uno\G
>                                          ************* 1. row *************
>                                                 Table: uno
>                                          Create Table: CREATE TABLE `uno` (
>                                           `c` char(10) NOT NULL default '',
>                                            PRIMARY KEY  (`c`)
>                                          ) ENGINE=ndbcluster
>                                            DEFAULT CHARSET=latin1
>                                          1 row in set (0.01 sec)
> 
> mysql1> begin;
> Query OK, 0 rows affected (0.00 sec)
> 
> mysql1> insert into uno values
>      -> ('aaa'), ('bbb');
> Query OK, 2 rows affected (0.00 sec)
> Records: 2  Duplicates: 0  Warnings: 0
> 
>                                          mysql2> select * from uno;
>                                          Empty set (0.00 sec)
> mysql1> commit;
> Query OK, 0 rows affected (0.00 sec)
> 
> mysql1> select * from uno;               mysql2> select * from uno;
> +-----+                                  +-----+
> | c   |                                  | c   |
> +-----+                                  +-----+
> | bbb |                                  | bbb |
> | aaa |                                  +-----+
> +-----+                                  1 row in set (0.01 sec)
> 2 rows in set (0.00 sec)
> 
> 
> 


-- 
Jonas Oreland, Software Engineer
MySQL AB, www.mysql.com

-- 
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe:    http://lists.mysql.com/[email protected]