Commit 3763edd3 authored by unknown's avatar unknown

Merge mysql.com:/users/lthalmann/bkroot/mysql-5.1-new-rpl

into  mysql.com:/users/lthalmann/bk/MERGE/mysql-5.1-merge


BitKeeper/etc/collapsed:
  auto-union
include/m_ctype.h:
  Auto merged
mysql-test/r/binlog_row_mix_innodb_myisam.result:
  Auto merged
mysql-test/r/ctype_utf8.result:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
mysql-test/t/view.test:
  Auto merged
sql/Makefile.am:
  Auto merged
sql/field.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
unittest/mytap/tap.c:
  Auto merged
sql/log_event.cc:
  manual merge
sql/sql_class.cc:
  manual merge
parents dd726470 4c3283b3
...@@ -15,3 +15,5 @@ ...@@ -15,3 +15,5 @@
45214442pBGT9KuZEGixBH71jTzbOA 45214442pBGT9KuZEGixBH71jTzbOA
45214a07hVsIGwvwa-WrO-jpeaSwVw 45214a07hVsIGwvwa-WrO-jpeaSwVw
452a92d0-31-8wSzSfZi165fcGcXPA 452a92d0-31-8wSzSfZi165fcGcXPA
452c6c6dAjuNghfc1ObZ_UQ5SCl85g
4538a7b0EbDHHkWPbIwxO6ZIDdg6Dg
...@@ -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;
...@@ -58,7 +59,7 @@ enable_query_log; ...@@ -58,7 +59,7 @@ enable_query_log;
select * from t1 for update; select * from t1 for update;
start slave; start slave;
--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 insert into t2 values(201); # provoke deadlock, slave should be victim
commit; commit;
sync_with_master; sync_with_master;
select * from t1; # check that slave succeeded finally select * from t1; # check that slave succeeded finally
...@@ -73,11 +74,13 @@ show slave status; ...@@ -73,11 +74,13 @@ 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 # slave 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 slave succeeded finally
...@@ -96,11 +99,13 @@ set global max_relay_log_size=0; ...@@ -96,11 +99,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 +120,4 @@ connection master; ...@@ -115,4 +120,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
......
...@@ -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
......
...@@ -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
...@@ -35,14 +35,14 @@ begin; ...@@ -35,14 +35,14 @@ begin;
select * from t1 for update; select * from t1 for update;
a a
start slave; start slave;
insert into t2 values(22); insert into t2 values(201);
commit; commit;
select * from t1; select * from t1;
a a
1 1
select * from t2; select * from t2;
a a
22 201
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 +78,16 @@ Master_SSL_Cipher ...@@ -78,12 +78,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 201
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 +95,7 @@ a ...@@ -91,7 +95,7 @@ a
1 1
select * from t2; select * from t2;
a a
22 201
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 +132,16 @@ Master_SSL_Key ...@@ -128,12 +132,16 @@ 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 201
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 +150,7 @@ a ...@@ -142,7 +150,7 @@ a
1 1
select * from t2; select * from t2;
a a
22 201
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 +186,4 @@ Master_SSL_Cipher ...@@ -178,3 +186,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;
...@@ -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.
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
......
...@@ -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
......
...@@ -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;
...@@ -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
...@@ -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.
...@@ -3468,38 +3468,15 @@ bool ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat) ...@@ -3468,38 +3468,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);
......
...@@ -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);
} }
......
...@@ -424,6 +424,18 @@ bool Log_to_csv_event_handler:: ...@@ -424,6 +424,18 @@ bool Log_to_csv_event_handler::
{ {
TABLE *table= general_log.table; 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 */ /* below should never happen */
if (unlikely(!logger.is_log_tables_initialized)) if (unlikely(!logger.is_log_tables_initialized))
return FALSE; return FALSE;
......
...@@ -5694,7 +5694,6 @@ int Rows_log_event::exec_event(st_relay_log_info *rli) ...@@ -5694,7 +5694,6 @@ int Rows_log_event::exec_event(st_relay_log_info *rli)
for (ptr= rli->tables_to_lock ; ptr ; ptr= ptr->next_global) for (ptr= rli->tables_to_lock ; ptr ; ptr= ptr->next_global)
{ {
rli->m_table_map.set_table(ptr->table_id, ptr->table); rli->m_table_map.set_table(ptr->table_id, ptr->table);
rli->touching_table(ptr->db, ptr->table_name, ptr->table_id);
} }
#ifdef HAVE_QUERY_CACHE #ifdef HAVE_QUERY_CACHE
query_cache.invalidate_locked_for_write(rli->tables_to_lock); query_cache.invalidate_locked_for_write(rli->tables_to_lock);
...@@ -6230,8 +6229,7 @@ int Table_map_log_event::exec_event(st_relay_log_info *rli) ...@@ -6230,8 +6229,7 @@ int Table_map_log_event::exec_event(st_relay_log_info *rli)
/* /*
We record in the slave's information that the table should be We record in the slave's information that the table should be
locked by linking the table into the list of tables to lock, and locked by linking the table into the list of tables to lock.
tell the RLI that we are touching a table.
*/ */
table_list->next_global= table_list->next_local= rli->tables_to_lock; table_list->next_global= table_list->next_local= rli->tables_to_lock;
rli->tables_to_lock= table_list; rli->tables_to_lock= table_list;
......
This diff is collapsed.
...@@ -962,7 +962,7 @@ bool load_master_data(THD* thd) ...@@ -962,7 +962,7 @@ bool load_master_data(THD* thd)
Cancel the previous START SLAVE UNTIL, as the fact to download Cancel the previous START SLAVE UNTIL, as the fact to download
a new copy logically makes UNTIL irrelevant. a new copy logically makes UNTIL irrelevant.
*/ */
clear_until_condition(&active_mi->rli); active_mi->rli.clear_until_condition();
/* /*
No need to update rli.event* coordinates, they will be when the slave No need to update rli.event* coordinates, they will be when the slave
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -2776,6 +2776,12 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype, ...@@ -2776,6 +2776,12 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype,
#endif /*HAVE_ROW_BASED_REPLICATION*/ #endif /*HAVE_ROW_BASED_REPLICATION*/
switch (qtype) { switch (qtype) {
case THD::ROW_QUERY_TYPE:
#ifdef HAVE_ROW_BASED_REPLICATION
if (current_stmt_binlog_row_based)
DBUG_RETURN(0);
#endif
/* Otherwise, we fall through */
case THD::MYSQL_QUERY_TYPE: case THD::MYSQL_QUERY_TYPE:
/* /*
Using this query type is a conveniece hack, since we have been Using this query type is a conveniece hack, since we have been
...@@ -2785,12 +2791,6 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype, ...@@ -2785,12 +2791,6 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype,
Make sure to change in check_table_binlog_row_based() according Make sure to change in check_table_binlog_row_based() according
to how you treat this. to how you treat this.
*/ */
case THD::ROW_QUERY_TYPE:
#ifdef HAVE_ROW_BASED_REPLICATION
if (current_stmt_binlog_row_based)
DBUG_RETURN(0);
#endif
/* Otherwise, we fall through */
case THD::STMT_QUERY_TYPE: case THD::STMT_QUERY_TYPE:
/* /*
The MYSQL_LOG::write() function will set the STMT_END_F flag and The MYSQL_LOG::write() function will set the STMT_END_F flag and
......
This diff is collapsed.
This diff is collapsed.
...@@ -1058,6 +1058,9 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet, ...@@ -1058,6 +1058,9 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
packet->append(STRING_WITH_LEN("CREATE TEMPORARY TABLE ")); packet->append(STRING_WITH_LEN("CREATE TEMPORARY TABLE "));
else else
packet->append(STRING_WITH_LEN("CREATE TABLE ")); packet->append(STRING_WITH_LEN("CREATE TABLE "));
if (create_info_arg &&
(create_info_arg->options & HA_LEX_CREATE_IF_NOT_EXISTS))
packet->append(STRING_WITH_LEN("IF NOT EXISTS "));
if (table_list->schema_table) if (table_list->schema_table)
alias= table_list->schema_table->table_name; alias= table_list->schema_table->table_name;
else else
......
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