<?xml version="1.0" encoding="utf-8"?>
<launchpad-bug id="916975">
  <date_last_updated>2012-03-29 14:01:16.056270+00:00</date_last_updated>
  <api_links>
    <bug_api_link>https://api.launchpad.net/1.0/bugs/916975</bug_api_link>
    <bug_owner_link>https://api.launchpad.net/1.0/~elenst</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/916975/linked_branches</linked_branches_collection_link>
    <activity_link>https://api.launchpad.net/1.0/bugs/916975/activity</activity_link>
  </api_links>
  <bug_web_link>https://bugs.launchpad.net/bugs/916975</bug_web_link>
  <owner>Elena Stepanova</owner>
  <assignee>Sergei</assignee>
  <milestone_title>Maria 5.5</milestone_title>
  <duplicate_link></duplicate_link>
  <duplicate_bug_id></duplicate_bug_id>
  <title>Crash in handler::mark_trx_read_write on ALTER TABLE after REPAIR non-existing partition</title>
  <status>New</status>
  <importance>Undecided</importance>
  <created>2012-01-15 23:10:21.054834+00:00</created>
  <description>
<![CDATA[#3  0x081ba181 in handle_segfault (sig=11) at /home/elenst/maria-5.5/sql/mysqld.cc:2921
#4  <signal handler called>
#5  0x083e9e65 in handler::mark_trx_read_write (this=0x0) at /home/elenst/maria-5.5/sql/handler.h:2671
#6  0x083e8e1b in handler::ha_write_row (this=0x0, buf=0xa163dc8 "\371\005") at /home/elenst/maria-5.5/sql/handler.cc:5017
#7  0x08861325 in ha_partition::write_row (this=0xa1638c0, buf=0xa163dc8 "\371\005")
    at /home/elenst/maria-5.5/sql/ha_partition.cc:3409
#8  0x083e8e49 in handler::ha_write_row (this=0xa1638c0, buf=0xa163dc8 "\371\005")
    at /home/elenst/maria-5.5/sql/handler.cc:5020
#9  0x082eb76e in copy_data_between_tables (thd=0xa0aab80, from=0xa1a0e20, to=0xa152798, create=..., ignore=false,
    order_num=1, order=0xa156048, copied=0x826771e0, deleted=0x826771d8, keys_onoff=LEAVE_AS_IS, error_if_not_empty=false)
    at /home/elenst/maria-5.5/sql/sql_table.cc:7305
#10 0x082e9937 in mysql_alter_table (thd=0xa0aab80, new_db=0xa155f98 "test", new_name=0xa155b70 "t", create_info=0x82677708,
    table_list=0xa155b98, alter_info=0x826777a0, order_num=1, order=0xa156048, ignore=false, require_online=false)
    at /home/elenst/maria-5.5/sql/sql_table.cc:6646
#11 0x08536363 in Alter_table_statement::execute (this=0xa156078, thd=0xa0aab80)
    at /home/elenst/maria-5.5/sql/sql_alter.cc:106
#12 0x0825fcc8 in mysql_execute_command (thd=0xa0aab80) at /home/elenst/maria-5.5/sql/sql_parse.cc:4422
#13 0x08262b02 in mysql_parse (thd=0xa0aab80, rawbuf=0xa155ae8 "ALTER TABLE t ORDER BY b", length=24, parser_state=0x82677db8)
    at /home/elenst/maria-5.5/sql/sql_parse.cc:5698
#14 0x08256fb5 in dispatch_command (command=COM_QUERY, thd=0xa0aab80, packet=0xa149639 "ALTER TABLE t ORDER BY b",
    packet_length=24) at /home/elenst/maria-5.5/sql/sql_parse.cc:1049
