<?xml version="1.0" encoding="utf-8"?>
<launchpad-bug id="1008516">
  <date_last_updated>2012-06-04 21:10:30.199233+00:00</date_last_updated>
  <api_links>
    <bug_api_link>https://api.launchpad.net/1.0/bugs/1008516</bug_api_link>
    <bug_owner_link>https://api.launchpad.net/1.0/~sbester</bug_owner_link>
    <milestone_link>https://api.launchpad.net/1.0/maria/+milestone/5.5</milestone_link>
    <linked_branches_collection_link>https://api.launchpad.net/1.0/bugs/1008516/linked_branches</linked_branches_collection_link>
    <activity_link>https://api.launchpad.net/1.0/bugs/1008516/activity</activity_link>
  </api_links>
  <bug_web_link>https://bugs.launchpad.net/bugs/1008516</bug_web_link>
  <owner>sbester</owner>
  <assignee>Sergei</assignee>
  <milestone_title>Maria 5.5</milestone_title>
  <duplicate_link></duplicate_link>
  <duplicate_bug_id></duplicate_bug_id>
  <title>Failing assertion: templ-&gt;mysql_col_len == len</title>
  <status>New</status>
  <importance>Medium</importance>
  <created>2012-06-04 13:37:20.942216+00:00</created>
  <description>
<![CDATA[InnoDB: Assertion failure in thread X in file row0sel.c line 2681
InnoDB: Failing assertion: templ->mysql_col_len == len

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7ffff42d3700 (LWP 30861)]
in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64        return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
(gdb) bt
#0  in raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  in abort () at abort.c:92
#2  in row_sel_field_store_in_mysql_format at ./maria-5.5/storage/xtradb/row/row0sel.c:2681
#3  in row_sel_store_mysql_field at ./maria-5.5/storage/xtradb/row/row0sel.c:2810
#4  in row_search_idx_cond_check at ./maria-5.5/storage/xtradb/row/row0sel.c:3436
#5  in row_search_for_mysql at ./maria-5.5/storage/xtradb/row/row0sel.c:4619
#6  in ha_innobase::index_read at ./maria-5.5/storage/xtradb/handler/ha_innodb.cc:6562
#7  in handler::index_read_map at ./maria-5.5/sql/handler.h:2105
#8  in handler::ha_index_read_map at ./maria-5.5/sql/sql_class.h:4146
#9  in handler::read_range_first at ./maria-5.5/sql/handler.cc:4544
#10 in handler::multi_range_read_next at ./maria-5.5/sql/multi_range_read.cc:296
#11 in Mrr_simple_index_reader::get_next at ./maria-5.5/sql/multi_range_read.cc:328
#12 in DsMrr_impl::dsmrr_next at ./maria-5.5/sql/multi_range_read.cc:1391
#13 in ha_innobase::multi_range_read_next at ./maria-5.5/storage/xtradb/handler/ha_innodb.cc:13084
#14 in QUICK_RANGE_SELECT::get_next at ./maria-5.5/sql/opt_range.cc:10966
#15 in rr_quick at ./maria-5.5/sql/records.cc:339
#16 in join_init_read_record at ./maria-5.5/sql/sql_select.cc:16854
#17 in sub_select at ./maria-5.5/sql/sql_select.cc:16000
#18 in do_select at ./maria-5.5/sql/sql_select.cc:15673
#19 in JOIN::exec at ./maria-5.5/sql/sql_select.cc:2794
#20 in mysql_select at ./maria-5.5/sql/sql_select.cc:3014
#21 in handle_select at ./maria-5.5/sql/sql_select.cc:311
#22 in execute_sqlcom_select at ./maria-5.5/sql/sql_parse.cc:4616
#23 in mysql_execute_command (thd=0x30749f0) at ./maria-5.5/sql/sql_parse.cc:2184
#24 in mysql_parse at ./maria-5.5/sql/sql_parse.cc:5731
#25 in dispatch_command at ./maria-5.5/sql/sql_parse.cc:1055
#26 in do_command at ./maria-5.5/sql/sql_parse.cc:794
#27 in do_handle_one_connection at ./maria-5.5/sql/sql_connect.cc:1253
#28 in handle_one_connection at ./maria-5.5/sql/sql_connect.cc:1168
#29 in start_thread at pthread_create.c:301
#30 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:115

Reminds me of an old bug:
http://bugs.mysql.com/bug.php?id=58015
(Assert in row_sel_field_store_in_mysql_format when running innodb_mrr_icp test)

How to repeat:
-----------------
# might have to use debug build
# repeatable with 5.5.24-MariaDB-valgrind-max-debug on linux x64

drop table if exists `t1`;
create table `t1` (`a` int,`b` char(5),primary key (`a`), key (`b`(1))) engine=innodb ;
insert into `t1` values ('a','b');
select 1 from `t1` where `a` and `b` >= 'aa';]]>  </description>
  <activities>
    <activity datechanged="2012-06-04T13:37:20.942216+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[]]>      </newvalue>
      <whatchanged>bug</whatchanged>
      <person>sbester</person>
      <message>added bug</message>
    </activity>
    <activity datechanged="2012-06-04T15:11:50.054668+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[http://bugs.mysql.com/bug.php?id=58015]]>      </newvalue>
      <whatchanged>bug watch added</whatchanged>
      <person>Elena Stepanova</person>
      <message></message>
    </activity>
    <activity datechanged="2012-06-04T15:11:58.950032+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[assertion]]>      </newvalue>
      <whatchanged>tags</whatchanged>
      <person>Elena Stepanova</person>
      <message></message>
    </activity>
    <activity datechanged="2012-06-04T15:12:13.595217+00:00">
      <oldvalue>
