Commit 0edd2ec4 authored by unknown's avatar unknown
Browse files

BUG#19140: Create index caused crash


mysql-test/r/ndb_partition_key.result:
  New test case to ensure path in code is tested
mysql-test/r/partition.result:
  New test case for bug
mysql-test/t/ndb_partition_key.test:
  New test case to ensure path in code is tested
mysql-test/t/partition.test:
  New test case for bug
sql/sql_partition.cc:
  Use stack variable, not variable on lex object, caused havoc when doing a create index.
sql/sql_table.cc:
  Editorial changes + added a comment to a path in code I didn't remember myself what it was good for.
parent 3065eeb3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -197,3 +197,7 @@ ENGINE=NDB
PARTITION BY KEY(c3);
ALTER TABLE t1 ADD COLUMN c4 INT AFTER c1;
DROP TABLE t1;
CREATE TABLE t1 (a int)
PARTITION BY KEY(a)
(PARTITION p0 ENGINE = NDB);
DROP TABLE t1;
+5 −0
Original line number Diff line number Diff line
@@ -886,4 +886,9 @@ s1
2
3
drop table t1;
create table t1 (a int) engine=memory
partition by key(a);
insert into t1 values (1);
create index inx1 on t1(a);
drop table t1;
End of 5.1 tests
+7 −0
Original line number Diff line number Diff line
@@ -196,3 +196,10 @@ CREATE TABLE t1 (

ALTER TABLE t1 ADD COLUMN c4 INT AFTER c1;
DROP TABLE t1;

CREATE TABLE t1 (a int)
PARTITION BY KEY(a)
(PARTITION p0 ENGINE = NDB);
DROP TABLE t1;

+14 −0
Original line number Diff line number Diff line
@@ -9,6 +9,11 @@
drop table if exists t1;
--enable_warnings

create table t1 (a int)
partition by key(a)
(partition p0 engine = MEMORY);
drop table t1;

#
# Partition by key no partition defined => OK
#
@@ -1009,4 +1014,13 @@ select auto_increment from information_schema.tables where table_name='t1';
select * from t1;
drop table t1;

#
# BUG 19140 Partitions: Create index for partitioned table crashes
#
create table t1 (a int) engine=memory
partition by key(a);
insert into t1 values (1);
create index inx1 on t1(a);
drop table t1;

--echo End of 5.1 tests
+2 −2
Original line number Diff line number Diff line
@@ -4509,7 +4509,7 @@ the generated partition syntax in a correct manner.
      if (alter_info->flags & ALTER_REMOVE_PARTITIONING)
      {
        DBUG_PRINT("info", ("Remove partitioning"));
        if (!(thd->lex->create_info.used_fields & HA_CREATE_USED_ENGINE))
        if (!(create_info->used_fields & HA_CREATE_USED_ENGINE))
        {
          DBUG_PRINT("info", ("No explicit engine used"));
          create_info->db_type= table->part_info->default_engine_type;
@@ -4526,7 +4526,7 @@ the generated partition syntax in a correct manner.
          beneath.
        */
        thd->work_part_info= table->part_info;
        if (thd->lex->create_info.used_fields & HA_CREATE_USED_ENGINE &&
        if (create_info->used_fields & HA_CREATE_USED_ENGINE &&
            create_info->db_type != table->part_info->default_engine_type)
        {
          /*
Loading