summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2011-11-24 18:48:58 +0200
committerMichael Widenius <monty@askmonty.org>2011-11-24 18:48:58 +0200
commit69204571425ed3221e94c7eb1e030c00089bca26 (patch)
tree3d9cfbc44a057883c7db6bce267c8ebfd5fa9313 /tests
parente3e60a4102d6918e4231e402bef89b1a6b2a20cb (diff)
parentd26aefb0775048128495eaab151ee4118f8f7afd (diff)
downloadmariadb-git-69204571425ed3221e94c7eb1e030c00089bca26.tar.gz
Merge with MariaDB 5.1
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am7
-rw-r--r--tests/bug25714.c7
-rwxr-xr-xtests/grant.pl16
-rw-r--r--tests/mysql_client_test.c83
4 files changed, 107 insertions, 6 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 5283edacf25..204c5457f13 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,4 +1,5 @@
-# Copyright (C) 2000-2006 MySQL AB
+# Copyright (c) 2000-2007 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
@@ -12,8 +13,8 @@
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
-# MA 02111-1307, USA
+# Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+# MA 02110-1301, USA
## Process this file with automake to create Makefile.in
diff --git a/tests/bug25714.c b/tests/bug25714.c
index c0d9fbf7652..ad3b863dd75 100644
--- a/tests/bug25714.c
+++ b/tests/bug25714.c
@@ -1,4 +1,6 @@
-/* Copyright (C) 2007 MySQL AB
+/*
+ Copyright (c) 2007 MySQL AB, 2009 Sun Microsystems, Inc.
+ Use is subject to license terms.
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 +13,8 @@
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
+*/
#include <my_global.h>
#include <my_sys.h>
diff --git a/tests/grant.pl b/tests/grant.pl
index 4f2bd1a61cb..a2465d19bb1 100755
--- a/tests/grant.pl
+++ b/tests/grant.pl
@@ -1,4 +1,20 @@
#!/usr/bin/perl
+# Copyright (c) 2000, 2005 MySQL AB, 2009 Sun Microsystems, Inc.
+# Use is subject to license terms.
+#
+# 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
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
#
# Testing of grants.
# Note that this will delete all table and column grants !
diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c
index c6efdca60f6..6c1b638ce81 100644
--- a/tests/mysql_client_test.c
+++ b/tests/mysql_client_test.c
@@ -1,4 +1,5 @@
-/* Copyright (c) 2002, 2010, Oracle and/or its affiliates.
+/* Copyright (c) 2002, 2011, Oracle and/or its affiliates.
+ Copyright (c) 2008-2011 Monty Program 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
@@ -18558,6 +18559,85 @@ static void test_bug56976()
DBUG_VOID_RETURN;
}
+/*
+ Bug#13001491: MYSQL_REFRESH CRASHES WHEN STORED ROUTINES ARE RUN CONCURRENTLY.
+*/
+static void test_bug13001491()
+{
+ int rc;
+ char query[MAX_TEST_QUERY_LENGTH];
+ MYSQL *c;
+
+ myheader("test_bug13001491");
+
+ my_snprintf(query, MAX_TEST_QUERY_LENGTH,
+ "GRANT ALL PRIVILEGES ON *.* TO mysqltest_u1@%s",
+ opt_host ? opt_host : "'localhost'");
+
+ rc= mysql_query(mysql, query);
+ myquery(rc);
+
+ my_snprintf(query, MAX_TEST_QUERY_LENGTH,
+ "GRANT RELOAD ON *.* TO mysqltest_u1@%s",
+ opt_host ? opt_host : "'localhost'");
+
+ rc= mysql_query(mysql, query);
+ myquery(rc);
+
+ c= mysql_client_init(NULL);
+
+ DIE_UNLESS(mysql_real_connect(c, opt_host, "mysqltest_u1", NULL,
+ current_db, opt_port, opt_unix_socket,
+ CLIENT_MULTI_STATEMENTS |
+ CLIENT_MULTI_RESULTS));
+
+ rc= mysql_query(c, "DROP PROCEDURE IF EXISTS p1");
+ myquery(rc);
+
+ rc= mysql_query(c,
+ "CREATE PROCEDURE p1() "
+ "BEGIN "
+ " DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END; "
+ " SELECT COUNT(*) "
+ " FROM INFORMATION_SCHEMA.PROCESSLIST "
+ " GROUP BY user "
+ " ORDER BY NULL "
+ " INTO @a; "
+ "END");
+ myquery(rc);
+
+ rc= mysql_query(c, "CALL p1()");
+ myquery(rc);
+
+ mysql_free_result(mysql_store_result(c));
+
+ /* Check that mysql_refresh() succeeds without REFRESH_LOG. */
+ rc= mysql_refresh(c, REFRESH_GRANT |
+ REFRESH_TABLES | REFRESH_HOSTS |
+ REFRESH_STATUS | REFRESH_THREADS);
+ myquery(rc);
+
+ /*
+ Check that mysql_refresh(REFRESH_LOG) does not crash the server even if it
+ fails. mysql_refresh(REFRESH_LOG) fails when error log points to unavailable
+ location.
+ */
+ mysql_refresh(c, REFRESH_LOG);
+
+ rc= mysql_query(c, "DROP PROCEDURE p1");
+ myquery(rc);
+
+ mysql_close(c);
+ c= NULL;
+
+ my_snprintf(query, MAX_TEST_QUERY_LENGTH,
+ "DROP USER mysqltest_u1@%s",
+ opt_host ? opt_host : "'localhost'");
+
+ rc= mysql_query(mysql, query);
+ myquery(rc);
+}
+
/*
Read and parse arguments and MySQL options from my.cnf
@@ -18886,6 +18966,7 @@ static struct my_tests_st my_tests[]= {
{ "test_bug47485", test_bug47485 },
{ "test_bug58036", test_bug58036 },
{ "test_bug56976", test_bug56976 },
+ { "test_bug13001491", test_bug13001491 },
{ 0, 0 }
};