#15 0x0825647a in do_command (thd=0xa0aab80) at /home/elenst/maria-5.5/sql/sql_parse.cc:788
#16 0x0833dd18 in do_handle_one_connection (thd_arg=0xa0aab80) at /home/elenst/maria-5.5/sql/sql_connect.cc:1225
#17 0x0833d866 in handle_one_connection (arg=0xa0aab80) at /home/elenst/maria-5.5/sql/sql_connect.cc:1140
#18 0x0855b199 in pfs_spawn_thread (arg=0xa1aa490) at /home/elenst/maria-5.5/storage/perfschema/pfs.cc:1015
#19 0xb771bb25 in start_thread () from /lib/libpthread.so.0

 bzr version-info
revision-id: <email address hidden>
date: 2012-01-11 13:35:27 +0100
build-date: 2012-01-16 03:06:55 +0400
revno: 3214
branch-nick: maria-5.5

Also reproducible on MySQL 5.5.20 and 5.6.4, filed as http://bugs.mysql.com/bug.php?id=64038.

Test case:

CREATE TABLE t ( a INT, b INT );
INSERT INTO t VALUES (5,3),(5,6);
ALTER TABLE t PARTITION BY KEY(b) PARTITIONS 3 ;
ALTER TABLE t REPAIR PARTITION p1, p3;
ALTER TABLE t ORDER BY b;]]>  </description>
  <activities>
    <activity datechanged="2012-01-15T23:10:21.054834+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[]]>      </newvalue>
      <whatchanged>bug</whatchanged>
      <person>Elena Stepanova</person>
      <message>added bug</message>
    </activity>
    <activity datechanged="2012-01-26T23:08:43.429484+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[Sergei (sergii)]]>      </newvalue>
      <whatchanged>maria: assignee</whatchanged>
      <person>Elena Stepanova</person>
      <message></message>
    </activity>
    <activity datechanged="2012-03-02T14:32:00.523010+00:00">
      <oldvalue>
<![CDATA[Crash in handler::ha_thd on ALTER TABLE after REPAIR non-existing partition]]>      </oldvalue>
      <newvalue>
<![CDATA[Crash in handler::mark_trx_read_write on ALTER TABLE after REPAIR non-existing partition]]>      </newvalue>
      <whatchanged>summary</whatchanged>
      <person>Elena Stepanova</person>
      <message></message>
    </activity>
    <activity datechanged="2012-03-29T14:01:15.868817+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[crash partitions upstream]]>      </newvalue>
      <whatchanged>tags</whatchanged>
      <person>Elena Stepanova</person>
      <message></message>
    </activity>
  </activities>
  <comments>
    <comment commentlink="https://api.launchpad.net/1.0/maria/+bug/916975/comments/0" datecreated="2012-01-15T23:10:21.054834+00:00">
      <person>Elena Stepanova</person>
      <subject>
<![CDATA[Crash in handler::ha_thd on ALTER TABLE after REPAIR non-existing partition]]>      </subject>
      <content>
<![CDATA[#3  0x081ba181 in handle_segfault (sig=11) at /home/elenst/maria-5.5/sql/mysqld.cc:2921
#4  <signal handler called>
#5  0x083e9e65 in handler::mark_trx_read_write (this=0x0) at /home/elenst/maria-5.5/sql/handler.h:2671
#6  0x083e8e1b in handler::ha_write_row (this=0x0, buf=0xa163dc8 "\371\005") at /home/elenst/maria-5.5/sql/handler.cc:5017
#7  0x08861325 in ha_partition::write_row (this=0xa1638c0, buf=0xa163dc8 "\371\005")
    at /home/elenst/maria-5.5/sql/ha_partition.cc:3409
#8  0x083e8e49 in handler::ha_write_row (this=0xa1638c0, buf=0xa163dc8 "\371\005")
    at /home/elenst/maria-5.5/sql/handler.cc:5020
#9  0x082eb76e in copy_data_between_tables (thd=0xa0aab80, from=0xa1a0e20, to=0xa152798, create=..., ignore=false,
    order_num=1, order=0xa156048, copied=0x826771e0, deleted=0x826771d8, keys_onoff=LEAVE_AS_IS, error_if_not_empty=false)
    at /home/elenst/maria-5.5/sql/sql_table.cc:7305
#10 0x082e9937 in mysql_alter_table (thd=0xa0aab80, new_db=0xa155f98 "test", new_name=0xa155b70 "t", create_info=0x82677708,
    table_list=0xa155b98, alter_info=0x826777a0, order_num=1, order=0xa156048, ignore=false, require_online=false)
    at /home/elenst/maria-5.5/sql/sql_table.cc:6646
