Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug case in semi join When having complicated data transformation #58794

Open
curry-oss opened this issue Jan 8, 2025 · 1 comment
Open

Bug case in semi join When having complicated data transformation #58794

curry-oss opened this issue Jan 8, 2025 · 1 comment
Labels
affects-8.5 This bug affects the 8.5.x(LTS) versions. type/bug The issue is confirmed as a bug.

Comments

@curry-oss
Copy link

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

DROP TABLE IF EXISTS t0;
DROP TABLE IF EXISTS t1;

CREATE TABLE t0 (
    c0 BLOB(338),
    c1 NUMERIC NOT NULL,
    c2 NUMERIC UNSIGNED ZEROFILL UNIQUE
);

CREATE TABLE t1 LIKE t0;

INSERT IGNORE INTO t0 VALUES (NULL, 2025, NULL);
INSERT INTO t1 (c2, c0, c1) VALUES (2025, '', -2023);

SELECT 
    CRC32(LOG10(t1.c2)) & (0.2 OR IS_IPV4_MAPPED('J'))
FROM 
    t1 WHERE 
    EXISTS ( SELECT 1 FROM t0);

2. What did you expect to see? (Required)

see the following case:

3. What did you see instead (Required)

// MySQL 8.4.1
MySQL [test]> SELECT
    ->     CRC32(LOG10(t1.c2)) & (0.2 OR IS_IPV4_MAPPED('J'))
    -> FROM
    ->     t1
    -> WHERE
    ->     EXISTS (
    ->         SELECT 1
    ->         FROM t0
    ->     );
+----------------------------------------------------+
| CRC32(LOG10(t1.c2)) & (0.2 OR IS_IPV4_MAPPED('J')) |
+----------------------------------------------------+
|                                                  0 |
+----------------------------------------------------+
1 row in set (0.01 sec)

// TiDB
mysql> SELECT
    ->     CRC32(LOG10(t1.c2)) & (0.2 OR IS_IPV4_MAPPED('J'))
    -> FROM
    ->     t1
    -> WHERE
    ->     EXISTS (
    ->         SELECT 1
    ->         FROM t0
    ->     );
+----------------------------------------------------+
| CRC32(LOG10(t1.c2)) & (0.2 OR IS_IPV4_MAPPED('J')) |
+----------------------------------------------------+
|                                                  1 |
+----------------------------------------------------+
1 row in set (0.04 sec)

4. What is your TiDB version? (Required)

TiDB v8.5.0

@curry-oss curry-oss added the type/bug The issue is confirmed as a bug. label Jan 8, 2025
@curry-oss
Copy link
Author

/label affects-8.5

@ti-chi-bot ti-chi-bot bot added the affects-8.5 This bug affects the 8.5.x(LTS) versions. label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-8.5 This bug affects the 8.5.x(LTS) versions. type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

1 participant