Wrong result in maria-5.3-mwl128 with join_cache_level = 4 and small join_buffer_size and join buffer (flat, BNLH join)

Bug #668290 reported by Philip Stoev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MariaDB
Fix Released
High
Igor Babaev

Bug Description

The following query:

SELECT t2 .col_int_key FROM t2 JOIN t1 ON t2 .col_varchar_10_latin1_key = t1 .col_varchar_10_utf8_key ;

returns no rows when executed with join_cache_level = 4, join_buffer_size = 164 , even though there are rows for which the condition t2 .col_varchar_10_latin1_key = t1 .col_varchar_10_utf8_key is TRUE.

The execution strategy is reported as "Using join buffer (flat, BNLH join)". maria-5.3 is not affected.

Related branches

Revision history for this message
Philip Stoev (pstoev-askmonty) wrote :

Test case:

--disable_warnings
DROP TABLE /*! IF EXISTS */ t1;
DROP TABLE /*! IF EXISTS */ t2;
--enable_warnings

CREATE TABLE t1 (
  col_int_key int(11) DEFAULT NULL,
  col_varchar_10_latin1_key varchar(10) DEFAULT NULL,
  col_varchar_10_utf8_key varchar(10) CHARACTER SET utf8 DEFAULT NULL,
  KEY col_int_key (col_int_key),
  KEY col_varchar_10_latin1_key (col_varchar_10_latin1_key),
  KEY col_varchar_10_utf8_key (col_varchar_10_utf8_key)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO t1 VALUES (650903552,'cmxffkpsel','z'),(535298048,'tvtjrcmxff','y'),(1626865664,'when','for'),(39649280,'rcvljitvtj','ercvljitvt'),(792068096,'ttercvljit','jttercvlji');
CREATE TABLE t2 (
  col_varchar_10_utf8_key varchar(10) CHARACTER SET utf8 DEFAULT NULL,
  col_int_key int(11) DEFAULT NULL,
  col_varchar_10_latin1_key varchar(10) DEFAULT NULL,
  KEY col_varchar_10_utf8_key (col_varchar_10_utf8_key),
  KEY col_int_key (col_int_key),
  KEY col_varchar_10_latin1_key (col_varchar_10_latin1_key)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO t2 VALUES ('g',7,'like'),('fujttercvl',6,'y'),('s',2,'e'),('didn\'t',0,'v'),('gvdrodpedk',8,'chogvdrodp'),('jichogvdro',7,'will');

SELECT t2 .col_int_key FROM t2 JOIN t1 ON t2 .col_varchar_10_latin1_key = t1 .col_varchar_10_utf8_key ;
EXPLAIN SELECT t2 .col_int_key FROM t2 JOIN t1 ON t2 .col_varchar_10_latin1_key = t1 .col_varchar_10_utf8_key ;

SET SESSION join_cache_level = 4;
SET SESSION join_buffer_size = 164;

SELECT t2 .col_int_key FROM t2 JOIN t1 ON t2 .col_varchar_10_latin1_key = t1 .col_varchar_10_utf8_key ;
EXPLAIN SELECT t2 .col_int_key FROM t2 JOIN t1 ON t2 .col_varchar_10_latin1_key = t1 .col_varchar_10_utf8_key ;

Changed in maria:
milestone: none → 5.3
assignee: nobody → Igor Babaev (igorb-seattle)
summary: Wrong result in maria-5.3-mwl128 with join_cache_level = 4 and small
- join_buffer_size
+ join_buffer_size and join buffer (flat, BNLH join)
Changed in maria:
status: New → Confirmed
importance: Undecided → High
Changed in maria:
status: Confirmed → Fix Committed
Changed in maria:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.