Navigation Menu

Skip to content

Commit

Permalink
mysql57 test: don't care order
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Apr 20, 2016
1 parent 1ca897f commit 7a2fe71
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
Expand Up @@ -10,15 +10,18 @@ FULLTEXT KEY (not_matched)
INSERT INTO texts VALUES (1, 'Hello1', 'World1');
INSERT INTO texts VALUES (2, 'Hello2', 'World2');
INSERT INTO texts VALUES (3, 'Hello3', 'World3');
SELECT id,
SELECT *
FROM (SELECT id,
matched,
not_matched,
MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE),
MATCH(not_matched) AGAINST('+Hello' IN BOOLEAN MODE)
FROM texts
WHERE MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE);
WHERE MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE))
AS searched_texts
ORDER BY id;
id matched not_matched MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE) MATCH(not_matched) AGAINST('+Hello' IN BOOLEAN MODE)
1 Hello1 World1 1 0
3 Hello3 World3 1 0
2 Hello2 World2 1 0
3 Hello3 World3 1 0
DROP TABLE texts;
Expand Up @@ -35,13 +35,16 @@ INSERT INTO texts VALUES (1, 'Hello1', 'World1');
INSERT INTO texts VALUES (2, 'Hello2', 'World2');
INSERT INTO texts VALUES (3, 'Hello3', 'World3');

SELECT id,
matched,
not_matched,
MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE),
MATCH(not_matched) AGAINST('+Hello' IN BOOLEAN MODE)
FROM texts
WHERE MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE);
SELECT *
FROM (SELECT id,
matched,
not_matched,
MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE),
MATCH(not_matched) AGAINST('+Hello' IN BOOLEAN MODE)
FROM texts
WHERE MATCH(matched) AGAINST('+Hello' IN BOOLEAN MODE))
AS searched_texts
ORDER BY id;

DROP TABLE texts;

Expand Down

0 comments on commit 7a2fe71

Please sign in to comment.