Commit 6e1c96db authored by Georgi Kodinov's avatar Georgi Kodinov

merge mysql-5.1->mysql-5.1-security

parents 5ac773b9 17743904
...@@ -143,7 +143,8 @@ static my_bool opt_compress= FALSE, tty_password= FALSE, ...@@ -143,7 +143,8 @@ static my_bool opt_compress= FALSE, tty_password= FALSE,
const char *auto_generate_sql_type= "mixed"; const char *auto_generate_sql_type= "mixed";
static unsigned long connect_flags= CLIENT_MULTI_RESULTS | static unsigned long connect_flags= CLIENT_MULTI_RESULTS |
CLIENT_MULTI_STATEMENTS; CLIENT_MULTI_STATEMENTS |
CLIENT_REMEMBER_OPTIONS;
static int verbose, delimiter_length; static int verbose, delimiter_length;
static uint commit_rate; static uint commit_rate;
......
...@@ -343,6 +343,8 @@ static int emb_stmt_execute(MYSQL_STMT *stmt) ...@@ -343,6 +343,8 @@ static int emb_stmt_execute(MYSQL_STMT *stmt)
set_stmt_errmsg(stmt, net); set_stmt_errmsg(stmt, net);
DBUG_RETURN(1); DBUG_RETURN(1);
} }
else if (stmt->mysql->status == MYSQL_STATUS_GET_RESULT)
stmt->mysql->status= MYSQL_STATUS_STATEMENT_GET_RESULT;
DBUG_RETURN(0); DBUG_RETURN(0);
} }
......
...@@ -245,3 +245,13 @@ mtr ...@@ -245,3 +245,13 @@ mtr
mysql mysql
test test
DROP DATABASE bug58090; DROP DATABASE bug58090;
#
# Bug #11766072 - 59107: MYSQLSLAP CRASHES IF STARTED WITH NO ARGUMENTS ON WINDOWS
#
Benchmark
Average number of seconds to run all queries: TIME seconds
Minimum number of seconds to run all queries: TIME seconds
Maximum number of seconds to run all queries: TIME seconds
Number of clients running queries: 1
Average number of queries per client: 0
...@@ -109,6 +109,7 @@ DROP FUNCTION db1.f1; ...@@ -109,6 +109,7 @@ DROP FUNCTION db1.f1;
DROP TABLE db1.t1; DROP TABLE db1.t1;
DROP DATABASE db1; DROP DATABASE db1;
DROP DATABASE db2; DROP DATABASE db2;
USE test;
# #
# Bug#13105873:valgrind warning:possible crash in foreign # Bug#13105873:valgrind warning:possible crash in foreign
# key handling on subsequent create table if not exists # key handling on subsequent create table if not exists
...@@ -130,3 +131,92 @@ Note 1050 Table 't2' already exists ...@@ -130,3 +131,92 @@ Note 1050 Table 't2' already exists
DROP DATABASE testdb; DROP DATABASE testdb;
USE test; USE test;
End of 5.1 tests End of 5.1 tests
#
# Bug#11763507 - 56224: FUNCTION NAME IS CASE-SENSITIVE
#
SET @@SQL_MODE = '';
CREATE FUNCTION testf_bug11763507() RETURNS INT
BEGIN
RETURN 0;
END
$
CREATE PROCEDURE testp_bug11763507()
BEGIN
SELECT "PROCEDURE testp_bug11763507";
END
$
SELECT testf_bug11763507();
testf_bug11763507()
0
SELECT TESTF_bug11763507();
TESTF_bug11763507()
0
SHOW FUNCTION STATUS LIKE 'testf_bug11763507';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
test testf_bug11763507 FUNCTION root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
SHOW FUNCTION STATUS WHERE NAME='testf_bug11763507';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
test testf_bug11763507 FUNCTION root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
SHOW FUNCTION STATUS LIKE 'TESTF_bug11763507';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
test testf_bug11763507 FUNCTION root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
SHOW FUNCTION STATUS WHERE NAME='TESTF_bug11763507';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
test testf_bug11763507 FUNCTION root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
SHOW CREATE FUNCTION testf_bug11763507;
Function sql_mode Create Function character_set_client collation_connection Database Collation
testf_bug11763507 CREATE DEFINER=`root`@`localhost` FUNCTION `testf_bug11763507`() RETURNS int(11)
BEGIN
RETURN 0;
END latin1 latin1_swedish_ci latin1_swedish_ci
SHOW CREATE FUNCTION TESTF_bug11763507;
Function sql_mode Create Function character_set_client collation_connection Database Collation
testf_bug11763507 CREATE DEFINER=`root`@`localhost` FUNCTION `testf_bug11763507`() RETURNS int(11)
BEGIN
RETURN 0;
END latin1 latin1_swedish_ci latin1_swedish_ci
CALL testp_bug11763507();
PROCEDURE testp_bug11763507
PROCEDURE testp_bug11763507
CALL TESTP_bug11763507();
PROCEDURE testp_bug11763507
PROCEDURE testp_bug11763507
SHOW PROCEDURE STATUS LIKE 'testp_bug11763507';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
test testp_bug11763507 PROCEDURE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
SHOW PROCEDURE STATUS WHERE NAME='testp_bug11763507';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
test testp_bug11763507 PROCEDURE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
SHOW PROCEDURE STATUS LIKE 'TESTP_bug11763507';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
test testp_bug11763507 PROCEDURE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
SHOW PROCEDURE STATUS WHERE NAME='TESTP_bug11763507';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
test testp_bug11763507 PROCEDURE root@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
SHOW CREATE PROCEDURE testp_bug11763507;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
testp_bug11763507 CREATE DEFINER=`root`@`localhost` PROCEDURE `testp_bug11763507`()
BEGIN
SELECT "PROCEDURE testp_bug11763507";
END latin1 latin1_swedish_ci latin1_swedish_ci
SHOW CREATE PROCEDURE TESTP_bug11763507;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
testp_bug11763507 CREATE DEFINER=`root`@`localhost` PROCEDURE `testp_bug11763507`()
BEGIN
SELECT "PROCEDURE testp_bug11763507";
END latin1 latin1_swedish_ci latin1_swedish_ci
SELECT specific_name FROM INFORMATION_SCHEMA.ROUTINES WHERE specific_name LIKE 'testf_bug11763507';
specific_name
testf_bug11763507
SELECT specific_name FROM INFORMATION_SCHEMA.ROUTINES WHERE specific_name LIKE 'TESTF_bug11763507';
specific_name
testf_bug11763507
SELECT specific_name FROM INFORMATION_SCHEMA.ROUTINES WHERE specific_name='testf_bug11763507';
specific_name
testf_bug11763507
SELECT specific_name FROM INFORMATION_SCHEMA.ROUTINES WHERE specific_name='TESTF_bug11763507';
specific_name
testf_bug11763507
DROP PROCEDURE testp_bug11763507;
DROP FUNCTION testf_bug11763507;
#END OF BUG#11763507 test.
...@@ -888,3 +888,32 @@ Pos Instruction ...@@ -888,3 +888,32 @@ Pos Instruction
4 jump 6 4 jump 6
5 error 1339 5 error 1339
DROP PROCEDURE p1; DROP PROCEDURE p1;
#
# Bug#11763507 - 56224: FUNCTION NAME IS CASE-SENSITIVE
#
SET @@SQL_MODE = '';
CREATE FUNCTION testf_bug11763507() RETURNS INT
BEGIN
RETURN 0;
END
$
CREATE PROCEDURE testp_bug11763507()
BEGIN
SELECT "PROCEDURE testp_bug11763507";
END
$
SHOW FUNCTION CODE testf_bug11763507;
Pos Instruction
0 freturn 3 0
SHOW FUNCTION CODE TESTF_bug11763507;
Pos Instruction
0 freturn 3 0
SHOW PROCEDURE CODE testp_bug11763507;
Pos Instruction
0 stmt 0 "SELECT "PROCEDURE testp_bug11763507""
SHOW PROCEDURE CODE TESTP_bug11763507;
Pos Instruction
0 stmt 0 "SELECT "PROCEDURE testp_bug11763507""
DROP PROCEDURE testp_bug11763507;
DROP FUNCTION testf_bug11763507;
#END OF BUG#11763507 test.
...@@ -279,6 +279,26 @@ ERROR 70100: Query execution was interrupted ...@@ -279,6 +279,26 @@ ERROR 70100: Query execution was interrupted
DROP VIEW v1; DROP VIEW v1;
DROP TABLE t1; DROP TABLE t1;
DROP FUNCTION f1; DROP FUNCTION f1;
#
# Bug#11763507 - 56224: FUNCTION NAME IS CASE-SENSITIVE
#
SET @@SQL_MODE = '';
CREATE EVENT teste_bug11763507 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
DO SELECT 1 $
SHOW EVENTS LIKE 'teste_bug11763507';
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
test teste_bug11763507 root@localhost SYSTEM ONE TIME # # # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
SHOW EVENTS LIKE 'TESTE_bug11763507';
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
test teste_bug11763507 root@localhost SYSTEM ONE TIME # # # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
SHOW CREATE EVENT teste_bug11763507;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
teste_bug11763507 SYSTEM # latin1 latin1_swedish_ci latin1_swedish_ci
SHOW CREATE EVENT TESTE_bug11763507;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
teste_bug11763507 SYSTEM # latin1 latin1_swedish_ci latin1_swedish_ci
DROP EVENT teste_bug11763507;
#END OF BUG#11763507 test.
# ------------------------------------------------------------------ # ------------------------------------------------------------------
# -- End of 5.1 tests # -- End of 5.1 tests
# ------------------------------------------------------------------ # ------------------------------------------------------------------
...@@ -4461,6 +4461,55 @@ ERROR 21000: Subquery returns more than 1 row ...@@ -4461,6 +4461,55 @@ ERROR 21000: Subquery returns more than 1 row
SET SESSION sql_mode=@old_sql_mode; SET SESSION sql_mode=@old_sql_mode;
DEALLOCATE PREPARE stmt; DEALLOCATE PREPARE stmt;
DROP TABLE t1; DROP TABLE t1;
#
# Bug#12763207 - ASSERT IN SUBSELECT::SINGLE_VALUE_TRANSFORMER
#
CREATE TABLE t1(a1 int);
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2(a1 int);
INSERT INTO t2 VALUES (3);
SELECT @@session.sql_mode INTO @old_sql_mode;
SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 2 FROM t2);
1
1
1
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 2.0 FROM t2);
1
1
1
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 'a' FROM t2);
1
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t2);
1
1
1
SET SESSION sql_mode=@old_sql_mode;
DROP TABLE t1, t2;
#
# Bug#12763207 - ASSERT IN SUBSELECT::SINGLE_VALUE_TRANSFORMER
#
create table t2(i int);
insert into t2 values(0);
SELECT @@session.sql_mode INTO @old_sql_mode;
SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
CREATE VIEW v1 AS
SELECT 'f' FROM t2 UNION SELECT 'x' FROM t2
;
CREATE TABLE t1 (
pk int NOT NULL,
col_varchar_key varchar(1) DEFAULT NULL,
PRIMARY KEY (pk),
KEY col_varchar_key (col_varchar_key)
);
SELECT t1.pk
FROM t1
WHERE t1.col_varchar_key < ALL ( SELECT * FROM v1 )
;
pk
SET SESSION sql_mode=@old_sql_mode;
drop table t2, t1;
drop view v1;
End of 5.0 tests. End of 5.0 tests.
CREATE TABLE t1 (a INT, b INT); CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 VALUES (2,22),(1,11),(2,22); INSERT INTO t1 VALUES (2,22),(1,11),(2,22);
......
# Can't run test of external client with embedded server # Can't run test of external client with embedded server
--source include/not_embedded.inc --source include/not_embedded.inc
--source include/not_windows.inc
--exec $MYSQL_SLAP --silent --concurrency=5 --iterations=20 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --exec $MYSQL_SLAP --silent --concurrency=5 --iterations=20 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql
...@@ -37,7 +36,7 @@ ...@@ -37,7 +36,7 @@
--exec $MYSQL_SLAP --only-print --delimiter=";" --query="select * from t1;select * from t2" --create="CREATE TABLE t1 (id int, name varchar(64)); create table t2(foo1 varchar(32), foo2 varchar(32)); INSERT INTO t1 VALUES (1, 'This is a test'); insert into t2 values ('test', 'test2')" --engine="heap,myisam" --post-query="SHOW TABLES" --pre-query="SHOW TABLES"; --exec $MYSQL_SLAP --only-print --delimiter=";" --query="select * from t1;select * from t2" --create="CREATE TABLE t1 (id int, name varchar(64)); create table t2(foo1 varchar(32), foo2 varchar(32)); INSERT INTO t1 VALUES (1, 'This is a test'); insert into t2 values ('test', 'test2')" --engine="heap,myisam" --post-query="SHOW TABLES" --pre-query="SHOW TABLES";
--exec $MYSQL_SLAP --only-print --delimiter=";" --query="select * from t1;select * from t2" --create="CREATE TABLE t1 (id int, name varchar(64)); create table t2(foo1 varchar(32), foo2 varchar(32)); INSERT INTO t1 VALUES (1, 'This is a test'); insert into t2 values ('test', 'test2')" --engine="heap,myisam" --post-query="SHOW TABLES" --pre-query="SHOW TABLES" --number-of-queries=6 --commit=1; --exec $MYSQL_SLAP --only-print --delimiter=";" --query="select * from t1;select * from t2" --create="CREATE TABLE t1 (id int, name varchar(64)); create table t2(foo1 varchar(32), foo2 varchar(32)); INSERT INTO t1 VALUES (1, 'This is a test'); insert into t2 values ('test', 'test2')" --engine="heap,myisam" --post-query="SHOW TABLES" --pre-query="SHOW TABLES" --number-of-queries=6 --commit=1
--exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=write --detach=2 --exec $MYSQL_SLAP --silent --concurrency=5 --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-add-autoincrement --auto-generate-sql-load-type=write --detach=2
...@@ -68,3 +67,9 @@ SHOW DATABASES; ...@@ -68,3 +67,9 @@ SHOW DATABASES;
SHOW DATABASES; SHOW DATABASES;
DROP DATABASE bug58090; DROP DATABASE bug58090;
--echo #
--echo # Bug #11766072 - 59107: MYSQLSLAP CRASHES IF STARTED WITH NO ARGUMENTS ON WINDOWS
--echo #
--replace_regex /queries: [0-9]+.[0-9]+/queries: TIME/
--exec $MYSQL_SLAP
...@@ -138,6 +138,7 @@ DROP FUNCTION db1.f1; ...@@ -138,6 +138,7 @@ DROP FUNCTION db1.f1;
DROP TABLE db1.t1; DROP TABLE db1.t1;
DROP DATABASE db1; DROP DATABASE db1;
DROP DATABASE db2; DROP DATABASE db2;
USE test;
--echo # --echo #
--echo # Bug#13105873:valgrind warning:possible crash in foreign --echo # Bug#13105873:valgrind warning:possible crash in foreign
...@@ -164,3 +165,66 @@ DROP DATABASE testdb; ...@@ -164,3 +165,66 @@ DROP DATABASE testdb;
USE test; USE test;
--echo End of 5.1 tests --echo End of 5.1 tests
--echo #
--echo # Bug#11763507 - 56224: FUNCTION NAME IS CASE-SENSITIVE
--echo #
SET @@SQL_MODE = '';
DELIMITER $;
CREATE FUNCTION testf_bug11763507() RETURNS INT
BEGIN
RETURN 0;
END
$
CREATE PROCEDURE testp_bug11763507()
BEGIN
SELECT "PROCEDURE testp_bug11763507";
END
$
DELIMITER ;$
# STORED FUNCTIONS
SELECT testf_bug11763507();
SELECT TESTF_bug11763507();
--replace_column 5 # 6 #
SHOW FUNCTION STATUS LIKE 'testf_bug11763507';
--replace_column 5 # 6 #
SHOW FUNCTION STATUS WHERE NAME='testf_bug11763507';
--replace_column 5 # 6 #
SHOW FUNCTION STATUS LIKE 'TESTF_bug11763507';
--replace_column 5 # 6 #
SHOW FUNCTION STATUS WHERE NAME='TESTF_bug11763507';
SHOW CREATE FUNCTION testf_bug11763507;
SHOW CREATE FUNCTION TESTF_bug11763507;
# STORED PROCEDURE
CALL testp_bug11763507();
CALL TESTP_bug11763507();
--replace_column 5 # 6 #
SHOW PROCEDURE STATUS LIKE 'testp_bug11763507';
--replace_column 5 # 6 #
SHOW PROCEDURE STATUS WHERE NAME='testp_bug11763507';
--replace_column 5 # 6 #
SHOW PROCEDURE STATUS LIKE 'TESTP_bug11763507';
--replace_column 5 # 6 #
SHOW PROCEDURE STATUS WHERE NAME='TESTP_bug11763507';
SHOW CREATE PROCEDURE testp_bug11763507;
SHOW CREATE PROCEDURE TESTP_bug11763507;
# INFORMATION SCHEMA
SELECT specific_name FROM INFORMATION_SCHEMA.ROUTINES WHERE specific_name LIKE 'testf_bug11763507';
SELECT specific_name FROM INFORMATION_SCHEMA.ROUTINES WHERE specific_name LIKE 'TESTF_bug11763507';
SELECT specific_name FROM INFORMATION_SCHEMA.ROUTINES WHERE specific_name='testf_bug11763507';
SELECT specific_name FROM INFORMATION_SCHEMA.ROUTINES WHERE specific_name='TESTF_bug11763507';
DROP PROCEDURE testp_bug11763507;
DROP FUNCTION testf_bug11763507;
--echo #END OF BUG#11763507 test.
...@@ -649,3 +649,35 @@ END// ...@@ -649,3 +649,35 @@ END//
DELIMITER ;// DELIMITER ;//
SHOW PROCEDURE CODE p1; SHOW PROCEDURE CODE p1;
DROP PROCEDURE p1; DROP PROCEDURE p1;
--echo #
--echo # Bug#11763507 - 56224: FUNCTION NAME IS CASE-SENSITIVE
--echo #
SET @@SQL_MODE = '';
DELIMITER $;
CREATE FUNCTION testf_bug11763507() RETURNS INT
BEGIN
RETURN 0;
END
$
CREATE PROCEDURE testp_bug11763507()
BEGIN
SELECT "PROCEDURE testp_bug11763507";
END
$
DELIMITER ;$
# STORED FUNCTIONS
SHOW FUNCTION CODE testf_bug11763507;
SHOW FUNCTION CODE TESTF_bug11763507;
# STORED PROCEDURE
SHOW PROCEDURE CODE testp_bug11763507;
SHOW PROCEDURE CODE TESTP_bug11763507;
DROP PROCEDURE testp_bug11763507;
DROP FUNCTION testf_bug11763507;
--echo #END OF BUG#11763507 test.
...@@ -449,6 +449,29 @@ DROP FUNCTION f1; ...@@ -449,6 +449,29 @@ DROP FUNCTION f1;
--disconnect con1 --disconnect con1
--disconnect con2 --disconnect con2
--echo #
--echo # Bug#11763507 - 56224: FUNCTION NAME IS CASE-SENSITIVE
--echo #
SET @@SQL_MODE = '';
DELIMITER $;
CREATE EVENT teste_bug11763507 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
DO SELECT 1 $
DELIMITER ;$
# EVENTS
--replace_column 6 # 7 # 8 # 9 #
SHOW EVENTS LIKE 'teste_bug11763507';
--replace_column 6 # 7 # 8 # 9 #
SHOW EVENTS LIKE 'TESTE_bug11763507';
--replace_column 4 #
SHOW CREATE EVENT teste_bug11763507;
--replace_column 4 #
SHOW CREATE EVENT TESTE_bug11763507;
DROP EVENT teste_bug11763507;
--echo #END OF BUG#11763507 test.
--echo # ------------------------------------------------------------------ --echo # ------------------------------------------------------------------
--echo # -- End of 5.1 tests --echo # -- End of 5.1 tests
......
...@@ -3427,6 +3427,61 @@ SET SESSION sql_mode=@old_sql_mode; ...@@ -3427,6 +3427,61 @@ SET SESSION sql_mode=@old_sql_mode;
DEALLOCATE PREPARE stmt; DEALLOCATE PREPARE stmt;
DROP TABLE t1; DROP TABLE t1;
--echo #
--echo # Bug#12763207 - ASSERT IN SUBSELECT::SINGLE_VALUE_TRANSFORMER
--echo #
CREATE TABLE t1(a1 int);
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2(a1 int);
INSERT INTO t2 VALUES (3);
SELECT @@session.sql_mode INTO @old_sql_mode;
SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
## All these are subject to the transformation
## '1 < some (...)' => '1 < max(...)'
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 2 FROM t2);
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 2.0 FROM t2);
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT 'a' FROM t2);
SELECT 1 FROM t1 WHERE 1 < SOME (SELECT a1 FROM t2);
SET SESSION sql_mode=@old_sql_mode;
DROP TABLE t1, t2;
--echo #
--echo # Bug#12763207 - ASSERT IN SUBSELECT::SINGLE_VALUE_TRANSFORMER
--echo #
create table t2(i int);
insert into t2 values(0);
SELECT @@session.sql_mode INTO @old_sql_mode;
SET SESSION sql_mode='ONLY_FULL_GROUP_BY';
CREATE VIEW v1 AS
SELECT 'f' FROM t2 UNION SELECT 'x' FROM t2
;
CREATE TABLE t1 (
pk int NOT NULL,
col_varchar_key varchar(1) DEFAULT NULL,
PRIMARY KEY (pk),
KEY col_varchar_key (col_varchar_key)
);
SELECT t1.pk
FROM t1
WHERE t1.col_varchar_key < ALL ( SELECT * FROM v1 )
;
SET SESSION sql_mode=@old_sql_mode;
drop table t2, t1;
drop view v1;
--echo End of 5.0 tests. --echo End of 5.0 tests.
# #
......
...@@ -1021,7 +1021,13 @@ Item_in_subselect::single_value_transformer(JOIN *join, ...@@ -1021,7 +1021,13 @@ Item_in_subselect::single_value_transformer(JOIN *join,
print_where(item, "rewrite with MIN/MAX", QT_ORDINARY);); print_where(item, "rewrite with MIN/MAX", QT_ORDINARY););
if (thd->variables.sql_mode & MODE_ONLY_FULL_GROUP_BY) if (thd->variables.sql_mode & MODE_ONLY_FULL_GROUP_BY)
{ {
DBUG_ASSERT(select_lex->non_agg_field_used()); /*
If the argument is a field, we assume that fix_fields() has
tagged the select_lex with non_agg_field_used.
We reverse that decision after this rewrite with MIN/MAX.
*/
if (item->get_arg(0)->type() == Item::FIELD_ITEM)
DBUG_ASSERT(select_lex->non_agg_field_used());
select_lex->set_non_agg_field_used(false); select_lex->set_non_agg_field_used(false);
} }
......
...@@ -4323,7 +4323,8 @@ bool store_schema_proc(THD *thd, TABLE *table, TABLE *proc_table, ...@@ -4323,7 +4323,8 @@ bool store_schema_proc(THD *thd, TABLE *table, TABLE *proc_table,
(sql_command_flags[lex->sql_command] & CF_STATUS_COMMAND) == 0) (sql_command_flags[lex->sql_command] & CF_STATUS_COMMAND) == 0)
{ {
restore_record(table, s->default_values); restore_record(table, s->default_values);
if (!wild || !wild[0] || !wild_compare(sp_name.c_ptr_safe(), wild, 0)) if (!wild || !wild[0] || !wild_case_compare(system_charset_info,
sp_name.c_ptr_safe(), wild))
{ {
int enum_idx= (int) proc_table->field[5]->val_int(); int enum_idx= (int) proc_table->field[5]->val_int();
table->field[3]->store(sp_name.ptr(), sp_name.length(), cs); table->field[3]->store(sp_name.ptr(), sp_name.length(), cs);
...@@ -5325,7 +5326,7 @@ copy_event_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table) ...@@ -5325,7 +5326,7 @@ copy_event_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table)
DBUG_RETURN(1); DBUG_RETURN(1);
} }
if (!(!wild || !wild[0] || !wild_compare(et.name.str, wild, 0))) if (!(!wild || !wild[0] || !wild_case_compare(scs, et.name.str, wild)))
DBUG_RETURN(0); DBUG_RETURN(0);
/* /*
......
...@@ -3979,6 +3979,7 @@ Item *Field_iterator_table::create_item(THD *thd) ...@@ -3979,6 +3979,7 @@ Item *Field_iterator_table::create_item(THD *thd)
{ {
select->non_agg_fields.push_back(item); select->non_agg_fields.push_back(item);
item->marker= select->cur_pos_in_select_list; item->marker= select->cur_pos_in_select_list;
select->set_non_agg_field_used(true);
} }
return item; return item;
} }
......
...@@ -120,9 +120,9 @@ struct trx_purge_struct{ ...@@ -120,9 +120,9 @@ struct trx_purge_struct{
read_view_t* view; /* The purge will not remove undo logs read_view_t* view; /* The purge will not remove undo logs
which are >= this view (purge view) */ which are >= this view (purge view) */
mutex_t mutex; /* Mutex protecting the fields below */ mutex_t mutex; /* Mutex protecting the fields below */
ulint n_pages_handled;/* Approximate number of undo log ulonglong n_pages_handled;/* Approximate number of undo log
pages processed in purge */ pages processed in purge */
ulint handle_limit; /* Target of how many pages to get ulonglong handle_limit; /* Target of how many pages to get
processed in the current purge */ processed in the current purge */
/*------------------------------*/ /*------------------------------*/
/* The following two fields form the 'purge pointer' which advances /* The following two fields form the 'purge pointer' which advances
......
...@@ -1022,7 +1022,7 @@ trx_purge(void) ...@@ -1022,7 +1022,7 @@ trx_purge(void)
{ {
que_thr_t* thr; que_thr_t* thr;
/* que_thr_t* thr2; */ /* que_thr_t* thr2; */
ulint old_pages_handled; ulonglong old_pages_handled;
mutex_enter(&(purge_sys->mutex)); mutex_enter(&(purge_sys->mutex));
...@@ -1116,7 +1116,7 @@ trx_purge(void) ...@@ -1116,7 +1116,7 @@ trx_purge(void)
(ulong) purge_sys->n_pages_handled); (ulong) purge_sys->n_pages_handled);
} }
return(purge_sys->n_pages_handled - old_pages_handled); return((ulint) (purge_sys->n_pages_handled - old_pages_handled));
} }
/********************************************************************** /**********************************************************************
......
...@@ -140,9 +140,9 @@ struct trx_purge_struct{ ...@@ -140,9 +140,9 @@ struct trx_purge_struct{
read_view_t* view; /*!< The purge will not remove undo logs read_view_t* view; /*!< The purge will not remove undo logs
which are >= this view (purge view) */ which are >= this view (purge view) */
mutex_t mutex; /*!< Mutex protecting the fields below */ mutex_t mutex; /*!< Mutex protecting the fields below */
ulint n_pages_handled;/*!< Approximate number of undo log ulonglong n_pages_handled;/*!< Approximate number of undo log
pages processed in purge */ pages processed in purge */
ulint handle_limit; /*!< Target of how many pages to get ulonglong handle_limit; /*!< Target of how many pages to get
processed in the current purge */ processed in the current purge */
/*------------------------------*/ /*------------------------------*/
/* The following two fields form the 'purge pointer' which advances /* The following two fields form the 'purge pointer' which advances
......
...@@ -1085,7 +1085,7 @@ trx_purge(void) ...@@ -1085,7 +1085,7 @@ trx_purge(void)
{ {
que_thr_t* thr; que_thr_t* thr;
/* que_thr_t* thr2; */ /* que_thr_t* thr2; */
ulint old_pages_handled; ulonglong old_pages_handled;
mutex_enter(&(purge_sys->mutex)); mutex_enter(&(purge_sys->mutex));
...@@ -1179,7 +1179,7 @@ trx_purge(void) ...@@ -1179,7 +1179,7 @@ trx_purge(void)
(ulong) purge_sys->n_pages_handled); (ulong) purge_sys->n_pages_handled);
} }
return(purge_sys->n_pages_handled - old_pages_handled); return((ulint) (purge_sys->n_pages_handled - old_pages_handled));
} }
/******************************************************************//** /******************************************************************//**
......
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