Navigation Menu

Skip to content

Commit

Permalink
mysql57 test: follow default sql_mode change
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Apr 20, 2016
1 parent 1218d84 commit 97338d3
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
@@ -0,0 +1,20 @@
DROP TABLE IF EXISTS diaries;
CREATE TABLE diaries (
id INT PRIMARY KEY AUTO_INCREMENT,
title TEXT,
created_at DATETIME
) 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` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=Mroonga DEFAULT CHARSET=utf8
INSERT INTO diaries (title, created_at)
VALUES ('2012', '2012');
ERROR 22007: Incorrect datetime value: '2012' for column 'created_at' at row 1
SELECT * FROM diaries;
id title created_at
DROP TABLE diaries;
@@ -0,0 +1,42 @@
# Copyright(C) 2012 Kentoku SHIBA
# Copyright(C) 2014 Kenji Maruyama <mmmaru777@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

--source ../../../../../../include/mroonga/skip_freebsd.inc
--source ../../../../../../include/mroonga/have_64bit.inc
--source ../../../../../../include/mroonga/have_mysql_57_or_later.inc
--source ../../../../../../include/mroonga/have_mroonga.inc

--disable_warnings
DROP TABLE IF EXISTS diaries;
--enable_warnings

CREATE TABLE diaries (
id INT PRIMARY KEY AUTO_INCREMENT,
title TEXT,
created_at DATETIME
) DEFAULT CHARSET UTF8;
SHOW CREATE TABLE diaries;

--error ER_TRUNCATED_WRONG_VALUE
INSERT INTO diaries (title, created_at)
VALUES ('2012', '2012');

SELECT * FROM diaries;

DROP TABLE diaries;

--source ../../../../../../include/mroonga/have_mroonga_deinit.inc
Expand Up @@ -18,6 +18,7 @@
--source ../../../../../../include/mroonga/skip_freebsd.inc
--source ../../../../../../include/mroonga/have_64bit.inc
--source ../../../../../../include/mroonga/have_version_56_or_later.inc
--source ../../../../../../include/mroonga/skip_mysql_57_or_later.inc
--source ../../../../../../include/mroonga/have_mroonga.inc

--disable_warnings
Expand Down

0 comments on commit 97338d3

Please sign in to comment.