Commit fbab0685 authored by Sergei Golubchik's avatar Sergei Golubchik

post-merge changes, fixes, and tests

parent 67a3ddf1
...@@ -8,4 +8,11 @@ CREATE TABLE t2 (a INT UNSIGNED, b INT, UNIQUE KEY (a, b)) ENGINE=BLACKHOLE; ...@@ -8,4 +8,11 @@ CREATE TABLE t2 (a INT UNSIGNED, b INT, UNIQUE KEY (a, b)) ENGINE=BLACKHOLE;
SELECT 1 FROM t1 WHERE a = ANY (SELECT a FROM t2); SELECT 1 FROM t1 WHERE a = ANY (SELECT a FROM t2);
1 1
DROP TABLE t1, t2; DROP TABLE t1, t2;
create temporary table t1 (a int) engine=blackhole;
lock table t1 write;
truncate table t1;
select * from t1;
a
unlock tables;
drop temporary table t1;
End of 5.5 tests End of 5.5 tests
...@@ -2339,6 +2339,16 @@ MIN(a) b ...@@ -2339,6 +2339,16 @@ MIN(a) b
0 a 0 a
DROP TABLE t1; DROP TABLE t1;
create table t1 (a int, b int);
insert into t1 values (1,11), (1,12), (2,22),(2,23), (4,44),(4,45);
create table t2 (c int, d int);
insert into t2 values (1,11), (1,12), (2,22),(2,23), (4,44),(4,45);
select distinct a,sum(b), (select d from t2 where c=a order by max(b) limit 1) from t1 group by a order by max(b);
a sum(b) (select d from t2 where c=a order by max(b) limit 1)
1 23 11
2 45 22
4 89 44
drop table t1, t2;
# #
# LP bug#993726 Wrong result from a query with ALL subquery predicate in WHERE # LP bug#993726 Wrong result from a query with ALL subquery predicate in WHERE
# #
......
...@@ -170,3 +170,7 @@ Error 1548 Cannot load from mysql.proc. The table is probably corrupted ...@@ -170,3 +170,7 @@ Error 1548 Cannot load from mysql.proc. The table is probably corrupted
# Restore mysql.proc # Restore mysql.proc
DROP TABLE mysql.proc; DROP TABLE mysql.proc;
RENAME TABLE proc_backup TO mysql.proc; RENAME TABLE proc_backup TO mysql.proc;
create database mysqltest1;
create procedure mysqltest1.foo() select "foo";
update mysql.proc set name='' where db='mysqltest1';
drop database mysqltest1;
...@@ -17,5 +17,15 @@ SELECT 1 FROM t1 WHERE a = ANY (SELECT a FROM t2); ...@@ -17,5 +17,15 @@ SELECT 1 FROM t1 WHERE a = ANY (SELECT a FROM t2);
DROP TABLE t1, t2; DROP TABLE t1, t2;
#
# Bug#19786309 - CRASH IN UNLOCK TABLES AFTER LOCKING AND TRUNCATING TEMPORARY TABLE.
#
create temporary table t1 (a int) engine=blackhole;
lock table t1 write;
truncate table t1;
select * from t1;
unlock tables;
drop temporary table t1;
--echo End of 5.5 tests --echo End of 5.5 tests
...@@ -1516,6 +1516,17 @@ let $query= SELECT MIN(a), b FROM t1 WHERE t1.b = 'a' GROUP BY b; ...@@ -1516,6 +1516,17 @@ let $query= SELECT MIN(a), b FROM t1 WHERE t1.b = 'a' GROUP BY b;
--echo --echo
DROP TABLE t1; DROP TABLE t1;
#
# Bug#19880368 : GROUP_CONCAT CRASHES AFTER DUMP_LEAF_KEY
#
create table t1 (a int, b int);
insert into t1 values (1,11), (1,12), (2,22),(2,23), (4,44),(4,45);
create table t2 (c int, d int);
insert into t2 values (1,11), (1,12), (2,22),(2,23), (4,44),(4,45);
select distinct a,sum(b), (select d from t2 where c=a order by max(b) limit 1) from t1 group by a order by max(b);
drop table t1, t2;
--echo # --echo #
--echo # LP bug#993726 Wrong result from a query with ALL subquery predicate in WHERE --echo # LP bug#993726 Wrong result from a query with ALL subquery predicate in WHERE
--echo # --echo #
......
...@@ -281,3 +281,11 @@ DROP DATABASE db1; ...@@ -281,3 +281,11 @@ DROP DATABASE db1;
--echo # Restore mysql.proc --echo # Restore mysql.proc
DROP TABLE mysql.proc; DROP TABLE mysql.proc;
RENAME TABLE proc_backup TO mysql.proc; RENAME TABLE proc_backup TO mysql.proc;
#
# BUG#19875331 - HANDLE_FATAL_SIGNAL 11 IN STRMAKE
#
create database mysqltest1;
create procedure mysqltest1.foo() select "foo";
update mysql.proc set name='' where db='mysqltest1';
drop database mysqltest1;
...@@ -4103,11 +4103,7 @@ class Item_cache: public Item_basic_constant ...@@ -4103,11 +4103,7 @@ class Item_cache: public Item_basic_constant
collation.set(item->collation); collation.set(item->collation);
unsigned_flag= item->unsigned_flag; unsigned_flag= item->unsigned_flag;
if (item->type() == FIELD_ITEM) if (item->type() == FIELD_ITEM)
{
cached_field= ((Item_field *)item)->field; cached_field= ((Item_field *)item)->field;
if (cached_field->table)
used_table_map= cached_field->table->map;
}
return 0; return 0;
}; };
enum Type type() const { return CACHE_ITEM; } enum Type type() const { return CACHE_ITEM; }
......
...@@ -3607,8 +3607,9 @@ static int init_common_variables() ...@@ -3607,8 +3607,9 @@ static int init_common_variables()
return 1; return 1;
set_server_version(); set_server_version();
sql_print_information("%s (mysqld %s) starting as process %lu ...", if (!opt_help)
my_progname, server_version, (ulong) getpid()); sql_print_information("%s (mysqld %s) starting as process %lu ...",
my_progname, server_version, (ulong) getpid());
#ifndef EMBEDDED_LIBRARY #ifndef EMBEDDED_LIBRARY
if (opt_abort && !opt_verbose) if (opt_abort && !opt_verbose)
......
...@@ -1495,13 +1495,8 @@ bool lock_db_routines(THD *thd, char *db) ...@@ -1495,13 +1495,8 @@ bool lock_db_routines(THD *thd, char *db)
{ {
char *sp_name= get_field(thd->mem_root, char *sp_name= get_field(thd->mem_root,
table->field[MYSQL_PROC_FIELD_NAME]); table->field[MYSQL_PROC_FIELD_NAME]);
if (sp_name == NULL) if (sp_name == NULL) // skip invalid sp names (hand-edited mysql.proc?)
{ continue;
table->file->ha_index_end();
my_error(ER_SP_WRONG_NAME, MYF(0), "");
close_system_tables(thd, &open_tables_state_backup);
DBUG_RETURN(true);
}
longlong sp_type= table->field[MYSQL_PROC_MYSQL_TYPE]->val_int(); longlong sp_type= table->field[MYSQL_PROC_MYSQL_TYPE]->val_int();
MDL_request *mdl_request= new (thd->mem_root) MDL_request; MDL_request *mdl_request= new (thd->mem_root) MDL_request;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment