[MDEV-26689] match results in DOUBLE value is out of range in Created: 2021-09-26  Updated: 2024-01-08  Resolved: 2024-01-08

Status: Closed
Project: MariaDB Server
Component/s: Full-text Search, Storage Engine - InnoDB
Affects Version/s: 10.3.28
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Ján Forgáč Assignee: Marko Mäkelä
Resolution: Incomplete Votes: 0
Labels: None
Environment:

Linux, Windows



 Description   

Same behavior is on this versions: 10.3.28, 10.4.17, 10.5.12

How to reproduce the crash:

CREATE TABLE `d_fulltext_phrase` (
  `id` int(11) NOT NULL,
  `phrase` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '(DC2Type:string)'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 
INSERT INTO `d_fulltext_phrase` (`id`, `phrase`) VALUES
(1, 'audi');
 
ALTER TABLE `d_fulltext_phrase`
  ADD PRIMARY KEY (`id`);
ALTER TABLE `d_fulltext_phrase` ADD FULLTEXT KEY `IDX_E4E8EE24A24BE60C` (`phrase`);
 
ALTER TABLE `d_fulltext_phrase`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

and than run:

SELECT phrase, (MATCH (phrase) AGAINST ('aud*' IN BOOLEAN MODE)) + 0
FROM d_fulltext_phrase

while this runs ok:

SELECT phrase, (MATCH (phrase) AGAINST ('aud*' IN BOOLEAN MODE)) 
FROM d_fulltext_phrase



 Comments   
Comment by Alice Sherepa [ 2021-09-27 ]

I could not reproduce the crash, only getting an error.
Could you please add your .cnf file(s) and error log. ? Is it reproducible for you on 10.3.31?

MariaDB [test]> CREATE TABLE `d_fulltext_phrase` (
    ->   `id` int(11) NOT NULL,
    ->   `phrase` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '(DC2Type:string)'
    -> ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
Query OK, 0 rows affected (0.008 sec)
 
MariaDB [test]> INSERT INTO `d_fulltext_phrase` (`id`, `phrase`) VALUES
    -> (1, 'audi');
Query OK, 1 row affected (0.001 sec)
 
MariaDB [test]> ALTER TABLE `d_fulltext_phrase` ADD PRIMARY KEY (`id`);
Query OK, 0 rows affected (0.011 sec)
Records: 0  Duplicates: 0  Warnings: 0
 
MariaDB [test]> ALTER TABLE `d_fulltext_phrase` ADD FULLTEXT KEY `IDX_E4E8EE24A24BE60C` (`phrase`);
Query OK, 0 rows affected (0.043 sec)
Records: 0  Duplicates: 0  Warnings: 0
 
MariaDB [test]> ALTER TABLE `d_fulltext_phrase`
    ->   MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
Query OK, 1 row affected (0.058 sec)               
Records: 1  Duplicates: 0  Warnings: 0
 
MariaDB [test]> SELECT phrase,
    ->        (MATCH (phrase) against ('aud*' IN BOOLEAN MODE)) + 0
    -> FROM d_fulltext_phrase;
ERROR 1690 (22003): DOUBLE value is out of range in '(match `test`.`d_fulltext_phrase`.`phrase` against ('aud*' in boolean mode)) + 0'
 
MariaDB [test]> select version();
+-----------------+
| version()       |
+-----------------+
| 10.3.28-MariaDB |
+-----------------+
1 row in set (0.000 sec)

Comment by Ján Forgáč [ 2021-09-27 ]

Sorry, there is no other crash than the error you could reproduce:

MariaDB [test]> SELECT phrase,
    ->        (MATCH (phrase) against ('aud*' IN BOOLEAN MODE)) + 0
    -> FROM d_fulltext_phrase;
ERROR 1690 (22003): DOUBLE value is out of range in '(match `test`.`d_fulltext_phrase`.`phrase` against ('aud*' in boolean mode)) + 0'

I suppose, there should be no error, in this case, or am I wrong?

Comment by Marko Mäkelä [ 2023-12-10 ]

Sorry for the delay.

I can’t reproduce this in the current 10.4 or 10.6 development branches:

10.4 5775df012701144a76eb96501336d53c61fb28a5

SELECT phrase, (MATCH(phrase) AGAINST ('aud*' IN BOOLEAN MODE))+0
FROM d_fulltext_phrase;
phrase	(MATCH(phrase) AGAINST ('aud*' IN BOOLEAN MODE))+0
audi	0.000000001885928302414186
SELECT phrase, (MATCH(phrase) AGAINST ('aud*' IN BOOLEAN MODE))
FROM d_fulltext_phrase;
phrase	(MATCH(phrase) AGAINST ('aud*' IN BOOLEAN MODE))
audi	0.000000001885928302414186

Same with 10.6 bc5e904043d4c50fb0cc0cbdce4149866bf4e6e0.

Apparently something was fixed after this bug was reported. I do not remember any possibly related change in the InnoDB storage engine. Can this bug be closed?

Generated at Thu Feb 08 09:47:12 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.