title: Mariadb query runs out of memory with use of match() against()
body: <p>I have a very large table (around 50 GB) but with few columns:</p>
  
  <pre><code>CREATE TABLE my_table (
      id BIGINT(20) NOT NULL AUTO_INCREMENT,
      id_sec BIGINT(20) NULL,
      full_name VARCHAR(100) NULL DEFAULT NULL,
      PRIMARY KEY (id),
      FULLTEXT INDEX fts_full_name (full_name)
  )
  COLLATE='utf8_general_ci'
  ENGINE=InnoDB
  </code></pre>
  
  <p>when I execute the following queries:</p>
  
  <pre><code>SELECT * FROM my_table WHERE MATCH(full_name) AGAINST('lastname middle first ' IN BOOLEAN MODE)
  
  SELECT * FROM my_table WHERE MATCH(full_name) AGAINST('lastname middle first ')
  
  SELECT * FROM my_table WHERE MATCH(full_name) AGAINST('lastname middle first ' IN BOOLEAN MODE) LIMIT 1000
  
  SELECT * FROM my_table WHERE MATCH(full_name) AGAINST('lastname middle first ') LIMIT 1000
  
  SELECT * FROM my_table WHERE MATCH(full_name) AGAINST('lastname middle first ' IN BOOLEAN MODE) LIMIT 100
  
  SELECT * FROM my_table WHERE MATCH(full_name) AGAINST('lastname middle first ') LIMIT 100
  </code></pre>
  
  <p>Sometimes send me the following error message:</p>
  
  <pre><code>SQL Error (128): Table handler out of memory
  </code></pre>
  
  <p>But it does not happen when I execute:</p>
  
  <pre><code>SELECT * FROM my_table WHERE MATCH(full_name) AGAINST('+lastname +middle +first ' IN BOOLEAN MODE)
  
  SELECT * FROM my_table WHERE MATCH(full_name) AGAINST('+lastname +middle +first ')
  </code></pre>
  
  <p>I have tried with the following values and there is no improvement:</p>
  
  <pre><code>--key-buffer-size=20M 
  --tmp-table-size=2G 
  --thread-pool-max-threads=10 
  --max-connections=100 
  --max-heap-table-size=2G 
  --innodb-buffer-pool-size=4G
  </code></pre>
  
  <p>Does anyone know what could be happening? or how can I correct it?</p>
  
  <p>My server is running in windows 10 (x64), 10.3.12-MariaDB (x64), 32 GB of RAM, core i7</p>
  
  <p>Thanks.</p>