#11 0x08536363 in Alter_table_statement::execute (this=0xa156078, thd=0xa0aab80)
    at /home/elenst/maria-5.5/sql/sql_alter.cc:106
#12 0x0825fcc8 in mysql_execute_command (thd=0xa0aab80) at /home/elenst/maria-5.5/sql/sql_parse.cc:4422
#13 0x08262b02 in mysql_parse (thd=0xa0aab80, rawbuf=0xa155ae8 "ALTER TABLE t ORDER BY b", length=24, parser_state=0x82677db8)
    at /home/elenst/maria-5.5/sql/sql_parse.cc:5698
#14 0x08256fb5 in dispatch_command (command=COM_QUERY, thd=0xa0aab80, packet=0xa149639 "ALTER TABLE t ORDER BY b",
    packet_length=24) at /home/elenst/maria-5.5/sql/sql_parse.cc:1049
#15 0x0825647a in do_command (thd=0xa0aab80) at /home/elenst/maria-5.5/sql/sql_parse.cc:788
#16 0x0833dd18 in do_handle_one_connection (thd_arg=0xa0aab80) at /home/elenst/maria-5.5/sql/sql_connect.cc:1225
#17 0x0833d866 in handle_one_connection (arg=0xa0aab80) at /home/elenst/maria-5.5/sql/sql_connect.cc:1140
#18 0x0855b199 in pfs_spawn_thread (arg=0xa1aa490) at /home/elenst/maria-5.5/storage/perfschema/pfs.cc:1015
#19 0xb771bb25 in start_thread () from /lib/libpthread.so.0

 bzr version-info
revision-id: wlad@montyprogram.com-20120111123527-rpysqoiao9wvg640
date: 2012-01-11 13:35:27 +0100
build-date: 2012-01-16 03:06:55 +0400
revno: 3214
branch-nick: maria-5.5

Also reproducible on MySQL 5.5.20 and 5.6.4, filed as http://bugs.mysql.com/bug.php?id=64038.

Test case:

CREATE TABLE t ( a INT, b INT );
INSERT INTO t VALUES (5,3),(5,6);
ALTER TABLE t PARTITION BY KEY(b) PARTITIONS 3 ;
ALTER TABLE t REPAIR PARTITION p1, p3;
ALTER TABLE t ORDER BY b;]]>      </content>
    </comment>
    <comment commentlink="https://api.launchpad.net/1.0/maria/+bug/916975/comments/1" datecreated="2012-01-25T00:46:51.531099+00:00">
      <person>Elena Stepanova</person>
      <subject>
<![CDATA[Re: Crash in handler::ha_thd on ALTER TABLE after REPAIR non-existing partition]]>      </subject>
      <content>
<![CDATA[Also filed as JIRA issue MDEV-111]]>      </content>
    </comment>
    <comment commentlink="https://api.launchpad.net/1.0/maria/+bug/916975/comments/2" datecreated="2012-03-03T00:29:28.466720+00:00">
      <person>Elena Stepanova</person>
      <subject>
<![CDATA[Re: Crash in handler::mark_trx_read_write on ALTER TABLE after REPAIR non-existing partition]]>      </subject>
      <content>
<![CDATA[JIRA issue MDEV-169 might also be related. ]]>      </content>
    </comment>
  </comments>
</launchpad-bug>
