summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2011-07-07 14:27:26 +0300
committerGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2011-07-07 14:27:26 +0300
commitc298dad7fd738c8dc09a318dba0570a8b8b4af19 (patch)
tree86408e6f11f92d61d72dccf381a9671cbf72c887 /mysql-test/t
parentf3b5aa7ad65d548177b158c23e7772033461e964 (diff)
parentbb5e014a2dac3b1e40b3268c6647ceb5d6a335a9 (diff)
downloadmariadb-git-c298dad7fd738c8dc09a318dba0570a8b8b4af19.tar.gz
weave merge of mysql-5.1->mysql-5.1-security
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/alter_table.test27
-rw-r--r--mysql-test/t/parser_stack.test4
-rw-r--r--mysql-test/t/sp_sync.test31
3 files changed, 59 insertions, 3 deletions
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index 4989a6c380c..2a8ac2a00d6 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -1073,4 +1073,31 @@ ALTER TABLE t1 DROP COLUMN a, ADD COLUMN c TEXT FIRST;
DROP TABLE t1;
+--echo #
+--echo # Test for bug #12652385 - "61493: REORDERING COLUMNS TO POSITION
+--echo # FIRST CAN CAUSE DATA TO BE CORRUPTED".
+--echo #
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+--echo # Use MyISAM engine as the fact that InnoDB doesn't support
+--echo # in-place ALTER TABLE in cases when columns are being renamed
+--echo # hides some bugs.
+create table t1 (i int, j int) engine=myisam;
+insert into t1 value (1, 2);
+--echo # First, test for original problem described in the bug report.
+select * from t1;
+--echo # Change of column order by the below ALTER TABLE statement should
+--echo # affect both column names and column contents.
+alter table t1 modify column j int first;
+select * from t1;
+--echo # Now test for similar problem with the same root.
+--echo # The below ALTER TABLE should change not only the name but
+--echo # also the value for the last column of the table.
+alter table t1 drop column i, add column k int default 0;
+select * from t1;
+--echo # Clean-up.
+drop table t1;
+
+
--echo End of 5.1 tests
diff --git a/mysql-test/t/parser_stack.test b/mysql-test/t/parser_stack.test
index 3330ef41833..e58459044f0 100644
--- a/mysql-test/t/parser_stack.test
+++ b/mysql-test/t/parser_stack.test
@@ -1,4 +1,4 @@
-# Copyright (C) 2008 Sun Microsystems, Inc
+# Copyright (c) 2008 MySQL AB
#
# 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
@@ -11,7 +11,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# These tests are designed to cause an internal parser stack overflow,
diff --git a/mysql-test/t/sp_sync.test b/mysql-test/t/sp_sync.test
index f9dae17b039..d8458f69eef 100644
--- a/mysql-test/t/sp_sync.test
+++ b/mysql-test/t/sp_sync.test
@@ -1,7 +1,10 @@
# This test should work in embedded server after mysqltest is fixed
-- source include/not_embedded.inc
---echo Tests of syncronization of stored procedure execution.
+# Save the initial number of concurrent sessions
+--source include/count_sessions.inc
+
+--echo Tests of synchronization of stored procedure execution.
--source include/have_debug_sync.inc
@@ -54,5 +57,31 @@ connection default;
DROP TABLE t1, t2;
DROP PROCEDURE p1;
+--echo #
+--echo # test for bug#11756013
+--echo #
+--disable_warnings
+DROP SCHEMA IF EXISTS s1;
+--enable_warnings
+CREATE SCHEMA s1;
+CREATE PROCEDURE s1.p1() BEGIN END;
+
+connect (con3, localhost, root);
+SET DEBUG_SYNC='before_db_dir_check SIGNAL check_db WAIT_FOR dropped_schema';
+--send CALL s1.p1
+
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR check_db';
+DROP SCHEMA s1;
+SET DEBUG_SYNC='now SIGNAL dropped_schema';
+
+connection con3;
+--error ER_BAD_DB_ERROR
+--reap
+connection default;
+disconnect con3;
+
SET DEBUG_SYNC = 'RESET';
+# Wait till we reached the initial number of concurrent sessions
+--source include/wait_until_count_sessions.inc