Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
12.2.2
-
None
-
None
-
Docker: mariadb:12.2.2
Server version: 12.2.2-MariaDB-ubu2404
Source revision: d26a6f44c1f2119377e79a9540886c6d8c01472f
Description
Hi, I found a logic bug in MariaDB 12.2.2.
When I executed it in other databases (such as MySQL), I obtained the following results:
+--------------------+
|
| c0 |
|
+--------------------+
|
| 0.8702339126741298 |
|
| 1481051462 |
|
| -436558251 |
|
| q1M8 |
|
+--------------------+
|
However, when I executed it in MariaDB 12.2.2, incorrect results were returned:
+--------------------+
|
| c0 |
|
+--------------------+
|
| 0.8702339126741298 |
|
| 1481051462 |
|
| -436558251 |
|
+--------------------+
|
How to repeat:
-- create table
|
DROP TABLE IF EXISTS `t0`; |
CREATE TABLE `t0` ( `c0` longtext COMMENT 'asdf' ); |
INSERT INTO `t0` VALUES ('0.8702339126741298'),('1481051462'),('-436558251'),('q1M8'); |
DROP TABLE IF EXISTS `t1`; |
CREATE TABLE `t1` ( `c0` longtext COMMENT 'asdf', UNIQUE KEY `i1` (`c0`(4)), KEY `i0` (`c0`(4)) USING BTREE ); |
INSERT INTO `t1` VALUES (NULL),('496420813'),(NULL),('77920684'),('-359793400'),('0.8702339126741298'); |
 |
-- bug-triggering query
|
SELECT
|
t_filter_sub_1.c0 AS `c0` |
FROM `t0` AS t_filter_sub_1 |
WHERE
|
LPAD(
|
'123', |
ABS( |
(
|
0 IN ( |
'1', |
1,
|
t_filter_sub_1.c0 % (-29.17)
|
)
|
)
|
) + 1,
|
t_filter_sub_1.c0
|
);
|
|