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

fix(tianmu): fix Load DPN when the table is empty (#964) #968

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions mysql-test/suite/tianmu/r/issue964.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
USE test;
DROP TABLE IF EXISTS t1,t2;
CREATE TABLE `t1` (
`id` int(11) DEFAULT NULL,
`name` varchar(20) DEFAULT NULL,
KEY `idx_n` (`name`)
) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
CREATE TABLE `t2` (
`id` int(11) DEFAULT NULL,
`name` varchar(20) DEFAULT NULL,
KEY `idx_n` (`name`)
)DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
insert into t1 values(1,'abc');
insert into t1 values(2,'def');
SELECT
t1.id,
t1.name,
t2.id,
t2.name
FROM
t1
LEFT JOIN t2 ON
t1.name = t2.name
WHERE
t1.name IN ('abc');
id name id name
1 abc NULL NULL
DROP TABLE t1,t2;
44 changes: 44 additions & 0 deletions mysql-test/suite/tianmu/t/issue964.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
--source include/have_tianmu.inc

USE test;

--disable_warnings

DROP TABLE IF EXISTS t1,t2;

## DDL

CREATE TABLE `t1` (
`id` int(11) DEFAULT NULL,
`name` varchar(20) DEFAULT NULL,
KEY `idx_n` (`name`)
) DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

CREATE TABLE `t2` (
`id` int(11) DEFAULT NULL,
`name` varchar(20) DEFAULT NULL,
KEY `idx_n` (`name`)
)DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

## insert data, only for table t1

insert into t1 values(1,'abc');
insert into t1 values(2,'def');

## join return empty table t2

SELECT
t1.id,
t1.name,
t2.id,
t2.name
FROM
t1
LEFT JOIN t2 ON
t1.name = t2.name
WHERE
t1.name IN ('abc');

## clear tables

DROP TABLE t1,t2;
Loading