Loading client/mysqltest.c +2 −1 Original line number Diff line number Diff line Loading @@ -2170,7 +2170,8 @@ int read_line(char *buf, int size) if (feof(cur_file->file)) { found_eof: if (cur_file->file != stdin){ if (cur_file->file != stdin) { my_fclose(cur_file->file, MYF(0)); cur_file->file= 0; } Loading mysql-test/r/innodb.result +11 −0 Original line number Diff line number Diff line Loading @@ -1674,3 +1674,14 @@ select * from t1; a 42 drop table t1; create table t1 (a int not null, b int not null, c blob not null, d int not null, e int, primary key (a,b,c(255),d)) engine=innodb; insert into t1 values (2,2,"b",2,2),(1,1,"a",1,1),(3,3,"ab",3,3); select * from t1 order by a,b,c,d; a b c d e 1 1 a 1 1 2 2 b 2 2 3 3 ab 3 3 explain select * from t1 order by a,b,c,d; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using filesort drop table t1; mysql-test/t/innodb.test +10 −0 Original line number Diff line number Diff line Loading @@ -1220,4 +1220,14 @@ insert into t1 values (42); select * from t1; drop table t1; # # Bug #13025 Server crash during filesort # create table t1 (a int not null, b int not null, c blob not null, d int not null, e int, primary key (a,b,c(255),d)) engine=innodb; insert into t1 values (2,2,"b",2,2),(1,1,"a",1,1),(3,3,"ab",3,3); select * from t1 order by a,b,c,d; explain select * from t1 order by a,b,c,d; drop table t1; # End of 4.1 tests sql/filesort.cc +1 −1 Original line number Diff line number Diff line Loading @@ -443,7 +443,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select, ha_store_ptr(ref_pos,ref_length,record); // Position to row record+=sort_form->db_record_offset; } else else if (!error) file->position(sort_form->record[0]); } if (error && error != HA_ERR_RECORD_DELETED) Loading sql/item_cmpfunc.cc +9 −7 Original line number Diff line number Diff line Loading @@ -51,7 +51,8 @@ static void agg_cmp_type(Item_result *type, Item **items, uint nitems) type[0]= item_cmp_type(type[0], items[i]->result_type()); } static void my_coll_agg_error(DTCollation &c1, DTCollation &c2, const char *fname) static void my_coll_agg_error(DTCollation &c1, DTCollation &c2, const char *fname) { my_error(ER_CANT_AGGREGATE_2COLLATIONS,MYF(0), c1.collation->name,c1.derivation_name(), Loading Loading @@ -850,8 +851,8 @@ longlong Item_func_interval::val_int() 1 got error */ bool Item_func_between::fix_fields(THD *thd, struct st_table_list *tables, Item **ref) bool Item_func_between::fix_fields(THD *thd, struct st_table_list *tables, Item **ref) { if (Item_func_opt_neg::fix_fields(thd, tables, ref)) return 1; Loading @@ -861,8 +862,9 @@ Item_func_between::fix_fields(THD *thd, struct st_table_list *tables, Item **ref return 0; /* not_null_tables_cache == union(T1(e), intersection(T1(e1),T1(e2))) */ not_null_tables_cache= args[0]->not_null_tables() | (args[1]->not_null_tables() & args[2]->not_null_tables()); not_null_tables_cache= (args[0]->not_null_tables() | (args[1]->not_null_tables() & args[2]->not_null_tables())); return 0; } Loading Loading @@ -1106,8 +1108,8 @@ Item_func_if::fix_fields(THD *thd, struct st_table_list *tlist, Item **ref) if (Item_func::fix_fields(thd, tlist, ref)) return 1; not_null_tables_cache= (args[1]->not_null_tables() & args[2]->not_null_tables()); not_null_tables_cache= (args[1]->not_null_tables() & args[2]->not_null_tables()); return 0; } Loading Loading
client/mysqltest.c +2 −1 Original line number Diff line number Diff line Loading @@ -2170,7 +2170,8 @@ int read_line(char *buf, int size) if (feof(cur_file->file)) { found_eof: if (cur_file->file != stdin){ if (cur_file->file != stdin) { my_fclose(cur_file->file, MYF(0)); cur_file->file= 0; } Loading
mysql-test/r/innodb.result +11 −0 Original line number Diff line number Diff line Loading @@ -1674,3 +1674,14 @@ select * from t1; a 42 drop table t1; create table t1 (a int not null, b int not null, c blob not null, d int not null, e int, primary key (a,b,c(255),d)) engine=innodb; insert into t1 values (2,2,"b",2,2),(1,1,"a",1,1),(3,3,"ab",3,3); select * from t1 order by a,b,c,d; a b c d e 1 1 a 1 1 2 2 b 2 2 3 3 ab 3 3 explain select * from t1 order by a,b,c,d; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using filesort drop table t1;
mysql-test/t/innodb.test +10 −0 Original line number Diff line number Diff line Loading @@ -1220,4 +1220,14 @@ insert into t1 values (42); select * from t1; drop table t1; # # Bug #13025 Server crash during filesort # create table t1 (a int not null, b int not null, c blob not null, d int not null, e int, primary key (a,b,c(255),d)) engine=innodb; insert into t1 values (2,2,"b",2,2),(1,1,"a",1,1),(3,3,"ab",3,3); select * from t1 order by a,b,c,d; explain select * from t1 order by a,b,c,d; drop table t1; # End of 4.1 tests
sql/filesort.cc +1 −1 Original line number Diff line number Diff line Loading @@ -443,7 +443,7 @@ static ha_rows find_all_keys(SORTPARAM *param, SQL_SELECT *select, ha_store_ptr(ref_pos,ref_length,record); // Position to row record+=sort_form->db_record_offset; } else else if (!error) file->position(sort_form->record[0]); } if (error && error != HA_ERR_RECORD_DELETED) Loading
sql/item_cmpfunc.cc +9 −7 Original line number Diff line number Diff line Loading @@ -51,7 +51,8 @@ static void agg_cmp_type(Item_result *type, Item **items, uint nitems) type[0]= item_cmp_type(type[0], items[i]->result_type()); } static void my_coll_agg_error(DTCollation &c1, DTCollation &c2, const char *fname) static void my_coll_agg_error(DTCollation &c1, DTCollation &c2, const char *fname) { my_error(ER_CANT_AGGREGATE_2COLLATIONS,MYF(0), c1.collation->name,c1.derivation_name(), Loading Loading @@ -850,8 +851,8 @@ longlong Item_func_interval::val_int() 1 got error */ bool Item_func_between::fix_fields(THD *thd, struct st_table_list *tables, Item **ref) bool Item_func_between::fix_fields(THD *thd, struct st_table_list *tables, Item **ref) { if (Item_func_opt_neg::fix_fields(thd, tables, ref)) return 1; Loading @@ -861,8 +862,9 @@ Item_func_between::fix_fields(THD *thd, struct st_table_list *tables, Item **ref return 0; /* not_null_tables_cache == union(T1(e), intersection(T1(e1),T1(e2))) */ not_null_tables_cache= args[0]->not_null_tables() | (args[1]->not_null_tables() & args[2]->not_null_tables()); not_null_tables_cache= (args[0]->not_null_tables() | (args[1]->not_null_tables() & args[2]->not_null_tables())); return 0; } Loading Loading @@ -1106,8 +1108,8 @@ Item_func_if::fix_fields(THD *thd, struct st_table_list *tlist, Item **ref) if (Item_func::fix_fields(thd, tlist, ref)) return 1; not_null_tables_cache= (args[1]->not_null_tables() & args[2]->not_null_tables()); not_null_tables_cache= (args[1]->not_null_tables() & args[2]->not_null_tables()); return 0; } Loading