Commit 098571df authored by baker@bk-internal.mysql.com's avatar baker@bk-internal.mysql.com

Merge bk-internal.mysql.com:/data0/bk/mysql-5.1

into  bk-internal.mysql.com:/data0/bk/mysql-5.1-arch
parents 39458a6e 55b66644
......@@ -15,5 +15,7 @@
45214442pBGT9KuZEGixBH71jTzbOA
45214a07hVsIGwvwa-WrO-jpeaSwVw
452a92d0-31-8wSzSfZi165fcGcXPA
452c6c6dAjuNghfc1ObZ_UQ5SCl85g
4538a7b0EbDHHkWPbIwxO6ZIDdg6Dg
454a7ef8gdvE_ddMlJyghvOAkKPNOQ
454f8960jsVT_kMKJtZ9OCgXoba0xQ
......@@ -35,9 +35,17 @@ fi
CHANGESET=`bk -R prs -r+ -h -d':P:::I:' 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" = "" ]
then
TO=dev-public@mysql.com
......
......@@ -1360,6 +1360,21 @@ static int dump_local_log_entries(const char* logname)
}
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,
0, MYF(MY_WME | MY_NABP | MY_DONT_CHECK_FILESIZE)))
return 1;
......
......@@ -15,7 +15,6 @@ DOT_FRM_VERSION=6
# See the libtool docs for information on how to do shared lib versions.
SHARED_LIB_MAJOR_VERSION=15
SHARED_LIB_VERSION=$SHARED_LIB_MAJOR_VERSION:0:0
# Set all version vars based on $VERSION. How do we do this more elegant ?
# Remember that regexps needs to quote [ and ] since this is run through m4
MYSQL_NO_DASH_VERSION=`echo $VERSION | sed -e "s|[[a-z]]*-.*$||"`
......
......@@ -190,8 +190,8 @@ typedef struct my_charset_handler_st
const unsigned char *s, const unsigned char *e);
/* Functions for case and sort conversion */
void (*caseup_str)(struct charset_info_st *, char *);
void (*casedn_str)(struct charset_info_st *, char *);
uint (*caseup_str)(struct charset_info_st *, char *);
uint (*casedn_str)(struct charset_info_st *, char *);
uint (*caseup)(struct charset_info_st *, char *src, uint srclen,
char *dst, uint dstlen);
uint (*casedn)(struct charset_info_st *, char *src, uint srclen,
......@@ -324,8 +324,8 @@ extern uint my_instr_simple(struct charset_info_st *,
/* Functions for 8bit */
extern void my_caseup_str_8bit(CHARSET_INFO *, char *);
extern void my_casedn_str_8bit(CHARSET_INFO *, char *);
extern uint my_caseup_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,
char *dst, uint dstlen);
extern uint my_casedn_8bit(CHARSET_INFO *, char *src, uint srclen,
......@@ -415,8 +415,8 @@ int my_mbcharlen_8bit(CHARSET_INFO *, uint c);
/* Functions for multibyte charsets */
extern void my_caseup_str_mb(CHARSET_INFO *, char *);
extern void my_casedn_str_mb(CHARSET_INFO *, char *);
extern uint my_caseup_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,
char *dst, uint dstlen);
extern uint my_casedn_mb(CHARSET_INFO *, char *src, uint srclen,
......
......@@ -59,4 +59,17 @@ insert into t1 values(null);
select * from 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
......@@ -15,7 +15,8 @@
connection master;
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 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;
show variables like 'slave_transaction_retries';
sync_slave_with_master;
......@@ -30,7 +31,9 @@ stop slave;
connection master;
begin;
# 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;
while ($1)
{
......@@ -38,16 +41,14 @@ while ($1)
dec $1;
}
enable_query_log;
insert into t3 select * from t2 for update;
insert into t1 values(1);
commit;
save_master_pos;
connection slave;
begin;
# Let's make our transaction large so that it's slave who is chosen as
# victim
let $1=1000;
# Let's make our transaction large so that it's repl-ed msta that's victim
let $1=100;
disable_query_log;
while ($1)
{
......@@ -55,14 +56,21 @@ while ($1)
dec $1;
}
enable_query_log;
select * from t1 for update;
select * from t1 for update; # t1,t2 on local slave's
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
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;
sync_with_master;
select * from t1; # check that slave succeeded finally
select * from t2;
select * from t1; # check that repl-ed succeeded finally
select * from t2 /* must be 1 */;
# check that no error is reported
--replace_column 1 # 7 # 8 # 9 # 16 # 22 # 23 # 33 #
--replace_result $MASTER_MYPORT MASTER_MYPORT
......@@ -73,14 +81,16 @@ show slave status;
# 2) Test lock wait timeout
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;
select * from t2 for update; # hold lock
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;
sync_with_master;
select * from t1; # check that slave succeeded finally
select * from t1; # check that repl-ed succeeded finally
select * from t2;
# check that no error is reported
--replace_column 1 # 7 # 8 # 9 # 11 # 16 # 22 # 23 # 33 #
......@@ -96,11 +106,13 @@ set global max_relay_log_size=0;
# This is really copy-paste of 2) of above
stop slave;
change master to master_log_pos=536;
delete from t3;
change master to master_log_pos=544;
begin;
select * from t2 for update;
start slave;
--real_sleep 10
select count(*) from t3 /* must be zero */; # replaying begins after rollback
commit;
sync_with_master;
select * from t1;
......@@ -115,4 +127,4 @@ connection master;
drop table t1,t2,t3,t4;
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 @@
# Test for strict-mode autoincrement
#
--disable_warnings
drop table if exists t1;
--enable_warnings
set @org_mode=@@sql_mode;
eval create table t1
(
......
......@@ -1499,7 +1499,7 @@ sub executable_setup () {
$exe_mysql_client_test=
mtr_exe_maybe_exists(vs_config_dirs('tests', 'mysql_client_test'),
"$glob_basedir/tests/mysql_client_test",
"$glob_basedir/bin");
"$glob_basedir/bin/mysql_client_test");
}
}
......
......@@ -245,6 +245,24 @@ select * from t1;
id
127
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;
set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
insert delayed into t1 values (207);
......@@ -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 # 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
)
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 # Table_map 1 # table_id: # (test.t1)
master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F
......
......@@ -155,6 +155,21 @@ select * from t1;
id
127
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;
set @@session.auto_increment_increment=1, @@session.auto_increment_offset=1;
insert delayed into t1 values (207);
......@@ -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 # 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
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 # Table_map 1 # table_id: # (test.t1)
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);
insert into t1 values ('test','test');
insert into t1 values ('','');
Warnings:
Warning 1265 Data truncated 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 'a' at row 1
Warning 1366 Incorrect string value: '\xCA\xC3\xD5\xCB' for column 'b' at row 1
drop table t1;
set names koi8r;
create table t1 (a char(10) character set cp1251);
......
......@@ -723,6 +723,28 @@ lily
river
drop table t1;
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);
INSERT INTO t1 VALUES (1, 'ZZZZZ'), (1, 'ZZZ'), (2, 'ZZZ'), (2, 'ZZZZZ');
SELECT id, MIN(s) FROM t1 GROUP BY id;
......
......@@ -197,7 +197,7 @@ drop table t1;
create table t1 (s1 char(10) character set utf8);
insert into t1 values (0x41FF);
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;
hex(s1)
41
......@@ -205,7 +205,7 @@ drop table t1;
create table t1 (s1 varchar(10) character set utf8);
insert into t1 values (0x41FF);
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;
hex(s1)
41
......@@ -213,7 +213,7 @@ drop table t1;
create table t1 (s1 text character set utf8);
insert into t1 values (0x41FF);
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;
hex(s1)
41
......@@ -1536,6 +1536,32 @@ set @a:=null;
execute my_stmt using @a;
a b
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 (
colA int(11) NOT NULL,
colB varchar(255) character set utf8 NOT NULL,
......
......@@ -381,10 +381,10 @@ t collation(t) FORMAT(MATCH t AGAINST ('Osnabruck'),6)
aus Osnabrck utf8_general_ci 1.591140
alter table t1 modify t varchar(200) collate latin1_german2_ci not null;
Warnings:
Warning 1265 Data truncated for column 't' at row 3
Warning 1265 Data truncated for column 't' at row 4
Warning 1265 Data truncated for column 't' at row 5
Warning 1265 Data truncated for column 't' at row 6
Warning 1366 Incorrect string value: '\xD0\xAD\xD1\x82\xD0\xBE...' for column 't' at row 3
Warning 1366 Incorrect string value: '\xD0\x9E\xD1\x82\xD0\xBB...' for column 't' at row 4
Warning 1366 Incorrect string value: '\xD0\x9D\xD0\xB5 \xD0...' for column 't' at row 5
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');
t collation(t)
aus Osnabrck latin1_german2_ci
......
......@@ -664,3 +664,73 @@ GROUP_CONCAT(a) x
2 1,2
1 2,3
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;
drop table t1, t2;
show tables;
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
......@@ -2090,14 +2090,6 @@ v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
deallocate prepare abc;
drop view v1;
drop table t1;
create procedure proc_1() install plugin my_plug soname '/root/some_plugin.so';
call proc_1();
ERROR HY000: No paths allowed for shared library
call proc_1();
ERROR HY000: No paths allowed for shared library
call proc_1();
ERROR HY000: No paths allowed for shared library
drop procedure proc_1;
create procedure proc_1() install plugin my_plug soname 'some_plugin.so';
call proc_1();
ERROR HY000: Can't open shared library
......@@ -2112,12 +2104,6 @@ select func_1(), func_1(), func_1() from dual;
ERROR 42000: FUNCTION test.func_1 does not exist
drop function func_1;
ERROR 42000: FUNCTION test.func_1 does not exist
prepare abc from "install plugin my_plug soname '/root/some_plugin.so'";
execute abc;
ERROR HY000: No paths allowed for shared library
execute abc;
ERROR HY000: No paths allowed for shared library
deallocate prepare abc;
prepare abc from "install plugin my_plug soname 'some_plugin.so'";
deallocate prepare abc;
create procedure proc_1() uninstall plugin my_plug;
......
create procedure proc_1() install plugin my_plug soname '/root/some_plugin.so';
call proc_1();
ERROR HY000: No paths allowed for shared library
call proc_1();
ERROR HY000: No paths allowed for shared library
call proc_1();
ERROR HY000: No paths allowed for shared library
drop procedure proc_1;
prepare abc from "install plugin my_plug soname '/root/some_plugin.so'";
execute abc;
ERROR HY000: No paths allowed for shared library
execute abc;
ERROR HY000: No paths allowed for shared library
deallocate prepare abc;
......@@ -6,7 +6,7 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
CREATE TABLE t1 (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;
show variables like 'slave_transaction_retries';
Variable_name Value
......@@ -28,21 +28,22 @@ Variable_name Value
slave_transaction_retries 2
stop slave;
begin;
insert into t3 select * from t2 for update;
insert into t2 values (0);
insert into t1 values(1);
commit;
begin;
select * from t1 for update;
a
start slave;
insert into t2 values(22);
select * from t2 for update /* dl */;
a
commit;
select * from t1;
a
1
select * from t2;
select * from t2 /* must be 1 */;
a
22
0
show slave status;
Slave_IO_State #
Master_Host 127.0.0.1
......@@ -78,12 +79,16 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
stop slave;
change master to master_log_pos=536;
delete from t3;
change master to master_log_pos=544;
begin;
select * from t2 for update;
a
22
0
start slave;
select count(*) from t3 /* must be zero */;
count(*)
0
commit;
select * from t1;
a
......@@ -91,7 +96,8 @@ a
1
select * from t2;
a
22
0
0
show slave status;
Slave_IO_State #
Master_Host 127.0.0.1
......@@ -128,12 +134,17 @@ Master_SSL_Key
Seconds_Behind_Master #
set global max_relay_log_size=0;
stop slave;
change master to master_log_pos=536;
delete from t3;
change master to master_log_pos=544;
begin;
select * from t2 for update;
a
22
0
0
start slave;
select count(*) from t3 /* must be zero */;
count(*)
0
commit;
select * from t1;
a
......@@ -142,7 +153,9 @@ a
1
select * from t2;
a
22
0
0
0
show slave status;
Slave_IO_State #
Master_Host 127.0.0.1
......@@ -178,3 +191,4 @@ Master_SSL_Cipher
Master_SSL_Key
Seconds_Behind_Master #
drop table t1,t2,t3,t4;
End of 5.1 tests
......@@ -23,6 +23,8 @@ password<>_binary''
delete from mysql.user where user=_binary'rpl_do_grant';
delete from mysql.db where user=_binary'rpl_do_grant';
flush privileges;
delete from mysql.user where user=_binary'rpl_do_grant';
delete from mysql.db where user=_binary'rpl_do_grant';
flush privileges;
show grants for rpl_do_grant@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;
a
DROP TABLE t1;
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(*)
**** Must make sure slave is clean *****
STOP SLAVE;
RESET SLAVE;
DROP PROCEDURE tpcb.load;
DROP PROCEDURE tpcb.trans;
DROP TABLE tpcb.account;
DROP TABLE tpcb.teller;
DROP TABLE tpcb.branch;
DROP TABLE tpcb.history;
DROP PROCEDURE IF EXISTS tpcb.load;
DROP PROCEDURE IF EXISTS tpcb.trans;
DROP TABLE IF EXISTS tpcb.account;
DROP TABLE IF EXISTS tpcb.teller;
DROP TABLE IF EXISTS tpcb.branch;
DROP TABLE IF EXISTS tpcb.history;
DROP DATABASE tpcb;
ALTER TABLESPACE ts1
DROP DATAFILE 'datafile.dat'
......@@ -392,8 +392,8 @@ COUNT(*)
4050
*** DUMP MASTER & SLAVE FOR COMPARE ********
*************** TEST 2 CLEANUP SECTION ********************
DROP PROCEDURE tpcb.load;
DROP PROCEDURE tpcb.trans;
DROP PROCEDURE IF EXISTS tpcb.load;
DROP PROCEDURE IF EXISTS tpcb.trans;
DROP TABLE tpcb.account;
DROP TABLE tpcb.teller;
DROP TABLE tpcb.branch;
......
......@@ -359,8 +359,6 @@ MAX(f1)
-------- switch to master -------
ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
SELECT MAX(f1) FROM t1;
MAX(f1)
5
......@@ -370,9 +368,9 @@ TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
6
5
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
-------- switch to master -------
flush logs;
......@@ -401,7 +399,7 @@ MAX(f1)
-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
6
5
-------- switch to master -------
RENAME TABLE mysqltest1.t3 to mysqltest1.t20;
......@@ -506,7 +504,7 @@ f2 bigint(20) YES NULL
-------- switch to master -------
######## CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "InnoDB" ########
######## CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "NDB" ########
-------- switch to master -------
INSERT INTO t1 SET f1= 7 + 1;
......@@ -520,7 +518,7 @@ MAX(f1)
7
-------- switch to master -------
CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "InnoDB";
CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= "NDB";
SELECT MAX(f1) FROM t1;
MAX(f1)
8
......@@ -579,8 +577,6 @@ MAX(f1)
-------- switch to master -------
ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
SELECT MAX(f1) FROM t1;
MAX(f1)
8
......@@ -590,9 +586,9 @@ TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
9
8
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
-------- switch to master -------
flush logs;
......@@ -613,7 +609,7 @@ MAX(f1)
-------- switch to slave --------
SELECT MAX(f1) FROM t1;
MAX(f1)
9
8
-------- switch to master -------
TRUNCATE TABLE mysqltest1.t7;
......@@ -650,11 +646,9 @@ flush logs;
-------- switch to master -------
SELECT * FROM mysqltest1.t7;
f1
-------- switch to slave --------
SELECT * FROM mysqltest1.t7;
f1
-------- switch to master -------
######## LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ ########
......@@ -957,7 +951,7 @@ t5 1 my_idx5 1 f1 A 0 NULL NULL YES BTREE
-------- switch to slave --------
SHOW INDEX FROM mysqltest1.t5;
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 -------
......@@ -1691,3 +1685,4 @@ user
DROP DATABASE IF EXISTS mysqltest1;
DROP DATABASE IF EXISTS mysqltest2;
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;
create table t1
(
......
drop table if exists t1;
set @org_mode=@@sql_mode;
create table t1
(
......
drop table if exists t1;
set @org_mode=@@sql_mode;
create table t1
(
......
drop table if exists t1;
set @org_mode=@@sql_mode;
create table t1
(
......
drop table if exists t1;
set @org_mode=@@sql_mode;
create table t1
(
......
......@@ -3015,3 +3015,22 @@ i j
DROP VIEW v1, v2;
DROP TABLE t1;
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;
......@@ -6,3 +6,17 @@ use prn;
ERROR 42000: Unknown database 'prn'
create table nu (a int);
drop table nu;
create procedure proc_1() install plugin my_plug soname '\\root\\some_plugin.dll';
call proc_1();
ERROR HY000: No paths allowed for shared library
call proc_1();
ERROR HY000: No paths allowed for shared library
call proc_1();
ERROR HY000: No paths allowed for shared library
drop procedure proc_1;
prepare abc from "install plugin my_plug soname '\\\\root\\\\some_plugin.dll'";
execute abc;
ERROR HY000: No paths allowed for shared library
execute abc;
ERROR HY000: No paths allowed for shared library
deallocate prepare abc;
......@@ -736,3 +736,76 @@ test
select extractValue('<x.-_:>test</x.-_:>','//*');
extractValue('<x.-_:>test</x.-_:>','//*')
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 '%%';
drop table t1;
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
# over a 'ucs2' field uses a temporary table
......
......@@ -1229,6 +1229,30 @@ set @a:=null;
execute my_stmt using @a;
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
# InnoDB tables using partial UTF8 indexes
......
......@@ -461,3 +461,38 @@ SELECT GROUP_CONCAT(a), x
GROUP BY x;
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;
show tables;
# 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
......@@ -2092,14 +2092,6 @@ drop view v1;
drop table t1;
create procedure proc_1() install plugin my_plug soname '/root/some_plugin.so';
--error ER_UDF_NO_PATHS
call proc_1();
--error ER_UDF_NO_PATHS
call proc_1();
--error ER_UDF_NO_PATHS
call proc_1();
drop procedure proc_1;
create procedure proc_1() install plugin my_plug soname 'some_plugin.so';
--replace_regex /(Can\'t open shared library).*$/\1/
--error ER_CANT_OPEN_LIBRARY
......@@ -2119,12 +2111,6 @@ delimiter ;|
select func_1(), func_1(), func_1() from dual;
--error ER_SP_DOES_NOT_EXIST
drop function func_1;
prepare abc from "install plugin my_plug soname '/root/some_plugin.so'";
--error ER_UDF_NO_PATHS
execute abc;
--error ER_UDF_NO_PATHS
execute abc;
deallocate prepare abc;
prepare abc from "install plugin my_plug soname 'some_plugin.so'";
deallocate prepare abc;
......
# Non-windows specific ps tests.
--source include/not_windows.inc
#
# Bug #20665: All commands supported in Stored Procedures should work in
# Prepared Statements
#
create procedure proc_1() install plugin my_plug soname '/root/some_plugin.so';
--error ER_UDF_NO_PATHS
call proc_1();
--error ER_UDF_NO_PATHS
call proc_1();
--error ER_UDF_NO_PATHS
call proc_1();
drop procedure proc_1;
prepare abc from "install plugin my_plug soname '/root/some_plugin.so'";
--error ER_UDF_NO_PATHS
execute abc;
--error ER_UDF_NO_PATHS
execute abc;
deallocate prepare abc;
......@@ -39,11 +39,11 @@ connection master;
delete from mysql.user where user=_binary'rpl_do_grant';
delete from mysql.db where user=_binary'rpl_do_grant';
flush privileges;
save_master_pos;
connection slave;
sync_with_master;
# no need to delete manually, as the DELETEs must have done some real job on
# master (updated binlog)
sync_slave_with_master;
# The mysql database is not replicated, so we have to do the deletes
# manually on the slave as well.
delete from mysql.user where user=_binary'rpl_do_grant';
delete from mysql.db where user=_binary'rpl_do_grant';
flush privileges;
# 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;
DROP TABLE t1;
DROP TABLE t4;
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)
--connection slave
STOP SLAVE;
RESET SLAVE;
DROP PROCEDURE tpcb.load;
DROP PROCEDURE tpcb.trans;
DROP TABLE tpcb.account;
DROP TABLE tpcb.teller;
DROP TABLE tpcb.branch;
DROP TABLE tpcb.history;
DROP PROCEDURE IF EXISTS tpcb.load;
DROP PROCEDURE IF EXISTS tpcb.trans;
DROP TABLE IF EXISTS tpcb.account;
DROP TABLE IF EXISTS tpcb.teller;
DROP TABLE IF EXISTS tpcb.branch;
DROP TABLE IF EXISTS tpcb.history;
DROP DATABASE tpcb;
ALTER TABLESPACE ts1
......@@ -534,8 +534,8 @@ SELECT COUNT(*) FROM history;
--echo *************** TEST 2 CLEANUP SECTION ********************
connection master;
DROP PROCEDURE tpcb.load;
DROP PROCEDURE tpcb.trans;
DROP PROCEDURE IF EXISTS tpcb.load;
DROP PROCEDURE IF EXISTS tpcb.trans;
DROP TABLE tpcb.account;
DROP TABLE tpcb.teller;
DROP TABLE tpcb.branch;
......
......@@ -31,4 +31,5 @@
--source include/have_ndb.inc
--source include/master-slave.inc
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;
--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;
......@@ -18,3 +18,25 @@ create table nu (a int);
drop table nu;
# End of 4.1 tests
#
# Bug #20665: All commands supported in Stored Procedures should work in
# Prepared Statements
#
create procedure proc_1() install plugin my_plug soname '\\root\\some_plugin.dll';
--error ER_UDF_NO_PATHS
call proc_1();
--error ER_UDF_NO_PATHS
call proc_1();
--error ER_UDF_NO_PATHS
call proc_1();
drop procedure proc_1;
prepare abc from "install plugin my_plug soname '\\\\root\\\\some_plugin.dll'";
--error ER_UDF_NO_PATHS
execute abc;
--error ER_UDF_NO_PATHS
execute abc;
deallocate prepare abc;
......@@ -376,3 +376,33 @@ select extractValue('<:>test</:>','//*');
select extractValue('<_>test</_>','//*');
# dot, dash, underscore and semicolon are good identifier middle characters
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
event_queue.cc event_db_repository.cc
sql_tablespace.cc events.cc ../sql-common/my_user.c
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.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 \
ha_ndbcluster.h ha_ndbcluster_binlog.h \
ha_ndbcluster_tables.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 \
lex.h lex_symbol.h sql_acl.h sql_crypt.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 \
sql_load.cc mf_iocache.cc field_conv.cc sql_show.cc \
sql_udf.cc sql_analyse.cc sql_analyse.h sql_cache.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 \
client.c sql_client.cc mini_client_errors.c pack.c\
stacktrace.c repl_failsafe.h repl_failsafe.cc \
......
This diff is collapsed.
......@@ -351,6 +351,9 @@ public:
virtual CHARSET_INFO *sort_charset(void) const { return charset(); }
virtual bool has_charset(void) const { return FALSE; }
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,
int cuted_increment);
bool check_int(const char *str, int length, const char *int_end,
......@@ -446,6 +449,7 @@ public:
class Field_str :public Field {
protected:
CHARSET_INFO *field_charset;
enum Derivation field_derivation;
public:
Field_str(char *ptr_arg,uint32 len_arg, uchar *null_ptr_arg,
uchar null_bit_arg, utype unireg_check_arg,
......@@ -459,6 +463,9 @@ public:
uint size_of() const { return sizeof(*this); }
CHARSET_INFO *charset(void) const { return field_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; }
uint32 max_length() { return field_length; }
friend class create_field;
......
......@@ -3436,7 +3436,6 @@ pthread_handler_t ndb_binlog_thread_func(void *arg)
global_system_variables.binlog_format == BINLOG_FORMAT_MIXED)
{
ndb_binlog_running= TRUE;
thd->current_stmt_binlog_row_based= TRUE; // If in mixed mode
}
else
{
......
This diff is collapsed.
......@@ -1655,7 +1655,7 @@ void Item_field::set_field(Field *field_par)
db_name= field_par->table->s->db.str;
alias_name_used= field_par->table->alias_name_used;
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;
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -424,6 +424,18 @@ bool Log_to_csv_event_handler::
{
TABLE *table= general_log.table;
/*
"INSERT INTO general_log" can generate warning sometimes.
Let's reset warnings from previous queries,
otherwise warning list can grow too much,
so thd->query gets spoiled as some point in time,
and mysql_parse() receives a broken query.
QQ: this problem needs to be studied in more details.
Probably it's better to suppress warnings in logging INSERTs at all.
Comment this line and run "cast.test" to see what's happening:
*/
mysql_reset_errors(table->in_use, 1);
/* below should never happen */
if (unlikely(!logger.is_log_tables_initialized))
return FALSE;
......
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