summaryrefslogtreecommitdiff
path: root/storage/mroonga/mysql-test/mroonga/storage/t/update_virtual_column.test
blob: e0cb953d51dc9ba088968820553c95a85e766e7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Copyright(C) 2010 Tetsuro IKEDA
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

--source include/not_embedded.inc
--source ../../include/mroonga/have_mroonga.inc

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

# for virtual columns
CREATE TABLE t1 (c1 int, _id int);
INSERT INTO t1 VALUES(1,null);
INSERT INTO t1 VALUES(2,null);
INSERT INTO t1 VALUES(3,null);
SELECT * FROM t1;
--disable_warnings
SET sql_mode="";
--enable_warnings
# warning WARN_DATA_TRUNCATED
UPDATE t1 SET _id = 10 WHERE c1 = 1;
SELECT * FROM t1;
--disable_warnings
SET sql_mode="STRICT_ALL_TABLES";
--enable_warnings
# We can't use WARN_DATA_TRUNCATED here because "WXXX" isn't supported
# MySQL 5.5, 5.6 and MariaDB 5.6. MariaDB 10.0 only supports it.
# We share this test with all MySQL servers. So we use number here.
--error 1265
UPDATE t1 SET _id = 11 WHERE c1 = 1;
SELECT * FROM t1;
DROP TABLE t1;

SET sql_mode=DEFAULT;

--source ../../include/mroonga/have_mroonga_deinit.inc