summaryrefslogtreecommitdiff
path: root/mysql-test/include
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/include')
-rw-r--r--mysql-test/include/commit.inc28
-rw-r--r--mysql-test/include/have_dynamic_loading.inc4
-rw-r--r--mysql-test/include/have_example_plugin.inc20
-rw-r--r--mysql-test/include/have_semisync_plugin.inc9
-rw-r--r--mysql-test/include/have_simple_parser.inc21
-rw-r--r--mysql-test/include/have_udf.inc21
-rw-r--r--mysql-test/include/rpl_udf.inc2
7 files changed, 67 insertions, 38 deletions
diff --git a/mysql-test/include/commit.inc b/mysql-test/include/commit.inc
index d91ba8291fd..4336d3be0ed 100644
--- a/mysql-test/include/commit.inc
+++ b/mysql-test/include/commit.inc
@@ -547,9 +547,9 @@ call p_verify_status_increment(0, 0, 0, 0);
--echo # the binary log.
--echo #
select f1();
-call p_verify_status_increment(0, 0, 1, 0);
+call p_verify_status_increment(1, 0, 1, 0);
commit;
-call p_verify_status_increment(0, 0, 1, 0);
+call p_verify_status_increment(1, 0, 1, 0);
--echo # 17. Read-only statement, a function changes non-trans-table.
--echo #
@@ -557,15 +557,19 @@ call p_verify_status_increment(0, 0, 1, 0);
--echo # non-transactional changes saved in the transaction cache to
--echo # the binary log.
--echo #
+--disable_warnings
select f1() from t1;
-call p_verify_status_increment(1, 0, 2, 0);
+--enable_warnings
+call p_verify_status_increment(2, 0, 2, 0);
commit;
-call p_verify_status_increment(1, 0, 2, 0);
+call p_verify_status_increment(2, 0, 2, 0);
--echo # 18. Read-write statement: UPDATE, change 0 (transactional) rows.
--echo #
select count(*) from t2;
+--disable_warnings
update t1 set a=2 where a=f1()+10;
+--enable_warnings
select count(*) from t2;
call p_verify_status_increment(2, 0, 2, 0);
commit;
@@ -579,7 +583,7 @@ call p_verify_status_increment(2, 0, 2, 0);
drop table t2;
set sql_mode=no_engine_substitution;
create temporary table t2 (a int);
-call p_verify_status_increment(0, 0, 0, 0);
+call p_verify_status_increment(1, 0, 0, 0);
set sql_mode=default;
--echo # 19. A function changes temp-trans-table.
--echo #
@@ -636,9 +640,9 @@ call p_verify_status_increment(2, 0, 1, 0);
--echo # 25. DDL: DROP TEMPORARY TABLE, does not start a transaction
--echo #
drop temporary table t2;
-call p_verify_status_increment(0, 0, 0, 0);
+call p_verify_status_increment(1, 0, 0, 0);
commit;
-call p_verify_status_increment(0, 0, 0, 0);
+call p_verify_status_increment(1, 0, 0, 0);
--echo # 26. Verify that SET AUTOCOMMIT issues an implicit commit
--echo #
@@ -719,17 +723,17 @@ call p_verify_status_increment(4, 4, 4, 4);
--echo # Sic: no table is created.
create table if not exists t2 (a int) select 6 union select 7;
--echo # Sic: first commits the statement, and then the transaction.
-call p_verify_status_increment(4, 4, 4, 4);
+call p_verify_status_increment(2, 0, 4, 4);
create table t3 select a from t2;
-call p_verify_status_increment(4, 4, 4, 4);
+call p_verify_status_increment(2, 0, 4, 4);
alter table t3 add column (b int);
call p_verify_status_increment(2, 0, 2, 0);
alter table t3 rename t4;
-call p_verify_status_increment(2, 2, 2, 2);
+call p_verify_status_increment(1, 0, 1, 0);
rename table t4 to t3;
-call p_verify_status_increment(2, 2, 2, 2);
+call p_verify_status_increment(1, 0, 1, 0);
truncate table t3;
-call p_verify_status_increment(4, 4, 4, 4);
+call p_verify_status_increment(2, 0, 2, 0);
create view v1 as select * from t2;
call p_verify_status_increment(1, 0, 1, 0);
check table t1;
diff --git a/mysql-test/include/have_dynamic_loading.inc b/mysql-test/include/have_dynamic_loading.inc
index 1b2c85b3904..3ce9641d87c 100644
--- a/mysql-test/include/have_dynamic_loading.inc
+++ b/mysql-test/include/have_dynamic_loading.inc
@@ -1,7 +1,9 @@
#
# Whether server supports dynamic loading.
#
---require r/have_dynamic_loading.require
+if (`SELECT @@have_dynamic_loading != 'YES'`) {
+ --skip The test requires dynamic loading
+}
disable_query_log;
show variables like 'have_dynamic_loading';
enable_query_log;
diff --git a/mysql-test/include/have_example_plugin.inc b/mysql-test/include/have_example_plugin.inc
index a2fffc17b97..3a667d2e21a 100644
--- a/mysql-test/include/have_example_plugin.inc
+++ b/mysql-test/include/have_example_plugin.inc
@@ -1,13 +1,21 @@
#
-# Check if server has support for loading udf's
-# i.e it will support dlopen
+# Check if server has support for loading plugins
#
---source include/have_dynamic_loading.inc
+if (`SELECT @@have_dynamic_loading != 'YES'`) {
+ --skip Example plugin requires dynamic loading
+}
#
# Check if the variable EXAMPLE_PLUGIN is set
#
---require r/have_example_plugin.require
-disable_query_log;
-eval select LENGTH('$EXAMPLE_PLUGIN') > 0 as 'have_example_plugin';
+if (`SELECT LENGTH('$EXAMPLE_PLUGIN') = 0`) {
+ --skip Example plugin requires the environment variable \$EXAMPLE_PLUGIN to be set (normally done by mtr)
+}
+
+#
+# Check if --plugin-dir was setup for exampledb
+#
+if (`SELECT CONCAT('--plugin-dir=', @@plugin_dir) != '$EXAMPLE_PLUGIN_OPT'`) {
+ --skip Example plugin requires that --plugin-dir is set to the example plugin dir (either the .opt file does not contain \$EXAMPLE_PLUGIN_OPT or another plugin is in use)
+}
enable_query_log;
diff --git a/mysql-test/include/have_semisync_plugin.inc b/mysql-test/include/have_semisync_plugin.inc
index 37c9a744b6a..d3b42dbf5fb 100644
--- a/mysql-test/include/have_semisync_plugin.inc
+++ b/mysql-test/include/have_semisync_plugin.inc
@@ -1,10 +1,9 @@
#
-# Check if dynamic loading is supported
+# Check if server has support for loading plugins
#
---require r/have_dynamic_loading.require
-disable_query_log;
-show variables like 'have_dynamic_loading';
-enable_query_log;
+if (`SELECT @@have_dynamic_loading != 'YES'`) {
+ --skip Requires dynamic loading
+}
#
# Check if the variable SEMISYNC_MASTER_PLUGIN is set
diff --git a/mysql-test/include/have_simple_parser.inc b/mysql-test/include/have_simple_parser.inc
index 5a4dc93ec81..745f68603fe 100644
--- a/mysql-test/include/have_simple_parser.inc
+++ b/mysql-test/include/have_simple_parser.inc
@@ -1,13 +1,20 @@
#
-# Check if server has support for loading udf's
-# i.e it will support dlopen
+# Check if server has support for loading plugins
#
---source include/have_dynamic_loading.inc
+if (`SELECT @@have_dynamic_loading != 'YES'`) {
+ --skip simple parser requires dynamic loading
+}
#
# Check if the variable SIMPLE_PARSER is set
#
---require r/have_simple_parser.require
-disable_query_log;
-eval select LENGTH('$SIMPLE_PARSER') > 0 as 'have_simple_parser';
-enable_query_log;
+if (`SELECT LENGTH('$SIMPLE_PARSER') = 0`) {
+ --skip simple parser requires the environment variable \$SIMPLE_PARSER to be set (normally done by mtr)
+}
+
+#
+# Check if --plugin-dir was setup for simple parser
+#
+if (`SELECT CONCAT('--plugin-dir=', @@plugin_dir) != '$SIMPLE_PARSER_OPT'`) {
+ --skip simple parser requires that --plugin-dir is set to the udf plugin dir (either the .opt file does not contain \$UDF_EXAMPLE_LIB_OPT or another plugin is in use)
+}
diff --git a/mysql-test/include/have_udf.inc b/mysql-test/include/have_udf.inc
index 7be57bbb7a9..d9ca1450043 100644
--- a/mysql-test/include/have_udf.inc
+++ b/mysql-test/include/have_udf.inc
@@ -1,13 +1,20 @@
#
-# Check if server has support for loading udf's
-# i.e it will support dlopen
+# Check if server has support for loading plugins
#
---source include/have_dynamic_loading.inc
+if (`SELECT @@have_dynamic_loading != 'YES'`) {
+ --skip UDF requires dynamic loading
+}
#
# Check if the variable UDF_EXAMPLE_LIB is set
#
---require r/have_udf_example.require
-disable_query_log;
-eval select LENGTH('$UDF_EXAMPLE_LIB') > 0 as 'have_udf_example_lib';
-enable_query_log;
+if (`SELECT LENGTH('$UDF_EXAMPLE_LIB') = 0`) {
+ --skip UDF requires the environment variable \$UDF_EXAMPLE_LIB to be set (normally done by mtr)
+}
+
+#
+# Check if --plugin-dir was setup for udf
+#
+if (`SELECT CONCAT('--plugin-dir=', @@plugin_dir) != '$UDF_EXAMPLE_LIB_OPT'`) {
+ --skip UDF requires that --plugin-dir is set to the udf plugin dir (either the .opt file does not contain \$UDF_EXAMPLE_LIB_OPT or another plugin is in use)
+}
diff --git a/mysql-test/include/rpl_udf.inc b/mysql-test/include/rpl_udf.inc
index 30f39d79d49..8be866613cb 100644
--- a/mysql-test/include/rpl_udf.inc
+++ b/mysql-test/include/rpl_udf.inc
@@ -55,11 +55,13 @@ connection master;
--echo "Running on the master"
--enable_info
eval CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=$engine_type;
+--disable_warnings
INSERT INTO t1 VALUES(myfunc_int(100), myfunc_double(50.00));
INSERT INTO t1 VALUES(myfunc_int(10), myfunc_double(5.00));
INSERT INTO t1 VALUES(myfunc_int(200), myfunc_double(25.00));
INSERT INTO t1 VALUES(myfunc_int(1), myfunc_double(500.00));
SELECT * FROM t1 ORDER BY sum;
+--enable_warnings
--disable_info
sync_slave_with_master;