68 changed files with 617 additions and 564 deletions
-
4Makefile.am
-
4client/mysql.cc
-
5client/mysql_upgrade.c
-
4cmake/abi_check.cmake
-
14configure.in
-
2extra/comp_err.c
-
24extra/yassl/src/yassl_imp.cpp
-
5include/my_pthread.h
-
2include/mysql.h
-
1include/mysql.h.pp
-
3include/mysql/plugin.h.pp
-
3include/mysql/service_my_snprintf.h
-
2include/mysql/service_thd_alloc.h
-
4include/mysys_err.h
-
3mysql-test/r/lowercase_table2.result
-
67mysql-test/suite/rpl/r/rpl_conditional_comments.result
-
8mysql-test/suite/rpl/r/rpl_packet.result
-
74mysql-test/suite/rpl/t/rpl_conditional_comments.test
-
39mysql-test/suite/rpl/t/rpl_packet.test
-
6mysys/errors.c
-
11mysys/mf_iocache.c
-
20mysys/my_copy.c
-
24mysys/my_redel.c
-
17regex/engine.c
-
2sql/field.cc
-
5sql/item.cc
-
73sql/log.cc
-
9sql/mysqld.cc
-
2sql/partition_info.cc
-
16sql/protocol.cc
-
7sql/slave.cc
-
3sql/spatial.cc
-
2sql/sql_acl.cc
-
14sql/sql_base.cc
-
3sql/sql_cache.cc
-
7sql/sql_cursor.cc
-
21sql/sql_lex.cc
-
24sql/sql_lex.h
-
15sql/sql_load.cc
-
18sql/sql_parse.cc
-
2sql/sql_parse.h
-
4sql/sql_partition.cc
-
2sql/sql_partition.h
-
7sql/sql_prepare.cc
-
12sql/sql_repl.cc
-
21sql/sql_show.cc
-
2sql/sql_table.cc
-
3sql/table.cc
-
2sql/table.h
-
2sql/udf_example.c
-
12storage/csv/ha_tina.cc
-
2storage/example/ha_example.cc
-
14storage/myisam/mi_locking.c
-
3storage/myisam/rt_split.c
-
5storage/myisammrg/myrg_open.c
-
86strings/ctype-big5.c
-
77strings/ctype-cp932.c
-
4strings/ctype-euc_kr.c
-
4strings/ctype-eucjpms.c
-
4strings/ctype-gb2312.c
-
86strings/ctype-gbk.c
-
22strings/ctype-mb.c
-
86strings/ctype-sjis.c
-
4strings/ctype-ujis.c
-
3strings/decimal.c
-
4unittest/Makefile.am
-
27unittest/strings/Makefile.am
-
114unittest/strings/strings-t.c
@ -0,0 +1,67 @@ |
|||
stop slave; |
|||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; |
|||
reset master; |
|||
reset slave; |
|||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; |
|||
start slave; |
|||
CREATE TABLE t1(c1 INT); |
|||
show binlog events from <binlog_start>; |
|||
Log_name Pos Event_type Server_id End_log_pos Info |
|||
master-bin.000001 # Query # # use `test`; CREATE TABLE t1(c1 INT) |
|||
|
|||
# Case 1: |
|||
# ------------------------------------------------------------------ |
|||
# In a statement, some CCs are applied while others are not. The CCs |
|||
# which are not applied on master will be binlogged as common comments. |
|||
/*!99999 --- */INSERT /*!INTO*/ /*!10000 t1 */ VALUES(10) /*!99999 ,(11)*/; |
|||
show binlog events from <binlog_start>; |
|||
Log_name Pos Event_type Server_id End_log_pos Info |
|||
master-bin.000001 # Query # # BEGIN |
|||
master-bin.000001 # Query # # use `test`; /* 99999 --- */INSERT /*!INTO*/ /*!10000 t1 */ VALUES(10) /* 99999 ,(11)*/ |
|||
master-bin.000001 # Query # # COMMIT |
|||
Comparing tables master:test.t1 and slave:test.t1 |
|||
|
|||
# Case 2: |
|||
# ----------------------------------------------------------------- |
|||
# Verify whether it can be binlogged correctly when executing prepared |
|||
# statement. |
|||
PREPARE stmt FROM 'INSERT INTO /*!99999 blabla*/ t1 VALUES(60) /*!99999 ,(61)*/'; |
|||
EXECUTE stmt; |
|||
DROP TABLE t1; |
|||
CREATE TABLE t1(c1 INT); |
|||
EXECUTE stmt; |
|||
Comparing tables master:test.t1 and slave:test.t1 |
|||
|
|||
SET @value=62; |
|||
PREPARE stmt FROM 'INSERT INTO /*!99999 blabla */ t1 VALUES(?) /*!99999 ,(63)*/'; |
|||
EXECUTE stmt USING @value; |
|||
DROP TABLE t1; |
|||
CREATE TABLE t1(c1 INT); |
|||
EXECUTE stmt USING @value; |
|||
show binlog events from <binlog_start>; |
|||
Log_name Pos Event_type Server_id End_log_pos Info |
|||
master-bin.000001 # Query # # BEGIN |
|||
master-bin.000001 # Query # # use `test`; INSERT INTO /* 99999 blabla*/ t1 VALUES(60) /* 99999 ,(61)*/ |
|||
master-bin.000001 # Query # # COMMIT |
|||
master-bin.000001 # Query # # use `test`; DROP TABLE t1 |
|||
master-bin.000001 # Query # # use `test`; CREATE TABLE t1(c1 INT) |
|||
master-bin.000001 # Query # # BEGIN |
|||
master-bin.000001 # Query # # use `test`; INSERT INTO /* 99999 blabla*/ t1 VALUES(60) /* 99999 ,(61)*/ |
|||
master-bin.000001 # Query # # COMMIT |
|||
master-bin.000001 # Query # # BEGIN |
|||
master-bin.000001 # Query # # use `test`; INSERT INTO /* 99999 blabla */ t1 VALUES(62) /* 99999 ,(63)*/ |
|||
master-bin.000001 # Query # # COMMIT |
|||
master-bin.000001 # Query # # use `test`; DROP TABLE t1 |
|||
master-bin.000001 # Query # # use `test`; CREATE TABLE t1(c1 INT) |
|||
master-bin.000001 # Query # # BEGIN |
|||
master-bin.000001 # Query # # use `test`; INSERT INTO /* 99999 blabla */ t1 VALUES(62) /* 99999 ,(63)*/ |
|||
master-bin.000001 # Query # # COMMIT |
|||
Comparing tables master:test.t1 and slave:test.t1 |
|||
|
|||
# Case 3: |
|||
# ----------------------------------------------------------------- |
|||
# Verify it can restore the '!', if the it is an uncomplete conditional |
|||
# comments |
|||
SELECT c1 FROM /*!99999 t1 WHEREN; |
|||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '/*!99999 t1 WHEREN' at line 1 |
|||
DROP TABLE t1; |
|||
@ -0,0 +1,74 @@ |
|||
############################################################################### |
|||
# After the patch for BUG#49124: |
|||
# - Use ' ' instead of '!' in the conditional comments which are not applied on |
|||
# master. So they become common comments and will not be applied on slave. |
|||
# |
|||
# - Example: |
|||
# 'INSERT INTO t1 VALUES (1) /*!10000, (2)*/ /*!99999 ,(3)*/ |
|||
# will be binlogged as |
|||
# 'INSERT INTO t1 VALUES (1) /*!10000, (2)*/ /* 99999 ,(3)*/'. |
|||
############################################################################### |
|||
source include/master-slave.inc; |
|||
source include/have_binlog_format_statement.inc; |
|||
|
|||
CREATE TABLE t1(c1 INT); |
|||
source include/show_binlog_events.inc; |
|||
let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); |
|||
|
|||
--echo |
|||
--echo # Case 1: |
|||
--echo # ------------------------------------------------------------------ |
|||
--echo # In a statement, some CCs are applied while others are not. The CCs |
|||
--echo # which are not applied on master will be binlogged as common comments. |
|||
|
|||
/*!99999 --- */INSERT /*!INTO*/ /*!10000 t1 */ VALUES(10) /*!99999 ,(11)*/; |
|||
|
|||
source include/show_binlog_events.inc; |
|||
let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); |
|||
sync_slave_with_master; |
|||
let $diff_table_1=master:test.t1; |
|||
let $diff_table_2=slave:test.t1; |
|||
source include/diff_tables.inc; |
|||
|
|||
--echo |
|||
--echo # Case 2: |
|||
--echo # ----------------------------------------------------------------- |
|||
--echo # Verify whether it can be binlogged correctly when executing prepared |
|||
--echo # statement. |
|||
PREPARE stmt FROM 'INSERT INTO /*!99999 blabla*/ t1 VALUES(60) /*!99999 ,(61)*/'; |
|||
EXECUTE stmt; |
|||
DROP TABLE t1; |
|||
CREATE TABLE t1(c1 INT); |
|||
EXECUTE stmt; |
|||
|
|||
sync_slave_with_master; |
|||
let $diff_table_1=master:test.t1; |
|||
let $diff_table_2=slave:test.t1; |
|||
source include/diff_tables.inc; |
|||
|
|||
--echo |
|||
SET @value=62; |
|||
PREPARE stmt FROM 'INSERT INTO /*!99999 blabla */ t1 VALUES(?) /*!99999 ,(63)*/'; |
|||
EXECUTE stmt USING @value; |
|||
DROP TABLE t1; |
|||
CREATE TABLE t1(c1 INT); |
|||
EXECUTE stmt USING @value; |
|||
|
|||
source include/show_binlog_events.inc; |
|||
let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); |
|||
|
|||
sync_slave_with_master; |
|||
let $diff_table_1=master:test.t1; |
|||
let $diff_table_2=slave:test.t1; |
|||
source include/diff_tables.inc; |
|||
|
|||
--echo |
|||
--echo # Case 3: |
|||
--echo # ----------------------------------------------------------------- |
|||
--echo # Verify it can restore the '!', if the it is an uncomplete conditional |
|||
--echo # comments |
|||
--error 1064 |
|||
SELECT c1 FROM /*!99999 t1 WHEREN; |
|||
|
|||
DROP TABLE t1; |
|||
source include/master-slave-end.inc; |
|||
@ -0,0 +1,27 @@ |
|||
# Copyright 2000, 2010, Oracle and/or its affiliates. All rights reserved.
|
|||
#
|
|||
# This program is free software; you can redistribute it and/or modify
|
|||
# it under the terms of the GNU General Public License as published by
|
|||
# the Free Software Foundation; version 2 of the License.
|
|||
#
|
|||
# This program is distributed in the hope that it will be useful,
|
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|||
# GNU General Public License for more details.
|
|||
#
|
|||
# You should have received a copy of the GNU General Public License
|
|||
# along with this program; if not, write to the Free Software
|
|||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
|
|||
AM_CPPFLAGS = @ZLIB_INCLUDES@ -I$(top_builddir)/include |
|||
AM_CPPFLAGS += -I$(top_srcdir)/include -I$(top_srcdir)/unittest/mytap |
|||
|
|||
LDADD = $(top_builddir)/unittest/mytap/libmytap.a \
|
|||
$(top_builddir)/mysys/libmysys.a \
|
|||
$(top_builddir)/dbug/libdbug.a \
|
|||
$(top_builddir)/strings/libmystrings.a |
|||
|
|||
noinst_PROGRAMS = strings-t |
|||
|
|||
# Don't update the files from bitkeeper
|
|||
%::SCCS/s.% |
|||
@ -0,0 +1,114 @@ |
|||
/* Copyright 2000, 2010, Oracle and/or its affiliates. All rights reserved. |
|||
|
|||
This program is free software; you can redistribute it and/or modify |
|||
it under the terms of the GNU General Public License as published by |
|||
the Free Software Foundation; version 2 of the License. |
|||
|
|||
This program is distributed in the hope that it will be useful, |
|||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
GNU General Public License for more details. |
|||
|
|||
You should have received a copy of the GNU General Public License |
|||
along with this program; if not, write to the Free Software |
|||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ |
|||
|
|||
#include <tap.h> |
|||
#include <my_global.h> |
|||
#include <my_sys.h> |
|||
|
|||
|
|||
/* |
|||
Test that like_range() returns well-formed results. |
|||
*/ |
|||
static int |
|||
test_like_range_for_charset(CHARSET_INFO *cs, const char *src, size_t src_len) |
|||
{ |
|||
char min_str[32], max_str[32]; |
|||
size_t min_len, max_len, min_well_formed_len, max_well_formed_len; |
|||
int error= 0; |
|||
|
|||
cs->coll->like_range(cs, src, src_len, '\\', '_', '%', |
|||
sizeof(min_str), min_str, max_str, &min_len, &max_len); |
|||
diag("min_len=%d\tmax_len=%d\t%s", (int) min_len, (int) max_len, cs->name); |
|||
min_well_formed_len= cs->cset->well_formed_len(cs, |
|||
min_str, min_str + min_len, |
|||
10000, &error); |
|||
max_well_formed_len= cs->cset->well_formed_len(cs, |
|||
max_str, max_str + max_len, |
|||
10000, &error); |
|||
if (min_len != min_well_formed_len) |
|||
diag("Bad min_str: min_well_formed_len=%d min_str[%d]=0x%02X", |
|||
(int) min_well_formed_len, (int) min_well_formed_len, |
|||
(uchar) min_str[min_well_formed_len]); |
|||
if (max_len != max_well_formed_len) |
|||
diag("Bad max_str: max_well_formed_len=%d max_str[%d]=0x%02X", |
|||
(int) max_well_formed_len, (int) max_well_formed_len, |
|||
(uchar) max_str[max_well_formed_len]); |
|||
return |
|||
min_len == min_well_formed_len && |
|||
max_len == max_well_formed_len ? 0 : 1; |
|||
} |
|||
|
|||
|
|||
static CHARSET_INFO *charset_list[]= |
|||
{ |
|||
#ifdef HAVE_CHARSET_big5 |
|||
&my_charset_big5_chinese_ci, |
|||
&my_charset_big5_bin, |
|||
#endif |
|||
#ifdef HAVE_CHARSET_euckr |
|||
&my_charset_euckr_korean_ci, |
|||
&my_charset_euckr_bin, |
|||
#endif |
|||
#ifdef HAVE_CHARSET_gb2312 |
|||
&my_charset_gb2312_chinese_ci, |
|||
&my_charset_gb2312_bin, |
|||
#endif |
|||
#ifdef HAVE_CHARSET_gbk |
|||
&my_charset_gbk_chinese_ci, |
|||
&my_charset_gbk_bin, |
|||
#endif |
|||
#ifdef HAVE_CHARSET_latin1 |
|||
&my_charset_latin1, |
|||
&my_charset_latin1_bin, |
|||
#endif |
|||
#ifdef HAVE_CHARSET_sjis |
|||
&my_charset_sjis_japanese_ci, |
|||
&my_charset_sjis_bin, |
|||
#endif |
|||
#ifdef HAVE_CHARSET_tis620 |
|||
&my_charset_tis620_thai_ci, |
|||
&my_charset_tis620_bin, |
|||
#endif |
|||
#ifdef HAVE_CHARSET_ujis |
|||
&my_charset_ujis_japanese_ci, |
|||
&my_charset_ujis_bin, |
|||
#endif |
|||
#ifdef HAVE_CHARSET_utf8 |
|||
&my_charset_utf8_general_ci, |
|||
&my_charset_utf8_unicode_ci, |
|||
&my_charset_utf8_bin, |
|||
#endif |
|||
}; |
|||
|
|||
|
|||
int main() |
|||
{ |
|||
size_t i, failed= 0; |
|||
|
|||
plan(1); |
|||
diag("Testing my_like_range_xxx() functions"); |
|||
|
|||
for (i= 0; i < array_elements(charset_list); i++) |
|||
{ |
|||
CHARSET_INFO *cs= charset_list[i]; |
|||
if (test_like_range_for_charset(cs, "abc%", 4)) |
|||
{ |
|||
++failed; |
|||
diag("Failed for %s", cs->name); |
|||
} |
|||
} |
|||
ok(failed == 0, "Testing my_like_range_xxx() functions"); |
|||
return exit_status(); |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue