1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge 10.4 into 10.5

This commit is contained in:
Marko Mäkelä
2022-08-30 12:29:04 +03:00
16 changed files with 341 additions and 38 deletions

View File

@@ -1,4 +1,5 @@
INSTALL PLUGIN simple_parser SONAME 'mypluglib';
FLUSH TABLES;
# Test Part 1: Grammar Test
CREATE TABLE articles (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
@@ -31,7 +32,7 @@ INSERT INTO articles (title, body) VALUES
('1001 MySQL Tricks','How to use full-text search engine'),
('Go MySQL Tricks','How to use full text search engine');
SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('mysql');
MATCH(title, body) AGAINST('mysql') ORDER BY id;
id title body
1 MySQL Tutorial DBMS stands for MySQL DataBase ...
2 How To Use MySQL Well After you went through a ...
@@ -68,7 +69,7 @@ INSERT INTO articles (title, body) VALUES
('Go MySQL Tricks','How to use full text search engine');
ALTER TABLE articles ADD FULLTEXT INDEX (title, body) WITH PARSER simple_parser;
SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('mysql');
MATCH(title, body) AGAINST('mysql') ORDER BY id;
id title body
1 MySQL Tutorial DBMS stands for MySQL DataBase ...
2 How To Use MySQL Well After you went through a ...
@@ -88,21 +89,23 @@ MATCH(title, body) AGAINST('full text');
id title body
5 Go MySQL Tricks How to use full text search engine
SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('full-text' WITH QUERY EXPANSION);
MATCH(title, body) AGAINST('full-text' WITH QUERY EXPANSION)
ORDER BY id;
id title body
1 MySQL Tutorial DBMS stands for MySQL DataBase ...
2 How To Use MySQL Well After you went through a ...
3 Optimizing MySQL In this tutorial we will show ...
4 1001 MySQL Tricks How to use full-text search engine
5 Go MySQL Tricks How to use full text search engine
2 How To Use MySQL Well After you went through a ...
1 MySQL Tutorial DBMS stands for MySQL DataBase ...
3 Optimizing MySQL In this tutorial we will show ...
SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('full text' WITH QUERY EXPANSION);
MATCH(title, body) AGAINST('full text' WITH QUERY EXPANSION)
ORDER BY id;
id title body
5 Go MySQL Tricks How to use full text search engine
4 1001 MySQL Tricks How to use full-text search engine
2 How To Use MySQL Well After you went through a ...
1 MySQL Tutorial DBMS stands for MySQL DataBase ...
2 How To Use MySQL Well After you went through a ...
3 Optimizing MySQL In this tutorial we will show ...
4 1001 MySQL Tricks How to use full-text search engine
5 Go MySQL Tricks How to use full text search engine
SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('"mysql database"' IN BOOLEAN MODE);
id title body
@@ -137,27 +140,27 @@ INSERT INTO articles (title, body) VALUES
('Go MariaDB Tricks','How to use full text search engine');
# restart
SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('MySQL');
MATCH(title, body) AGAINST('MySQL') ORDER BY id;
id title body
6 MySQL Tutorial DBMS stands for MySQL DataBase ...
7 How To Use MySQL Well After you went through a ...
8 Optimizing MySQL In this tutorial we will show ...
9 1001 MySQL Tricks How to use full-text search engine
SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('tutorial');
MATCH(title, body) AGAINST('tutorial') ORDER BY id;
id title body
6 MySQL Tutorial DBMS stands for MySQL DataBase ...
8 Optimizing MySQL In this tutorial we will show ...
SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('Tricks');
MATCH(title, body) AGAINST('Tricks') ORDER BY id;
id title body
9 1001 MySQL Tricks How to use full-text search engine
10 Go MariaDB Tricks How to use full text search engine
SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('full text search');
MATCH(title, body) AGAINST('full text search') ORDER BY id;
id title body
10 Go MariaDB Tricks How to use full text search engine
9 1001 MySQL Tricks How to use full-text search engine
10 Go MariaDB Tricks How to use full text search engine
SELECT COUNT(*) FROM articles;
COUNT(*)
5
@@ -185,7 +188,8 @@ UNINSTALL PLUGIN simple_parser;
Warnings:
Warning 1620 Plugin is busy and will be uninstalled on shutdown
SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('mysql');
MATCH(title, body) AGAINST('mysql')
ORDER BY id;
id title body
1 MySQL Tutorial DBMS stands for MySQL DataBase ...
2 How To Use MySQL Well After you went through a ...

View File

@@ -6,6 +6,9 @@
# Install fts parser plugin
INSTALL PLUGIN simple_parser SONAME 'mypluglib';
# Flush the table mysql.plugin in case the server shutdown would time out.
FLUSH TABLES;
-- echo # Test Part 1: Grammar Test
# Create a myisam table and alter it to innodb table
CREATE TABLE articles (
@@ -52,7 +55,7 @@ INSERT INTO articles (title, body) VALUES
# Simple term search
SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('mysql');
MATCH(title, body) AGAINST('mysql') ORDER BY id;
# Test stopword and word len less than fts_min_token_size
SELECT * FROM articles WHERE
@@ -90,7 +93,7 @@ ALTER TABLE articles ADD FULLTEXT INDEX (title, body) WITH PARSER simple_parser;
# Simple term search
SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('mysql');
MATCH(title, body) AGAINST('mysql') ORDER BY id;
# Test stopword and word len less than fts_min_token_size
SELECT * FROM articles WHERE
@@ -105,10 +108,12 @@ SELECT * FROM articles WHERE
# Test query expansion
SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('full-text' WITH QUERY EXPANSION);
MATCH(title, body) AGAINST('full-text' WITH QUERY EXPANSION)
ORDER BY id;
SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('full text' WITH QUERY EXPANSION);
MATCH(title, body) AGAINST('full text' WITH QUERY EXPANSION)
ORDER BY id;
# No result here, we get '"mysql' 'database"' by simple parser
SELECT * FROM articles WHERE
@@ -150,13 +155,13 @@ INSERT INTO articles (title, body) VALUES
--source include/restart_mysqld.inc
SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('MySQL');
MATCH(title, body) AGAINST('MySQL') ORDER BY id;
SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('tutorial');
MATCH(title, body) AGAINST('tutorial') ORDER BY id;
SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('Tricks');
MATCH(title, body) AGAINST('Tricks') ORDER BY id;
SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('full text search');
MATCH(title, body) AGAINST('full text search') ORDER BY id;
SELECT COUNT(*) FROM articles;
INSERT INTO articles (title, body) VALUES ('111', '1234 1234 1234');
@@ -193,7 +198,8 @@ UNINSTALL PLUGIN simple_parser;
# Simple term search
SELECT * FROM articles WHERE
MATCH(title, body) AGAINST('mysql');
MATCH(title, body) AGAINST('mysql')
ORDER BY id;
# Test stopword and word len less than fts_min_token_size
SELECT * FROM articles WHERE