--source include/not_embedded.inc
--source include/have_statement_timeout.inc
--source include/have_query_cache.inc
--source include/have_debug.inc
--source include/not_valgrind.inc
--source include/big_test.inc

CREATE TABLE `fttest04` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `str` varchar(300) DEFAULT NULL,
  `str2` mediumtext,
  PRIMARY KEY (`id`),
  FULLTEXT KEY `idx` (`str`,`str2`)
) ENGINE=InnoDB AUTO_INCREMENT=65520 DEFAULT CHARSET=utf8mb4;

--disable_result_log
DELIMITER |;
CREATE PROCEDURE load_test_data()
BEGIN

DECLARE cnt INTEGER UNSIGNED DEFAULT 1;
	WHILE (cnt <= 600220) DO
		INSERT INTO fttest04(str, str2) VALUES('徳島県','徳島県');
		SET cnt= cnt+1;
	END WHILE;
END|
DELIMITER ;|

CALL load_test_data();
DROP PROCEDURE load_test_data;

--enable_result_log
--error ER_QUERY_TIMEOUT
SELECT /*+ max_execution_time(2000) */ COUNT(id) FROM fttest04 WHERE
MATCH (str,str2) AGAINST ('徳島県' IN BOOLEAN MODE) ;

DROP TABLE fttest04;
