summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorHemant Kumar <hemant.hk.kumar@oracle.com>2012-01-06 15:52:56 +0530
committerHemant Kumar <hemant.hk.kumar@oracle.com>2012-01-06 15:52:56 +0530
commit141e89a68b059133ff03834526eec09ba2f245f8 (patch)
tree29ea40a5910419fefdd3c1a90ba381ea8a9f1f80 /mysql-test
parent44938d9ecccf0e7f6327b7e90a3dc24dadad5b59 (diff)
parentb03c15413f1fd6b244f8d8a2a57948d0df265ecb (diff)
downloadmariadb-git-141e89a68b059133ff03834526eec09ba2f245f8.tar.gz
Bug#12872804 - 62155: BINLOG.BINLOG_STM_UNSAFE_WARNING FAILS WHEN RUN WITH --REPEAT=2
Fixed the testcase using timestamp logic while doing grep from the error file.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result6
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test19
2 files changed, 17 insertions, 8 deletions
diff --git a/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result b/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result
index 23943474541..b006304908a 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result
@@ -54,13 +54,13 @@ USE test;
#
SET @old_log_warnings = @@log_warnings;
DROP TABLE IF EXISTS t1;
-CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(10));
+CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(15));
SET GLOBAL LOG_WARNINGS = 0;
-INSERT INTO t1 VALUES(UUID(), 'Bug#46265');
+INSERT INTO t1 VALUES(UUID(), 'timestamp');
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
SET GLOBAL LOG_WARNINGS = 1;
-INSERT INTO t1 VALUES(UUID(), 'Bug#46265');
+INSERT INTO t1 VALUES(UUID(), 'timestamp');
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test b/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test
index 85571a6c582..4a4a75af60f 100644
--- a/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_unsafe_warning.test
@@ -101,16 +101,24 @@ eval USE $old_db;
--echo # Bug#46265: Can not disable warning about unsafe statements for binary logging
--echo #
+let BINLOG_COUNTER1= `select CONVERT(NOW(),UNSIGNED) as timestmap from dual`;
+
SET @old_log_warnings = @@log_warnings;
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
-CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(10));
+CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(15));
+
SET GLOBAL LOG_WARNINGS = 0;
-INSERT INTO t1 VALUES(UUID(), 'Bug#46265');
+# Replacing the result file content here.
+# Instead of writing $BINLOG_COUNTER1 value to result file,
+# writing a fixed string timestamp to it.
+--replace_result $BINLOG_COUNTER1 timestamp
+eval INSERT INTO t1 VALUES(UUID(), '$BINLOG_COUNTER1');
SET GLOBAL LOG_WARNINGS = 1;
-INSERT INTO t1 VALUES(UUID(), 'Bug#46265');
+--replace_result $BINLOG_COUNTER1 timestamp
+eval INSERT INTO t1 VALUES(UUID(), '$BINLOG_COUNTER1');
DROP TABLE t1;
SET GLOBAL log_warnings = @old_log_warnings;
@@ -132,13 +140,14 @@ perl;
use strict;
my $log_error= $ENV{'LOG_ERROR'} or die "LOG_ERROR not set";
open(FILE, "$log_error") or die("Unable to open $log_error: $!\n");
- my $count = () = grep(/Bug#46265/g,<FILE>);
+ my $binlog_counter= $ENV{'BINLOG_COUNTER1'} or die "BINLOG_COUNTER1 not set";
+ my $count = () = grep(/$binlog_counter/g,<FILE>);
+ # Grep the timestamp value from the error file.
print "Occurrences: $count\n";
close(FILE);
EOF
# bug#50192: diplaying the unsafe warning comes out to the user warning stack
-
-- disable_warnings
DROP TABLE IF EXISTS t1, t2;
-- enable_warnings