Commit 3ecf6b34 authored by lars@black.(none)'s avatar lars@black.(none)

Merge mysql.com:/home/bkroot/mysql-5.1-new-rpl

into  mysql.com:/home/bk/MERGE/mysql-5.1-merge
parents a3d8fdbe 3af7d5fa
...@@ -15,5 +15,7 @@ ...@@ -15,5 +15,7 @@
45214442pBGT9KuZEGixBH71jTzbOA 45214442pBGT9KuZEGixBH71jTzbOA
45214a07hVsIGwvwa-WrO-jpeaSwVw 45214a07hVsIGwvwa-WrO-jpeaSwVw
452a92d0-31-8wSzSfZi165fcGcXPA 452a92d0-31-8wSzSfZi165fcGcXPA
452c6c6dAjuNghfc1ObZ_UQ5SCl85g
4538a7b0EbDHHkWPbIwxO6ZIDdg6Dg
454a7ef8gdvE_ddMlJyghvOAkKPNOQ 454a7ef8gdvE_ddMlJyghvOAkKPNOQ
454f8960jsVT_kMKJtZ9OCgXoba0xQ 454f8960jsVT_kMKJtZ9OCgXoba0xQ
...@@ -35,9 +35,17 @@ fi ...@@ -35,9 +35,17 @@ fi
CHANGESET=`bk -R prs -r+ -h -d':P:::I:' ChangeSet` CHANGESET=`bk -R prs -r+ -h -d':P:::I:' ChangeSet`
CSETKEY=`bk -R prs -r+ -h -d':KEY:' ChangeSet` CSETKEY=`bk -R prs -r+ -h -d':KEY:' ChangeSet`
BUG=`bk -R prs -r+ -h -d':C:' ChangeSet | sed -ne 's/^.*[Bb][Uu][Gg] *# *\([0-9][0-9]*\).*$/\1/p'` #
WL=`bk -R prs -r+ -h -d':C:' ChangeSet | sed -ne 's/^.*[Ww][Ll] *# *\([0-9][0-9]*\).*$/ WL#\1/p'` # composing subject lines of commit mails.
# if a fix targets to a WL and there is a bug referred
# then X-Bug mail header will contain the first found bug's number
#
BUG=`bk -R prs -r+ -h -d':C:' ChangeSet | \
sed -ne 's/[Bb][Uu][Gg] *# *\([0-9][0-9]*\).*$/BUG#\1/
s/.*BUG#\([0-9][0-9]*\)/\1/p'`
WL=`bk -R prs -r+ -h -d':C:' ChangeSet | \
sed -ne 's/[Ww][Ll] *# *\([0-9][0-9]*\).*$/WL#\1/
s/.*\(WL#[0-9][0-9]*\)/ \1/p'`
if [ "$BUG" = "" ] if [ "$BUG" = "" ]
then then
TO=dev-public@mysql.com TO=dev-public@mysql.com
......
...@@ -1360,6 +1360,21 @@ static int dump_local_log_entries(const char* logname) ...@@ -1360,6 +1360,21 @@ static int dump_local_log_entries(const char* logname)
} }
else // reading from stdin; else // reading from stdin;
{ {
/*
Windows opens stdin in text mode by default. Certain characters
such as CTRL-Z are interpeted as events and the read() method
will stop. CTRL-Z is the EOF marker in Windows. to get past this
you have to open stdin in binary mode. Setmode() is used to set
stdin in binary mode. Errors on setting this mode result in
halting the function and printing an error message to stderr.
*/
#if defined (__WIN__) || (_WIN64)
if (_setmode(fileno(stdin), O_BINARY) == -1)
{
fprintf(stderr, "Could not set binary mode on stdin.\n");
return 1;
}
#endif
if (init_io_cache(file, fileno(stdin), 0, READ_CACHE, (my_off_t) 0, if (init_io_cache(file, fileno(stdin), 0, READ_CACHE, (my_off_t) 0,
0, MYF(MY_WME | MY_NABP | MY_DONT_CHECK_FILESIZE))) 0, MYF(MY_WME | MY_NABP | MY_DONT_CHECK_FILESIZE)))
return 1; return 1;
......
...@@ -190,8 +190,8 @@ typedef struct my_charset_handler_st ...@@ -190,8 +190,8 @@ typedef struct my_charset_handler_st
const unsigned char *s, const unsigned char *e); const unsigned char *s, const unsigned char *e);
/* Functions for case and sort conversion */ /* Functions for case and sort conversion */
void (*caseup_str)(struct charset_info_st *, char *); uint (*caseup_str)(struct charset_info_st *, char *);
void (*casedn_str)(struct charset_info_st *, char *); uint (*casedn_str)(struct charset_info_st *, char *);
uint (*caseup)(struct charset_info_st *, char *src, uint srclen, uint (*caseup)(struct charset_info_st *, char *src, uint srclen,
char *dst, uint dstlen); char *dst, uint dstlen);
uint (*casedn)(struct charset_info_st *, char *src, uint srclen, uint (*casedn)(struct charset_info_st *, char *src, uint srclen,
...@@ -324,8 +324,8 @@ extern uint my_instr_simple(struct charset_info_st *, ...@@ -324,8 +324,8 @@ extern uint my_instr_simple(struct charset_info_st *,
/* Functions for 8bit */ /* Functions for 8bit */
extern void my_caseup_str_8bit(CHARSET_INFO *, char *); extern uint my_caseup_str_8bit(CHARSET_INFO *, char *);
extern void my_casedn_str_8bit(CHARSET_INFO *, char *); extern uint my_casedn_str_8bit(CHARSET_INFO *, char *);
extern uint my_caseup_8bit(CHARSET_INFO *, char *src, uint srclen, extern uint my_caseup_8bit(CHARSET_INFO *, char *src, uint srclen,
char *dst, uint dstlen); char *dst, uint dstlen);
extern uint my_casedn_8bit(CHARSET_INFO *, char *src, uint srclen, extern uint my_casedn_8bit(CHARSET_INFO *, char *src, uint srclen,
...@@ -415,8 +415,8 @@ int my_mbcharlen_8bit(CHARSET_INFO *, uint c); ...@@ -415,8 +415,8 @@ int my_mbcharlen_8bit(CHARSET_INFO *, uint c);
/* Functions for multibyte charsets */ /* Functions for multibyte charsets */
extern void my_caseup_str_mb(CHARSET_INFO *, char *); extern uint my_caseup_str_mb(CHARSET_INFO *, char *);
extern void my_casedn_str_mb(CHARSET_INFO *, char *); extern uint my_casedn_str_mb(CHARSET_INFO *, char *);
extern uint my_caseup_mb(CHARSET_INFO *, char *src, uint srclen, extern uint my_caseup_mb(CHARSET_INFO *, char *src, uint srclen,
char *dst, uint dstlen); char *dst, uint dstlen);
extern uint my_casedn_mb(CHARSET_INFO *, char *src, uint srclen, extern uint my_casedn_mb(CHARSET_INFO *, char *src, uint srclen,
......
...@@ -59,4 +59,17 @@ insert into t1 values(null); ...@@ -59,4 +59,17 @@ insert into t1 values(null);
select * from t1; select * from t1;
drop table t1; drop table t1;
# bug#22027
create table t1 (a int);
create table if not exists t2 select * from t1;
# bug#22762
create temporary table tt1 (a int);
create table if not exists t3 like tt1;
--replace_column 2 # 5 #
--replace_regex /table_id: [0-9]+/table_id: #/ /\/\* xid=.* \*\//\/* xid= *\//
show binlog events from 102;
drop table t1,t2,t3,tt1;
-- source extra/binlog_tests/binlog_insert_delayed.test -- source extra/binlog_tests/binlog_insert_delayed.test
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
connection master; connection master;
eval CREATE TABLE t1 (a INT NOT NULL, KEY(a)) ENGINE=$engine_type; eval CREATE TABLE t1 (a INT NOT NULL, KEY(a)) ENGINE=$engine_type;
eval CREATE TABLE t2 (a INT NOT NULL, KEY(a)) ENGINE=$engine_type; eval CREATE TABLE t2 (a INT NOT NULL, KEY(a)) ENGINE=$engine_type;
eval CREATE TABLE t3 (a INT) ENGINE=$engine_type; # requiring 'unique' for the timeout part of the test
eval CREATE TABLE t3 (a INT UNIQUE) ENGINE=$engine_type;
eval CREATE TABLE t4 (a INT) ENGINE=$engine_type; eval CREATE TABLE t4 (a INT) ENGINE=$engine_type;
show variables like 'slave_transaction_retries'; show variables like 'slave_transaction_retries';
sync_slave_with_master; sync_slave_with_master;
...@@ -30,7 +31,9 @@ stop slave; ...@@ -30,7 +31,9 @@ stop slave;
connection master; connection master;
begin; begin;
# Let's keep BEGIN and the locked statement in two different relay logs. # Let's keep BEGIN and the locked statement in two different relay logs.
let $1=200; insert into t2 values (0); # t2,t1 actors of deadlock in repl-ed ta
#insert into t3 select * from t2 for update;
let $1=10;
disable_query_log; disable_query_log;
while ($1) while ($1)
{ {
...@@ -38,16 +41,14 @@ while ($1) ...@@ -38,16 +41,14 @@ while ($1)
dec $1; dec $1;
} }
enable_query_log; enable_query_log;
insert into t3 select * from t2 for update;
insert into t1 values(1); insert into t1 values(1);
commit; commit;
save_master_pos; save_master_pos;
connection slave; connection slave;
begin; begin;
# Let's make our transaction large so that it's slave who is chosen as # Let's make our transaction large so that it's repl-ed msta that's victim
# victim let $1=100;
let $1=1000;
disable_query_log; disable_query_log;
while ($1) while ($1)
{ {
...@@ -55,14 +56,21 @@ while ($1) ...@@ -55,14 +56,21 @@ while ($1)
dec $1; dec $1;
} }
enable_query_log; enable_query_log;
select * from t1 for update; select * from t1 for update; # t1,t2 on local slave's
start slave; start slave;
# bad option, todo: replicate a non-transactional t_sync with the transaction
# and use wait_until_rows_count macro below
--real_sleep 3 # hope that slave is blocked now --real_sleep 3 # hope that slave is blocked now
insert into t2 values(22); # provoke deadlock, slave should be victim #let $count=11;
#let $table=t_sync;
#--include wait_until_rows_count.inc
select * from t2 for update /* dl */; # provoke deadlock, repl-ed should be victim
commit; commit;
sync_with_master; sync_with_master;
select * from t1; # check that slave succeeded finally select * from t1; # check that repl-ed succeeded finally
select * from t2; select * from t2 /* must be 1 */;
# check that no error is reported # check that no error is reported
--replace_column 1 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # --replace_column 1 # 7 # 8 # 9 # 16 # 22 # 23 # 33 #
--replace_result $MASTER_MYPORT MASTER_MYPORT --replace_result $MASTER_MYPORT MASTER_MYPORT
...@@ -73,14 +81,16 @@ show slave status; ...@@ -73,14 +81,16 @@ show slave status;
# 2) Test lock wait timeout # 2) Test lock wait timeout
stop slave; stop slave;
change master to master_log_pos=536; # the BEGIN log event delete from t3;
change master to master_log_pos=544; # the BEGIN log event
begin; begin;
select * from t2 for update; # hold lock select * from t2 for update; # hold lock
start slave; start slave;
--real_sleep 10 # slave should have blocked, and be retrying --real_sleep 10 # repl-ed should have blocked, and be retrying
select count(*) from t3 /* must be zero */; # replaying begins after rollback
commit; commit;
sync_with_master; sync_with_master;
select * from t1; # check that slave succeeded finally select * from t1; # check that repl-ed succeeded finally
select * from t2; select * from t2;
# check that no error is reported # check that no error is reported
--replace_column 1 # 7 # 8 # 9 # 11 # 16 # 22 # 23 # 33 # --replace_column 1 # 7 # 8 # 9 # 11 # 16 # 22 # 23 # 33 #
...@@ -96,11 +106,13 @@ set global max_relay_log_size=0; ...@@ -96,11 +106,13 @@ set global max_relay_log_size=0;
# This is really copy-paste of 2) of above # This is really copy-paste of 2) of above
stop slave; stop slave;
change master to master_log_pos=536; delete from t3;
change master to master_log_pos=544;
begin; begin;
select * from t2 for update; select * from t2 for update;
start slave; start slave;
--real_sleep 10 --real_sleep 10
select count(*) from t3 /* must be zero */; # replaying begins after rollback
commit; commit;
sync_with_master; sync_with_master;
select * from t1; select * from t1;
...@@ -115,4 +127,4 @@ connection master; ...@@ -115,4 +127,4 @@ connection master;
drop table t1,t2,t3,t4; drop table t1,t2,t3,t4;
sync_slave_with_master; sync_slave_with_master;
# End of 4.1 tests --echo End of 5.1 tests
This diff is collapsed.
This diff is collapsed.
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
# Test for strict-mode autoincrement # Test for strict-mode autoincrement
# #
--disable_warnings
drop table if exists t1;
--enable_warnings
set @org_mode=@@sql_mode; set @org_mode=@@sql_mode;
eval create table t1 eval create table t1
( (
......
...@@ -245,6 +245,24 @@ select * from t1; ...@@ -245,6 +245,24 @@ select * from t1;
id id
127 127
drop table t1; drop table t1;
create table t1 (a int);
create table if not exists t2 select * from t1;
create temporary table tt1 (a int);
create table if not exists t3 like tt1;
show binlog events from 102;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1 (id tinyint auto_increment primary key)
master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Query 1 # use `test`; drop table t1
master-bin.000001 # Query 1 # use `test`; create table t1 (a int)
master-bin.000001 # Query 1 # use `test`; CREATE TABLE IF NOT EXISTS `t2` (
`a` int(11) DEFAULT NULL
)
master-bin.000001 # Query 1 # use `test`; CREATE TABLE IF NOT EXISTS `t3` (
`a` int(11) DEFAULT NULL
)
drop table t1,t2,t3,tt1;
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1; set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
insert delayed into t1 values (207); insert delayed into t1 values (207);
...@@ -256,6 +274,14 @@ master-bin.000001 # Query 1 # use `test`; create table t1 (id tinyint auto_incre ...@@ -256,6 +274,14 @@ master-bin.000001 # Query 1 # use `test`; create table t1 (id tinyint auto_incre
master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
master-bin.000001 # Query 1 # use `test`; drop table t1 master-bin.000001 # Query 1 # use `test`; drop table t1
master-bin.000001 # Query 1 # use `test`; create table t1 (a int)
master-bin.000001 # Query 1 # use `test`; CREATE TABLE IF NOT EXISTS `t2` (
`a` int(11) DEFAULT NULL
)
master-bin.000001 # Query 1 # use `test`; CREATE TABLE IF NOT EXISTS `t3` (
`a` int(11) DEFAULT NULL
)
master-bin.000001 # Query 1 # use `test`; DROP TABLE `t1`,`t2`,`t3` /* generated by server */
master-bin.000001 # Query 1 # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam master-bin.000001 # Query 1 # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam
master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
......
...@@ -155,6 +155,21 @@ select * from t1; ...@@ -155,6 +155,21 @@ select * from t1;
id id
127 127
drop table t1; drop table t1;
create table t1 (a int);
create table if not exists t2 select * from t1;
create temporary table tt1 (a int);
create table if not exists t3 like tt1;
show binlog events from 102;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1 (id tinyint auto_increment primary key)
master-bin.000001 # Intvar 1 # INSERT_ID=127
master-bin.000001 # Query 1 # use `test`; insert into t1 values(null)
master-bin.000001 # Query 1 # use `test`; drop table t1
master-bin.000001 # Query 1 # use `test`; create table t1 (a int)
master-bin.000001 # Query 1 # use `test`; create table if not exists t2 select * from t1
master-bin.000001 # Query 1 # use `test`; create temporary table tt1 (a int)
master-bin.000001 # Query 1 # use `test`; create table if not exists t3 like tt1
drop table t1,t2,t3,tt1;
create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam;
set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1; set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
insert delayed into t1 values (207); insert delayed into t1 values (207);
...@@ -166,6 +181,11 @@ master-bin.000001 # Query 1 # use `test`; create table t1 (id tinyint auto_incre ...@@ -166,6 +181,11 @@ master-bin.000001 # Query 1 # use `test`; create table t1 (id tinyint auto_incre
master-bin.000001 # Intvar 1 # INSERT_ID=127 master-bin.000001 # Intvar 1 # INSERT_ID=127
master-bin.000001 # Query 1 # use `test`; insert into t1 values(null) master-bin.000001 # Query 1 # use `test`; insert into t1 values(null)
master-bin.000001 # Query 1 # use `test`; drop table t1 master-bin.000001 # Query 1 # use `test`; drop table t1
master-bin.000001 # Query 1 # use `test`; create table t1 (a int)
master-bin.000001 # Query 1 # use `test`; create table if not exists t2 select * from t1
master-bin.000001 # Query 1 # use `test`; create temporary table tt1 (a int)
master-bin.000001 # Query 1 # use `test`; create table if not exists t3 like tt1
master-bin.000001 # Query 1 # use `test`; drop table t1,t2,t3,tt1
master-bin.000001 # Query 1 # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam master-bin.000001 # Query 1 # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam
master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
......
...@@ -171,8 +171,8 @@ create table t1 (a char(10) character set koi8r, b text character set koi8r); ...@@ -171,8 +171,8 @@ create table t1 (a char(10) character set koi8r, b text character set koi8r);
insert into t1 values ('test','test'); insert into t1 values ('test','test');
insert into t1 values ('',''); insert into t1 values ('','');
Warnings: Warnings:
Warning 1265 Data truncated for column 'a' at row 1 Warning 1366 Incorrect string value: '\xCA\xC3\xD5\xCB' for column 'a' at row 1
Warning 1265 Data truncated for column 'b' at row 1 Warning 1366 Incorrect string value: '\xCA\xC3\xD5\xCB' for column 'b' at row 1
drop table t1; drop table t1;
set names koi8r; set names koi8r;
create table t1 (a char(10) character set cp1251); create table t1 (a char(10) character set cp1251);
......
...@@ -723,6 +723,28 @@ lily ...@@ -723,6 +723,28 @@ lily
river river
drop table t1; drop table t1;
deallocate prepare stmt; deallocate prepare stmt;
create table t1 (
a char(10) unicode not null,
index a (a)
) engine=myisam;
insert into t1 values (repeat(0x201f, 10));
insert into t1 values (repeat(0x2020, 10));
insert into t1 values (repeat(0x2021, 10));
explain select hex(a) from t1 order by a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL a 20 NULL 3 Using index
select hex(a) from t1 order by a;
hex(a)
201F201F201F201F201F201F201F201F201F201F
2020202020202020202020202020202020202020
2021202120212021202120212021202120212021
alter table t1 drop index a;
select hex(a) from t1 order by a;
hex(a)
201F201F201F201F201F201F201F201F201F201F
2020202020202020202020202020202020202020
2021202120212021202120212021202120212021
drop table t1;
CREATE TABLE t1 (id int, s char(5) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci); CREATE TABLE t1 (id int, s char(5) CHARACTER SET ucs2 COLLATE ucs2_unicode_ci);
INSERT INTO t1 VALUES (1, 'ZZZZZ'), (1, 'ZZZ'), (2, 'ZZZ'), (2, 'ZZZZZ'); INSERT INTO t1 VALUES (1, 'ZZZZZ'), (1, 'ZZZ'), (2, 'ZZZ'), (2, 'ZZZZZ');
SELECT id, MIN(s) FROM t1 GROUP BY id; SELECT id, MIN(s) FROM t1 GROUP BY id;
......
...@@ -197,7 +197,7 @@ drop table t1; ...@@ -197,7 +197,7 @@ drop table t1;
create table t1 (s1 char(10) character set utf8); create table t1 (s1 char(10) character set utf8);
insert into t1 values (0x41FF); insert into t1 values (0x41FF);
Warnings: Warnings:
Warning 1265 Data truncated for column 's1' at row 1 Warning 1366 Incorrect string value: '\xFF' for column 's1' at row 1
select hex(s1) from t1; select hex(s1) from t1;
hex(s1) hex(s1)
41 41
...@@ -205,7 +205,7 @@ drop table t1; ...@@ -205,7 +205,7 @@ drop table t1;
create table t1 (s1 varchar(10) character set utf8); create table t1 (s1 varchar(10) character set utf8);
insert into t1 values (0x41FF); insert into t1 values (0x41FF);
Warnings: Warnings:
Warning 1265 Data truncated for column 's1' at row 1 Warning 1366 Incorrect string value: '\xFF' for column 's1' at row 1
select hex(s1) from t1; select hex(s1) from t1;
hex(s1) hex(s1)
41 41
...@@ -213,7 +213,7 @@ drop table t1; ...@@ -213,7 +213,7 @@ drop table t1;
create table t1 (s1 text character set utf8); create table t1 (s1 text character set utf8);
insert into t1 values (0x41FF); insert into t1 values (0x41FF);
Warnings: Warnings:
Warning 1265 Data truncated for column 's1' at row 1 Warning 1366 Incorrect string value: '\xFF' for column 's1' at row 1
select hex(s1) from t1; select hex(s1) from t1;
hex(s1) hex(s1)
41 41
...@@ -1536,6 +1536,32 @@ set @a:=null; ...@@ -1536,6 +1536,32 @@ set @a:=null;
execute my_stmt using @a; execute my_stmt using @a;
a b a b
drop table if exists t1; drop table if exists t1;
drop table if exists t1;
drop view if exists v1, v2;
set names utf8;
create table t1(col1 varchar(12) character set utf8 collate utf8_unicode_ci);
insert into t1 values('t1_val');
create view v1 as select 'v1_val' as col1;
select coercibility(col1), collation(col1) from v1;
coercibility(col1) collation(col1)
4 utf8_general_ci
create view v2 as select col1 from v1 union select col1 from t1;
select coercibility(col1), collation(col1)from v2;
coercibility(col1) collation(col1)
2 utf8_unicode_ci
2 utf8_unicode_ci
drop view v1, v2;
create view v1 as select 'v1_val' collate utf8_swedish_ci as col1;
select coercibility(col1), collation(col1) from v1;
coercibility(col1) collation(col1)
0 utf8_swedish_ci
create view v2 as select col1 from v1 union select col1 from t1;
select coercibility(col1), collation(col1) from v2;
coercibility(col1) collation(col1)
0 utf8_swedish_ci
0 utf8_swedish_ci
drop view v1, v2;
drop table t1;
CREATE TABLE t1 ( CREATE TABLE t1 (
colA int(11) NOT NULL, colA int(11) NOT NULL,
colB varchar(255) character set utf8 NOT NULL, colB varchar(255) character set utf8 NOT NULL,
......
...@@ -381,10 +381,10 @@ t collation(t) FORMAT(MATCH t AGAINST ('Osnabruck'),6) ...@@ -381,10 +381,10 @@ t collation(t) FORMAT(MATCH t AGAINST ('Osnabruck'),6)
aus Osnabrck utf8_general_ci 1.591140 aus Osnabrck utf8_general_ci 1.591140
alter table t1 modify t varchar(200) collate latin1_german2_ci not null; alter table t1 modify t varchar(200) collate latin1_german2_ci not null;
Warnings: Warnings:
Warning 1265 Data truncated for column 't' at row 3 Warning 1366 Incorrect string value: '\xD0\xAD\xD1\x82\xD0\xBE...' for column 't' at row 3
Warning 1265 Data truncated for column 't' at row 4 Warning 1366 Incorrect string value: '\xD0\x9E\xD1\x82\xD0\xBB...' for column 't' at row 4
Warning 1265 Data truncated for column 't' at row 5 Warning 1366 Incorrect string value: '\xD0\x9D\xD0\xB5 \xD0...' for column 't' at row 5
Warning 1265 Data truncated for column 't' at row 6 Warning 1366 Incorrect string value: '\xD0\xB8 \xD0\xB1\xD1...' for column 't' at row 6
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrck'); SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrck');
t collation(t) t collation(t)
aus Osnabrck latin1_german2_ci aus Osnabrck latin1_german2_ci
......
...@@ -664,3 +664,73 @@ GROUP_CONCAT(a) x ...@@ -664,3 +664,73 @@ GROUP_CONCAT(a) x
2 1,2 2 1,2
1 2,3 1 2,3
DROP TABLE t1; DROP TABLE t1;
set names utf8;
create table t1
(
x text character set utf8 not null,
y integer not null
);
insert into t1 values (repeat('a', 1022), 0), (repeat(_utf8 0xc3b7, 4), 0);
set group_concat_max_len= 1022 + 10;
select @x:=group_concat(x) from t1 group by y;
select @@group_concat_max_len, length(@x), char_length(@x), right(@x,12), right(HEX(@x),12);
@@group_concat_max_len length(@x) char_length(@x) right(@x,12) right(HEX(@x),12)
1032 1031 1027 aaaaaaa,÷÷÷÷ C3B7C3B7C3B7
set group_concat_max_len= 1022 + 9;
select @x:=group_concat(x) from t1 group by y;
select @@group_concat_max_len, length(@x), char_length(@x), right(@x,12), right(HEX(@x),12);
@@group_concat_max_len length(@x) char_length(@x) right(@x,12) right(HEX(@x),12)
1031 1031 1027 aaaaaaa,÷÷÷÷ C3B7C3B7C3B7
set group_concat_max_len= 1022 + 8;
select @x:=group_concat(x) from t1 group by y;
select @@group_concat_max_len, length(@x), char_length(@x), right(@x,12), right(HEX(@x),12);
@@group_concat_max_len length(@x) char_length(@x) right(@x,12) right(HEX(@x),12)
1030 1029 1026 aaaaaaaa,÷÷÷ C3B7C3B7C3B7
set group_concat_max_len= 1022 + 7;
select @x:=group_concat(x) from t1 group by y;
select @@group_concat_max_len, length(@x), char_length(@x), right(@x,12), right(HEX(@x),12);
@@group_concat_max_len length(@x) char_length(@x) right(@x,12) right(HEX(@x),12)
1029 1029 1026 aaaaaaaa,÷÷÷ C3B7C3B7C3B7
set group_concat_max_len= 1022 + 6;
select @x:=group_concat(x) from t1 group by y;
select @@group_concat_max_len, length(@x), char_length(@x), right(@x,12), right(HEX(@x),12);
@@group_concat_max_len length(@x) char_length(@x) right(@x,12) right(HEX(@x),12)
1028 1027 1025 aaaaaaaaa,÷÷ 612CC3B7C3B7
set group_concat_max_len= 1022 + 5;
select @x:=group_concat(x) from t1 group by y;
select @@group_concat_max_len, length(@x), char_length(@x), right(@x,12), right(HEX(@x),12);
@@group_concat_max_len length(@x) char_length(@x) right(@x,12) right(HEX(@x),12)
1027 1027 1025 aaaaaaaaa,÷÷ 612CC3B7C3B7
set group_concat_max_len= 1022 + 4;
select @x:=group_concat(x) from t1 group by y;
select @@group_concat_max_len, length(@x), char_length(@x), right(@x,12), right(HEX(@x),12);
@@group_concat_max_len length(@x) char_length(@x) right(@x,12) right(HEX(@x),12)
1026 1025 1024 aaaaaaaaaa,÷ 6161612CC3B7
set group_concat_max_len= 1022 + 3;
select @x:=group_concat(x) from t1 group by y;
select @@group_concat_max_len, length(@x), char_length(@x), right(@x,12), right(HEX(@x),12);
@@group_concat_max_len length(@x) char_length(@x) right(@x,12) right(HEX(@x),12)
1025 1025 1024 aaaaaaaaaa,÷ 6161612CC3B7
set group_concat_max_len= 1022 + 2;
select @x:=group_concat(x) from t1 group by y;
select @@group_concat_max_len, length(@x), char_length(@x), right(@x,12), right(HEX(@x),12);
@@group_concat_max_len length(@x) char_length(@x) right(@x,12) right(HEX(@x),12)
1024 1023 1023 aaaaaaaaaaa, 61616161612C
set group_concat_max_len= 1022 + 1;
select @x:=group_concat(x) from t1 group by y;
select @@group_concat_max_len, length(@x), char_length(@x), right(@x,12), right(HEX(@x),12);
@@group_concat_max_len length(@x) char_length(@x) right(@x,12) right(HEX(@x),12)
1023 1023 1023 aaaaaaaaaaa, 61616161612C
drop table t1;
set group_concat_max_len=1024;
set names latin1;
create table t1 (f1 int unsigned, f2 varchar(255));
insert into t1 values (1,repeat('a',255)),(2,repeat('b',255));
select f2,group_concat(f1) from t1 group by f2;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def test t1 t1 f2 f2 253 255 255 Y 0 0 8
def group_concat(f1) 252 1024 1 Y 128 0 63
f2 group_concat(f1)
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 1
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 2
drop table t1;
...@@ -84,3 +84,27 @@ create table t2 like T1; ...@@ -84,3 +84,27 @@ create table t2 like T1;
drop table t1, t2; drop table t1, t2;
show tables; show tables;
Tables_in_test Tables_in_test
set names utf8;
drop table if exists İ,İİ;
create table İ (s1 int);
show create table İ;
Table Create Table
İ CREATE TABLE `i` (
`s1` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show tables;
Tables_in_test
i
drop table İ;
create table İİ (s1 int);
show create table İİ;
Table Create Table
İİ CREATE TABLE `ii` (
`s1` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show tables;
Tables_in_test
ii
drop table İİ;
set names latin1;
End of 5.0 tests
...@@ -6,7 +6,7 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; ...@@ -6,7 +6,7 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
CREATE TABLE t1 (a INT NOT NULL, KEY(a)) ENGINE=innodb; CREATE TABLE t1 (a INT NOT NULL, KEY(a)) ENGINE=innodb;
CREATE TABLE t2 (a INT NOT NULL, KEY(a)) ENGINE=innodb; CREATE TABLE t2 (a INT NOT NULL, KEY(a)) ENGINE=innodb;
CREATE TABLE t3 (a INT) ENGINE=innodb; CREATE TABLE t3 (a INT UNIQUE) ENGINE=innodb;
CREATE TABLE t4 (a INT) ENGINE=innodb; CREATE TABLE t4 (a INT) ENGINE=innodb;
show variables like 'slave_transaction_retries'; show variables like 'slave_transaction_retries';
Variable_name Value Variable_name Value
...@@ -28,21 +28,22 @@ Variable_name Value ...@@ -28,21 +28,22 @@ Variable_name Value
slave_transaction_retries 2 slave_transaction_retries 2
stop slave; stop slave;
begin; begin;
insert into t3 select * from t2 for update; insert into t2 values (0);
insert into t1 values(1); insert into t1 values(1);
commit; commit;
begin; begin;
select * from t1 for update; select * from t1 for update;
a a
start slave; start slave;
insert into t2 values(22); select * from t2 for update /* dl */;
a
commit; commit;
select * from t1; select * from t1;
a a
1 1
select * from t2; select * from t2 /* must be 1 */;
a a
22 0
show slave status; show slave status;
Slave_IO_State # Slave_IO_State #
Master_Host 127.0.0.1 Master_Host 127.0.0.1
...@@ -78,12 +79,16 @@ Master_SSL_Cipher ...@@ -78,12 +79,16 @@ Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
stop slave; stop slave;
change master to master_log_pos=536; delete from t3;
change master to master_log_pos=544;
begin; begin;
select * from t2 for update; select * from t2 for update;
a a
22 0
start slave; start slave;
select count(*) from t3 /* must be zero */;
count(*)
0
commit; commit;
select * from t1; select * from t1;
a a
...@@ -91,7 +96,8 @@ a ...@@ -91,7 +96,8 @@ a
1 1
select * from t2; select * from t2;
a a
22 0
0
show slave status; show slave status;
Slave_IO_State # Slave_IO_State #
Master_Host 127.0.0.1 Master_Host 127.0.0.1
...@@ -128,12 +134,17 @@ Master_SSL_Key ...@@ -128,12 +134,17 @@ Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
set global max_relay_log_size=0; set global max_relay_log_size=0;
stop slave; stop slave;
change master to master_log_pos=536; delete from t3;
change master to master_log_pos=544;
begin; begin;
select * from t2 for update; select * from t2 for update;
a a
22 0
0
start slave; start slave;
select count(*) from t3 /* must be zero */;
count(*)
0
commit; commit;
select * from t1; select * from t1;
a a
...@@ -142,7 +153,9 @@ a ...@@ -142,7 +153,9 @@ a
1 1
select * from t2; select * from t2;
a a
22 0
0
0
show slave status; show slave status;
Slave_IO_State # Slave_IO_State #
Master_Host 127.0.0.1 Master_Host 127.0.0.1
...@@ -178,3 +191,4 @@ Master_SSL_Cipher ...@@ -178,3 +191,4 @@ Master_SSL_Cipher
Master_SSL_Key Master_SSL_Key
Seconds_Behind_Master # Seconds_Behind_Master #
drop table t1,t2,t3,t4; drop table t1,t2,t3,t4;
End of 5.1 tests
...@@ -23,6 +23,8 @@ password<>_binary'' ...@@ -23,6 +23,8 @@ password<>_binary''
delete from mysql.user where user=_binary'rpl_do_grant'; delete from mysql.user where user=_binary'rpl_do_grant';
delete from mysql.db where user=_binary'rpl_do_grant'; delete from mysql.db where user=_binary'rpl_do_grant';
flush privileges; flush privileges;
delete from mysql.user where user=_binary'rpl_do_grant';
delete from mysql.db where user=_binary'rpl_do_grant';
flush privileges; flush privileges;
show grants for rpl_do_grant@localhost; show grants for rpl_do_grant@localhost;
ERROR 42000: There is no such grant defined for user 'rpl_do_grant' on host 'localhost' ERROR 42000: There is no such grant defined for user 'rpl_do_grant' on host 'localhost'
......
This diff is collapsed.
This diff is collapsed.
...@@ -14,3 +14,19 @@ SELECT * FROM t4; ...@@ -14,3 +14,19 @@ SELECT * FROM t4;
a a
DROP TABLE t1; DROP TABLE t1;
DROP TABLE t4; DROP TABLE t4;
DROP TABLE IF EXISTS t5;
CREATE TABLE t5 (
word varchar(50) collate utf8_unicode_ci NOT NULL default ''
) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
SET @@session.character_set_client=33,@@session.collation_connection=192;
CREATE TEMPORARY TABLE tmptbl504451f4258$1 (id INT NOT NULL) ENGINE=MEMORY;
INSERT INTO t5 (word) VALUES ('TEST’');
SELECT HEX(word) FROM t5;
HEX(word)
54455354E28099
SELECT HEX(word) FROM t5;
HEX(word)
54455354E28099
SELECT * FROM tmptbl504451f4258$1;
ERROR 42S02: Table 'test.tmptbl504451f4258$1' doesn't exist
DROP TABLE t5;
...@@ -326,12 +326,12 @@ COUNT(*) ...@@ -326,12 +326,12 @@ COUNT(*)
**** Must make sure slave is clean ***** **** Must make sure slave is clean *****
STOP SLAVE; STOP SLAVE;
RESET SLAVE; RESET SLAVE;
DROP PROCEDURE tpcb.load; DROP PROCEDURE IF EXISTS tpcb.load;
DROP PROCEDURE tpcb.trans; DROP PROCEDURE IF EXISTS tpcb.trans;
DROP TABLE tpcb.account; DROP TABLE IF EXISTS tpcb.account;
DROP TABLE tpcb.teller; DROP TABLE IF EXISTS tpcb.teller;
DROP TABLE tpcb.branch; DROP TABLE IF EXISTS tpcb.branch;
DROP TABLE tpcb.history; DROP TABLE IF EXISTS tpcb.history;
DROP DATABASE tpcb; DROP DATABASE tpcb;
ALTER TABLESPACE ts1 ALTER TABLESPACE ts1
DROP DATAFILE 'datafile.dat' DROP DATAFILE 'datafile.dat'
...@@ -392,8 +392,8 @@ COUNT(*) ...@@ -392,8 +392,8 @@ COUNT(*)
4050 4050
*** DUMP MASTER & SLAVE FOR COMPARE ******** *** DUMP MASTER & SLAVE FOR COMPARE ********
*************** TEST 2 CLEANUP SECTION ******************** *************** TEST 2 CLEANUP SECTION ********************
DROP PROCEDURE tpcb.load; DROP PROCEDURE IF EXISTS tpcb.load;
DROP PROCEDURE tpcb.trans; DROP PROCEDURE IF EXISTS tpcb.trans;
DROP TABLE tpcb.account; DROP TABLE tpcb.account;
DROP TABLE tpcb.teller; DROP TABLE tpcb.teller;
DROP TABLE tpcb.branch; DROP TABLE tpcb.branch;
......
...@@ -359,8 +359,6 @@ MAX(f1) ...@@ -359,8 +359,6 @@ MAX(f1)
-------- switch to master ------- -------- switch to master -------
ROLLBACK; ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
SELECT MAX(f1) FROM t1; SELECT MAX(f1) FROM t1;
MAX(f1) MAX(f1)
5 5
...@@ -370,9 +368,9 @@ TEST-INFO: MASTER: The INSERT is not committed (Succeeded) ...@@ -370,9 +368,9 @@ TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
-------- switch to slave -------- -------- switch to slave --------
SELECT MAX(f1) FROM t1; SELECT MAX(f1) FROM t1;
MAX(f1) MAX(f1)
6 5
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
-------- switch to master ------- -------- switch to master -------
flush logs; flush logs;
...@@ -401,7 +399,7 @@ MAX(f1) ...@@ -401,7 +399,7 @@ MAX(f1)
-------- switch to slave -------- -------- switch to slave --------
SELECT MAX(f1) FROM t1; SELECT MAX(f1) FROM t1;
MAX(f1) MAX(f1)
6 5
-------- switch to master ------- -------- switch to master -------
RENAME TABLE mysqltest1.t3 to mysqltest1.t20; RENAME TABLE mysqltest1.t3 to mysqltest1.t20;
...@@ -506,7 +504,7 @@ f2 bigint(20) YES NULL ...@@ -506,7 +504,7 @@ f2 bigint(20) YES NULL
-------- switch to master ------- -------- switch to master -------
######## CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "InnoDB" ######## ######## CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "NDB" ########
-------- switch to master ------- -------- switch to master -------
INSERT INTO t1 SET f1= 7 + 1; INSERT INTO t1 SET f1= 7 + 1;
...@@ -520,7 +518,7 @@ MAX(f1) ...@@ -520,7 +518,7 @@ MAX(f1)
7 7
-------- switch to master ------- -------- switch to master -------
CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "InnoDB"; CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "NDB";
SELECT MAX(f1) FROM t1; SELECT MAX(f1) FROM t1;
MAX(f1) MAX(f1)
8 8
...@@ -579,8 +577,6 @@ MAX(f1) ...@@ -579,8 +577,6 @@ MAX(f1)
-------- switch to master ------- -------- switch to master -------
ROLLBACK; ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
SELECT MAX(f1) FROM t1; SELECT MAX(f1) FROM t1;
MAX(f1) MAX(f1)
8 8
...@@ -590,9 +586,9 @@ TEST-INFO: MASTER: The INSERT is not committed (Succeeded) ...@@ -590,9 +586,9 @@ TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
-------- switch to slave -------- -------- switch to slave --------
SELECT MAX(f1) FROM t1; SELECT MAX(f1) FROM t1;
MAX(f1) MAX(f1)
9 8
TEST-INFO: SLAVE: The INSERT is committed (Succeeded) TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
-------- switch to master ------- -------- switch to master -------
flush logs; flush logs;
...@@ -613,7 +609,7 @@ MAX(f1) ...@@ -613,7 +609,7 @@ MAX(f1)
-------- switch to slave -------- -------- switch to slave --------
SELECT MAX(f1) FROM t1; SELECT MAX(f1) FROM t1;
MAX(f1) MAX(f1)
9 8
-------- switch to master ------- -------- switch to master -------
TRUNCATE TABLE mysqltest1.t7; TRUNCATE TABLE mysqltest1.t7;
...@@ -650,11 +646,9 @@ flush logs; ...@@ -650,11 +646,9 @@ flush logs;
-------- switch to master ------- -------- switch to master -------
SELECT * FROM mysqltest1.t7; SELECT * FROM mysqltest1.t7;
f1 f1
-------- switch to slave -------- -------- switch to slave --------
SELECT * FROM mysqltest1.t7; SELECT * FROM mysqltest1.t7;
f1 f1
-------- switch to master ------- -------- switch to master -------
######## LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ ######## ######## LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ ########
...@@ -957,7 +951,7 @@ t5 1 my_idx5 1 f1 A 0 NULL NULL YES BTREE ...@@ -957,7 +951,7 @@ t5 1 my_idx5 1 f1 A 0 NULL NULL YES BTREE
-------- switch to slave -------- -------- switch to slave --------
SHOW INDEX FROM mysqltest1.t5; SHOW INDEX FROM mysqltest1.t5;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t5 1 my_idx5 1 f1 A NULL NULL NULL YES BTREE t5 1 my_idx5 1 f1 A 0 NULL NULL YES BTREE
-------- switch to master ------- -------- switch to master -------
...@@ -1691,3 +1685,4 @@ user ...@@ -1691,3 +1685,4 @@ user
DROP DATABASE IF EXISTS mysqltest1; DROP DATABASE IF EXISTS mysqltest1;
DROP DATABASE IF EXISTS mysqltest2; DROP DATABASE IF EXISTS mysqltest2;
DROP DATABASE IF EXISTS mysqltest3; DROP DATABASE IF EXISTS mysqltest3;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
This diff is collapsed.
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;
drop database if exists DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
create database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
select @@net_buffer_length, @@max_allowed_packet;
@@net_buffer_length @@max_allowed_packet
1024 1024
create table `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1023');
select count(*) from `DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________`.`t1` /* must be 1 */;
count(*)
1
drop database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
drop table if exists t1;
set @org_mode=@@sql_mode; set @org_mode=@@sql_mode;
create table t1 create table t1
( (
......
drop table if exists t1;
set @org_mode=@@sql_mode; set @org_mode=@@sql_mode;
create table t1 create table t1
( (
......
drop table if exists t1;
set @org_mode=@@sql_mode; set @org_mode=@@sql_mode;
create table t1 create table t1
( (
......
drop table if exists t1;
set @org_mode=@@sql_mode; set @org_mode=@@sql_mode;
create table t1 create table t1
( (
......
drop table if exists t1;
set @org_mode=@@sql_mode; set @org_mode=@@sql_mode;
create table t1 create table t1
( (
......
...@@ -3015,3 +3015,22 @@ i j ...@@ -3015,3 +3015,22 @@ i j
DROP VIEW v1, v2; DROP VIEW v1, v2;
DROP TABLE t1; DROP TABLE t1;
End of 5.0 tests. End of 5.0 tests.
DROP DATABASE IF EXISTS `d-1`;
CREATE DATABASE `d-1`;
USE `d-1`;
CREATE TABLE `t-1` (c1 INT);
CREATE VIEW `v-1` AS SELECT c1 FROM `t-1`;
SHOW TABLES;
Tables_in_d-1
t-1
v-1
RENAME TABLE `t-1` TO `t-2`;
RENAME TABLE `v-1` TO `v-2`;
SHOW TABLES;
Tables_in_d-1
t-2
v-2
DROP TABLE `t-2`;
DROP VIEW `v-2`;
DROP DATABASE `d-1`;
USE test;
...@@ -736,3 +736,76 @@ test ...@@ -736,3 +736,76 @@ test
select extractValue('<x.-_:>test</x.-_:>','//*'); select extractValue('<x.-_:>test</x.-_:>','//*');
extractValue('<x.-_:>test</x.-_:>','//*') extractValue('<x.-_:>test</x.-_:>','//*')
test test
set @xml= "<entry><id>pt10</id><pt>10</pt></entry><entry><id>pt50</id><pt>50</pt></entry>";
select ExtractValue(@xml, "/entry[(pt=10)]/id");
ExtractValue(@xml, "/entry[(pt=10)]/id")
pt10
select ExtractValue(@xml, "/entry[(pt!=10)]/id");
ExtractValue(@xml, "/entry[(pt!=10)]/id")
pt50
select ExtractValue(@xml, "/entry[(pt<10)]/id");
ExtractValue(@xml, "/entry[(pt<10)]/id")
select ExtractValue(@xml, "/entry[(pt<=10)]/id");
ExtractValue(@xml, "/entry[(pt<=10)]/id")
pt10
select ExtractValue(@xml, "/entry[(pt>10)]/id");
ExtractValue(@xml, "/entry[(pt>10)]/id")
pt50
select ExtractValue(@xml, "/entry[(pt>=10)]/id");
ExtractValue(@xml, "/entry[(pt>=10)]/id")
pt10 pt50
select ExtractValue(@xml, "/entry[(pt=50)]/id");
ExtractValue(@xml, "/entry[(pt=50)]/id")
pt50
select ExtractValue(@xml, "/entry[(pt!=50)]/id");
ExtractValue(@xml, "/entry[(pt!=50)]/id")
pt10
select ExtractValue(@xml, "/entry[(pt<50)]/id");
ExtractValue(@xml, "/entry[(pt<50)]/id")
pt10
select ExtractValue(@xml, "/entry[(pt<=50)]/id");
ExtractValue(@xml, "/entry[(pt<=50)]/id")
pt10 pt50
select ExtractValue(@xml, "/entry[(pt>50)]/id");
ExtractValue(@xml, "/entry[(pt>50)]/id")
select ExtractValue(@xml, "/entry[(pt>=50)]/id");
ExtractValue(@xml, "/entry[(pt>=50)]/id")
pt50
select ExtractValue(@xml, "/entry[(10=pt)]/id");
ExtractValue(@xml, "/entry[(10=pt)]/id")
pt10
select ExtractValue(@xml, "/entry[(10!=pt)]/id");
ExtractValue(@xml, "/entry[(10!=pt)]/id")
pt50
select ExtractValue(@xml, "/entry[(10>pt)]/id");
ExtractValue(@xml, "/entry[(10>pt)]/id")
select ExtractValue(@xml, "/entry[(10>=pt)]/id");
ExtractValue(@xml, "/entry[(10>=pt)]/id")
pt10
select ExtractValue(@xml, "/entry[(10<pt)]/id");
ExtractValue(@xml, "/entry[(10<pt)]/id")
pt50
select ExtractValue(@xml, "/entry[(10<=pt)]/id");
ExtractValue(@xml, "/entry[(10<=pt)]/id")
pt10 pt50
select ExtractValue(@xml, "/entry[(50=pt)]/id");
ExtractValue(@xml, "/entry[(50=pt)]/id")
pt50
select ExtractValue(@xml, "/entry[(50!=pt)]/id");
ExtractValue(@xml, "/entry[(50!=pt)]/id")
pt10
select ExtractValue(@xml, "/entry[(50>pt)]/id");
ExtractValue(@xml, "/entry[(50>pt)]/id")
pt10
select ExtractValue(@xml, "/entry[(50>=pt)]/id");
ExtractValue(@xml, "/entry[(50>=pt)]/id")
pt10 pt50
select ExtractValue(@xml, "/entry[(50<pt)]/id");
ExtractValue(@xml, "/entry[(50<pt)]/id")
select ExtractValue(@xml, "/entry[(50<=pt)]/id");
ExtractValue(@xml, "/entry[(50<=pt)]/id")
pt50
...@@ -454,6 +454,23 @@ select utext from t1 where utext like '%%'; ...@@ -454,6 +454,23 @@ select utext from t1 where utext like '%%';
drop table t1; drop table t1;
deallocate prepare stmt; deallocate prepare stmt;
#
# Bug#22052 Trailing spaces are not removed from UNICODE fields in an index
#
create table t1 (
a char(10) unicode not null,
index a (a)
) engine=myisam;
insert into t1 values (repeat(0x201f, 10));
insert into t1 values (repeat(0x2020, 10));
insert into t1 values (repeat(0x2021, 10));
# make sure "index read" is used
explain select hex(a) from t1 order by a;
select hex(a) from t1 order by a;
alter table t1 drop index a;
select hex(a) from t1 order by a;
drop table t1;
# #
# Bug #20076: server crashes for a query with GROUP BY if MIN/MAX aggregation # Bug #20076: server crashes for a query with GROUP BY if MIN/MAX aggregation
# over a 'ucs2' field uses a temporary table # over a 'ucs2' field uses a temporary table
......
...@@ -1229,6 +1229,30 @@ set @a:=null; ...@@ -1229,6 +1229,30 @@ set @a:=null;
execute my_stmt using @a; execute my_stmt using @a;
drop table if exists t1; drop table if exists t1;
#
# Bug#21505 Create view - illegal mix of collation for operation 'UNION'
#
--disable_warnings
drop table if exists t1;
drop view if exists v1, v2;
--enable_warnings
set names utf8;
create table t1(col1 varchar(12) character set utf8 collate utf8_unicode_ci);
insert into t1 values('t1_val');
create view v1 as select 'v1_val' as col1;
select coercibility(col1), collation(col1) from v1;
create view v2 as select col1 from v1 union select col1 from t1;
select coercibility(col1), collation(col1)from v2;
drop view v1, v2;
create view v1 as select 'v1_val' collate utf8_swedish_ci as col1;
select coercibility(col1), collation(col1) from v1;
create view v2 as select col1 from v1 union select col1 from t1;
select coercibility(col1), collation(col1) from v2;
drop view v1, v2;
drop table t1;
# #
# Bug#19960: Inconsistent results when joining # Bug#19960: Inconsistent results when joining
# InnoDB tables using partial UTF8 indexes # InnoDB tables using partial UTF8 indexes
......
...@@ -21,7 +21,7 @@ ps_7ndb : BUG#18950 2006-02-16 jmiller create table like does n ...@@ -21,7 +21,7 @@ ps_7ndb : BUG#18950 2006-02-16 jmiller create table like does n
rpl_ndb_2innodb : BUG#19227 2006-04-20 pekka pk delete apparently not replicated rpl_ndb_2innodb : BUG#19227 2006-04-20 pekka pk delete apparently not replicated
rpl_ndb_2myisam : BUG#19227 Seems to pass currently rpl_ndb_2myisam : BUG#19227 Seems to pass currently
rpl_ndb_dd_partitions : BUG#19259 2006-04-21 rpl_ndb_dd_partitions fails on s/AMD rpl_ndb_dd_partitions : BUG#19259 2006-04-21 rpl_ndb_dd_partitions fails on s/AMD
rpl_ndb_ddl : BUG#18946 result file needs update + test needs to checked #rpl_ndb_ddl : BUG#18946 result file needs update + test needs to checked
rpl_ndb_innodb2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement rpl_ndb_innodb2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement
rpl_ndb_myisam2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement rpl_ndb_myisam2ndb : Bug #19710 Cluster replication to partition table fails on DELETE FROM statement
rpl_row_blob_innodb : BUG#18980 2006-04-10 kent Test fails randomly rpl_row_blob_innodb : BUG#18980 2006-04-10 kent Test fails randomly
......
...@@ -461,3 +461,38 @@ SELECT GROUP_CONCAT(a), x ...@@ -461,3 +461,38 @@ SELECT GROUP_CONCAT(a), x
GROUP BY x; GROUP BY x;
DROP TABLE t1; DROP TABLE t1;
#
# Bug#23451 GROUP_CONCAT truncates a multibyte utf8 character
#
set names utf8;
create table t1
(
x text character set utf8 not null,
y integer not null
);
insert into t1 values (repeat('a', 1022), 0), (repeat(_utf8 0xc3b7, 4), 0);
let $1= 10;
while ($1)
{
eval set group_concat_max_len= 1022 + $1;
--disable_result_log
select @x:=group_concat(x) from t1 group by y;
--enable_result_log
select @@group_concat_max_len, length(@x), char_length(@x), right(@x,12), right(HEX(@x),12);
dec $1;
}
drop table t1;
set group_concat_max_len=1024;
set names latin1;
#
# Bug#14169 type of group_concat() result changed to blob if tmp_table was used
#
create table t1 (f1 int unsigned, f2 varchar(255));
insert into t1 values (1,repeat('a',255)),(2,repeat('b',255));
--enable_metadata
select f2,group_concat(f1) from t1 group by f2;
--disable_metadata
drop table t1;
# End of 4.1 tests
...@@ -85,3 +85,23 @@ drop table t1, t2; ...@@ -85,3 +85,23 @@ drop table t1, t2;
show tables; show tables;
# End of 4.1 tests # End of 4.1 tests
#
# Bug#20404: SHOW CREATE TABLE fails with Turkish I
#
set names utf8;
--disable_warnings
drop table if exists İ,İİ;
--enable_warnings
create table İ (s1 int);
show create table İ;
show tables;
drop table İ;
create table İİ (s1 int);
show create table İİ;
show tables;
drop table İİ;
set names latin1;
--echo End of 5.0 tests
...@@ -39,11 +39,11 @@ connection master; ...@@ -39,11 +39,11 @@ connection master;
delete from mysql.user where user=_binary'rpl_do_grant'; delete from mysql.user where user=_binary'rpl_do_grant';
delete from mysql.db where user=_binary'rpl_do_grant'; delete from mysql.db where user=_binary'rpl_do_grant';
flush privileges; flush privileges;
save_master_pos; sync_slave_with_master;
connection slave; # The mysql database is not replicated, so we have to do the deletes
sync_with_master; # manually on the slave as well.
# no need to delete manually, as the DELETEs must have done some real job on delete from mysql.user where user=_binary'rpl_do_grant';
# master (updated binlog) delete from mysql.db where user=_binary'rpl_do_grant';
flush privileges; flush privileges;
# End of 4.1 tests # End of 4.1 tests
......
###########################################
# Author: Jeb
# Date: 2006-09-08
# Purpose: Wapper for rpl_extraSlave_Col.test
# Using innodb
###########################################
-- source include/have_binlog_format_row.inc
-- source include/have_innodb.inc
-- source include/master-slave.inc
let $engine_type = 'InnoDB';
-- source extra/rpl_tests/rpl_extraSlave_Col.test
###########################################
# Author: Jeb
# Date: 2006-09-07
# Purpose: Wapper for rpl_extraSlave_Col.test
# Using MyISAM
###########################################
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
let $engine_type = 'MyISAM';
-- source extra/rpl_tests/rpl_extraSlave_Col.test
--replicate-ignore-table=test.t1 --replicate-ignore-table=test.t2 --replicate-ignore-table=test.t3 --replicate-ignore-table=test.t1 --replicate-ignore-table=test.t2 --replicate-ignore-table=test.t3 --replicate-wild-ignore-table=%.tmptbl%
...@@ -28,3 +28,27 @@ connection master; ...@@ -28,3 +28,27 @@ connection master;
DROP TABLE t1; DROP TABLE t1;
DROP TABLE t4; DROP TABLE t4;
sync_slave_with_master; sync_slave_with_master;
#
# bug#22877 replication character sets get out of sync
# using replicate-wild-ignore-table
#
connection master;
--disable_warnings
DROP TABLE IF EXISTS t5;
--enable_warnings
CREATE TABLE t5 (
word varchar(50) collate utf8_unicode_ci NOT NULL default ''
) DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
SET @@session.character_set_client=33,@@session.collation_connection=192;
CREATE TEMPORARY TABLE tmptbl504451f4258$1 (id INT NOT NULL) ENGINE=MEMORY;
INSERT INTO t5 (word) VALUES ('TEST’');
SELECT HEX(word) FROM t5;
sync_slave_with_master;
connection slave;
SELECT HEX(word) FROM t5;
--error 1146
SELECT * FROM tmptbl504451f4258$1;
connection master;
DROP TABLE t5;
sync_slave_with_master;
...@@ -385,12 +385,12 @@ while ($j) ...@@ -385,12 +385,12 @@ while ($j)
--connection slave --connection slave
STOP SLAVE; STOP SLAVE;
RESET SLAVE; RESET SLAVE;
DROP PROCEDURE tpcb.load; DROP PROCEDURE IF EXISTS tpcb.load;
DROP PROCEDURE tpcb.trans; DROP PROCEDURE IF EXISTS tpcb.trans;
DROP TABLE tpcb.account; DROP TABLE IF EXISTS tpcb.account;
DROP TABLE tpcb.teller; DROP TABLE IF EXISTS tpcb.teller;
DROP TABLE tpcb.branch; DROP TABLE IF EXISTS tpcb.branch;
DROP TABLE tpcb.history; DROP TABLE IF EXISTS tpcb.history;
DROP DATABASE tpcb; DROP DATABASE tpcb;
ALTER TABLESPACE ts1 ALTER TABLESPACE ts1
...@@ -534,8 +534,8 @@ SELECT COUNT(*) FROM history; ...@@ -534,8 +534,8 @@ SELECT COUNT(*) FROM history;
--echo *************** TEST 2 CLEANUP SECTION ******************** --echo *************** TEST 2 CLEANUP SECTION ********************
connection master; connection master;
DROP PROCEDURE tpcb.load; DROP PROCEDURE IF EXISTS tpcb.load;
DROP PROCEDURE tpcb.trans; DROP PROCEDURE IF EXISTS tpcb.trans;
DROP TABLE tpcb.account; DROP TABLE tpcb.account;
DROP TABLE tpcb.teller; DROP TABLE tpcb.teller;
DROP TABLE tpcb.branch; DROP TABLE tpcb.branch;
......
...@@ -31,4 +31,5 @@ ...@@ -31,4 +31,5 @@
--source include/have_ndb.inc --source include/have_ndb.inc
--source include/master-slave.inc --source include/master-slave.inc
let $engine_type= "NDB"; let $engine_type= "NDB";
-- source extra/rpl_tests/rpl_ddl.test -- source extra/rpl_tests/rpl_ndb_ddl.test
###########################################
# Author: Jeb
# Date: 2006-09-08
# Purpose: Wapper for rpl_extraSlave_Col.test
# Using NDB
###########################################
-- source include/have_binlog_format_row.inc
--source include/have_ndb.inc
-- source include/master-slave.inc
let $engine_type = 'NDB';
-- source extra/rpl_tests/rpl_extraSlave_Col.test
-O max_allowed_packet=1024 -O net_buffer_length=1024
-O max_allowed_packet=1024 -O net_buffer_length=1024
#
# Check replication protocol packet size handling
# Bug#19402 SQL close to the size of the max_allowed_packet fails on slave
#
# max-out size db name
source include/master-slave.inc;
let $db= DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
disable_warnings;
eval drop database if exists $db;
enable_warnings;
eval create database $db;
connection master;
select @@net_buffer_length, @@max_allowed_packet;
disconnect master;
# alas, can't use eval here; if db name changed apply the change here
connect (master,localhost,root,,DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________);
connection master;
create table `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1023');
save_master_pos;
connection slave;
sync_with_master;
eval select count(*) from `$db`.`t1` /* must be 1 */;
connection master;
eval drop database $db;
save_master_pos;
connection slave;
sync_with_master;
# End of tests
...@@ -2959,3 +2959,22 @@ DROP TABLE t1; ...@@ -2959,3 +2959,22 @@ DROP TABLE t1;
--echo End of 5.0 tests. --echo End of 5.0 tests.
#
# Bug#21370 View renaming lacks tablename_to_filename encoding
#
--disable_warnings
DROP DATABASE IF EXISTS `d-1`;
--enable_warnings
CREATE DATABASE `d-1`;
USE `d-1`;
CREATE TABLE `t-1` (c1 INT);
CREATE VIEW `v-1` AS SELECT c1 FROM `t-1`;
SHOW TABLES;
RENAME TABLE `t-1` TO `t-2`;
RENAME TABLE `v-1` TO `v-2`;
SHOW TABLES;
DROP TABLE `t-2`;
DROP VIEW `v-2`;
DROP DATABASE `d-1`;
USE test;
...@@ -376,3 +376,33 @@ select extractValue('<:>test</:>','//*'); ...@@ -376,3 +376,33 @@ select extractValue('<:>test</:>','//*');
select extractValue('<_>test</_>','//*'); select extractValue('<_>test</_>','//*');
# dot, dash, underscore and semicolon are good identifier middle characters # dot, dash, underscore and semicolon are good identifier middle characters
select extractValue('<x.-_:>test</x.-_:>','//*'); select extractValue('<x.-_:>test</x.-_:>','//*');
#
# Bug#22823 gt and lt operators appear to be
# reversed in ExtractValue() command
#
set @xml= "<entry><id>pt10</id><pt>10</pt></entry><entry><id>pt50</id><pt>50</pt></entry>";
select ExtractValue(@xml, "/entry[(pt=10)]/id");
select ExtractValue(@xml, "/entry[(pt!=10)]/id");
select ExtractValue(@xml, "/entry[(pt<10)]/id");
select ExtractValue(@xml, "/entry[(pt<=10)]/id");
select ExtractValue(@xml, "/entry[(pt>10)]/id");
select ExtractValue(@xml, "/entry[(pt>=10)]/id");
select ExtractValue(@xml, "/entry[(pt=50)]/id");
select ExtractValue(@xml, "/entry[(pt!=50)]/id");
select ExtractValue(@xml, "/entry[(pt<50)]/id");
select ExtractValue(@xml, "/entry[(pt<=50)]/id");
select ExtractValue(@xml, "/entry[(pt>50)]/id");
select ExtractValue(@xml, "/entry[(pt>=50)]/id");
select ExtractValue(@xml, "/entry[(10=pt)]/id");
select ExtractValue(@xml, "/entry[(10!=pt)]/id");
select ExtractValue(@xml, "/entry[(10>pt)]/id");
select ExtractValue(@xml, "/entry[(10>=pt)]/id");
select ExtractValue(@xml, "/entry[(10<pt)]/id");
select ExtractValue(@xml, "/entry[(10<=pt)]/id");
select ExtractValue(@xml, "/entry[(50=pt)]/id");
select ExtractValue(@xml, "/entry[(50!=pt)]/id");
select ExtractValue(@xml, "/entry[(50>pt)]/id");
select ExtractValue(@xml, "/entry[(50>=pt)]/id");
select ExtractValue(@xml, "/entry[(50<pt)]/id");
select ExtractValue(@xml, "/entry[(50<=pt)]/id");
...@@ -54,6 +54,7 @@ ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc ...@@ -54,6 +54,7 @@ ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc
event_queue.cc event_db_repository.cc event_queue.cc event_db_repository.cc
sql_tablespace.cc events.cc ../sql-common/my_user.c sql_tablespace.cc events.cc ../sql-common/my_user.c
partition_info.cc rpl_utility.cc rpl_injector.cc sql_locale.cc partition_info.cc rpl_utility.cc rpl_injector.cc sql_locale.cc
rpl_rli.cc rpl_mi.cc
${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc
${PROJECT_SOURCE_DIR}/sql/sql_yacc.h ${PROJECT_SOURCE_DIR}/sql/sql_yacc.h
${PROJECT_SOURCE_DIR}/include/mysqld_error.h ${PROJECT_SOURCE_DIR}/include/mysqld_error.h
......
...@@ -54,7 +54,7 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \ ...@@ -54,7 +54,7 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
ha_ndbcluster.h ha_ndbcluster_binlog.h \ ha_ndbcluster.h ha_ndbcluster_binlog.h \
ha_ndbcluster_tables.h \ ha_ndbcluster_tables.h \
opt_range.h protocol.h rpl_tblmap.h rpl_utility.h \ opt_range.h protocol.h rpl_tblmap.h rpl_utility.h \
log.h sql_show.h rpl_rli.h \ log.h sql_show.h rpl_rli.h rpl_mi.h \
sql_select.h structs.h table.h sql_udf.h hash_filo.h \ sql_select.h structs.h table.h sql_udf.h hash_filo.h \
lex.h lex_symbol.h sql_acl.h sql_crypt.h \ lex.h lex_symbol.h sql_acl.h sql_crypt.h \
log_event.h sql_repl.h slave.h rpl_filter.h \ log_event.h sql_repl.h slave.h rpl_filter.h \
...@@ -94,7 +94,7 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc sql_partition.cc \ ...@@ -94,7 +94,7 @@ mysqld_SOURCES = sql_lex.cc sql_handler.cc sql_partition.cc \
sql_load.cc mf_iocache.cc field_conv.cc sql_show.cc \ sql_load.cc mf_iocache.cc field_conv.cc sql_show.cc \
sql_udf.cc sql_analyse.cc sql_analyse.h sql_cache.cc \ sql_udf.cc sql_analyse.cc sql_analyse.h sql_cache.cc \
slave.cc sql_repl.cc rpl_filter.cc rpl_tblmap.cc \ slave.cc sql_repl.cc rpl_filter.cc rpl_tblmap.cc \
rpl_utility.cc rpl_injector.cc \ rpl_utility.cc rpl_injector.cc rpl_rli.cc rpl_mi.cc \
sql_union.cc sql_derived.cc \ sql_union.cc sql_derived.cc \
client.c sql_client.cc mini_client_errors.c pack.c\ client.c sql_client.cc mini_client_errors.c pack.c\
stacktrace.c repl_failsafe.h repl_failsafe.cc \ stacktrace.c repl_failsafe.h repl_failsafe.cc \
......
This diff is collapsed.
...@@ -351,6 +351,9 @@ public: ...@@ -351,6 +351,9 @@ public:
virtual CHARSET_INFO *sort_charset(void) const { return charset(); } virtual CHARSET_INFO *sort_charset(void) const { return charset(); }
virtual bool has_charset(void) const { return FALSE; } virtual bool has_charset(void) const { return FALSE; }
virtual void set_charset(CHARSET_INFO *charset) { } virtual void set_charset(CHARSET_INFO *charset) { }
virtual enum Derivation derivation(void) const
{ return DERIVATION_IMPLICIT; }
virtual void set_derivation(enum Derivation derivation) { }
bool set_warning(MYSQL_ERROR::enum_warning_level, unsigned int code, bool set_warning(MYSQL_ERROR::enum_warning_level, unsigned int code,
int cuted_increment); int cuted_increment);
bool check_int(const char *str, int length, const char *int_end, bool check_int(const char *str, int length, const char *int_end,
...@@ -446,6 +449,7 @@ public: ...@@ -446,6 +449,7 @@ public:
class Field_str :public Field { class Field_str :public Field {
protected: protected:
CHARSET_INFO *field_charset; CHARSET_INFO *field_charset;
enum Derivation field_derivation;
public: public:
Field_str(char *ptr_arg,uint32 len_arg, uchar *null_ptr_arg, Field_str(char *ptr_arg,uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg, utype unireg_check_arg, uchar null_bit_arg, utype unireg_check_arg,
...@@ -459,6 +463,9 @@ public: ...@@ -459,6 +463,9 @@ public:
uint size_of() const { return sizeof(*this); } uint size_of() const { return sizeof(*this); }
CHARSET_INFO *charset(void) const { return field_charset; } CHARSET_INFO *charset(void) const { return field_charset; }
void set_charset(CHARSET_INFO *charset) { field_charset=charset; } void set_charset(CHARSET_INFO *charset) { field_charset=charset; }
enum Derivation derivation(void) const { return field_derivation; }
virtual void set_derivation(enum Derivation derivation_arg)
{ field_derivation= derivation_arg; }
bool binary() const { return field_charset == &my_charset_bin; } bool binary() const { return field_charset == &my_charset_bin; }
uint32 max_length() { return field_length; } uint32 max_length() { return field_length; }
friend class create_field; friend class create_field;
......
...@@ -3436,7 +3436,6 @@ pthread_handler_t ndb_binlog_thread_func(void *arg) ...@@ -3436,7 +3436,6 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
global_system_variables.binlog_format == BINLOG_FORMAT_MIXED) global_system_variables.binlog_format == BINLOG_FORMAT_MIXED)
{ {
ndb_binlog_running= TRUE; ndb_binlog_running= TRUE;
thd->current_stmt_binlog_row_based= TRUE; // If in mixed mode
} }
else else
{ {
......
...@@ -3460,38 +3460,15 @@ bool ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat) ...@@ -3460,38 +3460,15 @@ bool ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat)
declared static, but it works by putting it into an anonymous declared static, but it works by putting it into an anonymous
namespace. */ namespace. */
namespace { namespace {
struct st_table_data {
char const *db;
char const *name;
};
static int table_name_compare(void const *a, void const *b)
{
st_table_data const *x = (st_table_data const*) a;
st_table_data const *y = (st_table_data const*) b;
/* Doing lexical compare in order (db,name) */
int const res= strcmp(x->db, y->db);
return res != 0 ? res : strcmp(x->name, y->name);
}
bool check_table_binlog_row_based(THD *thd, TABLE *table) bool check_table_binlog_row_based(THD *thd, TABLE *table)
{ {
static st_table_data const ignore[] = {
{ "mysql", "event" },
{ "mysql", "general_log" },
{ "mysql", "slow_log" }
};
my_size_t const ignore_size = sizeof(ignore)/sizeof(*ignore);
st_table_data const item = { table->s->db.str, table->s->table_name.str };
if (table->s->cached_row_logging_check == -1) if (table->s->cached_row_logging_check == -1)
table->s->cached_row_logging_check= {
(table->s->tmp_table == NO_TMP_TABLE) && int const check(table->s->tmp_table == NO_TMP_TABLE &&
binlog_filter->db_ok(table->s->db.str) && binlog_filter->db_ok(table->s->db.str) &&
bsearch(&item, ignore, ignore_size, strcmp("mysql", table->s->db.str) != 0);
sizeof(st_table_data), table_name_compare) == NULL; table->s->cached_row_logging_check= check;
}
DBUG_ASSERT(table->s->cached_row_logging_check == 0 || DBUG_ASSERT(table->s->cached_row_logging_check == 0 ||
table->s->cached_row_logging_check == 1); table->s->cached_row_logging_check == 1);
......
...@@ -1655,7 +1655,7 @@ void Item_field::set_field(Field *field_par) ...@@ -1655,7 +1655,7 @@ void Item_field::set_field(Field *field_par)
db_name= field_par->table->s->db.str; db_name= field_par->table->s->db.str;
alias_name_used= field_par->table->alias_name_used; alias_name_used= field_par->table->alias_name_used;
unsigned_flag=test(field_par->flags & UNSIGNED_FLAG); unsigned_flag=test(field_par->flags & UNSIGNED_FLAG);
collation.set(field_par->charset(), DERIVATION_IMPLICIT); collation.set(field_par->charset(), field_par->derivation());
fixed= 1; fixed= 1;
} }
......
...@@ -27,19 +27,7 @@ class Item_field; ...@@ -27,19 +27,7 @@ class Item_field;
/* /*
"Declared Type Collation" "Declared Type Collation"
A combination of collation and its derivation. A combination of collation and its derivation.
*/
enum Derivation
{
DERIVATION_IGNORABLE= 5,
DERIVATION_COERCIBLE= 4,
DERIVATION_SYSCONST= 3,
DERIVATION_IMPLICIT= 2,
DERIVATION_NONE= 1,
DERIVATION_EXPLICIT= 0
};
/*
Flags for collation aggregation modes: Flags for collation aggregation modes:
MY_COLL_ALLOW_SUPERSET_CONV - allow conversion to a superset MY_COLL_ALLOW_SUPERSET_CONV - allow conversion to a superset
MY_COLL_ALLOW_COERCIBLE_CONV - allow conversion of a coercible value MY_COLL_ALLOW_COERCIBLE_CONV - allow conversion of a coercible value
......
...@@ -3019,6 +3019,7 @@ int dump_leaf_key(byte* key, element_count count __attribute__((unused)), ...@@ -3019,6 +3019,7 @@ int dump_leaf_key(byte* key, element_count count __attribute__((unused)),
String tmp2; String tmp2;
String *result= &item->result; String *result= &item->result;
Item **arg= item->args, **arg_end= item->args + item->arg_count_field; Item **arg= item->args, **arg_end= item->args + item->arg_count_field;
uint old_length= result->length();
if (item->no_appended) if (item->no_appended)
item->no_appended= FALSE; item->no_appended= FALSE;
...@@ -3053,8 +3054,22 @@ int dump_leaf_key(byte* key, element_count count __attribute__((unused)), ...@@ -3053,8 +3054,22 @@ int dump_leaf_key(byte* key, element_count count __attribute__((unused)),
/* stop if length of result more than max_length */ /* stop if length of result more than max_length */
if (result->length() > item->max_length) if (result->length() > item->max_length)
{ {
int well_formed_error;
CHARSET_INFO *cs= item->collation.collation;
const char *ptr= result->ptr();
uint add_length;
/*
It's ok to use item->result.length() as the fourth argument
as this is never used to limit the length of the data.
Cut is done with the third argument.
*/
add_length= cs->cset->well_formed_len(cs,
ptr + old_length,
ptr + item->max_length,
result->length(),
&well_formed_error);
result->length(old_length + add_length);
item->count_cut_values++; item->count_cut_values++;
result->length(item->max_length);
item->warning_for_row= TRUE; item->warning_for_row= TRUE;
return 1; return 1;
} }
...@@ -3244,8 +3259,7 @@ bool Item_func_group_concat::add() ...@@ -3244,8 +3259,7 @@ bool Item_func_group_concat::add()
we can dump the row here in case of GROUP_CONCAT(DISTINCT...) we can dump the row here in case of GROUP_CONCAT(DISTINCT...)
instead of doing tree traverse later. instead of doing tree traverse later.
*/ */
if (result.length() <= max_length && if (!warning_for_row &&
!warning_for_row &&
(!tree || (el->count == 1 && distinct && !arg_count_order))) (!tree || (el->count == 1 && distinct && !arg_count_order)))
dump_leaf_key(table->record[0] + table->s->null_bytes, 1, this); dump_leaf_key(table->record[0] + table->s->null_bytes, 1, this);
...@@ -3314,7 +3328,8 @@ bool Item_func_group_concat::setup(THD *thd) ...@@ -3314,7 +3328,8 @@ bool Item_func_group_concat::setup(THD *thd)
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
/* We'll convert all blobs to varchar fields in the temporary table */ /* We'll convert all blobs to varchar fields in the temporary table */
tmp_table_param->convert_blob_length= max_length; tmp_table_param->convert_blob_length= max_length *
collation.collation->mbmaxlen;
/* Push all not constant fields to the list and create a temp table */ /* Push all not constant fields to the list and create a temp table */
always_null= 0; always_null= 0;
for (uint i= 0; i < arg_count_field; i++) for (uint i= 0; i < arg_count_field; i++)
......
...@@ -532,7 +532,7 @@ public: ...@@ -532,7 +532,7 @@ public:
longlong val_int() longlong val_int()
{ {
Item_func *comp= (Item_func*)args[1]; Item_func *comp= (Item_func*)args[1];
Item_string *fake= (Item_string*)(comp->arguments()[1]); Item_string *fake= (Item_string*)(comp->arguments()[0]);
String *res= args[0]->val_nodeset(&tmp_nodeset); String *res= args[0]->val_nodeset(&tmp_nodeset);
MY_XPATH_FLT *fltbeg= (MY_XPATH_FLT*) res->ptr(); MY_XPATH_FLT *fltbeg= (MY_XPATH_FLT*) res->ptr();
MY_XPATH_FLT *fltend= (MY_XPATH_FLT*) (res->ptr() + res->length()); MY_XPATH_FLT *fltend= (MY_XPATH_FLT*) (res->ptr() + res->length());
...@@ -884,7 +884,7 @@ static Item *eq_func(int oper, Item *a, Item *b) ...@@ -884,7 +884,7 @@ static Item *eq_func(int oper, Item *a, Item *b)
Create a comparator function for scalar arguments, Create a comparator function for scalar arguments,
for the given arguments and reverse operation, e.g. for the given arguments and reverse operation, e.g.
A >= B is converted into A < B A > B is converted into B < A
RETURN RETURN
The newly created item. The newly created item.
...@@ -895,10 +895,10 @@ static Item *eq_func_reverse(int oper, Item *a, Item *b) ...@@ -895,10 +895,10 @@ static Item *eq_func_reverse(int oper, Item *a, Item *b)
{ {
case '=': return new Item_func_eq(a, b); case '=': return new Item_func_eq(a, b);
case '!': return new Item_func_ne(a, b); case '!': return new Item_func_ne(a, b);
case MY_XPATH_LEX_GE: return new Item_func_lt(a, b); case MY_XPATH_LEX_GE: return new Item_func_le(a, b);
case MY_XPATH_LEX_LE: return new Item_func_gt(a, b); case MY_XPATH_LEX_LE: return new Item_func_ge(a, b);
case MY_XPATH_LEX_GREATER: return new Item_func_le(a, b); case MY_XPATH_LEX_GREATER: return new Item_func_lt(a, b);
case MY_XPATH_LEX_LESS: return new Item_func_ge(a, b); case MY_XPATH_LEX_LESS: return new Item_func_gt(a, b);
} }
return 0; return 0;
} }
...@@ -951,13 +951,13 @@ static Item *create_comparator(MY_XPATH *xpath, ...@@ -951,13 +951,13 @@ static Item *create_comparator(MY_XPATH *xpath,
{ {
nodeset= (Item_nodeset_func*) a; nodeset= (Item_nodeset_func*) a;
scalar= b; scalar= b;
comp= eq_func(oper, scalar, fake); comp= eq_func(oper, fake, scalar);
} }
else else
{ {
nodeset= (Item_nodeset_func*) b; nodeset= (Item_nodeset_func*) b;
scalar= a; scalar= a;
comp= eq_func_reverse(oper, scalar, fake); comp= eq_func_reverse(oper, fake, scalar);
} }
return new Item_nodeset_to_const_comparator(nodeset, comp, xpath->pxml); return new Item_nodeset_to_const_comparator(nodeset, comp, xpath->pxml);
} }
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment