Quantcast
Channel: MySQL Forums - Connector/NET and C#, Mono, .Net
Viewing all articles
Browse latest Browse all 1447

Mysql Connector LEFT JOIN Bug (no replies)

$
0
0
Hello,

I can't believe what I am just facing. After many hours of research I ask you guys for help:

If you left join on console, phpmyadmin, heidisql or whatever you get a different result set than with mysql connector. I checked on different windows machines with different mysql versions and different connector versions, even the latest one.

Reproduce

CREATE TABLE `test1` (
`test1_ID` INT(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`test1_ID`) USING BTREE
)
COLLATE='utf8mb4_general_ci'
ENGINE=MyISAM

INSERT INTO `test1` (`test1_ID`) VALUES ('1');
INSERT INTO `test1` (`test1_ID`) VALUES ('2');
INSERT INTO `test1` (`test1_ID`) VALUES ('3');

CREATE TABLE `test2` (
`test2_test1_ID` INT(11) NOT NULL,
`test2_test` VARCHAR(50) NOT NULL DEFAULT '' COLLATE 'utf8mb4_general_ci'
)
COLLATE='utf8mb4_general_ci'
ENGINE=MyISAM

INSERT INTO `test2` (`test2_test1_ID`, `test2_test`) VALUES ('1', 'a');
INSERT INTO `test2` (`test2_test1_ID`, `test2_test`) VALUES ('1', 'b');

Now run:
select test1_ID, test2_test from test1
left join test2 on test1_ID = test2_test1_ID

you will always receive 4 entries but with mysqlconnector there are only 3 rows in the resultset.

I kindly ask you for your help as I can't rely on correct results anymore.

Viewing all articles
Browse latest Browse all 1447

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>