mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Bug #29878 Garbage data generation when executing SESSION_USER() on a slave.
Item_func_user doesn't calculate anything in it's val_str() method, just returns saved str_value. Though Item::save_in_field method can destroy str_value, relying on val_str() return. As a result we get the garbage stored in field. We cannot use Item::save_in_field implementation for Item_func_user, reimplement it in simpler way. mysql-test/r/rpl_session_var.result: Bug #29878 Garbage data generation when executing SESSION_USER() on a slave. test result mysql-test/t/rpl_session_var.test: Bug #29878 Garbage data generation when executing SESSION_USER() on a slave. test case sql/item.cc: Bug #29878 Garbage data generation when executing SESSION_USER() on a slave. duplicating code moved to Item::save_str_in_field sql/item.h: Bug #29878 Garbage data generation when executing SESSION_USER() on a slave. duplicating code moved to Item::save_str_in_field sql/item_strfunc.h: Bug #29878 Garbage data generation when executing SESSION_USER() on a slave. Item_func_user::save_in_field implemented as simple storing str_value
This commit is contained in:
@ -41,3 +41,13 @@ select * from t2 order by b;
|
||||
b a
|
||||
1 1
|
||||
drop table t1,t2;
|
||||
CREATE TABLE t1 (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`data` varchar(100),
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM;
|
||||
INSERT INTO t1(data) VALUES(SESSION_USER());
|
||||
SELECT * FROM t1;
|
||||
id data
|
||||
1
|
||||
drop table t1;
|
||||
|
@ -40,3 +40,25 @@ drop table t1,t2;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
|
||||
#
|
||||
# Bug #29878 Garbage data generation when executing SESSION_USER() on a slave.
|
||||
#
|
||||
|
||||
connection master;
|
||||
CREATE TABLE t1 (
|
||||
`id` int(11) NOT NULL auto_increment,
|
||||
`data` varchar(100),
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
INSERT INTO t1(data) VALUES(SESSION_USER());
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
SELECT * FROM t1;
|
||||
connection master;
|
||||
drop table t1;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
|
Reference in New Issue
Block a user