summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/engines/funcs/t/rpl_loaddatalocal.test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:24:36 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:24:36 +0000
commit06eaf7232e9a920468c0f8d74dcf2fe8b555501c (patch)
treee2c7b5777f728320e5b5542b6213fd3591ba51e2 /mysql-test/suite/engines/funcs/t/rpl_loaddatalocal.test
parentInitial commit. (diff)
downloadmariadb-06eaf7232e9a920468c0f8d74dcf2fe8b555501c.tar.xz
mariadb-06eaf7232e9a920468c0f8d74dcf2fe8b555501c.zip
Adding upstream version 1:10.11.6.upstream/1%10.11.6
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/engines/funcs/t/rpl_loaddatalocal.test')
-rw-r--r--mysql-test/suite/engines/funcs/t/rpl_loaddatalocal.test58
1 files changed, 58 insertions, 0 deletions
diff --git a/mysql-test/suite/engines/funcs/t/rpl_loaddatalocal.test b/mysql-test/suite/engines/funcs/t/rpl_loaddatalocal.test
new file mode 100644
index 00000000..36e863c4
--- /dev/null
+++ b/mysql-test/suite/engines/funcs/t/rpl_loaddatalocal.test
@@ -0,0 +1,58 @@
+# See if "LOAD DATA LOCAL INFILE" is well replicated
+# (LOAD DATA LOCAL INFILE is not written to the binlog
+# the same way as LOAD DATA INFILE : Append_blocks are smaller).
+# In MySQL 4.0 <4.0.12 there were 2 bugs with LOAD DATA LOCAL INFILE :
+# - the loaded file was not written entirely to the master's binlog,
+# only the first 4KB, 8KB or 16KB usually.
+# - the loaded file's first line was not written entirely to the
+# master's binlog (1st char was absent)
+--source include/master-slave.inc
+
+create table t1(a int);
+let $1=10000;
+disable_query_log;
+set SQL_LOG_BIN=0;
+while ($1)
+{
+ insert into t1 values(1);
+ dec $1;
+}
+set SQL_LOG_BIN=1;
+enable_query_log;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval select * into outfile '$MYSQLTEST_VARDIR/tmp/rpl_loaddatalocal.select_outfile' from t1;
+#This will generate a 20KB file, now test LOAD DATA LOCAL
+truncate table t1;
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval load data local infile '$MYSQLTEST_VARDIR/tmp/rpl_loaddatalocal.select_outfile' into table t1;
+remove_file $MYSQLTEST_VARDIR/tmp/rpl_loaddatalocal.select_outfile;
+--sync_slave_with_master
+select a,count(*) from t1 group by a;
+connection master;
+drop table t1;
+--sync_slave_with_master
+
+# End of 4.1 tests
+
+#
+# Now let us test how well we replicate LOAD DATA LOCAL in situation when
+# we met duplicates in tables to which we are adding rows.
+# (It supposed that LOAD DATA LOCAL ignores such errors)
+#
+connection master;
+create table t1(a int);
+insert into t1 values (1), (2), (2), (3);
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval select * into outfile '$MYSQLTEST_VARDIR/tmp/rpl_loaddatalocal.select_outfile' from t1;
+drop table t1;
+create table t1(a int primary key);
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+eval load data local infile '$MYSQLTEST_VARDIR/tmp/rpl_loaddatalocal.select_outfile' into table t1;
+remove_file $MYSQLTEST_VARDIR/tmp/rpl_loaddatalocal.select_outfile;
+SELECT * FROM t1 ORDER BY a;
+--sync_slave_with_master
+SELECT * FROM t1 ORDER BY a;
+connection master;
+drop table t1;
+--sync_slave_with_master
+--source include/rpl_end.inc