summaryrefslogtreecommitdiff
path: root/mysql-test/t/rpl_misc_functions.test
diff options
context:
space:
mode:
authorunknown <guilhem@mysql.com>2003-05-13 22:50:28 +0200
committerunknown <guilhem@mysql.com>2003-05-13 22:50:28 +0200
commit40e4b8d0cb1faf39acbfddc0e30f3e2d209bb4c2 (patch)
tree4c8a22e163b9ae0e547c23bacb1d8c2a93177192 /mysql-test/t/rpl_misc_functions.test
parent9f22d16669969dbbba5e9b1198e1623ef02c0289 (diff)
downloadmariadb-git-40e4b8d0cb1faf39acbfddc0e30f3e2d209bb4c2.tar.gz
Proper replication of CONNECTION_ID() and 4.1 PASSWORD() (bugs 177 and 344),
new test for this. sql/item_create.cc: Proper replication of CONNECTION_ID() (bug 177). This is just for replication; mysqlbinlog|mysql still does not work with CONNECTION_ID(), it will wait for row-level binlogging. sql/item_strfunc.cc: Proper replication of the new 4.1 PASSWORD() (bug 344)
Diffstat (limited to 'mysql-test/t/rpl_misc_functions.test')
-rw-r--r--mysql-test/t/rpl_misc_functions.test30
1 files changed, 30 insertions, 0 deletions
diff --git a/mysql-test/t/rpl_misc_functions.test b/mysql-test/t/rpl_misc_functions.test
new file mode 100644
index 00000000000..12eadbb25ed
--- /dev/null
+++ b/mysql-test/t/rpl_misc_functions.test
@@ -0,0 +1,30 @@
+#
+# Test of replicating some difficult functions
+#
+source include/master-slave.inc;
+
+create table t1(id int, i int, r1 int, r2 int, p varchar(100));
+insert into t1 values(1, connection_id(), 0, 0, "");
+# don't put rand and password in the same query, to see if they replicate
+# independently
+# Pure rand test
+insert into t1 values(2, 0, rand()*1000, rand()*1000, "");
+# change the rand suite on the master (we do this because otherwise password()
+# benefits from the fact that the above rand() is well replicated :
+# it picks the same sequence element, which hides a possible bug in password() replication.
+set sql_log_bin=0;
+insert into t1 values(6, 0, rand(), rand(), "");
+delete from t1 where id=6;
+set sql_log_bin=1;
+# Pure password test
+insert into t1 values(3, 0, 0, 0, password('does_this_work?'));
+# "altogether now"
+insert into t1 values(4, connection_id(), rand()*1000, rand()*1000, password('does_this_still_work?'));
+select * into outfile 'rpl_misc_functions.outfile' from t1;
+sync_slave_with_master;
+create table t2 like t1;
+# read the values from the master table
+load data local infile './var/master-data/test/rpl_misc_functions.outfile' into table t2;
+# compare them with the replica; the SELECT below should return no row
+select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p);
+stop slave;