"Fossies" - the Fresh Open Source Software Archive 
Member "mroonga-12.04/mysql-test/mroonga/wrapper/column/generated/virtual/t/add_fulltext_index.test" (6 Jun 2022, 1869 Bytes) of package /linux/misc/mroonga-12.04.tar.gz:
As a special service "Fossies" has tried to format the requested text file into HTML format (style:
standard) with prefixed line numbers.
Alternatively you can here
view or
download the uninterpreted source code file.
See also the last
Fossies "Diffs" side-by-side code changes report for "add_fulltext_index.test":
12.00_vs_12.02.
1 # Copyright(C) 2017 Naoya Murakami <naoya@createfield.com>
2 # Copyright(C) 2017 Kouhei Sutou <kou@clear-code.com>
3 #
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
8 #
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
18 --source ../../../../../include/mroonga/skip_mysql_8_0_or_later.inc
19 --source ../../../../../include/mroonga/have_innodb.inc
20 --source ../../../../../include/mroonga/have_mariadb_10_2_or_later.inc
21 --source ../../../../../include/mroonga/have_mroonga.inc
22
23 --disable_warnings
24 DROP TABLE IF EXISTS logs;
25 --enable_warnings
26
27 CREATE TABLE logs (
28 id INT PRIMARY KEY,
29 record JSON,
30 message VARCHAR(255) GENERATED ALWAYS AS (json_extract(`record`, '$.message')) VIRTUAL
31 ) ENGINE=Mroonga DEFAULT CHARSET=utf8mb4 COMMENT = 'ENGINE "InnoDB"';
32
33 INSERT INTO logs(id, record)
34 VALUES (1, '{"level": "info", "message": "start server"}');
35
36 ALTER TABLE logs ADD FULLTEXT INDEX (message);
37
38 INSERT INTO logs(id, record)
39 VALUES (2, '{"level": "info", "message": "start server"}');
40 INSERT INTO logs(id, record)
41 VALUES (3, '{"level": "warn", "message": "abort server"}');
42
43 SELECT * FROM logs WHERE MATCH(message) AGAINST('+start' IN BOOLEAN MODE);
44
45 DROP TABLE logs;
46
47 --source ../../../../../include/mroonga/have_mroonga_deinit.inc