Loading client/mysqlbinlog.cc +31 −7 Original line number Diff line number Diff line Loading @@ -465,6 +465,31 @@ Create_file event for file_id: %u\n",ae->file_id); Load_log_processor load_processor; /** Replace windows-style backslashes by forward slashes so it can be consumed by the mysql client, which requires Unix path. @todo This is only useful under windows, so may be ifdef'ed out on other systems. /Sven @todo If a Create_file_log_event contains a filename with a backslash (valid under unix), then we have problems under windows. /Sven @param[in,out] fname Filename to modify. The filename is modified in-place. */ static void convert_path_to_forward_slashes(char *fname) { while (*fname) { if (*fname == '\\') *fname= '/'; fname++; } } static bool check_database(const char *log_dbname) { return one_database && Loading Loading @@ -582,6 +607,11 @@ int process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev, */ if (ce) { /* We must not convert earlier, since the file is used by my_open() in Load_log_processor::append(). */ convert_path_to_forward_slashes((char*) ce->fname); ce->print(result_file, print_event_info, TRUE); my_free((char*)ce->fname,MYF(MY_WME)); delete ce; Loading Loading @@ -622,13 +652,7 @@ Create_file event for file_id: %u\n",exv->file_id); if (fname) { /* Fix the path so it can be consumed by mysql client (requires Unix path). */ int stop= strlen(fname); for (int i= 0; i < stop; i++) if (fname[i] == '\\') fname[i]= '/'; convert_path_to_forward_slashes(fname); exlq->print(result_file, print_event_info, fname); my_free(fname, MYF(MY_WME)); } Loading mysql-test/r/ndb_alter_table2.result +19 −0 Original line number Diff line number Diff line Loading @@ -40,3 +40,22 @@ a b c select * from t1; a b c drop table t1; DROP TABLE IF EXISTS truncate_test; CREATE TABLE truncate_test ( i INT PRIMARY KEY, a INT, b VARCHAR(11), UNIQUE KEY (a) ) ENGINE = NDB; INSERT INTO truncate_test VALUES (1, 1, 'test') ON DUPLICATE KEY UPDATE b = 'new'; INSERT INTO truncate_test VALUES (1, 1, 'test') ON DUPLICATE KEY UPDATE b = 'new'; TRUNCATE truncate_test; INSERT INTO truncate_test VALUES (1, 1, 'test') ON DUPLICATE KEY UPDATE b = 'new'; SELECT * FROM truncate_test; i a b 1 1 test INSERT INTO truncate_test VALUES (1, 1, 'test') ON DUPLICATE KEY UPDATE b = 'new'; SELECT * FROM truncate_test; i a b 1 1 new DROP TABLE truncate_test; mysql-test/r/ndb_auto_increment.result +3 −3 Original line number Diff line number Diff line Loading @@ -421,10 +421,10 @@ select * from t1 order by a; a 1 20 21 33 34 35 65 insert into t1 values (100); insert into t1 values (NULL); insert into t1 values (NULL); Loading @@ -432,11 +432,11 @@ select * from t1 order by a; a 1 20 21 22 33 34 35 65 66 100 101 set auto_increment_offset = @old_auto_increment_offset; Loading mysql-test/r/ndb_bug31477.result 0 → 100644 +98 −0 Original line number Diff line number Diff line drop table if exists t1; create table t1(a int primary key, b int, c int, unique(b)) engine = ndb; insert into t1 values (2,2,2); insert into t1 values (3,3,3); insert into t1 values (4,4,4); begin; insert into t1 values (1,1,1); begin; update t1 set c = 2 where b = 1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction rollback; rollback; drop table t1; create table t1(a int primary key, b int, c int, key(b)) engine = ndb; insert into t1 values (2,2,2); insert into t1 values (3,3,3); insert into t1 values (4,4,4); begin; insert into t1 values (1,1,1); begin; update t1 set c = 2 where b = 1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction rollback; rollback; drop table t1; --con1 create table t1(a int primary key, b int, c int, key(b)) engine = ndb; insert into t1 values (1,1,1); insert into t1 values (2,2,2); insert into t1 values (3,3,3); insert into t1 values (4,4,4); begin; update t1 set c = 10 where a = 1; update t1 set c = 20 where a = 1; update t1 set c = 30 where a = 1; --con1 c=30 select * from t1 where b >= 1 order by b; a b c 1 1 30 2 2 2 3 3 3 4 4 4 --con2 c=1 select * from t1 where b >= 1 order by b; a b c 1 1 1 2 2 2 3 3 3 4 4 4 --con1 delete from t1 where a = 1; --con1 c=none select * from t1 where b >= 1 order by b; a b c 2 2 2 3 3 3 4 4 4 --con2 c=1 select * from t1 where b >= 1 order by b; a b c 1 1 1 2 2 2 3 3 3 4 4 4 --con1 commit; --con1 c=none select * from t1 where b >= 1 order by b; a b c 2 2 2 3 3 3 4 4 4 --con2 c=none select * from t1 where b >= 1 order by b; a b c 2 2 2 3 3 3 4 4 4 --con1 begin; insert into t1 values (1,1,1); update t1 set c = 10 where a = 1; update t1 set c = 20 where a = 1; update t1 set c = 30 where a = 1; --con1 c=30 select * from t1 where b >= 1 order by b; a b c 1 1 30 2 2 2 3 3 3 4 4 4 --con2 c=none select * from t1 where b >= 1 order by b; a b c 2 2 2 3 3 3 4 4 4 drop table t1; mysql-test/r/ndb_condition_pushdown.result +6 −0 Original line number Diff line number Diff line Loading @@ -1904,6 +1904,12 @@ a b d 10 1 4369 20 2 8738 50 5 21845 -- big filter just below limit a b d 10 1 4369 20 2 8738 50 5 21845 -- big filter just above limit a b d 10 1 4369 20 2 8738 Loading Loading
client/mysqlbinlog.cc +31 −7 Original line number Diff line number Diff line Loading @@ -465,6 +465,31 @@ Create_file event for file_id: %u\n",ae->file_id); Load_log_processor load_processor; /** Replace windows-style backslashes by forward slashes so it can be consumed by the mysql client, which requires Unix path. @todo This is only useful under windows, so may be ifdef'ed out on other systems. /Sven @todo If a Create_file_log_event contains a filename with a backslash (valid under unix), then we have problems under windows. /Sven @param[in,out] fname Filename to modify. The filename is modified in-place. */ static void convert_path_to_forward_slashes(char *fname) { while (*fname) { if (*fname == '\\') *fname= '/'; fname++; } } static bool check_database(const char *log_dbname) { return one_database && Loading Loading @@ -582,6 +607,11 @@ int process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev, */ if (ce) { /* We must not convert earlier, since the file is used by my_open() in Load_log_processor::append(). */ convert_path_to_forward_slashes((char*) ce->fname); ce->print(result_file, print_event_info, TRUE); my_free((char*)ce->fname,MYF(MY_WME)); delete ce; Loading Loading @@ -622,13 +652,7 @@ Create_file event for file_id: %u\n",exv->file_id); if (fname) { /* Fix the path so it can be consumed by mysql client (requires Unix path). */ int stop= strlen(fname); for (int i= 0; i < stop; i++) if (fname[i] == '\\') fname[i]= '/'; convert_path_to_forward_slashes(fname); exlq->print(result_file, print_event_info, fname); my_free(fname, MYF(MY_WME)); } Loading
mysql-test/r/ndb_alter_table2.result +19 −0 Original line number Diff line number Diff line Loading @@ -40,3 +40,22 @@ a b c select * from t1; a b c drop table t1; DROP TABLE IF EXISTS truncate_test; CREATE TABLE truncate_test ( i INT PRIMARY KEY, a INT, b VARCHAR(11), UNIQUE KEY (a) ) ENGINE = NDB; INSERT INTO truncate_test VALUES (1, 1, 'test') ON DUPLICATE KEY UPDATE b = 'new'; INSERT INTO truncate_test VALUES (1, 1, 'test') ON DUPLICATE KEY UPDATE b = 'new'; TRUNCATE truncate_test; INSERT INTO truncate_test VALUES (1, 1, 'test') ON DUPLICATE KEY UPDATE b = 'new'; SELECT * FROM truncate_test; i a b 1 1 test INSERT INTO truncate_test VALUES (1, 1, 'test') ON DUPLICATE KEY UPDATE b = 'new'; SELECT * FROM truncate_test; i a b 1 1 new DROP TABLE truncate_test;
mysql-test/r/ndb_auto_increment.result +3 −3 Original line number Diff line number Diff line Loading @@ -421,10 +421,10 @@ select * from t1 order by a; a 1 20 21 33 34 35 65 insert into t1 values (100); insert into t1 values (NULL); insert into t1 values (NULL); Loading @@ -432,11 +432,11 @@ select * from t1 order by a; a 1 20 21 22 33 34 35 65 66 100 101 set auto_increment_offset = @old_auto_increment_offset; Loading
mysql-test/r/ndb_bug31477.result 0 → 100644 +98 −0 Original line number Diff line number Diff line drop table if exists t1; create table t1(a int primary key, b int, c int, unique(b)) engine = ndb; insert into t1 values (2,2,2); insert into t1 values (3,3,3); insert into t1 values (4,4,4); begin; insert into t1 values (1,1,1); begin; update t1 set c = 2 where b = 1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction rollback; rollback; drop table t1; create table t1(a int primary key, b int, c int, key(b)) engine = ndb; insert into t1 values (2,2,2); insert into t1 values (3,3,3); insert into t1 values (4,4,4); begin; insert into t1 values (1,1,1); begin; update t1 set c = 2 where b = 1; ERROR HY000: Lock wait timeout exceeded; try restarting transaction rollback; rollback; drop table t1; --con1 create table t1(a int primary key, b int, c int, key(b)) engine = ndb; insert into t1 values (1,1,1); insert into t1 values (2,2,2); insert into t1 values (3,3,3); insert into t1 values (4,4,4); begin; update t1 set c = 10 where a = 1; update t1 set c = 20 where a = 1; update t1 set c = 30 where a = 1; --con1 c=30 select * from t1 where b >= 1 order by b; a b c 1 1 30 2 2 2 3 3 3 4 4 4 --con2 c=1 select * from t1 where b >= 1 order by b; a b c 1 1 1 2 2 2 3 3 3 4 4 4 --con1 delete from t1 where a = 1; --con1 c=none select * from t1 where b >= 1 order by b; a b c 2 2 2 3 3 3 4 4 4 --con2 c=1 select * from t1 where b >= 1 order by b; a b c 1 1 1 2 2 2 3 3 3 4 4 4 --con1 commit; --con1 c=none select * from t1 where b >= 1 order by b; a b c 2 2 2 3 3 3 4 4 4 --con2 c=none select * from t1 where b >= 1 order by b; a b c 2 2 2 3 3 3 4 4 4 --con1 begin; insert into t1 values (1,1,1); update t1 set c = 10 where a = 1; update t1 set c = 20 where a = 1; update t1 set c = 30 where a = 1; --con1 c=30 select * from t1 where b >= 1 order by b; a b c 1 1 30 2 2 2 3 3 3 4 4 4 --con2 c=none select * from t1 where b >= 1 order by b; a b c 2 2 2 3 3 3 4 4 4 drop table t1;
mysql-test/r/ndb_condition_pushdown.result +6 −0 Original line number Diff line number Diff line Loading @@ -1904,6 +1904,12 @@ a b d 10 1 4369 20 2 8738 50 5 21845 -- big filter just below limit a b d 10 1 4369 20 2 8738 50 5 21845 -- big filter just above limit a b d 10 1 4369 20 2 8738 Loading