mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge rurik.mysql.com:/home/igor/mysql-4.0
into rurik.mysql.com:/home/igor/dev/mysql-4.0-0
This commit is contained in:
51
mysql-test/r/rpl_set_charset.result
Normal file
51
mysql-test/r/rpl_set_charset.result
Normal file
@ -0,0 +1,51 @@
|
||||
slave stop;
|
||||
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;
|
||||
slave start;
|
||||
drop database if exists mysqltest1;
|
||||
create database mysqltest1 /*!40100 character set latin2 */;
|
||||
use mysqltest1;
|
||||
drop table if exists t1;
|
||||
create table t1 (a varchar(255) character set latin2, b varchar(4));
|
||||
SET CHARACTER SET cp1250_latin2;
|
||||
INSERT INTO t1 VALUES ('<27><><EFBFBD><EFBFBD><EFBFBD>','80');
|
||||
INSERT INTO t1 VALUES ('<27><><EFBFBD><EFBFBD><EFBFBD>','90');
|
||||
INSERT INTO t1 VALUES ('<27><><EFBFBD><EFBFBD>','A0');
|
||||
INSERT INTO t1 VALUES ('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','B0');
|
||||
INSERT INTO t1 VALUES ('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','C0');
|
||||
INSERT INTO t1 VALUES ('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','D0');
|
||||
INSERT INTO t1 VALUES ('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','E0');
|
||||
INSERT INTO t1 VALUES ('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','F0');
|
||||
select "--- on master ---";
|
||||
--- on master ---
|
||||
--- on master ---
|
||||
select hex(a),b from t1 order by b;
|
||||
hex(a) b
|
||||
A9A6ABAEAC 80
|
||||
B9B6BBBEBC 90
|
||||
A3A1AAAF A0
|
||||
B3B1BAA5B5BF B0
|
||||
C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF C0
|
||||
D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF D0
|
||||
E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF E0
|
||||
F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF F0
|
||||
show binlog events from 1979;
|
||||
Log_name Pos Event_type Server_id Orig_log_pos Info
|
||||
master-bin.001 1979 Query 1 1979 use `mysqltest1`; SET CHARACTER SET DEFAULT
|
||||
use mysqltest1;
|
||||
select "--- on slave ---";
|
||||
--- on slave ---
|
||||
--- on slave ---
|
||||
select hex(a),b from t1 order by b;
|
||||
hex(a) b
|
||||
A9A6ABAEAC 80
|
||||
B9B6BBBEBC 90
|
||||
A3A1AAAF A0
|
||||
B3B1BAA5B5BF B0
|
||||
C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF C0
|
||||
D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF D0
|
||||
E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF E0
|
||||
F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF F0
|
||||
drop database mysqltest1;
|
@ -88,7 +88,6 @@ explain (select a,b from t1 limit 2) union all (select a,b from t2 order by a l
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t1 ALL NULL NULL NULL NULL 4
|
||||
t2 ALL NULL NULL NULL NULL 4 Using filesort
|
||||
t1 ALL NULL NULL NULL NULL 4
|
||||
(select sql_calc_found_rows a,b from t1 limit 2) union all (select a,b from t2 order by a) limit 2;
|
||||
a b
|
||||
1 a
|
||||
@ -420,6 +419,7 @@ a
|
||||
(SELECT * FROM t1) UNION all (SELECT SQL_CALC_FOUND_ROWS * FROM t2) LIMIT 1;
|
||||
Wrong usage/placement of 'SQL_CALC_FOUND_ROWS'
|
||||
create temporary table t1 select a from t1 union select a from t2;
|
||||
drop table t1;
|
||||
create table t1 select a from t1 union select a from t2;
|
||||
INSERT TABLE 't1' isn't allowed in FROM table list
|
||||
select a from t1 union select a from t2 order by t2.a;
|
||||
@ -429,3 +429,10 @@ select length(version()) > 1 as `*` UNION select 2;
|
||||
*
|
||||
1
|
||||
2
|
||||
create table t1 (a int);
|
||||
insert into t1 values (0), (3), (1), (2);
|
||||
explain (select * from t1) union (select * from t1) order by a;
|
||||
table type possible_keys key key_len ref rows Extra
|
||||
t1 ALL NULL NULL NULL NULL 4
|
||||
t1 ALL NULL NULL NULL NULL 4
|
||||
drop table t1;
|
||||
|
40
mysql-test/t/rpl_set_charset.test
Normal file
40
mysql-test/t/rpl_set_charset.test
Normal file
@ -0,0 +1,40 @@
|
||||
source include/master-slave.inc;
|
||||
--disable_warnings
|
||||
drop database if exists mysqltest1;
|
||||
# 4.1 bases its conversion on the db's charset,
|
||||
# while 4.0 uses the part of "SET CHARACTER SET" after "_".
|
||||
# So for 4.1 we add a clause to CREATE DATABASE.
|
||||
create database mysqltest1 /*!40100 character set latin2 */;
|
||||
use mysqltest1;
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
create table t1 (a varchar(255) character set latin2, b varchar(4));
|
||||
SET CHARACTER SET cp1250_latin2;
|
||||
INSERT INTO t1 VALUES ('<27><><EFBFBD><EFBFBD><EFBFBD>','80');
|
||||
INSERT INTO t1 VALUES ('<27><><EFBFBD><EFBFBD><EFBFBD>','90');
|
||||
INSERT INTO t1 VALUES ('<27><><EFBFBD><EFBFBD>','A0');
|
||||
INSERT INTO t1 VALUES ('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','B0');
|
||||
INSERT INTO t1 VALUES ('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','C0');
|
||||
INSERT INTO t1 VALUES ('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','D0');
|
||||
INSERT INTO t1 VALUES ('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','E0');
|
||||
INSERT INTO t1 VALUES ('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','F0');
|
||||
select "--- on master ---";
|
||||
select hex(a),b from t1 order by b;
|
||||
# It's complicated to verify that the charset is reset to default in
|
||||
# the binlog after each query, except by checking the binlog. When you
|
||||
# merge this into 4.1/5.0, the 1979 will have to be changed; all you have
|
||||
# to do is read the var/log/master-bin.0*01 with mysqlbinlog, verify
|
||||
# that a SET CHARACTER SET DEFAULT is just after the last INSERT, and
|
||||
# replace 1979 by its position (the "# at" line above the SET).
|
||||
show binlog events from 1979;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
||||
use mysqltest1;
|
||||
select "--- on slave ---";
|
||||
select hex(a),b from t1 order by b;
|
||||
connection master;
|
||||
drop database mysqltest1;
|
||||
save_master_pos;
|
||||
connection slave;
|
||||
sync_with_master;
|
@ -224,6 +224,7 @@ SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a desc LIMIT 1;
|
||||
(SELECT * FROM t1) UNION all (SELECT SQL_CALC_FOUND_ROWS * FROM t2) LIMIT 1;
|
||||
|
||||
create temporary table t1 select a from t1 union select a from t2;
|
||||
drop table t1;
|
||||
--error 1093
|
||||
create table t1 select a from t1 union select a from t2;
|
||||
--error 1054
|
||||
@ -236,3 +237,11 @@ drop table t1,t2;
|
||||
|
||||
select length(version()) > 1 as `*` UNION select 2;
|
||||
|
||||
#
|
||||
# Bug #4980: problem with explain
|
||||
#
|
||||
|
||||
create table t1 (a int);
|
||||
insert into t1 values (0), (3), (1), (2);
|
||||
explain (select * from t1) union (select * from t1) order by a;
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user