Commit 30e89acd authored by Marko Mäkelä's avatar Marko Mäkelä

Import, adapt and extend a test from Oracle

parent 98174795
......@@ -636,6 +636,26 @@ EXECUTE stmt;
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
End of 5.1 tests
CREATE TABLE z(a INTEGER) engine=innodb;
CREATE TABLE q(b TEXT CHARSET latin1, fulltext(b)) engine=innodb;
EXPLAIN SELECT 1 FROM q WHERE (SELECT MATCH(b) AGAINST ('*') FROM z);
ERROR 42000: syntax error, unexpected $end, expecting FTS_TERM or FTS_NUMB or '*'
SELECT 1 FROM q WHERE (SELECT MATCH(b) AGAINST ('*') FROM z);
ERROR 42000: syntax error, unexpected $end, expecting FTS_TERM or FTS_NUMB or '*'
EXPLAIN SELECT MATCH(b) AGAINST ('*') FROM z;
ERROR 42S22: Unknown column 'b' in 'field list'
SELECT MATCH(b) AGAINST ('*') FROM z;
ERROR 42S22: Unknown column 'b' in 'field list'
EXPLAIN SELECT MATCH(a) AGAINST ('*') FROM z;
ERROR HY000: Can't find FULLTEXT index matching the column list
SELECT MATCH(a) AGAINST ('*') FROM z;
ERROR HY000: Can't find FULLTEXT index matching the column list
EXPLAIN SELECT MATCH(b) AGAINST ('*') FROM q;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE q ALL NULL NULL NULL NULL 1
SELECT MATCH(b) AGAINST ('*') FROM q;
ERROR 42000: syntax error, unexpected $end, expecting FTS_TERM or FTS_NUMB or '*'
DROP TABLE z, q;
create table t (
FTS_DOC_ID BIGINT UNSIGNED PRIMARY KEY, t TEXT, FULLTEXT KEY (t)
) ENGINE=InnoDB;
......
......@@ -676,6 +676,31 @@ DROP TABLE t1;
--echo End of 5.1 tests
# This is an adapted and extended version of an Oracle test for
# Bug#21140111: Explain ... match against: Assertion failed: ret ...
# No bug was repeatable for MariaDB.
CREATE TABLE z(a INTEGER) engine=innodb;
CREATE TABLE q(b TEXT CHARSET latin1, fulltext(b)) engine=innodb;
--error ER_PARSE_ERROR
EXPLAIN SELECT 1 FROM q WHERE (SELECT MATCH(b) AGAINST ('*') FROM z);
--error ER_PARSE_ERROR
SELECT 1 FROM q WHERE (SELECT MATCH(b) AGAINST ('*') FROM z);
--error ER_BAD_FIELD_ERROR
EXPLAIN SELECT MATCH(b) AGAINST ('*') FROM z;
--error ER_BAD_FIELD_ERROR
SELECT MATCH(b) AGAINST ('*') FROM z;
--error ER_FT_MATCHING_KEY_NOT_FOUND
EXPLAIN SELECT MATCH(a) AGAINST ('*') FROM z;
--error ER_FT_MATCHING_KEY_NOT_FOUND
SELECT MATCH(a) AGAINST ('*') FROM z;
EXPLAIN SELECT MATCH(b) AGAINST ('*') FROM q;
--error ER_PARSE_ERROR
SELECT MATCH(b) AGAINST ('*') FROM q;
DROP TABLE z, q;
create table t (
FTS_DOC_ID BIGINT UNSIGNED PRIMARY KEY, t TEXT, FULLTEXT KEY (t)
) ENGINE=InnoDB;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment