merge 5.3->5.5
This commit is contained in:
commit
31249744fe
@ -479,6 +479,28 @@ SELECT * FROM
|
|||||||
WHERE tmp.a;
|
WHERE tmp.a;
|
||||||
a b
|
a b
|
||||||
100 200
|
100 200
|
||||||
|
#
|
||||||
|
# MDEV-5356: Server crashes in Item_equal::contains on 2nd
|
||||||
|
# execution of a PS
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (a INT, b INT);
|
||||||
|
INSERT INTO t1 VALUES (1,2),(3,4);
|
||||||
|
CREATE TABLE t2 (c INT);
|
||||||
|
INSERT INTO t2 VALUES (5),(6);
|
||||||
|
CREATE TABLE t3 (d INT);
|
||||||
|
INSERT INTO t3 VALUES (7),(8);
|
||||||
|
CREATE PROCEDURE pr()
|
||||||
|
UPDATE t3,
|
||||||
|
(SELECT c FROM
|
||||||
|
(SELECT 1 FROM t1 WHERE a=72 AND NOT b) sq,
|
||||||
|
t2
|
||||||
|
) sq2
|
||||||
|
SET d=sq2.c;
|
||||||
|
CALL pr();
|
||||||
|
CALL pr();
|
||||||
|
CALL pr();
|
||||||
|
drop procedure pr;
|
||||||
|
drop table t1,t2,t3;
|
||||||
# End of 5.3 tests
|
# End of 5.3 tests
|
||||||
#
|
#
|
||||||
# Bug#58730 Assertion failed: table->key_read == 0 in close_thread_table,
|
# Bug#58730 Assertion failed: table->key_read == 0 in close_thread_table,
|
||||||
|
14
mysql-test/r/repair_symlink-5543.result
Normal file
14
mysql-test/r/repair_symlink-5543.result
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
create table t1 (a int) engine=myisam data directory='MYSQL_TMP_DIR';
|
||||||
|
insert t1 values (1);
|
||||||
|
repair table t1;
|
||||||
|
Table Op Msg_type Msg_text
|
||||||
|
test.t1 repair error Can't create new tempfile: 'MYSQL_TMP_DIR/t1.TMD'
|
||||||
|
test.t1 repair status Operation failed
|
||||||
|
drop table t1;
|
||||||
|
create table t2 (a int) engine=aria data directory='MYSQL_TMP_DIR';
|
||||||
|
insert t2 values (1);
|
||||||
|
repair table t2;
|
||||||
|
Table Op Msg_type Msg_text
|
||||||
|
test.t2 repair error Can't create new tempfile: 'MYSQL_TMP_DIR/t2.TMD'
|
||||||
|
test.t2 repair status Operation failed
|
||||||
|
drop table t2;
|
@ -394,6 +394,35 @@ WHERE tmp.b;
|
|||||||
SELECT * FROM
|
SELECT * FROM
|
||||||
( SELECT 100 a, subsel.b FROM ( SELECT 200 b ) subsel ) tmp
|
( SELECT 100 a, subsel.b FROM ( SELECT 200 b ) subsel ) tmp
|
||||||
WHERE tmp.a;
|
WHERE tmp.a;
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-5356: Server crashes in Item_equal::contains on 2nd
|
||||||
|
--echo # execution of a PS
|
||||||
|
--echo #
|
||||||
|
CREATE TABLE t1 (a INT, b INT);
|
||||||
|
INSERT INTO t1 VALUES (1,2),(3,4);
|
||||||
|
|
||||||
|
CREATE TABLE t2 (c INT);
|
||||||
|
INSERT INTO t2 VALUES (5),(6);
|
||||||
|
|
||||||
|
CREATE TABLE t3 (d INT);
|
||||||
|
INSERT INTO t3 VALUES (7),(8);
|
||||||
|
|
||||||
|
CREATE PROCEDURE pr()
|
||||||
|
UPDATE t3,
|
||||||
|
(SELECT c FROM
|
||||||
|
(SELECT 1 FROM t1 WHERE a=72 AND NOT b) sq,
|
||||||
|
t2
|
||||||
|
) sq2
|
||||||
|
SET d=sq2.c;
|
||||||
|
|
||||||
|
CALL pr();
|
||||||
|
CALL pr();
|
||||||
|
CALL pr();
|
||||||
|
|
||||||
|
drop procedure pr;
|
||||||
|
drop table t1,t2,t3;
|
||||||
|
|
||||||
--echo # End of 5.3 tests
|
--echo # End of 5.3 tests
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
|
26
mysql-test/t/repair_symlink-5543.test
Normal file
26
mysql-test/t/repair_symlink-5543.test
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#
|
||||||
|
# MDEV-5543 MyISAM repair unsafe usage of TMD files
|
||||||
|
#
|
||||||
|
--source include/have_symlink.inc
|
||||||
|
--source include/not_windows.inc
|
||||||
|
--source include/have_maria.inc
|
||||||
|
|
||||||
|
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||||
|
eval create table t1 (a int) engine=myisam data directory='$MYSQL_TMP_DIR';
|
||||||
|
insert t1 values (1);
|
||||||
|
--system ln -s $MYSQL_TMP_DIR/foobar5543 $MYSQL_TMP_DIR/t1.TMD
|
||||||
|
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||||
|
repair table t1;
|
||||||
|
drop table t1;
|
||||||
|
|
||||||
|
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||||
|
eval create table t2 (a int) engine=aria data directory='$MYSQL_TMP_DIR';
|
||||||
|
insert t2 values (1);
|
||||||
|
--system ln -s $MYSQL_TMP_DIR/foobar5543 $MYSQL_TMP_DIR/t2.TMD
|
||||||
|
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
|
||||||
|
repair table t2;
|
||||||
|
drop table t2;
|
||||||
|
|
||||||
|
--list_files $MYSQL_TMP_DIR foobar5543
|
||||||
|
--system rm $MYSQL_TMP_DIR/t1.TMD $MYSQL_TMP_DIR/t2.TMD
|
||||||
|
|
@ -8334,12 +8334,9 @@ bool setup_tables(THD *thd, Name_resolution_context *context,
|
|||||||
if (table_list->merge_underlying_list)
|
if (table_list->merge_underlying_list)
|
||||||
{
|
{
|
||||||
DBUG_ASSERT(table_list->is_merged_derived());
|
DBUG_ASSERT(table_list->is_merged_derived());
|
||||||
Query_arena *arena= thd->stmt_arena, backup;
|
Query_arena *arena, backup;
|
||||||
|
arena= thd->activate_stmt_arena_if_needed(&backup);
|
||||||
bool res;
|
bool res;
|
||||||
if (arena->is_conventional())
|
|
||||||
arena= 0; // For easier test
|
|
||||||
else
|
|
||||||
thd->set_n_backup_active_arena(arena, &backup);
|
|
||||||
res= table_list->setup_underlying(thd);
|
res= table_list->setup_underlying(thd);
|
||||||
if (arena)
|
if (arena)
|
||||||
thd->restore_active_arena(arena, &backup);
|
thd->restore_active_arena(arena, &backup);
|
||||||
@ -8718,11 +8715,8 @@ void wrap_ident(THD *thd, Item **conds)
|
|||||||
{
|
{
|
||||||
Item_direct_ref_to_ident *wrapper;
|
Item_direct_ref_to_ident *wrapper;
|
||||||
DBUG_ASSERT((*conds)->type() == Item::FIELD_ITEM || (*conds)->type() == Item::REF_ITEM);
|
DBUG_ASSERT((*conds)->type() == Item::FIELD_ITEM || (*conds)->type() == Item::REF_ITEM);
|
||||||
Query_arena *arena= thd->stmt_arena, backup;
|
Query_arena *arena, backup;
|
||||||
if (arena->is_conventional())
|
arena= thd->activate_stmt_arena_if_needed(&backup);
|
||||||
arena= 0;
|
|
||||||
else
|
|
||||||
thd->set_n_backup_active_arena(arena, &backup);
|
|
||||||
if ((wrapper= new Item_direct_ref_to_ident((Item_ident *)(*conds))))
|
if ((wrapper= new Item_direct_ref_to_ident((Item_ident *)(*conds))))
|
||||||
(*conds)= (Item*) wrapper;
|
(*conds)= (Item*) wrapper;
|
||||||
if (arena)
|
if (arena)
|
||||||
|
@ -612,11 +612,8 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived)
|
|||||||
thd->lex->sql_command == SQLCOM_DELETE_MULTI))))
|
thd->lex->sql_command == SQLCOM_DELETE_MULTI))))
|
||||||
DBUG_RETURN(FALSE);
|
DBUG_RETURN(FALSE);
|
||||||
|
|
||||||
Query_arena *arena= thd->stmt_arena, backup;
|
Query_arena *arena, backup;
|
||||||
if (arena->is_conventional())
|
arena= thd->activate_stmt_arena_if_needed(&backup);
|
||||||
arena= 0; // For easier test
|
|
||||||
else
|
|
||||||
thd->set_n_backup_active_arena(arena, &backup);
|
|
||||||
|
|
||||||
SELECT_LEX *first_select= unit->first_select();
|
SELECT_LEX *first_select= unit->first_select();
|
||||||
|
|
||||||
|
@ -4075,11 +4075,8 @@ void SELECT_LEX::mark_const_derived(bool empty)
|
|||||||
|
|
||||||
bool st_select_lex::save_leaf_tables(THD *thd)
|
bool st_select_lex::save_leaf_tables(THD *thd)
|
||||||
{
|
{
|
||||||
Query_arena *arena= thd->stmt_arena, backup;
|
Query_arena *arena, backup;
|
||||||
if (arena->is_conventional())
|
arena= thd->activate_stmt_arena_if_needed(&backup);
|
||||||
arena= 0;
|
|
||||||
else
|
|
||||||
thd->set_n_backup_active_arena(arena, &backup);
|
|
||||||
|
|
||||||
List_iterator_fast<TABLE_LIST> li(leaf_tables);
|
List_iterator_fast<TABLE_LIST> li(leaf_tables);
|
||||||
TABLE_LIST *table;
|
TABLE_LIST *table;
|
||||||
@ -4107,10 +4104,7 @@ bool st_select_lex::save_prep_leaf_tables(THD *thd)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
Query_arena *arena= thd->stmt_arena, backup;
|
Query_arena *arena= thd->stmt_arena, backup;
|
||||||
if (arena->is_conventional())
|
arena= thd->activate_stmt_arena_if_needed(&backup);
|
||||||
arena= 0;
|
|
||||||
else
|
|
||||||
thd->set_n_backup_active_arena(arena, &backup);
|
|
||||||
|
|
||||||
List_iterator_fast<TABLE_LIST> li(leaf_tables);
|
List_iterator_fast<TABLE_LIST> li(leaf_tables);
|
||||||
TABLE_LIST *table;
|
TABLE_LIST *table;
|
||||||
|
@ -1052,11 +1052,8 @@ JOIN::optimize()
|
|||||||
MEMROOT for prepared statements and stored procedures.
|
MEMROOT for prepared statements and stored procedures.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Query_arena *arena= thd->stmt_arena, backup;
|
Query_arena *arena, backup;
|
||||||
if (arena->is_conventional())
|
arena= thd->activate_stmt_arena_if_needed(&backup);
|
||||||
arena= 0; // For easier test
|
|
||||||
else
|
|
||||||
thd->set_n_backup_active_arena(arena, &backup);
|
|
||||||
|
|
||||||
sel->first_cond_optimization= 0;
|
sel->first_cond_optimization= 0;
|
||||||
|
|
||||||
|
@ -1138,11 +1138,7 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
|
|||||||
will be TRUE as far as we make new table cache).
|
will be TRUE as far as we make new table cache).
|
||||||
*/
|
*/
|
||||||
old_lex= thd->lex;
|
old_lex= thd->lex;
|
||||||
arena= thd->stmt_arena;
|
arena= thd->activate_stmt_arena_if_needed(&backup);
|
||||||
if (arena->is_conventional())
|
|
||||||
arena= 0;
|
|
||||||
else
|
|
||||||
thd->set_n_backup_active_arena(arena, &backup);
|
|
||||||
|
|
||||||
/* init timestamp */
|
/* init timestamp */
|
||||||
if (!table->timestamp.str)
|
if (!table->timestamp.str)
|
||||||
|
@ -4087,7 +4087,7 @@ bool TABLE_LIST::create_field_translation(THD *thd)
|
|||||||
SELECT_LEX *select= get_single_select();
|
SELECT_LEX *select= get_single_select();
|
||||||
List_iterator_fast<Item> it(select->item_list);
|
List_iterator_fast<Item> it(select->item_list);
|
||||||
uint field_count= 0;
|
uint field_count= 0;
|
||||||
Query_arena *arena= thd->stmt_arena, backup;
|
Query_arena *arena, backup;
|
||||||
bool res= FALSE;
|
bool res= FALSE;
|
||||||
DBUG_ENTER("TABLE_LIST::create_field_translation");
|
DBUG_ENTER("TABLE_LIST::create_field_translation");
|
||||||
|
|
||||||
@ -4126,10 +4126,7 @@ bool TABLE_LIST::create_field_translation(THD *thd)
|
|||||||
DBUG_RETURN(FALSE);
|
DBUG_RETURN(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arena->is_conventional())
|
arena= thd->activate_stmt_arena_if_needed(&backup);
|
||||||
arena= 0; // For easier test
|
|
||||||
else
|
|
||||||
thd->set_n_backup_active_arena(arena, &backup);
|
|
||||||
|
|
||||||
/* Create view fields translation table */
|
/* Create view fields translation table */
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
/* Copyright (C) 2004-2008 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
/* Copyright (C) 2004-2008 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
||||||
Copyright (C) 2008-2009 Sun Microsystems, Inc.
|
Copyright (C) 2008-2009 Sun Microsystems, Inc.
|
||||||
|
Copyright (c) 2009, 2014, SkySQL Ab.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -1580,7 +1581,7 @@ int ha_maria::repair(THD *thd, HA_CHECK *param, bool do_optimize)
|
|||||||
|
|
||||||
param->db_name= table->s->db.str;
|
param->db_name= table->s->db.str;
|
||||||
param->table_name= table->alias.c_ptr();
|
param->table_name= table->alias.c_ptr();
|
||||||
param->tmpfile_createflag= O_RDWR | O_TRUNC;
|
param->tmpfile_createflag= O_RDWR | O_TRUNC | O_EXCL;
|
||||||
param->using_global_keycache= 1;
|
param->using_global_keycache= 1;
|
||||||
param->thd= thd;
|
param->thd= thd;
|
||||||
param->tmpdir= &mysql_tmpdir_list;
|
param->tmpdir= &mysql_tmpdir_list;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright (c) 2000, 2012, Oracle and/or its affiliates.
|
Copyright (c) 2000, 2012, Oracle and/or its affiliates.
|
||||||
|
Copyright (c) 2009, 2014, SkySQL Ab.
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@ -1071,7 +1072,7 @@ int ha_myisam::repair(THD *thd, HA_CHECK ¶m, bool do_optimize)
|
|||||||
|
|
||||||
param.db_name= table->s->db.str;
|
param.db_name= table->s->db.str;
|
||||||
param.table_name= table->alias.c_ptr();
|
param.table_name= table->alias.c_ptr();
|
||||||
param.tmpfile_createflag = O_RDWR | O_TRUNC;
|
param.tmpfile_createflag= O_RDWR | O_TRUNC | O_EXCL;
|
||||||
param.using_global_keycache = 1;
|
param.using_global_keycache = 1;
|
||||||
param.thd= thd;
|
param.thd= thd;
|
||||||
param.tmpdir= &mysql_tmpdir_list;
|
param.tmpdir= &mysql_tmpdir_list;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user