Navigation Menu

Skip to content

Commit

Permalink
mysql57 test: set default value for timestamp explicitly
Browse files Browse the repository at this point in the history
Because MySQL 5.7 enables NO_ZERO_DATE by default. It disables DEFAULT 0.
  • Loading branch information
kou committed Apr 19, 2016
1 parent d1b204e commit 1cdfa7d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Expand Up @@ -2,17 +2,17 @@ DROP TABLE IF EXISTS diaries;
CREATE TABLE diaries (
id INT PRIMARY KEY AUTO_INCREMENT,
title TEXT,
created_at TIMESTAMP,
updated_at TIMESTAMP,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
KEY (updated_at)
) DEFAULT CHARSET UTF8;
SHOW CREATE TABLE diaries;
Table Create Table
diaries CREATE TABLE `diaries` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` text,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `updated_at` (`updated_at`)
) ENGINE=Mroonga DEFAULT CHARSET=utf8
Expand Down
6 changes: 3 additions & 3 deletions mysql-test/mroonga/storage/column/timestamp/t/with_index.test
@@ -1,4 +1,4 @@
# Copyright(C) 2012 Kouhei Sutou <kou@clear-code.com>
# Copyright(C) 2012-2016 Kouhei Sutou <kou@clear-code.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand All @@ -23,8 +23,8 @@ DROP TABLE IF EXISTS diaries;
CREATE TABLE diaries (
id INT PRIMARY KEY AUTO_INCREMENT,
title TEXT,
created_at TIMESTAMP,
updated_at TIMESTAMP,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
KEY (updated_at)
) DEFAULT CHARSET UTF8;
SHOW CREATE TABLE diaries;
Expand Down

0 comments on commit 1cdfa7d

Please sign in to comment.