<![CDATA[Undecided]]>      </oldvalue>
      <newvalue>
<![CDATA[Medium]]>      </newvalue>
      <whatchanged>maria: importance</whatchanged>
      <person>Elena Stepanova</person>
      <message></message>
    </activity>
    <activity datechanged="2012-06-04T15:12:26.668497+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[Sergei (sergii)]]>      </newvalue>
      <whatchanged>maria: assignee</whatchanged>
      <person>Elena Stepanova</person>
      <message></message>
    </activity>
    <activity datechanged="2012-06-04T15:12:31.268066+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[5.5]]>      </newvalue>
      <whatchanged>maria: milestone</whatchanged>
      <person>Elena Stepanova</person>
      <message></message>
    </activity>
    <activity datechanged="2012-06-04T21:10:23.270609+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[lp:~maria-captains/maria/5.3-serg]]>      </newvalue>
      <whatchanged>branch linked</whatchanged>
      <person>Launchpad Janitor</person>
      <message></message>
    </activity>
  </activities>
  <comments>
    <comment commentlink="https://api.launchpad.net/1.0/maria/+bug/1008516/comments/1" datecreated="2012-06-04T15:11:50.054668+00:00">
      <person>Elena Stepanova</person>
      <subject>
<![CDATA[Re: Failing assertion: templ->mysql_col_len == len]]>      </subject>
      <content>
<![CDATA[Reproducible on maria-5.5 with XtraDB.
Could not reproduce on maria-5.3, percona-server, mysql-5.5, and on maria-5.5 with InnoDB plugin, but possibly only because in all these cases a different plan is chosen (5.5 with XtraDB says 'Using index condition', others don't).

Comments in http://bugs.mysql.com/bug.php?id=58015 say that the assertion is bogus, so it's just a debug nuisance. 
]]>      </content>
    </comment>
    <comment commentlink="https://api.launchpad.net/1.0/maria/+bug/1008516/comments/2" datecreated="2012-06-04T15:21:55.245518+00:00">
      <person>Elena Stepanova</person>
      <subject>
<![CDATA[Re: Failing assertion: templ->mysql_col_len == len]]>      </subject>
      <content>
<![CDATA[Also filed in JIRA as https://mariadb.atlassian.net/browse/MDEV-308]]>      </content>
    </comment>
  </comments>
  <branches>
    <branch>lp:~maria-captains/maria/5.3-serg</branch>
  </branches>
</launchpad-bug>
