mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge joreland@bk-internal.mysql.com:/home/bk/mysql-4.1
into eel.(none):/home/jonas/src/mysql-4.1-push
This commit is contained in:
@ -8576,6 +8576,23 @@ FC4B
|
||||
DROP TABLE t1;
|
||||
DROP TABLE t2;
|
||||
DROP TABLE t3;
|
||||
RESET MASTER;
|
||||
CREATE TABLE t1(f1 blob);
|
||||
PREPARE stmt1 FROM 'INSERT INTO t1 VALUES(?)';
|
||||
SET @var1= x'8300';
|
||||
EXECUTE stmt1 USING @var1;
|
||||
SHOW BINLOG EVENTS;
|
||||
Log_name Pos Event_type Server_id Orig_log_pos Info
|
||||
master-bin.000001 # Start 1 # Server ver: 4.1.15-debug-log, Binlog ver: 3
|
||||
master-bin.000001 # Query 1 # use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=95,COLLATION_CONNECTION=95,COLLATION_DATABASE=95,COLLATION_SERVER=8
|
||||
master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1(f1 blob)
|
||||
master-bin.000001 # Query 1 # use `test`; SET ONE_SHOT CHARACTER_SET_CLIENT=95,COLLATION_CONNECTION=95,COLLATION_DATABASE=95,COLLATION_SERVER=8
|
||||
master-bin.000001 # User var 1 # @`var1`=_binary 0x8300 COLLATE binary
|
||||
master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES(@'var1')
|
||||
SELECT HEX(f1) FROM t1;
|
||||
HEX(f1)
|
||||
8300
|
||||
DROP table t1;
|
||||
SET collation_connection='cp932_japanese_ci';
|
||||
create table t1 select repeat('a',4000) a;
|
||||
delete from t1;
|
||||
|
@ -464,3 +464,43 @@ SELECT DISTINCT html,SUM(out)/(SUM(rin)+1) as 'prod' FROM t1 GROUP BY rin;
|
||||
html prod
|
||||
1 0.00
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (a int);
|
||||
INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
|
||||
SELECT DISTINCT a, 1 FROM t1;
|
||||
a 1
|
||||
1 1
|
||||
2 1
|
||||
3 1
|
||||
4 1
|
||||
5 1
|
||||
SELECT DISTINCT 1, a FROM t1;
|
||||
1 a
|
||||
1 1
|
||||
1 2
|
||||
1 3
|
||||
1 4
|
||||
1 5
|
||||
CREATE TABLE t2 (a int, b int);
|
||||
INSERT INTO t2 VALUES (1,1),(2,2),(2,3),(2,4),(3,5);
|
||||
SELECT DISTINCT a, b, 2 FROM t2;
|
||||
a b 2
|
||||
1 1 2
|
||||
2 2 2
|
||||
2 3 2
|
||||
2 4 2
|
||||
3 5 2
|
||||
SELECT DISTINCT 2, a, b FROM t2;
|
||||
2 a b
|
||||
2 1 1
|
||||
2 2 2
|
||||
2 2 3
|
||||
2 2 4
|
||||
2 3 5
|
||||
SELECT DISTINCT a, 2, b FROM t2;
|
||||
a 2 b
|
||||
1 2 1
|
||||
2 2 2
|
||||
2 2 3
|
||||
2 2 4
|
||||
3 2 5
|
||||
DROP TABLE t1,t2;
|
||||
|
1035
mysql-test/r/rpl_drop_db.result
Normal file
1035
mysql-test/r/rpl_drop_db.result
Normal file
File diff suppressed because it is too large
Load Diff
17
mysql-test/r/rpl_insert_select.result
Normal file
17
mysql-test/r/rpl_insert_select.result
Normal file
@ -0,0 +1,17 @@
|
||||
stop slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
create table t1 (n int not null primary key);
|
||||
insert into t1 values (1);
|
||||
create table t2 (n int);
|
||||
insert into t2 values (1);
|
||||
insert ignore into t1 select * from t2;
|
||||
insert into t1 values (2);
|
||||
select * from t1;
|
||||
n
|
||||
1
|
||||
2
|
||||
drop table t1,t2;
|
@ -401,6 +401,28 @@ DROP TABLE t2;
|
||||
DROP TABLE t3;
|
||||
#DROP TABLE t4;
|
||||
|
||||
# Test prepared statement with 0x8300 sequence in parameter while
|
||||
# running with cp932 client character set.
|
||||
RESET MASTER;
|
||||
CREATE TABLE t1(f1 blob);
|
||||
PREPARE stmt1 FROM 'INSERT INTO t1 VALUES(?)';
|
||||
SET @var1= x'8300';
|
||||
# TODO: Note that this doesn't actually test the code which was added for
|
||||
# bug#11338 because this syntax for prepared statements causes the PS to
|
||||
# be replicated differently than if we executed the PS from C or Java.
|
||||
# Using this syntax, variable names are inserted into the binlog instead
|
||||
# of values. The real goal of this test is to check the code that was
|
||||
# added to Item_param::query_val_str() in order to do hex encoding of
|
||||
# PS parameters when the client character set is cp932;
|
||||
# Bug#11338 has an example java program which can be used to verify this
|
||||
# code (and I have used it to test the fix) until there is some way to
|
||||
# exercise this code from mysql-test-run.
|
||||
EXECUTE stmt1 USING @var1;
|
||||
--replace_column 2 # 5 #
|
||||
SHOW BINLOG EVENTS;
|
||||
SELECT HEX(f1) FROM t1;
|
||||
DROP table t1;
|
||||
# end test for bug#11338
|
||||
|
||||
SET collation_connection='cp932_japanese_ci';
|
||||
-- source include/ctype_filesort.inc
|
||||
|
@ -333,4 +333,21 @@ INSERT INTO t1 VALUES ('1',1,0);
|
||||
SELECT DISTINCT html,SUM(out)/(SUM(rin)+1) as 'prod' FROM t1 GROUP BY rin;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Test cases for #12625: DISTINCT for a list with constants
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (a int);
|
||||
INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
|
||||
SELECT DISTINCT a, 1 FROM t1;
|
||||
SELECT DISTINCT 1, a FROM t1;
|
||||
|
||||
CREATE TABLE t2 (a int, b int);
|
||||
INSERT INTO t2 VALUES (1,1),(2,2),(2,3),(2,4),(3,5);
|
||||
SELECT DISTINCT a, b, 2 FROM t2;
|
||||
SELECT DISTINCT 2, a, b FROM t2;
|
||||
SELECT DISTINCT a, 2, b FROM t2;
|
||||
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
52
mysql-test/t/rpl_drop_db.test
Normal file
52
mysql-test/t/rpl_drop_db.test
Normal file
@ -0,0 +1,52 @@
|
||||
# test case for BUG#4680 -- if there are extra files in the db directory
|
||||
# dropping the db on the master causes replication problems
|
||||
|
||||
-- source include/master-slave.inc
|
||||
connection master;
|
||||
|
||||
--disable_warnings
|
||||
drop database if exists d1;
|
||||
--enable_warnings
|
||||
create database d1;
|
||||
create table d1.t1 (n int);
|
||||
insert into d1.t1 values (1);
|
||||
select * from d1.t1 into outfile 'd1/f1.txt';
|
||||
create table d1.t2 (n int);
|
||||
create table d1.t3 (n int);
|
||||
--error 1010
|
||||
drop database d1;
|
||||
use d1;
|
||||
show tables;
|
||||
|
||||
# test the branch of the code that deals with the query buffer overflow
|
||||
|
||||
let $1=1000;
|
||||
while ($1)
|
||||
{
|
||||
eval create table d1.t$1(n int);
|
||||
dec $1;
|
||||
}
|
||||
--error 1010
|
||||
drop database d1;
|
||||
use d1;
|
||||
show tables;
|
||||
use test;
|
||||
create table t1 (n int);
|
||||
insert into t1 values (1234);
|
||||
sync_slave_with_master;
|
||||
|
||||
connection slave;
|
||||
use d1;
|
||||
show tables;
|
||||
use test;
|
||||
select * from t1;
|
||||
|
||||
connection master;
|
||||
drop table t1;
|
||||
sync_slave_with_master;
|
||||
|
||||
#cleanup
|
||||
connection slave;
|
||||
stop slave;
|
||||
system rm -rf var/master-data/d1;
|
||||
|
19
mysql-test/t/rpl_insert_select.test
Normal file
19
mysql-test/t/rpl_insert_select.test
Normal file
@ -0,0 +1,19 @@
|
||||
# Testcase for BUG#10456 - INSERT INTO ... SELECT violating a primary key
|
||||
# breaks replication
|
||||
|
||||
-- source include/master-slave.inc
|
||||
connection master;
|
||||
|
||||
create table t1 (n int not null primary key);
|
||||
insert into t1 values (1);
|
||||
create table t2 (n int);
|
||||
insert into t2 values (1);
|
||||
insert ignore into t1 select * from t2;
|
||||
insert into t1 values (2);
|
||||
sync_slave_with_master;
|
||||
connection slave;
|
||||
select * from t1;
|
||||
|
||||
connection master;
|
||||
drop table t1,t2;
|
||||
sync_slave_with_master;
|
Reference in New Issue
Block a user