summaryrefslogtreecommitdiffstats
path: root/mysql-test/main/subselect_nulls_innodb.test
blob: 79d572a2e0e3b20369ecb1f696545ed2f89d35ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
--source include/have_innodb.inc

--echo #
--echo # MDEV-32090 Index does not handle null-safe equals operator correctly in join
--echo #

CREATE TEMPORARY TABLE t1 (
  `id` int(10) unsigned NOT NULL,
  `number` int(10) unsigned DEFAULT 0,
  `name` varchar(47) DEFAULT NULL,
  `street` mediumint(8) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `streetNumber` (`street`,`number`,`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

INSERT INTO t1 (id, number, name, street) VALUES (100733476, 14, NULL, 1115569);

SELECT
    b1.id
FROM
    t1 b1
    INNER JOIN t1 b2 ON (
        b1.street = b2.street
        AND b1.number <=> b2.number
        AND b1.name <=> b2.name
    );

DROP TABLE t1;

--echo #
--echo # End of 10.11 tests
--echo #