Bug #39625 current_timestamp not work
Submitted: 24 Sep 2008 9:53 Modified: 6 Oct 2008 8:54
Reporter: ws lee Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S1 (Critical)
Version:5.1.23-ndb-6.2.15 OS:Solaris
Assigned to: CPU Architecture:Any

[24 Sep 2008 9:53] ws lee
Description:
In Column property, Column DEFAULT CURRENT_TIMESTAMP is not work.

i am using 2 data node.
----------------
NoOfReplicas=2
----------------

How to repeat:
mysql> select version();
+-----------------------------------+
| version()                         |
+-----------------------------------+
| 5.1.23-ndb-6.2.15-cluster-gpl-log | 
+-----------------------------------+
1 row in set (0.00 sec)

mysql> delimiter //

mysql> CREATE TRIGGER trg1 AFTER DELETE ON test
    -> FOR EACH ROW
    -> BEGIN
    ->    INSERT INTO test_audit(id,created_t,modified_t,no)
    ->    VALUES(old.id,old.created_t,old.modified_t,old.no);
    -> END
    -> //
Query OK, 0 rows affected (0.00 sec)

mysql> delimiter ;

mysql> desc test;
+------------+-----------+------+-----+-------------------+-------+
| Field      | Type      | Null | Key | Default           | Extra |
+------------+-----------+------+-----+-------------------+-------+
| id         | int(11)   | NO   | MUL | NULL              |       | 
| created_t  | timestamp | NO   |     | CURRENT_TIMESTAMP |       | 
| modified_t | timestamp | YES  |     | NULL              |       | 
| no         | int(11)   | NO   | MUL | NULL              |       | 
+------------+-----------+------+-----+-------------------+-------+
4 rows in set (0.00 sec)

mysql> insert into test(id,no) values(9999,9999);
Query OK, 1 row affected (0.01 sec)

mysql> select * from test;
+------+---------------------+------------+------+
| id   | created_t           | modified_t | no   |
+------+---------------------+------------+------+
| 9999 | 0000-00-00 00:00:00 |       NULL | 9999 | 
+------+---------------------+------------+------+
1 row in set (0.00 sec)

In created_t inserted 0000-00-00 00:00:00 value althow CURRENT_TIMESTAMP in default.

it maybe absolutely bug.
please check!
[24 Sep 2008 9:59] ws lee
I am sorry.
Upper How to repeat is misspelling.

See below.
this is correct.

How to repeat:
mysql> select version();
+-----------------------------------+
| version()                         |
+-----------------------------------+
| 5.1.23-ndb-6.2.15-cluster-gpl-log | 
+-----------------------------------+
1 row in set (0.00 sec)

mysql> delimiter //

mysql> CREATE TABLE `test` (
    ->   `id` int(11) NOT NULL,
    ->   `created_t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    ->   `modified_t` timestamp NULL DEFAULT NULL,
    ->   `no` int(11) NOT NULL,
    ->   KEY `id` (`id`),
    ->   KEY `no` (`no`)
    -> ) ENGINE=ndbcluster DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (1.46 sec)

mysql> delimiter ;

mysql> desc test;
+------------+-----------+------+-----+-------------------+-------+
| Field      | Type      | Null | Key | Default           | Extra |
+------------+-----------+------+-----+-------------------+-------+
| id         | int(11)   | NO   | MUL | NULL              |       | 
| created_t  | timestamp | NO   |     | CURRENT_TIMESTAMP |       | 
| modified_t | timestamp | YES  |     | NULL              |       | 
| no         | int(11)   | NO   | MUL | NULL              |       | 
+------------+-----------+------+-----+-------------------+-------+
4 rows in set (0.00 sec)

mysql> insert into test(id,no) values(9999,9999);
Query OK, 1 row affected (0.01 sec)

mysql> select * from test;
+------+---------------------+------------+------+
| id   | created_t           | modified_t | no   |
+------+---------------------+------------+------+
| 9999 | 0000-00-00 00:00:00 |       NULL | 9999 | 
+------+---------------------+------------+------+
1 row in set (0.00 sec)

In created_t inserted 0000-00-00 00:00:00 value althow CURRENT_TIMESTAMP in default.

it maybe absolutely bug.
please check!
[24 Sep 2008 20:58] Sveta Smirnova
Thank you for the report.

I can not repeat described behavior with version 5.1.27-ndb-6.3.17, although bug is repeatable with 5.1.23-ndb-6.2.15 Please consider to upgrade or wait next 6.2 release.
[6 Oct 2008 8:53] ws lee
To. Sveta Smirnova
Thanks your reply.

before upeer check, you need to below.

in my.cnf
ndb_index_stat_enable=1

please recheck!
[6 Oct 2008 8:54] ws lee
I am sorry.
ignore my upper comment.