Merge lp:~vlad-lesin/percona-server/5.1-bug1049871-injections-gca into lp:percona-server/5.1

Proposed by Vlad Lesin on 2012-09-25
Status: Merged
Approved by: Stewart Smith on 2013-01-03
Approved revision: 484
Merged at revision: 510
Proposed branch: lp:~vlad-lesin/percona-server/5.1-bug1049871-injections-gca
Merge into: lp:percona-server/5.1
Diff against target: 3096 lines (+1134/-485)
37 files modified
Percona-Server/client/sql_string.cc (+44/-0)
Percona-Server/client/sql_string.h (+10/-0)
Percona-Server/mysql-test/r/func_compress.result (+2/-2)
Percona-Server/mysql-test/r/mysqlbinlog.result (+12/-12)
Percona-Server/mysql-test/r/mysqlbinlog2.result (+35/-35)
Percona-Server/mysql-test/r/mysqlbinlog_row.result (+1/-1)
Percona-Server/mysql-test/r/mysqlbinlog_row_innodb.result (+4/-4)
Percona-Server/mysql-test/r/mysqlbinlog_row_myisam.result (+4/-4)
Percona-Server/mysql-test/r/mysqlbinlog_row_trans.result (+1/-1)
Percona-Server/mysql-test/r/user_var-binlog.result (+1/-1)
Percona-Server/mysql-test/r/variables.result (+1/-1)
Percona-Server/mysql-test/suite/binlog/r/binlog_base64_flag.result (+1/-1)
Percona-Server/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result (+1/-1)
Percona-Server/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result (+2/-2)
Percona-Server/mysql-test/suite/rpl/r/rpl_mdev382.result (+275/-0)
Percona-Server/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result (+4/-4)
Percona-Server/mysql-test/suite/rpl/r/rpl_sp.result (+6/-6)
Percona-Server/mysql-test/suite/rpl/t/rpl_mdev382.test (+249/-0)
Percona-Server/sql/ha_ndbcluster_binlog.cc (+17/-8)
Percona-Server/sql/item.cc (+2/-1)
Percona-Server/sql/item_func.cc (+3/-3)
Percona-Server/sql/item_func.h (+1/-1)
Percona-Server/sql/log.cc (+5/-6)
Percona-Server/sql/log_event.cc (+251/-203)
Percona-Server/sql/log_event.h (+25/-22)
Percona-Server/sql/log_event_old.cc (+1/-1)
Percona-Server/sql/log_event_old.h (+1/-1)
Percona-Server/sql/mysql_priv.h (+1/-1)
Percona-Server/sql/sql_base.cc (+23/-12)
Percona-Server/sql/sql_db.cc (+19/-30)
Percona-Server/sql/sql_insert.cc (+7/-7)
Percona-Server/sql/sql_load.cc (+35/-56)
Percona-Server/sql/sql_repl.cc (+1/-1)
Percona-Server/sql/sql_show.cc (+6/-37)
Percona-Server/sql/sql_string.cc (+61/-10)
Percona-Server/sql/sql_string.h (+11/-0)
Percona-Server/sql/sql_table.cc (+11/-10)
To merge this branch: bzr merge lp:~vlad-lesin/percona-server/5.1-bug1049871-injections-gca
Reviewer Review Type Date Requested Status
Stewart Smith (community) Approve on 2013-01-03
Laurynas Biveinis (community) 2012-09-25 Approve on 2012-10-12
Review via email: mp+126236@code.launchpad.net

Description of the change

The fix for bug #1049871.

Test results can be found here http://jenkins.percona.com/view/PS%205.1/job/percona-server-5.1-param/426/ .

Each failed test was ran separately on same hosts at least 100 times. Only rpl_stop_slave test fail was repeated that way. Except that here http://jenkins.percona.com/view/PS%205.1/job/percona-server-5.1-param/427/ are test results for clean 5.1. As we can see there is almost the same failed tests set. That allows me suppose failed tests are not connected with the new code.

To post a comment you must log in.
Stewart Smith (stewart) wrote :

This will need a 5.5 branch before we can merge.

Vlad Lesin (vlad-lesin) wrote :

> This will need a 5.5 branch before we can merge.

Yes, I've just pushed 5.5 version and it is under testing now.

   - QUOTED_IDENTIFIED macro definition should use the do { ... }
     while(0) idiom. Also, it is duplicated three times in the
     patch.
   - Lines 1074--1075 formatting issue.
   - The patch is missing
     mysql-test/suite/rpl/t/rpl_mdev382.test|result. Is this intentional?

review: Needs Fixing

This was only a partial review.

Vlad Lesin (vlad-lesin) wrote :

> - QUOTED_IDENTIFIED macro definition should use the do { ... }
> while(0) idiom.
The idea of this macros is to use allocation on stack for string operation. That is why that idiom does not suite for the macros.

> Also, it is duplicated three times in the patch.
IMHO the macros is repeated twice as the whole sql_string.* for client and server parts. Logically this macros should be in sql_string.h header. I decided it is not a good idea to make new header file just for that macros.

> - Lines 1074--1075 formatting issue.
Fixed.

> - The patch is missing
> mysql-test/suite/rpl/t/rpl_mdev382.test|result. Is this intentional?
I missed it. Thanks. I relaunched jenkins testing to be sure this test is passed.

> > - QUOTED_IDENTIFIED macro definition should use the do { ... }
> > while(0) idiom.
> The idea of this macros is to use allocation on stack for string operation.
> That is why that idiom does not suite for the macros.

Ah, correct, sorry. And declaring the var outside the macro, then passing its address will not be optimal due to constructor initialization.

>
> > Also, it is duplicated three times in the patch.
> IMHO the macros is repeated twice as the whole sql_string.* for client and
> server parts. Logically this macros should be in sql_string.h header. I
> decided it is not a good idea to make new header file just for that macros.

OK, especially given the nature of the patch.

Looks good to me. This is still a partial review, please coordinate with Stewart on how to proceed.

review: Approve
Stewart Smith (stewart) wrote :

http://jenkins.percona.com/job/merge-PS-5.1-staging/16/BUILD_TYPE=release,Host=centos6-64/testReport/junit/%28root%29/rpl/rpl_mdev382__stmt_/

CURRENT_TEST: rpl.rpl_mdev382
--- /home/jenkins/workspace/merge-PS-5.1-staging/BUILD_TYPE/release/Host/centos6-64/Percona-Server/mysql-test/suite/rpl/r/rpl_mdev382.result 2012-12-21 01:34:50.044464000 +0300
+++ /home/jenkins/workspace/merge-PS-5.1-staging/BUILD_TYPE/release/Host/centos6-64/Percona-Server/mysql-test/suite/rpl/r/rpl_mdev382.reject 2012-12-21 01:40:08.249617163 +0300
@@ -206,7 +206,7 @@
 master-bin.000001 # User var # # @`a``2`=42
 master-bin.000001 # User var # # @`a``3`=9223372036854775807
 master-bin.000001 # User var # # @`a``4`=-1
-master-bin.000001 # User var # # @`b```=-1.2345601234568e+125
+master-bin.000001 # User var # # @`b```=%
 master-bin.000001 # User var # # @```c`=-1234501234567890123456789012345678901234567890123456789.0123456789
 master-bin.000001 # User var # # @```d```=_latin1 0x78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878 COLLATE latin1_swedish_ci
 master-bin.000001 # Query # # use `db1``; SELECT 'oops!'`; INSERT INTO t1 VALUES (@`a``1`+1, @`a``2`*100, @`a``3`-1, @`a``4`-1, @`b```/2, @```c`, substr(@```d```, 2, 98))

mysqltest: Result content mismatch
------------

review: Needs Fixing
Vlad Lesin (vlad-lesin) wrote :

Fixed in last revision (http://jenkins.percona.com/view/PS%205.1/job/percona-server-5.1-param/479/ )

> http://jenkins.percona.com/job/merge-PS-5.1-staging/16/BUILD_TYPE=release,Host
> =centos6-64/testReport/junit/%28root%29/rpl/rpl_mdev382__stmt_/
>
> CURRENT_TEST: rpl.rpl_mdev382
> --- /home/jenkins/workspace/merge-
> PS-5.1-staging/BUILD_TYPE/release/Host/centos6-64/Percona-Server/mysql-
> test/suite/rpl/r/rpl_mdev382.result 2012-12-21 01:34:50.044464000 +0300
> +++ /home/jenkins/workspace/merge-
> PS-5.1-staging/BUILD_TYPE/release/Host/centos6-64/Percona-Server/mysql-
> test/suite/rpl/r/rpl_mdev382.reject 2012-12-21 01:40:08.249617163 +0300
> @@ -206,7 +206,7 @@
> master-bin.000001 # User var # # @`a``2`=42
> master-bin.000001 # User var # #
> @`a``3`=9223372036854775807
> master-bin.000001 # User var # # @`a``4`=-1
> -master-bin.000001 # User var # #
> @`b```=-1.2345601234568e+125
> +master-bin.000001 # User var # # @`b```=%
> master-bin.000001 # User var # #
> @```c`=-1234501234567890123456789012345678901234567890123456789.0123456789
> master-bin.000001 # User var # #
> @```d```=_latin1 0x78787878787878787878787878787878787878787878787878787878787
> 878787878787878787878787878787878787878787878787878787878787878787878787878787
> 878787878787878787878787878787878787878787878787878787878787878 COLLATE
> latin1_swedish_ci
> master-bin.000001 # Query # # use `db1``; SELECT
> 'oops!'`; INSERT INTO t1 VALUES (@`a``1`+1, @`a``2`*100, @`a``3`-1, @`a``4`-1,
> @`b```/2, @```c`, substr(@```d```, 2, 98))
>
> mysqltest: Result content mismatch
> ------------

Stewart Smith (stewart) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Percona-Server/client/sql_string.cc'
--- Percona-Server/client/sql_string.cc 2012-04-02 02:09:15 +0000
+++ Percona-Server/client/sql_string.cc 2012-12-30 12:40:31 +0000
@@ -540,6 +540,50 @@
540 return FALSE;540 return FALSE;
541}541}
542542
543bool String::append_identifier(const char *name,
544 uint length,
545 CHARSET_INFO *ci,
546 int quote_char)
547{
548 const char *name_end;
549 char q= (char)quote_char;
550 CHARSET_INFO *lci = ci ? ci : charset();
551
552 if (quote_char == EOF)
553 return append(name, length, charset());
554
555 /*
556 The identifier must be quoted as it includes a quote character or
557 it's a keyword
558 */
559
560 VOID(reserve(length*2 + 2));
561 if (append(&q, 1, lci))
562 return true;
563
564 for (name_end= name+length ; name < name_end ; name+= length)
565 {
566 uchar chr= (uchar) *name;
567 length= my_mbcharlen(lci, chr);
568 /*
569 my_mbcharlen can return 0 on a wrong multibyte
570 sequence. It is possible when upgrading from 4.0,
571 and identifier contains some accented characters.
572 The manual says it does not work. So we'll just
573 change length to 1 not to hang in the endless loop.
574 */
575 if (!length)
576 length= 1;
577 if (length == 1 && chr == (uchar) q &&
578 append(&q, 1, lci))
579 return true;
580 if (append(name, length, lci))
581 return true;
582 }
583 return append(&q, 1, lci);
584}
585
586
543uint32 String::numchars()587uint32 String::numchars()
544{588{
545 return str_charset->cset->numchars(str_charset, Ptr, Ptr+str_length);589 return str_charset->cset->numchars(str_charset, Ptr, Ptr+str_length);
546590
=== modified file 'Percona-Server/client/sql_string.h'
--- Percona-Server/client/sql_string.h 2012-02-09 15:03:59 +0000
+++ Percona-Server/client/sql_string.h 2012-12-30 12:40:31 +0000
@@ -28,6 +28,12 @@
28#define NOT_FIXED_DEC 3128#define NOT_FIXED_DEC 31
29#endif29#endif
3030
31#define QUOTED_IDENTIFIER(str_name, buf_size, q, cs, id_name, id_size) \
32 char buf_##str_name[(buf_size)]; \
33 String str_name((buf_##str_name), (buf_size), (cs)); \
34 str_name.length(0); \
35 str_name.append_identifier((id_name), (id_size), (cs), (q));
36
31class String;37class String;
32int sortcmp(const String *a,const String *b, CHARSET_INFO *cs);38int sortcmp(const String *a,const String *b, CHARSET_INFO *cs);
33String *copy_if_not_alloced(String *a,String *b,uint32 arg_length);39String *copy_if_not_alloced(String *a,String *b,uint32 arg_length);
@@ -250,6 +256,10 @@
250 bool append(IO_CACHE* file, uint32 arg_length);256 bool append(IO_CACHE* file, uint32 arg_length);
251 bool append_with_prefill(const char *s, uint32 arg_length, 257 bool append_with_prefill(const char *s, uint32 arg_length,
252 uint32 full_length, char fill_char);258 uint32 full_length, char fill_char);
259 bool append_identifier(const char *name,
260 uint length,
261 CHARSET_INFO *ci,
262 int quote_char);
253 int strstr(const String &search,uint32 offset=0); // Returns offset to substring or -1263 int strstr(const String &search,uint32 offset=0); // Returns offset to substring or -1
254 int strrstr(const String &search,uint32 offset=0); // Returns offset to substring or -1264 int strrstr(const String &search,uint32 offset=0); // Returns offset to substring or -1
255 bool replace(uint32 offset,uint32 arg_length,const char *to,uint32 length);265 bool replace(uint32 offset,uint32 arg_length,const char *to,uint32 length);
256266
=== modified file 'Percona-Server/mysql-test/r/func_compress.result'
--- Percona-Server/mysql-test/r/func_compress.result 2009-06-19 09:29:21 +0000
+++ Percona-Server/mysql-test/r/func_compress.result 2012-12-30 12:40:31 +0000
@@ -11,7 +11,7 @@
11id select_type table type possible_keys key key_len ref rows filtered Extra11id select_type table type possible_keys key key_len ref rows filtered Extra
121 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used121 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
13Warnings:13Warnings:
14Note 1003 select uncompress(compress((@test_compress_string))) AS `uncompress(compress(@test_compress_string))`14Note 1003 select uncompress(compress((@`test_compress_string`))) AS `uncompress(compress(@test_compress_string))`
15select uncompressed_length(compress(@test_compress_string))=length(@test_compress_string);15select uncompressed_length(compress(@test_compress_string))=length(@test_compress_string);
16uncompressed_length(compress(@test_compress_string))=length(@test_compress_string)16uncompressed_length(compress(@test_compress_string))=length(@test_compress_string)
171171
@@ -19,7 +19,7 @@
19id select_type table type possible_keys key key_len ref rows filtered Extra19id select_type table type possible_keys key key_len ref rows filtered Extra
201 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used201 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
21Warnings:21Warnings:
22Note 1003 select (uncompressed_length(compress((@test_compress_string))) = length((@test_compress_string))) AS `uncompressed_length(compress(@test_compress_string))=length(@test_compress_string)`22Note 1003 select (uncompressed_length(compress((@`test_compress_string`))) = length((@`test_compress_string`))) AS `uncompressed_length(compress(@test_compress_string))=length(@test_compress_string)`
23select uncompressed_length(compress(@test_compress_string));23select uncompressed_length(compress(@test_compress_string));
24uncompressed_length(compress(@test_compress_string))24uncompressed_length(compress(@test_compress_string))
2511725117
2626
=== modified file 'Percona-Server/mysql-test/r/mysqlbinlog.result'
--- Percona-Server/mysql-test/r/mysqlbinlog.result 2012-02-09 15:01:35 +0000
+++ Percona-Server/mysql-test/r/mysqlbinlog.result 2012-12-30 12:40:31 +0000
@@ -18,7 +18,7 @@
18/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;18/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
19DELIMITER /*!*/;19DELIMITER /*!*/;
20ROLLBACK/*!*/;20ROLLBACK/*!*/;
21use test/*!*/;21use `test`/*!*/;
22SET TIMESTAMP=1000000000/*!*/;22SET TIMESTAMP=1000000000/*!*/;
23SET @@session.pseudo_thread_id=999999999/*!*/;23SET @@session.pseudo_thread_id=999999999/*!*/;
24SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;24SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -64,7 +64,7 @@
64/*!40019 SET @@session.max_insert_delayed_threads=0*/;64/*!40019 SET @@session.max_insert_delayed_threads=0*/;
65/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;65/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
66DELIMITER /*!*/;66DELIMITER /*!*/;
67use test/*!*/;67use `test`/*!*/;
68SET TIMESTAMP=1000000000/*!*/;68SET TIMESTAMP=1000000000/*!*/;
69SET @@session.pseudo_thread_id=999999999/*!*/;69SET @@session.pseudo_thread_id=999999999/*!*/;
70SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;70SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -97,7 +97,7 @@
97/*!40019 SET @@session.max_insert_delayed_threads=0*/;97/*!40019 SET @@session.max_insert_delayed_threads=0*/;
98/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;98/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
99DELIMITER /*!*/;99DELIMITER /*!*/;
100use test/*!*/;100use `test`/*!*/;
101SET TIMESTAMP=1000000000/*!*/;101SET TIMESTAMP=1000000000/*!*/;
102SET @@session.pseudo_thread_id=999999999/*!*/;102SET @@session.pseudo_thread_id=999999999/*!*/;
103SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;103SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -119,7 +119,7 @@
119/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;119/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
120DELIMITER /*!*/;120DELIMITER /*!*/;
121ROLLBACK/*!*/;121ROLLBACK/*!*/;
122use test/*!*/;122use `test`/*!*/;
123SET TIMESTAMP=1000000000/*!*/;123SET TIMESTAMP=1000000000/*!*/;
124SET @@session.pseudo_thread_id=999999999/*!*/;124SET @@session.pseudo_thread_id=999999999/*!*/;
125SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;125SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -165,7 +165,7 @@
165/*!40019 SET @@session.max_insert_delayed_threads=0*/;165/*!40019 SET @@session.max_insert_delayed_threads=0*/;
166/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;166/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
167DELIMITER /*!*/;167DELIMITER /*!*/;
168use test/*!*/;168use `test`/*!*/;
169SET TIMESTAMP=1000000000/*!*/;169SET TIMESTAMP=1000000000/*!*/;
170SET @@session.pseudo_thread_id=999999999/*!*/;170SET @@session.pseudo_thread_id=999999999/*!*/;
171SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;171SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -198,7 +198,7 @@
198/*!40019 SET @@session.max_insert_delayed_threads=0*/;198/*!40019 SET @@session.max_insert_delayed_threads=0*/;
199/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;199/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
200DELIMITER /*!*/;200DELIMITER /*!*/;
201use test/*!*/;201use `test`/*!*/;
202SET TIMESTAMP=1000000000/*!*/;202SET TIMESTAMP=1000000000/*!*/;
203SET @@session.pseudo_thread_id=999999999/*!*/;203SET @@session.pseudo_thread_id=999999999/*!*/;
204SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;204SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -227,7 +227,7 @@
227SET @@session.collation_database=DEFAULT/*!*/;227SET @@session.collation_database=DEFAULT/*!*/;
228BEGIN228BEGIN
229/*!*/;229/*!*/;
230use test/*!*/;230use `test`/*!*/;
231SET TIMESTAMP=1108844555/*!*/;231SET TIMESTAMP=1108844555/*!*/;
232insert t1 values (1)232insert t1 values (1)
233/*!*/;233/*!*/;
@@ -246,7 +246,7 @@
246SET @@session.collation_database=DEFAULT/*!*/;246SET @@session.collation_database=DEFAULT/*!*/;
247BEGIN247BEGIN
248/*!*/;248/*!*/;
249use test/*!*/;249use `test`/*!*/;
250SET TIMESTAMP=1108844555/*!*/;250SET TIMESTAMP=1108844555/*!*/;
251insert t1 values (1)251insert t1 values (1)
252/*!*/;252/*!*/;
@@ -299,7 +299,7 @@
299/*!40019 SET @@session.max_insert_delayed_threads=0*/;299/*!40019 SET @@session.max_insert_delayed_threads=0*/;
300/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;300/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
301DELIMITER /*!*/;301DELIMITER /*!*/;
302use test/*!*/;302use `test`/*!*/;
303SET TIMESTAMP=1000000000/*!*/;303SET TIMESTAMP=1000000000/*!*/;
304SET @@session.pseudo_thread_id=999999999/*!*/;304SET @@session.pseudo_thread_id=999999999/*!*/;
305SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;305SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -349,7 +349,7 @@
349/*!40019 SET @@session.max_insert_delayed_threads=0*/;349/*!40019 SET @@session.max_insert_delayed_threads=0*/;
350/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;350/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
351DELIMITER /*!*/;351DELIMITER /*!*/;
352use test/*!*/;352use `test`/*!*/;
353SET TIMESTAMP=1000000000/*!*/;353SET TIMESTAMP=1000000000/*!*/;
354SET @@session.pseudo_thread_id=999999999/*!*/;354SET @@session.pseudo_thread_id=999999999/*!*/;
355SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;355SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -484,7 +484,7 @@
484/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;484/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
485DELIMITER /*!*/;485DELIMITER /*!*/;
486ROLLBACK/*!*/;486ROLLBACK/*!*/;
487use test/*!*/;487use `test`/*!*/;
488SET TIMESTAMP=1253783037/*!*/;488SET TIMESTAMP=1253783037/*!*/;
489SET @@session.pseudo_thread_id=999999999/*!*/;489SET @@session.pseudo_thread_id=999999999/*!*/;
490SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;490SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -584,7 +584,7 @@
584SET TIMESTAMP=1266652094/*!*/;584SET TIMESTAMP=1266652094/*!*/;
585SavePoint mixed_cases585SavePoint mixed_cases
586/*!*/;586/*!*/;
587use db1/*!*/;587use `db1`/*!*/;
588SET TIMESTAMP=1266652094/*!*/;588SET TIMESTAMP=1266652094/*!*/;
589INSERT INTO db1.t2 VALUES("in savepoint mixed_cases")589INSERT INTO db1.t2 VALUES("in savepoint mixed_cases")
590/*!*/;590/*!*/;
591591
=== modified file 'Percona-Server/mysql-test/r/mysqlbinlog2.result'
--- Percona-Server/mysql-test/r/mysqlbinlog2.result 2008-04-02 09:49:22 +0000
+++ Percona-Server/mysql-test/r/mysqlbinlog2.result 2012-12-30 12:40:31 +0000
@@ -19,7 +19,7 @@
19/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;19/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
20DELIMITER /*!*/;20DELIMITER /*!*/;
21ROLLBACK/*!*/;21ROLLBACK/*!*/;
22use test/*!*/;22use `test`/*!*/;
23SET TIMESTAMP=1579609942/*!*/;23SET TIMESTAMP=1579609942/*!*/;
24SET @@session.pseudo_thread_id=999999999/*!*/;24SET @@session.pseudo_thread_id=999999999/*!*/;
25SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;25SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -62,7 +62,7 @@
62DELIMITER /*!*/;62DELIMITER /*!*/;
63ROLLBACK/*!*/;63ROLLBACK/*!*/;
64SET INSERT_ID=1/*!*/;64SET INSERT_ID=1/*!*/;
65use test/*!*/;65use `test`/*!*/;
66SET TIMESTAMP=1579609942/*!*/;66SET TIMESTAMP=1579609942/*!*/;
67SET @@session.pseudo_thread_id=999999999/*!*/;67SET @@session.pseudo_thread_id=999999999/*!*/;
68SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;68SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -101,7 +101,7 @@
101DELIMITER /*!*/;101DELIMITER /*!*/;
102ROLLBACK/*!*/;102ROLLBACK/*!*/;
103SET INSERT_ID=4/*!*/;103SET INSERT_ID=4/*!*/;
104use test/*!*/;104use `test`/*!*/;
105SET TIMESTAMP=1579609946/*!*/;105SET TIMESTAMP=1579609946/*!*/;
106SET @@session.pseudo_thread_id=999999999/*!*/;106SET @@session.pseudo_thread_id=999999999/*!*/;
107SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;107SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -127,7 +127,7 @@
127/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;127/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
128DELIMITER /*!*/;128DELIMITER /*!*/;
129ROLLBACK/*!*/;129ROLLBACK/*!*/;
130use test/*!*/;130use `test`/*!*/;
131SET TIMESTAMP=1579609942/*!*/;131SET TIMESTAMP=1579609942/*!*/;
132SET @@session.pseudo_thread_id=999999999/*!*/;132SET @@session.pseudo_thread_id=999999999/*!*/;
133SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;133SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -162,7 +162,7 @@
162DELIMITER /*!*/;162DELIMITER /*!*/;
163ROLLBACK/*!*/;163ROLLBACK/*!*/;
164SET INSERT_ID=4/*!*/;164SET INSERT_ID=4/*!*/;
165use test/*!*/;165use `test`/*!*/;
166SET TIMESTAMP=1579609946/*!*/;166SET TIMESTAMP=1579609946/*!*/;
167SET @@session.pseudo_thread_id=999999999/*!*/;167SET @@session.pseudo_thread_id=999999999/*!*/;
168SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;168SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -185,7 +185,7 @@
185DELIMITER /*!*/;185DELIMITER /*!*/;
186ROLLBACK/*!*/;186ROLLBACK/*!*/;
187SET INSERT_ID=3/*!*/;187SET INSERT_ID=3/*!*/;
188use test/*!*/;188use `test`/*!*/;
189SET TIMESTAMP=1579609944/*!*/;189SET TIMESTAMP=1579609944/*!*/;
190SET @@session.pseudo_thread_id=999999999/*!*/;190SET @@session.pseudo_thread_id=999999999/*!*/;
191SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;191SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -215,7 +215,7 @@
215/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;215/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
216DELIMITER /*!*/;216DELIMITER /*!*/;
217ROLLBACK/*!*/;217ROLLBACK/*!*/;
218use test/*!*/;218use `test`/*!*/;
219SET TIMESTAMP=1579609942/*!*/;219SET TIMESTAMP=1579609942/*!*/;
220SET @@session.pseudo_thread_id=999999999/*!*/;220SET @@session.pseudo_thread_id=999999999/*!*/;
221SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;221SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -246,7 +246,7 @@
246/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;246/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
247DELIMITER /*!*/;247DELIMITER /*!*/;
248ROLLBACK/*!*/;248ROLLBACK/*!*/;
249use test/*!*/;249use `test`/*!*/;
250SET TIMESTAMP=1579609942/*!*/;250SET TIMESTAMP=1579609942/*!*/;
251SET @@session.pseudo_thread_id=999999999/*!*/;251SET @@session.pseudo_thread_id=999999999/*!*/;
252SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;252SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -281,7 +281,7 @@
281DELIMITER ;281DELIMITER ;
282DELIMITER /*!*/;282DELIMITER /*!*/;
283SET INSERT_ID=6/*!*/;283SET INSERT_ID=6/*!*/;
284use test/*!*/;284use `test`/*!*/;
285SET TIMESTAMP=1579609943/*!*/;285SET TIMESTAMP=1579609943/*!*/;
286SET @@session.pseudo_thread_id=999999999/*!*/;286SET @@session.pseudo_thread_id=999999999/*!*/;
287SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;287SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -304,7 +304,7 @@
304DELIMITER /*!*/;304DELIMITER /*!*/;
305ROLLBACK/*!*/;305ROLLBACK/*!*/;
306SET INSERT_ID=1/*!*/;306SET INSERT_ID=1/*!*/;
307use test/*!*/;307use `test`/*!*/;
308SET TIMESTAMP=1579609942/*!*/;308SET TIMESTAMP=1579609942/*!*/;
309SET @@session.pseudo_thread_id=999999999/*!*/;309SET @@session.pseudo_thread_id=999999999/*!*/;
310SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;310SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -335,7 +335,7 @@
335DELIMITER ;335DELIMITER ;
336DELIMITER /*!*/;336DELIMITER /*!*/;
337SET INSERT_ID=6/*!*/;337SET INSERT_ID=6/*!*/;
338use test/*!*/;338use `test`/*!*/;
339SET TIMESTAMP=1579609943/*!*/;339SET TIMESTAMP=1579609943/*!*/;
340SET @@session.pseudo_thread_id=999999999/*!*/;340SET @@session.pseudo_thread_id=999999999/*!*/;
341SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;341SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -358,7 +358,7 @@
358DELIMITER /*!*/;358DELIMITER /*!*/;
359ROLLBACK/*!*/;359ROLLBACK/*!*/;
360SET INSERT_ID=4/*!*/;360SET INSERT_ID=4/*!*/;
361use test/*!*/;361use `test`/*!*/;
362SET TIMESTAMP=1579609946/*!*/;362SET TIMESTAMP=1579609946/*!*/;
363SET @@session.pseudo_thread_id=999999999/*!*/;363SET @@session.pseudo_thread_id=999999999/*!*/;
364SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;364SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -377,7 +377,7 @@
377DELIMITER ;377DELIMITER ;
378DELIMITER /*!*/;378DELIMITER /*!*/;
379SET INSERT_ID=6/*!*/;379SET INSERT_ID=6/*!*/;
380use test/*!*/;380use `test`/*!*/;
381SET TIMESTAMP=1579609943/*!*/;381SET TIMESTAMP=1579609943/*!*/;
382SET @@session.pseudo_thread_id=999999999/*!*/;382SET @@session.pseudo_thread_id=999999999/*!*/;
383SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;383SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -399,7 +399,7 @@
399/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;399/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
400DELIMITER /*!*/;400DELIMITER /*!*/;
401ROLLBACK/*!*/;401ROLLBACK/*!*/;
402use test/*!*/;402use `test`/*!*/;
403SET TIMESTAMP=1579609942/*!*/;403SET TIMESTAMP=1579609942/*!*/;
404SET @@session.pseudo_thread_id=999999999/*!*/;404SET @@session.pseudo_thread_id=999999999/*!*/;
405SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;405SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -445,7 +445,7 @@
445DELIMITER /*!*/;445DELIMITER /*!*/;
446ROLLBACK/*!*/;446ROLLBACK/*!*/;
447SET INSERT_ID=3/*!*/;447SET INSERT_ID=3/*!*/;
448use test/*!*/;448use `test`/*!*/;
449SET TIMESTAMP=1579609944/*!*/;449SET TIMESTAMP=1579609944/*!*/;
450SET @@session.pseudo_thread_id=999999999/*!*/;450SET @@session.pseudo_thread_id=999999999/*!*/;
451SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;451SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -468,7 +468,7 @@
468DELIMITER ;468DELIMITER ;
469DELIMITER /*!*/;469DELIMITER /*!*/;
470SET INSERT_ID=6/*!*/;470SET INSERT_ID=6/*!*/;
471use test/*!*/;471use `test`/*!*/;
472SET TIMESTAMP=1579609943/*!*/;472SET TIMESTAMP=1579609943/*!*/;
473SET @@session.pseudo_thread_id=999999999/*!*/;473SET @@session.pseudo_thread_id=999999999/*!*/;
474SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;474SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -490,7 +490,7 @@
490/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;490/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
491DELIMITER /*!*/;491DELIMITER /*!*/;
492ROLLBACK/*!*/;492ROLLBACK/*!*/;
493use test/*!*/;493use `test`/*!*/;
494SET TIMESTAMP=1579609942/*!*/;494SET TIMESTAMP=1579609942/*!*/;
495SET @@session.pseudo_thread_id=999999999/*!*/;495SET @@session.pseudo_thread_id=999999999/*!*/;
496SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;496SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -520,7 +520,7 @@
520/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;520/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
521DELIMITER /*!*/;521DELIMITER /*!*/;
522ROLLBACK/*!*/;522ROLLBACK/*!*/;
523use test/*!*/;523use `test`/*!*/;
524SET TIMESTAMP=1579609942/*!*/;524SET TIMESTAMP=1579609942/*!*/;
525SET @@session.pseudo_thread_id=999999999/*!*/;525SET @@session.pseudo_thread_id=999999999/*!*/;
526SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;526SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -563,7 +563,7 @@
563DELIMITER /*!*/;563DELIMITER /*!*/;
564ROLLBACK/*!*/;564ROLLBACK/*!*/;
565SET INSERT_ID=1/*!*/;565SET INSERT_ID=1/*!*/;
566use test/*!*/;566use `test`/*!*/;
567SET TIMESTAMP=1579609942/*!*/;567SET TIMESTAMP=1579609942/*!*/;
568SET @@session.pseudo_thread_id=999999999/*!*/;568SET @@session.pseudo_thread_id=999999999/*!*/;
569SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;569SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -601,7 +601,7 @@
601/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;601/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
602DELIMITER /*!*/;602DELIMITER /*!*/;
603SET INSERT_ID=4/*!*/;603SET INSERT_ID=4/*!*/;
604use test/*!*/;604use `test`/*!*/;
605SET TIMESTAMP=1579609946/*!*/;605SET TIMESTAMP=1579609946/*!*/;
606SET @@session.pseudo_thread_id=999999999/*!*/;606SET @@session.pseudo_thread_id=999999999/*!*/;
607SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;607SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -627,7 +627,7 @@
627/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;627/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
628DELIMITER /*!*/;628DELIMITER /*!*/;
629ROLLBACK/*!*/;629ROLLBACK/*!*/;
630use test/*!*/;630use `test`/*!*/;
631SET TIMESTAMP=1579609942/*!*/;631SET TIMESTAMP=1579609942/*!*/;
632SET @@session.pseudo_thread_id=999999999/*!*/;632SET @@session.pseudo_thread_id=999999999/*!*/;
633SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;633SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -661,7 +661,7 @@
661/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;661/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
662DELIMITER /*!*/;662DELIMITER /*!*/;
663SET INSERT_ID=4/*!*/;663SET INSERT_ID=4/*!*/;
664use test/*!*/;664use `test`/*!*/;
665SET TIMESTAMP=1579609946/*!*/;665SET TIMESTAMP=1579609946/*!*/;
666SET @@session.pseudo_thread_id=999999999/*!*/;666SET @@session.pseudo_thread_id=999999999/*!*/;
667SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;667SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -684,7 +684,7 @@
684DELIMITER /*!*/;684DELIMITER /*!*/;
685ROLLBACK/*!*/;685ROLLBACK/*!*/;
686SET INSERT_ID=3/*!*/;686SET INSERT_ID=3/*!*/;
687use test/*!*/;687use `test`/*!*/;
688SET TIMESTAMP=1579609944/*!*/;688SET TIMESTAMP=1579609944/*!*/;
689SET @@session.pseudo_thread_id=999999999/*!*/;689SET @@session.pseudo_thread_id=999999999/*!*/;
690SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;690SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -714,7 +714,7 @@
714/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;714/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
715DELIMITER /*!*/;715DELIMITER /*!*/;
716ROLLBACK/*!*/;716ROLLBACK/*!*/;
717use test/*!*/;717use `test`/*!*/;
718SET TIMESTAMP=1579609942/*!*/;718SET TIMESTAMP=1579609942/*!*/;
719SET @@session.pseudo_thread_id=999999999/*!*/;719SET @@session.pseudo_thread_id=999999999/*!*/;
720SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;720SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -744,7 +744,7 @@
744/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;744/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
745DELIMITER /*!*/;745DELIMITER /*!*/;
746ROLLBACK/*!*/;746ROLLBACK/*!*/;
747use test/*!*/;747use `test`/*!*/;
748SET TIMESTAMP=1579609942/*!*/;748SET TIMESTAMP=1579609942/*!*/;
749SET @@session.pseudo_thread_id=999999999/*!*/;749SET @@session.pseudo_thread_id=999999999/*!*/;
750SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;750SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -779,7 +779,7 @@
779DELIMITER ;779DELIMITER ;
780DELIMITER /*!*/;780DELIMITER /*!*/;
781SET INSERT_ID=6/*!*/;781SET INSERT_ID=6/*!*/;
782use test/*!*/;782use `test`/*!*/;
783SET TIMESTAMP=1579609943/*!*/;783SET TIMESTAMP=1579609943/*!*/;
784SET @@session.pseudo_thread_id=999999999/*!*/;784SET @@session.pseudo_thread_id=999999999/*!*/;
785SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;785SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -802,7 +802,7 @@
802DELIMITER /*!*/;802DELIMITER /*!*/;
803ROLLBACK/*!*/;803ROLLBACK/*!*/;
804SET INSERT_ID=1/*!*/;804SET INSERT_ID=1/*!*/;
805use test/*!*/;805use `test`/*!*/;
806SET TIMESTAMP=1579609942/*!*/;806SET TIMESTAMP=1579609942/*!*/;
807SET @@session.pseudo_thread_id=999999999/*!*/;807SET @@session.pseudo_thread_id=999999999/*!*/;
808SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;808SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -833,7 +833,7 @@
833DELIMITER ;833DELIMITER ;
834DELIMITER /*!*/;834DELIMITER /*!*/;
835SET INSERT_ID=6/*!*/;835SET INSERT_ID=6/*!*/;
836use test/*!*/;836use `test`/*!*/;
837SET TIMESTAMP=1579609943/*!*/;837SET TIMESTAMP=1579609943/*!*/;
838SET @@session.pseudo_thread_id=999999999/*!*/;838SET @@session.pseudo_thread_id=999999999/*!*/;
839SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;839SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -855,7 +855,7 @@
855/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;855/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
856DELIMITER /*!*/;856DELIMITER /*!*/;
857SET INSERT_ID=4/*!*/;857SET INSERT_ID=4/*!*/;
858use test/*!*/;858use `test`/*!*/;
859SET TIMESTAMP=1579609946/*!*/;859SET TIMESTAMP=1579609946/*!*/;
860SET @@session.pseudo_thread_id=999999999/*!*/;860SET @@session.pseudo_thread_id=999999999/*!*/;
861SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;861SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -874,7 +874,7 @@
874DELIMITER ;874DELIMITER ;
875DELIMITER /*!*/;875DELIMITER /*!*/;
876SET INSERT_ID=6/*!*/;876SET INSERT_ID=6/*!*/;
877use test/*!*/;877use `test`/*!*/;
878SET TIMESTAMP=1579609943/*!*/;878SET TIMESTAMP=1579609943/*!*/;
879SET @@session.pseudo_thread_id=999999999/*!*/;879SET @@session.pseudo_thread_id=999999999/*!*/;
880SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;880SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -896,7 +896,7 @@
896/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;896/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
897DELIMITER /*!*/;897DELIMITER /*!*/;
898ROLLBACK/*!*/;898ROLLBACK/*!*/;
899use test/*!*/;899use `test`/*!*/;
900SET TIMESTAMP=1579609942/*!*/;900SET TIMESTAMP=1579609942/*!*/;
901SET @@session.pseudo_thread_id=999999999/*!*/;901SET @@session.pseudo_thread_id=999999999/*!*/;
902SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;902SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -942,7 +942,7 @@
942DELIMITER /*!*/;942DELIMITER /*!*/;
943ROLLBACK/*!*/;943ROLLBACK/*!*/;
944SET INSERT_ID=3/*!*/;944SET INSERT_ID=3/*!*/;
945use test/*!*/;945use `test`/*!*/;
946SET TIMESTAMP=1579609944/*!*/;946SET TIMESTAMP=1579609944/*!*/;
947SET @@session.pseudo_thread_id=999999999/*!*/;947SET @@session.pseudo_thread_id=999999999/*!*/;
948SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;948SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -965,7 +965,7 @@
965DELIMITER ;965DELIMITER ;
966DELIMITER /*!*/;966DELIMITER /*!*/;
967SET INSERT_ID=6/*!*/;967SET INSERT_ID=6/*!*/;
968use test/*!*/;968use `test`/*!*/;
969SET TIMESTAMP=1579609943/*!*/;969SET TIMESTAMP=1579609943/*!*/;
970SET @@session.pseudo_thread_id=999999999/*!*/;970SET @@session.pseudo_thread_id=999999999/*!*/;
971SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;971SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -987,7 +987,7 @@
987/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;987/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
988DELIMITER /*!*/;988DELIMITER /*!*/;
989ROLLBACK/*!*/;989ROLLBACK/*!*/;
990use test/*!*/;990use `test`/*!*/;
991SET TIMESTAMP=1579609942/*!*/;991SET TIMESTAMP=1579609942/*!*/;
992SET @@session.pseudo_thread_id=999999999/*!*/;992SET @@session.pseudo_thread_id=999999999/*!*/;
993SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;993SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -1017,7 +1017,7 @@
1017/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;1017/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
1018DELIMITER /*!*/;1018DELIMITER /*!*/;
1019ROLLBACK/*!*/;1019ROLLBACK/*!*/;
1020use test/*!*/;1020use `test`/*!*/;
1021SET TIMESTAMP=1579609942/*!*/;1021SET TIMESTAMP=1579609942/*!*/;
1022SET @@session.pseudo_thread_id=999999999/*!*/;1022SET @@session.pseudo_thread_id=999999999/*!*/;
1023SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;1023SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
10241024
=== modified file 'Percona-Server/mysql-test/r/mysqlbinlog_row.result'
--- Percona-Server/mysql-test/r/mysqlbinlog_row.result 2008-09-06 04:49:43 +0000
+++ Percona-Server/mysql-test/r/mysqlbinlog_row.result 2012-12-30 12:40:31 +0000
@@ -336,7 +336,7 @@
336ROLLBACK/*!*/;336ROLLBACK/*!*/;
337# at #337# at #
338#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0338#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
339use test/*!*/;339use `test`/*!*/;
340SET TIMESTAMP=1000000000/*!*/;340SET TIMESTAMP=1000000000/*!*/;
341SET @@session.pseudo_thread_id=#/*!*/;341SET @@session.pseudo_thread_id=#/*!*/;
342SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;342SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
343343
=== modified file 'Percona-Server/mysql-test/r/mysqlbinlog_row_innodb.result'
--- Percona-Server/mysql-test/r/mysqlbinlog_row_innodb.result 2010-03-22 12:10:18 +0000
+++ Percona-Server/mysql-test/r/mysqlbinlog_row_innodb.result 2012-12-30 12:40:31 +0000
@@ -2253,7 +2253,7 @@
2253ROLLBACK/*!*/;2253ROLLBACK/*!*/;
2254# at #2254# at #
2255#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=02255#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
2256use test/*!*/;2256use `test`/*!*/;
2257SET TIMESTAMP=1000000000/*!*/;2257SET TIMESTAMP=1000000000/*!*/;
2258SET @@session.pseudo_thread_id=#/*!*/;2258SET @@session.pseudo_thread_id=#/*!*/;
2259SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;2259SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -3876,7 +3876,7 @@
3876ROLLBACK/*!*/;3876ROLLBACK/*!*/;
3877# at #3877# at #
3878#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=03878#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
3879use test/*!*/;3879use `test`/*!*/;
3880SET TIMESTAMP=1000000000/*!*/;3880SET TIMESTAMP=1000000000/*!*/;
3881SET @@session.pseudo_thread_id=#/*!*/;3881SET @@session.pseudo_thread_id=#/*!*/;
3882SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;3882SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -4243,7 +4243,7 @@
4243ROLLBACK/*!*/;4243ROLLBACK/*!*/;
4244# at #4244# at #
4245#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=04245#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
4246use test/*!*/;4246use `test`/*!*/;
4247SET TIMESTAMP=1000000000/*!*/;4247SET TIMESTAMP=1000000000/*!*/;
4248SET @@session.pseudo_thread_id=#/*!*/;4248SET @@session.pseudo_thread_id=#/*!*/;
4249SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;4249SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -4804,7 +4804,7 @@
4804ROLLBACK/*!*/;4804ROLLBACK/*!*/;
4805# at #4805# at #
4806#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=04806#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
4807use test/*!*/;4807use `test`/*!*/;
4808SET TIMESTAMP=1000000000/*!*/;4808SET TIMESTAMP=1000000000/*!*/;
4809SET @@session.pseudo_thread_id=#/*!*/;4809SET @@session.pseudo_thread_id=#/*!*/;
4810SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;4810SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
48114811
=== modified file 'Percona-Server/mysql-test/r/mysqlbinlog_row_myisam.result'
--- Percona-Server/mysql-test/r/mysqlbinlog_row_myisam.result 2008-09-06 04:49:43 +0000
+++ Percona-Server/mysql-test/r/mysqlbinlog_row_myisam.result 2012-12-30 12:40:31 +0000
@@ -2253,7 +2253,7 @@
2253ROLLBACK/*!*/;2253ROLLBACK/*!*/;
2254# at #2254# at #
2255#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=02255#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
2256use test/*!*/;2256use `test`/*!*/;
2257SET TIMESTAMP=1000000000/*!*/;2257SET TIMESTAMP=1000000000/*!*/;
2258SET @@session.pseudo_thread_id=#/*!*/;2258SET @@session.pseudo_thread_id=#/*!*/;
2259SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;2259SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -3898,7 +3898,7 @@
3898ROLLBACK/*!*/;3898ROLLBACK/*!*/;
3899# at #3899# at #
3900#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=03900#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
3901use test/*!*/;3901use `test`/*!*/;
3902SET TIMESTAMP=1000000000/*!*/;3902SET TIMESTAMP=1000000000/*!*/;
3903SET @@session.pseudo_thread_id=#/*!*/;3903SET @@session.pseudo_thread_id=#/*!*/;
3904SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;3904SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -4271,7 +4271,7 @@
4271ROLLBACK/*!*/;4271ROLLBACK/*!*/;
4272# at #4272# at #
4273#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=04273#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
4274use test/*!*/;4274use `test`/*!*/;
4275SET TIMESTAMP=1000000000/*!*/;4275SET TIMESTAMP=1000000000/*!*/;
4276SET @@session.pseudo_thread_id=#/*!*/;4276SET @@session.pseudo_thread_id=#/*!*/;
4277SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;4277SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -4842,7 +4842,7 @@
4842ROLLBACK/*!*/;4842ROLLBACK/*!*/;
4843# at #4843# at #
4844#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=04844#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
4845use test/*!*/;4845use `test`/*!*/;
4846SET TIMESTAMP=1000000000/*!*/;4846SET TIMESTAMP=1000000000/*!*/;
4847SET @@session.pseudo_thread_id=#/*!*/;4847SET @@session.pseudo_thread_id=#/*!*/;
4848SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;4848SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
48494849
=== modified file 'Percona-Server/mysql-test/r/mysqlbinlog_row_trans.result'
--- Percona-Server/mysql-test/r/mysqlbinlog_row_trans.result 2009-08-27 09:32:27 +0000
+++ Percona-Server/mysql-test/r/mysqlbinlog_row_trans.result 2012-12-30 12:40:31 +0000
@@ -132,7 +132,7 @@
132ROLLBACK/*!*/;132ROLLBACK/*!*/;
133# at #133# at #
134#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0134#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0
135use test/*!*/;135use `test`/*!*/;
136SET TIMESTAMP=1000000000/*!*/;136SET TIMESTAMP=1000000000/*!*/;
137SET @@session.pseudo_thread_id=#/*!*/;137SET @@session.pseudo_thread_id=#/*!*/;
138SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;138SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
139139
=== modified file 'Percona-Server/mysql-test/r/percona_server_variables_debug.result'
=== modified file 'Percona-Server/mysql-test/r/user_var-binlog.result'
--- Percona-Server/mysql-test/r/user_var-binlog.result 2008-04-02 09:49:22 +0000
+++ Percona-Server/mysql-test/r/user_var-binlog.result 2012-12-30 12:40:31 +0000
@@ -19,7 +19,7 @@
19DELIMITER /*!*/;19DELIMITER /*!*/;
20ROLLBACK/*!*/;20ROLLBACK/*!*/;
21SET @`a b`:=_latin1 0x68656C6C6F COLLATE `latin1_swedish_ci`/*!*/;21SET @`a b`:=_latin1 0x68656C6C6F COLLATE `latin1_swedish_ci`/*!*/;
22use test/*!*/;22use `test`/*!*/;
23SET TIMESTAMP=10000/*!*/;23SET TIMESTAMP=10000/*!*/;
24SET @@session.pseudo_thread_id=999999999/*!*/;24SET @@session.pseudo_thread_id=999999999/*!*/;
25SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;25SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
2626
=== modified file 'Percona-Server/mysql-test/r/variables.result'
--- Percona-Server/mysql-test/r/variables.result 2011-03-28 10:25:03 +0000
+++ Percona-Server/mysql-test/r/variables.result 2012-12-30 12:40:31 +0000
@@ -77,7 +77,7 @@
77id select_type table type possible_keys key key_len ref rows filtered Extra77id select_type table type possible_keys key key_len ref rows filtered Extra
781 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used781 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
79Warnings:79Warnings:
80Note 1003 select (@t1:=((@t2:=1) + (@t3:=4))) AS `@t1:=(@t2:=1)+@t3:=4`,(@t1) AS `@t1`,(@t2) AS `@t2`,(@t3) AS `@t3`80Note 1003 select (@t1:=((@t2:=1) + (@t3:=4))) AS `@t1:=(@t2:=1)+@t3:=4`,(@`t1`) AS `@t1`,(@`t2`) AS `@t2`,(@`t3`) AS `@t3`
81select @t5;81select @t5;
82@t582@t5
831.23456831.23456
8484
=== modified file 'Percona-Server/mysql-test/suite/binlog/r/binlog_base64_flag.result'
--- Percona-Server/mysql-test/suite/binlog/r/binlog_base64_flag.result 2011-02-23 09:31:37 +0000
+++ Percona-Server/mysql-test/suite/binlog/r/binlog_base64_flag.result 2012-12-30 12:40:31 +0000
@@ -35,7 +35,7 @@
35# at 435# at 4
36<#>ROLLBACK/*!*/;36<#>ROLLBACK/*!*/;
37# at 10237# at 102
38<#>use test/*!*/;38<#>use `test`/*!*/;
39SET TIMESTAMP=1196959712/*!*/;39SET TIMESTAMP=1196959712/*!*/;
40<#>SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;40<#>SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
41SET @@session.sql_mode=0/*!*/;41SET @@session.sql_mode=0/*!*/;
4242
=== modified file 'Percona-Server/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result'
--- Percona-Server/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result 2008-10-23 19:27:09 +0000
+++ Percona-Server/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result 2012-12-30 12:40:31 +0000
@@ -13,7 +13,7 @@
13DELIMITER /*!*/;13DELIMITER /*!*/;
14ROLLBACK/*!*/;14ROLLBACK/*!*/;
15SET @`v`:=_ucs2 0x006100620063 COLLATE `ucs2_general_ci`/*!*/;15SET @`v`:=_ucs2 0x006100620063 COLLATE `ucs2_general_ci`/*!*/;
16use test/*!*/;16use `test`/*!*/;
17SET TIMESTAMP=10000/*!*/;17SET TIMESTAMP=10000/*!*/;
18SET @@session.pseudo_thread_id=999999999/*!*/;18SET @@session.pseudo_thread_id=999999999/*!*/;
19SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;19SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
2020
=== modified file 'Percona-Server/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result'
--- Percona-Server/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result 2010-09-02 13:05:06 +0000
+++ Percona-Server/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result 2012-12-30 12:40:31 +0000
@@ -631,7 +631,7 @@
631master-bin.000001 # Intvar # # INSERT_ID=10631master-bin.000001 # Intvar # # INSERT_ID=10
632master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#632master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
633master-bin.000001 # Intvar # # INSERT_ID=10633master-bin.000001 # Intvar # # INSERT_ID=10
634master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @b) SET `b`=((@b) + `bug27417`(2)) ;file_id=#634master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @`b`) SET `b`=((@`b`) + `bug27417`(2)) ;file_id=#
635master-bin.000001 # Query # # ROLLBACK635master-bin.000001 # Query # # ROLLBACK
636/* the output must denote there is the query */;636/* the output must denote there is the query */;
637drop trigger trg_del_t2;637drop trigger trg_del_t2;
@@ -869,7 +869,7 @@
869master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#869master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
870master-bin.000001 # Intvar # # INSERT_ID=10870master-bin.000001 # Intvar # # INSERT_ID=10
871master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci871master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci
872master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @b) SET `b`=((@b) + `bug27417`(2)) ;file_id=#872master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE `t4` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @`b`) SET `b`=((@`b`) + `bug27417`(2)) ;file_id=#
873master-bin.000001 # Query # # ROLLBACK873master-bin.000001 # Query # # ROLLBACK
874drop trigger trg_del_t2;874drop trigger trg_del_t2;
875drop table t1,t2,t3,t4,t5;875drop table t1,t2,t3,t4,t5;
876876
=== added file 'Percona-Server/mysql-test/suite/rpl/r/rpl_mdev382.result'
--- Percona-Server/mysql-test/suite/rpl/r/rpl_mdev382.result 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/suite/rpl/r/rpl_mdev382.result 2012-12-30 12:40:31 +0000
@@ -0,0 +1,275 @@
1include/master-slave.inc
2[connection master]
3create table t1 (a int primary key) engine=innodb;
4create table t2 (a int primary key) engine=myisam;
5begin;
6insert into t1 values (1);
7SET sql_mode = 'ANSI_QUOTES';
8savepoint `a``; create database couldbebadthingshere; savepoint ``dummy`;
9insert into t1 values (2);
10insert into t2 values (1);
11SET sql_mode = '';
12rollback to savepoint `a``; create database couldbebadthingshere; savepoint ``dummy`;
13Warnings:
14Warning 1196 Some non-transactional changed tables couldn't be rolled back
15insert into t1 values (3);
16commit;
17show binlog events from <binlog_start>;
18Log_name Pos Event_type Server_id End_log_pos Info
19master-bin.000001 # Query # # use `test`; create table t1 (a int primary key) engine=innodb
20master-bin.000001 # Query # # use `test`; create table t2 (a int primary key) engine=myisam
21master-bin.000001 # Query # # BEGIN
22master-bin.000001 # Query # # use `test`; insert into t1 values (1)
23master-bin.000001 # Query # # SAVEPOINT "a`; create database couldbebadthingshere; savepoint `dummy"
24master-bin.000001 # Query # # use `test`; insert into t1 values (2)
25master-bin.000001 # Query # # use `test`; insert into t2 values (1)
26master-bin.000001 # Query # # ROLLBACK TO `a``; create database couldbebadthingshere; savepoint ``dummy`
27master-bin.000001 # Query # # use `test`; insert into t1 values (3)
28master-bin.000001 # Xid # # COMMIT /* XID */
29BEGIN;
30insert into t1 values(10);
31set sql_mode = 'ANSI_QUOTES';
32set sql_quote_show_create = 1;
33savepoint a;
34insert into t1 values(11);
35savepoint "a""a";
36insert into t1 values(12);
37set sql_quote_show_create = 0;
38savepoint b;
39insert into t1 values(13);
40savepoint "b""b";
41insert into t1 values(14);
42set sql_mode = '';
43set sql_quote_show_create = 1;
44savepoint c;
45insert into t1 values(15);
46savepoint `c``c`;
47insert into t1 values(16);
48set sql_quote_show_create = 0;
49savepoint d;
50insert into t1 values(17);
51savepoint `d``d`;
52insert into t1 values(18);
53COMMIT;
54set sql_quote_show_create = 1;
55show binlog events from <binlog_start>;
56Log_name Pos Event_type Server_id End_log_pos Info
57master-bin.000001 # Query # # BEGIN
58master-bin.000001 # Query # # use `test`; insert into t1 values(10)
59master-bin.000001 # Query # # SAVEPOINT "a"
60master-bin.000001 # Query # # use `test`; insert into t1 values(11)
61master-bin.000001 # Query # # SAVEPOINT "a""a"
62master-bin.000001 # Query # # use `test`; insert into t1 values(12)
63master-bin.000001 # Query # # SAVEPOINT b
64master-bin.000001 # Query # # use `test`; insert into t1 values(13)
65master-bin.000001 # Query # # SAVEPOINT "b""b"
66master-bin.000001 # Query # # use `test`; insert into t1 values(14)
67master-bin.000001 # Query # # SAVEPOINT `c`
68master-bin.000001 # Query # # use `test`; insert into t1 values(15)
69master-bin.000001 # Query # # SAVEPOINT `c``c`
70master-bin.000001 # Query # # use `test`; insert into t1 values(16)
71master-bin.000001 # Query # # SAVEPOINT d
72master-bin.000001 # Query # # use `test`; insert into t1 values(17)
73master-bin.000001 # Query # # SAVEPOINT `d``d`
74master-bin.000001 # Query # # use `test`; insert into t1 values(18)
75master-bin.000001 # Xid # # COMMIT /* XID */
76*** Test correct USE statement in SHOW BINLOG EVENTS ***
77set sql_mode = 'ANSI_QUOTES';
78CREATE DATABASE "db1`; SELECT 'oops!'";
79use "db1`; SELECT 'oops!'";
80CREATE TABLE t1 (a INT PRIMARY KEY) engine=MyISAM;
81INSERT INTO t1 VALUES (1);
82set sql_mode = '';
83INSERT INTO t1 VALUES (2);
84set sql_mode = 'ANSI_QUOTES';
85show binlog events from <binlog_start>;
86Log_name Pos Event_type Server_id End_log_pos Info
87master-bin.000001 # Query # # CREATE DATABASE "db1`; SELECT 'oops!'"
88master-bin.000001 # Query # # use "db1`; SELECT 'oops!'"; CREATE TABLE t1 (a INT PRIMARY KEY) engine=MyISAM
89master-bin.000001 # Query # # use "db1`; SELECT 'oops!'"; INSERT INTO t1 VALUES (1)
90master-bin.000001 # Query # # use "db1`; SELECT 'oops!'"; INSERT INTO t1 VALUES (2)
91set sql_mode = '';
92set sql_quote_show_create = 0;
93show binlog events from <binlog_start>;
94Log_name Pos Event_type Server_id End_log_pos Info
95master-bin.000001 # Query # # CREATE DATABASE "db1`; SELECT 'oops!'"
96master-bin.000001 # Query # # use `db1``; SELECT 'oops!'`; CREATE TABLE t1 (a INT PRIMARY KEY) engine=MyISAM
97master-bin.000001 # Query # # use `db1``; SELECT 'oops!'`; INSERT INTO t1 VALUES (1)
98master-bin.000001 # Query # # use `db1``; SELECT 'oops!'`; INSERT INTO t1 VALUES (2)
99set sql_quote_show_create = 1;
100show binlog events from <binlog_start>;
101Log_name Pos Event_type Server_id End_log_pos Info
102master-bin.000001 # Query # # CREATE DATABASE "db1`; SELECT 'oops!'"
103master-bin.000001 # Query # # use `db1``; SELECT 'oops!'`; CREATE TABLE t1 (a INT PRIMARY KEY) engine=MyISAM
104master-bin.000001 # Query # # use `db1``; SELECT 'oops!'`; INSERT INTO t1 VALUES (1)
105master-bin.000001 # Query # # use `db1``; SELECT 'oops!'`; INSERT INTO t1 VALUES (2)
106DROP TABLE t1;
107use test;
108***Test LOAD DATA INFILE with various identifiers that need correct quoting ***
109use `db1``; SELECT 'oops!'`;
110set timestamp=1000000000;
111CREATE TABLE `t``1` (`a``1` VARCHAR(4) PRIMARY KEY, `b``2` VARCHAR(3),
112`c``3` VARCHAR(7));
113LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/f''le.txt' INTO TABLE `t``1`
114 FIELDS TERMINATED BY ',' ESCAPED BY '\\' ENCLOSED BY ''''
115 LINES TERMINATED BY '\n'
116 (`a``1`, @`b```) SET `b``2` = @`b```, `c``3` = concat('|', "b""a'z", "!");
117SELECT * FROM `t``1`;
118a`1 b`2 c`3
119fo\o bar |b"a'z!
120truncate `t``1`;
121use test;
122LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/f''le.txt'
123 INTO TABLE `db1``; SELECT 'oops!'`.`t``1`
124 FIELDS TERMINATED BY ',' ESCAPED BY '\\' ENCLOSED BY ''''
125 LINES TERMINATED BY '\n'
126 (`a``1`, `b``2`) SET `c``3` = concat('|', "b""a'z", "!");
127SELECT * FROM `db1``; SELECT 'oops!'`.`t``1`;
128a`1 b`2 c`3
129fo\o bar |b"a'z!
130show binlog events from <binlog_start>;
131Log_name Pos Event_type Server_id End_log_pos Info
132master-bin.000001 # Query # # use `db1``; SELECT 'oops!'`; CREATE TABLE `t``1` (`a``1` VARCHAR(4) PRIMARY KEY, `b``2` VARCHAR(3),
133`c``3` VARCHAR(7))
134master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
135master-bin.000001 # Execute_load_query # # use `db1``; SELECT 'oops!'`; LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/f\'le.txt' INTO TABLE `t``1` FIELDS TERMINATED BY ',' ENCLOSED BY '\'' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a``1`, @`b```) SET `b``2`=(@`b```), `c``3`=concat('|','b"a\'z','!') ;file_id=#
136master-bin.000001 # Query # # use `db1``; SELECT 'oops!'`; truncate `t``1`
137master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
138master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/f\'le.txt' INTO TABLE `db1``; SELECT 'oops!'`.`t``1` FIELDS TERMINATED BY ',' ENCLOSED BY '\'' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a``1`, `b``2`) SET `c``3`=concat('|','b"a\'z','!') ;file_id=#
139/*!40019 SET @@session.max_insert_delayed_threads=0*/;
140/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
141DELIMITER /*!*/;
142ROLLBACK/*!*/;
143use `db1``; SELECT 'oops!'`/*!*/;
144SET TIMESTAMP=1000000000/*!*/;
145SET @@session.pseudo_thread_id=999999999/*!*/;
146SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
147SET @@session.sql_mode=0/*!*/;
148SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
149/*!\C latin1 *//*!*/;
150SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
151SET @@session.lc_time_names=0/*!*/;
152SET @@session.collation_database=DEFAULT/*!*/;
153CREATE TABLE `t``1` (`a``1` VARCHAR(4) PRIMARY KEY, `b``2` VARCHAR(3),
154`c``3` VARCHAR(7))
155/*!*/;
156SET TIMESTAMP=1000000000/*!*/;
157LOAD DATA LOCAL INFILE '<name>' INTO TABLE `t``1` FIELDS TERMINATED BY ',' ENCLOSED BY '\'' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a``1`, @`b```) SET `b``2`=(@`b```), `c``3`=concat('|','b"a\'z','!')
158/*!*/;
159SET TIMESTAMP=1000000000/*!*/;
160truncate `t``1`
161/*!*/;
162use `test`/*!*/;
163SET TIMESTAMP=1000000000/*!*/;
164LOAD DATA LOCAL INFILE '<name>' INTO TABLE `db1``; SELECT 'oops!'`.`t``1` FIELDS TERMINATED BY ',' ENCLOSED BY '\'' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a``1`, `b``2`) SET `c``3`=concat('|','b"a\'z','!')
165/*!*/;
166DELIMITER ;
167# End of log file
168ROLLBACK /* added by mysqlbinlog */;
169/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
170SELECT * FROM `db1``; SELECT 'oops!'`.`t``1`;
171a`1 b`2 c`3
172fo\o bar |b"a'z!
173DROP TABLE `db1``; SELECT 'oops!'`.`t``1`;
174drop table t1,t2;
175*** Test truncation of long SET expression in LOAD DATA ***
176CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(1000));
177LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/file.txt' INTO TABLE t1
178FIELDS TERMINATED BY ','
179 (a, @b) SET b = CONCAT(@b, '| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|', @b);
180SELECT * FROM t1 ORDER BY a;
181a b
1821 X| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|X
1832 A| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|A
184show binlog events from <binlog_start>;
185Log_name Pos Event_type Server_id End_log_pos Info
186master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=#
187master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/file.txt' INTO TABLE `t1` FIELDS TERMINATED BY ',' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @`b`) SET `b`=concat((@`b`),'| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|',(@`b`)) ;file_id=#
188SELECT * FROM t1 ORDER BY a;
189a b
1901 X| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|X
1912 A| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|A
192DROP TABLE t1;
193*** Test user variables whose names require correct quoting ***
194use `db1``; SELECT 'oops!'`;
195CREATE TABLE t1 (a1 BIGINT PRIMARY KEY, a2 BIGINT, a3 BIGINT, a4 BIGINT UNSIGNED, b DOUBLE, c DECIMAL(65,10), d VARCHAR(100));
196INSERT INTO t1 VALUES (-9223372036854775808,42,9223372036854775807,18446744073709551615,-1234560123456789e110, -1234501234567890123456789012345678901234567890123456789.0123456789, REPEAT("x", 100));
197SELECT @`a``1`:=a1, @`a``2`:=a2, @`a``3`:=a3, @`a``4`:=a4, @`b```:=b, @```c`:=c, @```d```:=d FROM t1;
198@`a``1`:=a1 @`a``2`:=a2 @`a``3`:=a3 @`a``4`:=a4 @`b```:=b @```c`:=c @```d```:=d
199-9223372036854775808 42 9223372036854775807 18446744073709551615 -1.23456012345679e+125 -1234501234567890123456789012345678901234567890123456789.0123456789 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
200INSERT INTO t1 VALUES (@`a``1`+1, @`a``2`*100, @`a``3`-1, @`a``4`-1, @`b```/2, @```c`, substr(@```d```, 2, 98));
201show binlog events from <binlog_start>;
202Log_name Pos Event_type Server_id End_log_pos Info
203master-bin.000001 # Query # # use `db1``; SELECT 'oops!'`; CREATE TABLE t1 (a1 BIGINT PRIMARY KEY, a2 BIGINT, a3 BIGINT, a4 BIGINT UNSIGNED, b DOUBLE, c DECIMAL(65,10), d VARCHAR(100))
204master-bin.000001 # Query # # use `db1``; SELECT 'oops!'`; INSERT INTO t1 VALUES (-9223372036854775808,42,9223372036854775807,18446744073709551615,-1234560123456789e110, -1234501234567890123456789012345678901234567890123456789.0123456789, REPEAT("x", 100))
205master-bin.000001 # User var # # @`a``1`=-9223372036854775808
206master-bin.000001 # User var # # @`a``2`=42
207master-bin.000001 # User var # # @`a``3`=9223372036854775807
208master-bin.000001 # User var # # @`a``4`=-1
209master-bin.000001 # User var # # @`b```=-1.2345601234568e+125
210master-bin.000001 # User var # # @```c`=-1234501234567890123456789012345678901234567890123456789.0123456789
211master-bin.000001 # User var # # @```d```=_latin1 0x78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878 COLLATE latin1_swedish_ci
212master-bin.000001 # Query # # use `db1``; SELECT 'oops!'`; INSERT INTO t1 VALUES (@`a``1`+1, @`a``2`*100, @`a``3`-1, @`a``4`-1, @`b```/2, @```c`, substr(@```d```, 2, 98))
213/*!40019 SET @@session.max_insert_delayed_threads=0*/;
214/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
215DELIMITER /*!*/;
216ROLLBACK/*!*/;
217use `db1``; SELECT 'oops!'`/*!*/;
218SET TIMESTAMP=1000000000/*!*/;
219SET @@session.pseudo_thread_id=999999999/*!*/;
220SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
221SET @@session.sql_mode=0/*!*/;
222SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
223/*!\C latin1 *//*!*/;
224SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
225SET @@session.lc_time_names=0/*!*/;
226SET @@session.collation_database=DEFAULT/*!*/;
227CREATE TABLE t1 (a1 BIGINT PRIMARY KEY, a2 BIGINT, a3 BIGINT, a4 BIGINT UNSIGNED, b DOUBLE, c DECIMAL(65,10), d VARCHAR(100))
228/*!*/;
229SET TIMESTAMP=1000000000/*!*/;
230INSERT INTO t1 VALUES (-9223372036854775808,42,9223372036854775807,18446744073709551615,-1234560123456789e110, -1234501234567890123456789012345678901234567890123456789.0123456789, REPEAT("x", 100))
231/*!*/;
232SET @`a``1`:=-9223372036854775808/*!*/;
233SET @`a``2`:=42/*!*/;
234SET @`a``3`:=9223372036854775807/*!*/;
235SET @`a``4`:=-1/*!*/;
236SET @`b```:=-1.2345601234568e+125/*!*/;
237SET @```c`:=-1234501234567890123456789012345678901234567890123456789.0123456789/*!*/;
238SET @```d```:=_latin1 0x78787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878 COLLATE `latin1_swedish_ci`/*!*/;
239SET TIMESTAMP=1000000000/*!*/;
240INSERT INTO t1 VALUES (@`a``1`+1, @`a``2`*100, @`a``3`-1, @`a``4`-1, @`b```/2, @```c`, substr(@```d```, 2, 98))
241/*!*/;
242DELIMITER ;
243# End of log file
244ROLLBACK /* added by mysqlbinlog */;
245/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
246SELECT * FROM `db1``; SELECT 'oops!'`.t1 ORDER BY a1;
247a1 a2 a3 a4 b c d
248-9223372036854775808 42 9223372036854775807 18446744073709551615 -1.23456012345679e+125 -1234501234567890123456789012345678901234567890123456789.0123456789 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
249-9223372036854775807 4200 9223372036854775806 0 -6.17280061728394e+124 -1234501234567890123456789012345678901234567890123456789.0123456789 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
250DROP TABLE t1;
251*** Test correct quoting of DELETE FROM statement binlogged for HEAP table that is emptied due to server restart
252include/stop_slave.inc
253CREATE TABLE `db1``; SELECT 'oops!'`.`t``1` (`a``` INT PRIMARY KEY) ENGINE=heap;
254INSERT INTO `db1``; SELECT 'oops!'`.`t``1` VALUES (1), (2), (5);
255SELECT * FROM `db1``; SELECT 'oops!'`.`t``1` ORDER BY 1;
256a`
2571
2582
2595
260set timestamp=1000000000;
261# The table should be empty on the master.
262SELECT * FROM `db1``; SELECT 'oops!'`.`t``1`;
263a`
264# The DELETE statement should be correctly quoted
265show binlog events in 'master-bin.000002' from <binlog_start>;
266Log_name Pos Event_type Server_id End_log_pos Info
267master-bin.000002 # Query # # use `test`; DELETE FROM `db1``; SELECT 'oops!'`.`t``1`
268include/start_slave.inc
269# The table should be empty on the slave also.
270SELECT * FROM `db1``; SELECT 'oops!'`.`t``1`;
271a`
272DROP TABLE `db1``; SELECT 'oops!'`.`t``1`;
273use test;
274DROP DATABASE `db1``; SELECT 'oops!'`;
275include/rpl_end.inc
0276
=== modified file 'Percona-Server/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result'
--- Percona-Server/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result 2010-12-19 17:07:28 +0000
+++ Percona-Server/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result 2012-12-30 12:40:31 +0000
@@ -153,7 +153,7 @@
153/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;153/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
154DELIMITER /*!*/;154DELIMITER /*!*/;
155ROLLBACK/*!*/;155ROLLBACK/*!*/;
156use test/*!*/;156use `test`/*!*/;
157SET TIMESTAMP=1000000000/*!*/;157SET TIMESTAMP=1000000000/*!*/;
158SET @@session.pseudo_thread_id=999999999/*!*/;158SET @@session.pseudo_thread_id=999999999/*!*/;
159SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;159SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -175,7 +175,7 @@
175/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;175/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
176DELIMITER /*!*/;176DELIMITER /*!*/;
177ROLLBACK/*!*/;177ROLLBACK/*!*/;
178use test/*!*/;178use `test`/*!*/;
179SET TIMESTAMP=1000000000/*!*/;179SET TIMESTAMP=1000000000/*!*/;
180SET @@session.pseudo_thread_id=999999999/*!*/;180SET @@session.pseudo_thread_id=999999999/*!*/;
181SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;181SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -284,7 +284,7 @@
284/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;284/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
285DELIMITER /*!*/;285DELIMITER /*!*/;
286ROLLBACK/*!*/;286ROLLBACK/*!*/;
287use test/*!*/;287use `test`/*!*/;
288SET TIMESTAMP=1000000000/*!*/;288SET TIMESTAMP=1000000000/*!*/;
289SET @@session.pseudo_thread_id=999999999/*!*/;289SET @@session.pseudo_thread_id=999999999/*!*/;
290SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;290SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
@@ -316,7 +316,7 @@
316/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;316/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
317DELIMITER /*!*/;317DELIMITER /*!*/;
318ROLLBACK/*!*/;318ROLLBACK/*!*/;
319use test/*!*/;319use `test`/*!*/;
320SET TIMESTAMP=1000000000/*!*/;320SET TIMESTAMP=1000000000/*!*/;
321SET @@session.pseudo_thread_id=999999999/*!*/;321SET @@session.pseudo_thread_id=999999999/*!*/;
322SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;322SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
323323
=== modified file 'Percona-Server/mysql-test/suite/rpl/r/rpl_sp.result'
--- Percona-Server/mysql-test/suite/rpl/r/rpl_sp.result 2010-12-19 17:07:28 +0000
+++ Percona-Server/mysql-test/suite/rpl/r/rpl_sp.result 2012-12-30 12:40:31 +0000
@@ -627,7 +627,7 @@
627SET TIMESTAMP=t/*!*/;627SET TIMESTAMP=t/*!*/;
628create database mysqltest1628create database mysqltest1
629/*!*/;629/*!*/;
630use mysqltest1/*!*/;630use `mysqltest1`/*!*/;
631SET TIMESTAMP=t/*!*/;631SET TIMESTAMP=t/*!*/;
632create table t1 (a varchar(100))632create table t1 (a varchar(100))
633/*!*/;633/*!*/;
@@ -840,7 +840,7 @@
840SET TIMESTAMP=t/*!*/;840SET TIMESTAMP=t/*!*/;
841drop user "zedjzlcsjhd"@127.0.0.1841drop user "zedjzlcsjhd"@127.0.0.1
842/*!*/;842/*!*/;
843use test/*!*/;843use `test`/*!*/;
844SET TIMESTAMP=t/*!*/;844SET TIMESTAMP=t/*!*/;
845drop function if exists f1845drop function if exists f1
846/*!*/;846/*!*/;
@@ -925,7 +925,7 @@
925SET TIMESTAMP=t/*!*/;925SET TIMESTAMP=t/*!*/;
926create database mysqltest2926create database mysqltest2
927/*!*/;927/*!*/;
928use mysqltest2/*!*/;928use `mysqltest2`/*!*/;
929SET TIMESTAMP=t/*!*/;929SET TIMESTAMP=t/*!*/;
930create table t ( t integer )930create table t ( t integer )
931/*!*/;931/*!*/;
@@ -943,7 +943,7 @@
943return 0;943return 0;
944end944end
945/*!*/;945/*!*/;
946use mysqltest/*!*/;946use `mysqltest`/*!*/;
947SET TIMESTAMP=t/*!*/;947SET TIMESTAMP=t/*!*/;
948SELECT `mysqltest2`.`f1`()948SELECT `mysqltest2`.`f1`()
949/*!*/;949/*!*/;
@@ -953,14 +953,14 @@
953SET TIMESTAMP=t/*!*/;953SET TIMESTAMP=t/*!*/;
954drop database mysqltest2954drop database mysqltest2
955/*!*/;955/*!*/;
956use test/*!*/;956use `test`/*!*/;
957SET TIMESTAMP=t/*!*/;957SET TIMESTAMP=t/*!*/;
958CREATE DEFINER=`root`@`localhost` PROCEDURE `mysqltestbug36570_p1`()958CREATE DEFINER=`root`@`localhost` PROCEDURE `mysqltestbug36570_p1`()
959begin959begin
960select 1;960select 1;
961end961end
962/*!*/;962/*!*/;
963use mysql/*!*/;963use `mysql`/*!*/;
964SET TIMESTAMP=t/*!*/;964SET TIMESTAMP=t/*!*/;
965CREATE DEFINER=`root`@`localhost` PROCEDURE `test`.` mysqltestbug36570_p2`( a int)965CREATE DEFINER=`root`@`localhost` PROCEDURE `test`.` mysqltestbug36570_p2`( a int)
966`label`:966`label`:
967967
=== added file 'Percona-Server/mysql-test/suite/rpl/t/rpl_mdev382.test'
--- Percona-Server/mysql-test/suite/rpl/t/rpl_mdev382.test 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/suite/rpl/t/rpl_mdev382.test 2012-12-30 12:40:31 +0000
@@ -0,0 +1,249 @@
1--source include/have_innodb.inc
2--source include/not_windows.inc
3--source include/have_binlog_format_statement.inc
4--source include/master-slave.inc
5
6# MDEV-382: multiple SQL injections in replication code.
7
8# Test previous SQL injection attack against binlog for SAVEPOINT statement.
9# The test would cause syntax error on slave due to improper quoting of
10# the savepoint name.
11connection master;
12create table t1 (a int primary key) engine=innodb;
13create table t2 (a int primary key) engine=myisam;
14
15begin;
16insert into t1 values (1);
17SET sql_mode = 'ANSI_QUOTES';
18savepoint `a``; create database couldbebadthingshere; savepoint ``dummy`;
19insert into t1 values (2);
20insert into t2 values (1);
21SET sql_mode = '';
22rollback to savepoint `a``; create database couldbebadthingshere; savepoint ``dummy`;
23insert into t1 values (3);
24commit;
25
26--source include/show_binlog_events.inc
27
28# This failed due to syntax error in query when the bug was not fixed.
29sync_slave_with_master;
30connection slave;
31
32# Test some more combinations of ANSI_QUOTES and sql_quote_show_create
33connection master;
34let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
35BEGIN;
36insert into t1 values(10);
37set sql_mode = 'ANSI_QUOTES';
38set sql_quote_show_create = 1;
39savepoint a;
40insert into t1 values(11);
41savepoint "a""a";
42insert into t1 values(12);
43set sql_quote_show_create = 0;
44savepoint b;
45insert into t1 values(13);
46savepoint "b""b";
47insert into t1 values(14);
48set sql_mode = '';
49set sql_quote_show_create = 1;
50savepoint c;
51insert into t1 values(15);
52savepoint `c``c`;
53insert into t1 values(16);
54set sql_quote_show_create = 0;
55savepoint d;
56insert into t1 values(17);
57savepoint `d``d`;
58insert into t1 values(18);
59COMMIT;
60set sql_quote_show_create = 1;
61
62--source include/show_binlog_events.inc
63
64--echo *** Test correct USE statement in SHOW BINLOG EVENTS ***
65connection master;
66let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
67set sql_mode = 'ANSI_QUOTES';
68CREATE DATABASE "db1`; SELECT 'oops!'";
69use "db1`; SELECT 'oops!'";
70CREATE TABLE t1 (a INT PRIMARY KEY) engine=MyISAM;
71INSERT INTO t1 VALUES (1);
72set sql_mode = '';
73INSERT INTO t1 VALUES (2);
74set sql_mode = 'ANSI_QUOTES';
75--source include/show_binlog_events.inc
76set sql_mode = '';
77set sql_quote_show_create = 0;
78--source include/show_binlog_events.inc
79set sql_quote_show_create = 1;
80--source include/show_binlog_events.inc
81DROP TABLE t1;
82
83use test;
84
85--echo ***Test LOAD DATA INFILE with various identifiers that need correct quoting ***
86
87--let $load_file= $MYSQLTEST_VARDIR/tmp/f'le.txt
88--write_file $load_file
89'fo\\o','bar'
90EOF
91--exec chmod go+r "$load_file"
92
93use `db1``; SELECT 'oops!'`;
94let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
95set timestamp=1000000000;
96CREATE TABLE `t``1` (`a``1` VARCHAR(4) PRIMARY KEY, `b``2` VARCHAR(3),
97 `c``3` VARCHAR(7));
98--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
99eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/f''le.txt' INTO TABLE `t``1`
100 FIELDS TERMINATED BY ',' ESCAPED BY '\\\\' ENCLOSED BY ''''
101 LINES TERMINATED BY '\\n'
102 (`a``1`, @`b```) SET `b``2` = @`b```, `c``3` = concat('|', "b""a'z", "!");
103
104SELECT * FROM `t``1`;
105# Also test when code prefixes table name with database.
106truncate `t``1`;
107use test;
108--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
109eval LOAD DATA INFILE '$MYSQLTEST_VARDIR/tmp/f''le.txt'
110 INTO TABLE `db1``; SELECT 'oops!'`.`t``1`
111 FIELDS TERMINATED BY ',' ESCAPED BY '\\\\' ENCLOSED BY ''''
112 LINES TERMINATED BY '\\n'
113 (`a``1`, `b``2`) SET `c``3` = concat('|', "b""a'z", "!");
114SELECT * FROM `db1``; SELECT 'oops!'`.`t``1`;
115let $pos2= query_get_value(SHOW MASTER STATUS, Position, 1);
116
117--source include/show_binlog_events.inc
118let $MYSQLD_DATADIR= `select @@datadir`;
119--replace_regex /LOCAL INFILE '.*SQL_LOAD.*' INTO/LOCAL INFILE '<name>' INTO/
120--exec $MYSQL_BINLOG --short-form --start-position=$binlog_start --stop-position=$pos2 $MYSQLD_DATADIR/master-bin.000001
121
122sync_slave_with_master;
123connection slave;
124SELECT * FROM `db1``; SELECT 'oops!'`.`t``1`;
125connection master;
126
127DROP TABLE `db1``; SELECT 'oops!'`.`t``1`;
128--remove_file $load_file
129
130connection master;
131drop table t1,t2;
132
133
134--echo *** Test truncation of long SET expression in LOAD DATA ***
135CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(1000));
136--let $load_file= $MYSQLTEST_VARDIR/tmp/file.txt
137--write_file $load_file
1381,X
1392,A
140EOF
141--exec chmod go+r "$load_file"
142
143let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
144# The bug was that the SET expression was truncated to 256 bytes, so test with
145# an expression longer than that.
146--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
147eval LOAD DATA INFILE '$load_file' INTO TABLE t1
148 FIELDS TERMINATED BY ','
149 (a, @b) SET b = CONCAT(@b, '| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|', @b);
150
151SELECT * FROM t1 ORDER BY a;
152--source include/show_binlog_events.inc
153
154sync_slave_with_master;
155connection slave;
156SELECT * FROM t1 ORDER BY a;
157
158connection master;
159--remove_file $load_file
160DROP TABLE t1;
161
162
163--echo *** Test user variables whose names require correct quoting ***
164use `db1``; SELECT 'oops!'`;
165let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
166CREATE TABLE t1 (a1 BIGINT PRIMARY KEY, a2 BIGINT, a3 BIGINT, a4 BIGINT UNSIGNED, b DOUBLE, c DECIMAL(65,10), d VARCHAR(100));
167INSERT INTO t1 VALUES (-9223372036854775808,42,9223372036854775807,18446744073709551615,-1234560123456789e110, -1234501234567890123456789012345678901234567890123456789.0123456789, REPEAT("x", 100));
168SELECT @`a``1`:=a1, @`a``2`:=a2, @`a``3`:=a3, @`a``4`:=a4, @`b```:=b, @```c`:=c, @```d```:=d FROM t1;
169INSERT INTO t1 VALUES (@`a``1`+1, @`a``2`*100, @`a``3`-1, @`a``4`-1, @`b```/2, @```c`, substr(@```d```, 2, 98));
170let $pos2= query_get_value(SHOW MASTER STATUS, Position, 1);
171
172--source include/show_binlog_events.inc
173
174--exec $MYSQL_BINLOG --short-form --start-position=$binlog_start --stop-position=$pos2 $MYSQLD_DATADIR/master-bin.000001
175
176sync_slave_with_master;
177connection slave;
178SELECT * FROM `db1``; SELECT 'oops!'`.t1 ORDER BY a1;
179
180connection master;
181DROP TABLE t1;
182
183
184--echo *** Test correct quoting of DELETE FROM statement binlogged for HEAP table that is emptied due to server restart
185
186# Let's keep the slave stopped during master restart, to avoid any potential
187# races between slave reconnect and master restart.
188connection slave;
189--source include/stop_slave.inc
190
191connection master;
192CREATE TABLE `db1``; SELECT 'oops!'`.`t``1` (`a``` INT PRIMARY KEY) ENGINE=heap;
193INSERT INTO `db1``; SELECT 'oops!'`.`t``1` VALUES (1), (2), (5);
194SELECT * FROM `db1``; SELECT 'oops!'`.`t``1` ORDER BY 1;
195
196# Restart the master mysqld.
197# This will cause an implicit truncation of the memory-based table, which will
198# cause logging of an explicit DELETE FROM to binlog.
199--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
200wait-rpl_mdev382.test
201EOF
202
203--shutdown_server 30
204
205--remove_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
206--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
207restart-rpl_mdev382.test
208EOF
209
210connection default;
211--enable_reconnect
212--source include/wait_until_connected_again.inc
213# rpl_end.inc needs to use the connection server_1
214connection server_1;
215--enable_reconnect
216--source include/wait_until_connected_again.inc
217connection master;
218--enable_reconnect
219--source include/wait_until_connected_again.inc
220set timestamp=1000000000;
221
222--echo # The table should be empty on the master.
223let $binlog_file= master-bin.000002;
224let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1);
225SELECT * FROM `db1``; SELECT 'oops!'`.`t``1`;
226
227--echo # The DELETE statement should be correctly quoted
228--source include/show_binlog_events.inc
229
230connection slave;
231--source include/start_slave.inc
232
233connection master;
234sync_slave_with_master;
235connection slave;
236--echo # The table should be empty on the slave also.
237SELECT * FROM `db1``; SELECT 'oops!'`.`t``1`;
238
239connection master;
240DROP TABLE `db1``; SELECT 'oops!'`.`t``1`;
241sync_slave_with_master;
242
243
244connection master;
245use test;
246DROP DATABASE `db1``; SELECT 'oops!'`;
247
248
249--source include/rpl_end.inc
0250
=== modified file 'Percona-Server/sql/ha_ndbcluster_binlog.cc'
--- Percona-Server/sql/ha_ndbcluster_binlog.cc 2011-07-03 15:47:37 +0000
+++ Percona-Server/sql/ha_ndbcluster_binlog.cc 2012-12-30 12:40:31 +0000
@@ -1268,7 +1268,9 @@
1268 DBUG_RETURN(0);1268 DBUG_RETURN(0);
1269 }1269 }
12701270
1271 char tmp_buf2[FN_REFLEN];1271 char tmp_buf2_mem[FN_REFLEN];
1272 String tmp_buf2(tmp_buf2_mem, sizeof(tmp_buf2_mem), system_charset_info);
1273 tmp_buf2.length(0);
1272 const char *type_str;1274 const char *type_str;
1273 switch (type)1275 switch (type)
1274 {1276 {
@@ -1277,17 +1279,24 @@
1277 if (thd->lex->sql_command == SQLCOM_DROP_DB)1279 if (thd->lex->sql_command == SQLCOM_DROP_DB)
1278 DBUG_RETURN(0);1280 DBUG_RETURN(0);
1279 /* redo the drop table query as is may contain several tables */1281 /* redo the drop table query as is may contain several tables */
1280 query= tmp_buf2;1282 tmp_buf2.append(STRING_WITH_LEN("drop table "));
1281 query_length= (uint) (strxmov(tmp_buf2, "drop table `",1283 append_identifier(thd, &tmp_buf2, table_name, strlen(table_name));
1282 table_name, "`", NullS) - tmp_buf2);1284 query= tmp_buf2.c_ptr_safe();
1285 query_length= tmp_buf2.length();
1283 type_str= "drop table";1286 type_str= "drop table";
1284 break;1287 break;
1285 case SOT_RENAME_TABLE:1288 case SOT_RENAME_TABLE:
1286 /* redo the rename table query as is may contain several tables */1289 /* redo the rename table query as is may contain several tables */
1287 query= tmp_buf2;1290 tmp_buf2.append(STRING_WITH_LEN("rename table "));
1288 query_length= (uint) (strxmov(tmp_buf2, "rename table `",1291 append_identifier(thd, &tmp_buf2, db, strlen(db));
1289 db, ".", table_name, "` to `",1292 tmp_buf2.append(STRING_WITH_LEN("."));
1290 new_db, ".", new_table_name, "`", NullS) - tmp_buf2);1293 append_identifier(thd, &tmp_buf2, table_name, strlen(table_name));
1294 tmp_buf2.append(STRING_WITH_LEN(" to "));
1295 append_identifier(thd, &tmp_buf2, new_db, strlen(new_db));
1296 tmp_buf2.append(STRING_WITH_LEN("."));
1297 append_identifier(thd, &tmp_buf2, new_table_name, strlen(new_table_name));
1298 query= tmp_buf2.c_ptr_safe();
1299 query_length= tmp_buf2.length();
1291 type_str= "rename table";1300 type_str= "rename table";
1292 break;1301 break;
1293 case SOT_CREATE_TABLE:1302 case SOT_CREATE_TABLE:
12941303
=== modified file 'Percona-Server/sql/item.cc'
--- Percona-Server/sql/item.cc 2012-08-20 00:29:22 +0000
+++ Percona-Server/sql/item.cc 2012-12-30 12:40:31 +0000
@@ -747,9 +747,10 @@
747 if (!my_charset_same(cs, system_charset_info))747 if (!my_charset_same(cs, system_charset_info))
748 {748 {
749 size_t res_length;749 size_t res_length;
750 name= sql_strmake_with_convert(str, name_length= length, cs,750 name= sql_strmake_with_convert(str, length, cs,
751 MAX_ALIAS_NAME, system_charset_info,751 MAX_ALIAS_NAME, system_charset_info,
752 &res_length);752 &res_length);
753 name_length= res_length;
753 }754 }
754 else755 else
755 name= sql_strmake(str, (name_length= min(length,MAX_ALIAS_NAME)));756 name= sql_strmake(str, (name_length= min(length,MAX_ALIAS_NAME)));
756757
=== modified file 'Percona-Server/sql/item_func.cc'
--- Percona-Server/sql/item_func.cc 2011-07-03 15:47:37 +0000
+++ Percona-Server/sql/item_func.cc 2012-12-30 12:40:31 +0000
@@ -4724,7 +4724,7 @@
4724void Item_func_get_user_var::print(String *str, enum_query_type query_type)4724void Item_func_get_user_var::print(String *str, enum_query_type query_type)
4725{4725{
4726 str->append(STRING_WITH_LEN("(@"));4726 str->append(STRING_WITH_LEN("(@"));
4727 str->append(name.str,name.length);4727 append_identifier(current_thd, str, name.str, name.length);
4728 str->append(')');4728 str->append(')');
4729}4729}
47304730
@@ -4822,10 +4822,10 @@
4822}4822}
48234823
48244824
4825void Item_user_var_as_out_param::print(String *str, enum_query_type query_type)4825void Item_user_var_as_out_param::print_for_load(THD *thd, String *str)
4826{4826{
4827 str->append('@');4827 str->append('@');
4828 str->append(name.str,name.length);4828 append_identifier(thd, str, name.str, name.length);
4829}4829}
48304830
48314831
48324832
=== modified file 'Percona-Server/sql/item_func.h'
--- Percona-Server/sql/item_func.h 2011-07-03 15:47:37 +0000
+++ Percona-Server/sql/item_func.h 2012-12-30 12:40:31 +0000
@@ -1486,7 +1486,7 @@
1486 my_decimal *val_decimal(my_decimal *decimal_buffer);1486 my_decimal *val_decimal(my_decimal *decimal_buffer);
1487 /* fix_fields() binds variable name with its entry structure */1487 /* fix_fields() binds variable name with its entry structure */
1488 bool fix_fields(THD *thd, Item **ref);1488 bool fix_fields(THD *thd, Item **ref);
1489 virtual void print(String *str, enum_query_type query_type);1489 void print_for_load(THD *thd, String *str);
1490 void set_null_value(CHARSET_INFO* cs);1490 void set_null_value(CHARSET_INFO* cs);
1491 void set_value(const char *str, uint length, CHARSET_INFO* cs);1491 void set_value(const char *str, uint length, CHARSET_INFO* cs);
1492};1492};
14931493
=== modified file 'Percona-Server/sql/log.cc'
--- Percona-Server/sql/log.cc 2012-12-13 22:37:09 +0000
+++ Percona-Server/sql/log.cc 2012-12-30 12:40:31 +0000
@@ -38,6 +38,7 @@
38#endif38#endif
3939
40#include <mysql/plugin.h>40#include <mysql/plugin.h>
41#include "sql_show.h"
4142
42/* max size of the log message */43/* max size of the log message */
43#define MAX_LOG_BUFFER_SIZE 102444#define MAX_LOG_BUFFER_SIZE 1024
@@ -1779,9 +1780,8 @@
17791780
1780 String log_query;1781 String log_query;
1781 if (log_query.append(STRING_WITH_LEN("SAVEPOINT ")) ||1782 if (log_query.append(STRING_WITH_LEN("SAVEPOINT ")) ||
1782 log_query.append("`") ||1783 append_identifier(thd, &log_query,
1783 log_query.append(thd->lex->ident.str, thd->lex->ident.length) ||1784 thd->lex->ident.str, thd->lex->ident.length))
1784 log_query.append("`"))
1785 DBUG_RETURN(1);1785 DBUG_RETURN(1);
1786 int errcode= query_error_code(thd, thd->killed == THD::NOT_KILLED);1786 int errcode= query_error_code(thd, thd->killed == THD::NOT_KILLED);
1787 Query_log_event qinfo(thd, log_query.c_ptr_safe(), log_query.length(),1787 Query_log_event qinfo(thd, log_query.c_ptr_safe(), log_query.length(),
@@ -1803,9 +1803,8 @@
1803 {1803 {
1804 String log_query;1804 String log_query;
1805 if (log_query.append(STRING_WITH_LEN("ROLLBACK TO ")) ||1805 if (log_query.append(STRING_WITH_LEN("ROLLBACK TO ")) ||
1806 log_query.append("`") ||1806 append_identifier(thd, &log_query,
1807 log_query.append(thd->lex->ident.str, thd->lex->ident.length) ||1807 thd->lex->ident.str, thd->lex->ident.length))
1808 log_query.append("`"))
1809 DBUG_RETURN(1);1808 DBUG_RETURN(1);
1810 int errcode= query_error_code(thd, thd->killed == THD::NOT_KILLED);1809 int errcode= query_error_code(thd, thd->killed == THD::NOT_KILLED);
1811 Query_log_event qinfo(thd, log_query.c_ptr_safe(), log_query.length(),1810 Query_log_event qinfo(thd, log_query.c_ptr_safe(), log_query.length(),
18121811
=== modified file 'Percona-Server/sql/log_event.cc'
--- Percona-Server/sql/log_event.cc 2012-08-20 03:14:02 +0000
+++ Percona-Server/sql/log_event.cc 2012-12-30 12:40:31 +0000
@@ -34,6 +34,7 @@
34#include "rpl_utility.h"34#include "rpl_utility.h"
35#include "rpl_record.h"35#include "rpl_record.h"
36#include <my_dir.h>36#include <my_dir.h>
37#include "sql_show.h"
3738
38#endif /* MYSQL_CLIENT */39#endif /* MYSQL_CLIENT */
3940
@@ -413,29 +414,28 @@
413 pretty_print_str()414 pretty_print_str()
414*/415*/
415416
416static char *pretty_print_str(char *packet, const char *str, int len)417static void
418pretty_print_str(String *packet, const char *str, int len)
417{419{
418 const char *end= str + len;420 const char *end= str + len;
419 char *pos= packet;421 packet->append(STRING_WITH_LEN("'"));
420 *pos++= '\'';
421 while (str < end)422 while (str < end)
422 {423 {
423 char c;424 char c;
424 switch ((c=*str++)) {425 switch ((c=*str++)) {
425 case '\n': *pos++= '\\'; *pos++= 'n'; break;426 case '\n': packet->append(STRING_WITH_LEN("\\n")); break;
426 case '\r': *pos++= '\\'; *pos++= 'r'; break;427 case '\r': packet->append(STRING_WITH_LEN("\\r")); break;
427 case '\\': *pos++= '\\'; *pos++= '\\'; break;428 case '\\': packet->append(STRING_WITH_LEN("\\\\")); break;
428 case '\b': *pos++= '\\'; *pos++= 'b'; break;429 case '\b': packet->append(STRING_WITH_LEN("\\b")); break;
429 case '\t': *pos++= '\\'; *pos++= 't'; break;430 case '\t': packet->append(STRING_WITH_LEN("\\t")); break;
430 case '\'': *pos++= '\\'; *pos++= '\''; break;431 case '\'': packet->append(STRING_WITH_LEN("\\'")); break;
431 case 0 : *pos++= '\\'; *pos++= '0'; break;432 case 0 : packet->append(STRING_WITH_LEN("\\0")); break;
432 default:433 default:
433 *pos++= c;434 packet->append(&c, 1);
434 break;435 break;
435 }436 }
436 }437 }
437 *pos++= '\'';438 packet->append(STRING_WITH_LEN("'"));
438 return pos;
439}439}
440#endif /* !MYSQL_CLIENT */440#endif /* !MYSQL_CLIENT */
441441
@@ -862,7 +862,7 @@
862 Log_event::pack_info()862 Log_event::pack_info()
863*/863*/
864864
865void Log_event::pack_info(Protocol *protocol)865void Log_event::pack_info(THD *thd, Protocol *protocol)
866{866{
867 protocol->store("", &my_charset_bin);867 protocol->store("", &my_charset_bin);
868}868}
@@ -871,7 +871,8 @@
871/**871/**
872 Only called by SHOW BINLOG EVENTS872 Only called by SHOW BINLOG EVENTS
873*/873*/
874int Log_event::net_send(Protocol *protocol, const char* log_name, my_off_t pos)874int Log_event::net_send(THD *thd, Protocol *protocol, const char* log_name,
875 my_off_t pos)
875{876{
876 const char *p= strrchr(log_name, FN_LIBCHAR);877 const char *p= strrchr(log_name, FN_LIBCHAR);
877 const char *event_type;878 const char *event_type;
@@ -885,7 +886,7 @@
885 protocol->store(event_type, strlen(event_type), &my_charset_bin);886 protocol->store(event_type, strlen(event_type), &my_charset_bin);
886 protocol->store((uint32) server_id);887 protocol->store((uint32) server_id);
887 protocol->store((ulonglong) log_pos);888 protocol->store((ulonglong) log_pos);
888 pack_info(protocol);889 pack_info(thd, protocol);
889 return protocol->write();890 return protocol->write();
890}891}
891#endif /* HAVE_REPLICATION */892#endif /* HAVE_REPLICATION */
@@ -2140,27 +2141,22 @@
2140 show the catalog ??2141 show the catalog ??
2141*/2142*/
21422143
2143void Query_log_event::pack_info(Protocol *protocol)2144void Query_log_event::pack_info(THD *thd, Protocol *protocol)
2144{2145{
2145 // TODO: show the catalog ??2146 // TODO: show the catalog ??
2146 char *buf, *pos;2147 char buf_mem[1024];
2147 if (!(buf= (char*) my_malloc(9 + db_len + q_len, MYF(MY_WME))))2148 String buf(buf_mem, sizeof(buf_mem), system_charset_info);
2148 return;2149 buf.real_alloc(9 + db_len + q_len);
2149 pos= buf;
2150 if (!(flags & LOG_EVENT_SUPPRESS_USE_F)2150 if (!(flags & LOG_EVENT_SUPPRESS_USE_F)
2151 && db && db_len)2151 && db && db_len)
2152 {2152 {
2153 pos= strmov(buf, "use `");2153 buf.append(STRING_WITH_LEN("use "));
2154 memcpy(pos, db, db_len);2154 append_identifier(thd, &buf, db, db_len);
2155 pos= strmov(pos+db_len, "`; ");2155 buf.append("; ");
2156 }2156 }
2157 if (query && q_len)2157 if (query && q_len)
2158 {2158 buf.append(query, q_len);
2159 memcpy(pos, query, q_len);2159 protocol->store(&buf);
2160 pos+= q_len;
2161 }
2162 protocol->store(buf, pos-buf, &my_charset_bin);
2163 my_free(buf, MYF(MY_ALLOW_ZERO_PTR));
2164}2160}
2165#endif2161#endif
21662162
@@ -3004,7 +3000,19 @@
3004 if (different_db)3000 if (different_db)
3005 memcpy(print_event_info->db, db, db_len + 1);3001 memcpy(print_event_info->db, db, db_len + 1);
3006 if (db[0] && different_db) 3002 if (db[0] && different_db)
3007 my_b_printf(file, "use %s%s\n", db, print_event_info->delimiter);3003 {
3004 QUOTED_IDENTIFIER(q_db,
3005 /* Room for expand ` to `` + initial/final ` + \0 */
3006 FN_REFLEN*2+3,
3007 '`',
3008 system_charset_info,
3009 db,
3010 db_len);
3011 my_b_printf(file,
3012 "use %s%s\n",
3013 q_db.c_ptr(),
3014 print_event_info->delimiter);
3015 }
3008 }3016 }
30093017
3010 end=int10_to_str((long) when, strmov(buff,"SET TIMESTAMP="),10);3018 end=int10_to_str((long) when, strmov(buff,"SET TIMESTAMP="),10);
@@ -3643,7 +3651,7 @@
3643*/3651*/
36443652
3645#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)3653#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
3646void Start_log_event_v3::pack_info(Protocol *protocol)3654void Start_log_event_v3::pack_info(THD *thd, Protocol *protocol)
3647{3655{
3648 char buf[12 + ST_SERVER_VER_LEN + 14 + 22], *pos;3656 char buf[12 + ST_SERVER_VER_LEN + 14 + 22], *pos;
3649 pos= strmov(buf, "Server ver: ");3657 pos= strmov(buf, "Server ver: ");
@@ -4292,131 +4300,115 @@
4292*/4300*/
42934301
4294#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)4302#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
4295uint Load_log_event::get_query_buffer_length()4303void Load_log_event::print_query(THD *thd, bool need_db, const char *cs,
4296{4304 String *buf, my_off_t *fn_start,
4297 return4305 my_off_t *fn_end, const char *qualify_db)
4298 5 + db_len + 3 + // "use DB; "4306{
4299 18 + fname_len + 2 + // "LOAD DATA INFILE 'file''"
4300 11 + // "CONCURRENT "
4301 7 + // LOCAL
4302 9 + // " REPLACE or IGNORE "
4303 13 + table_name_len*2 + // "INTO TABLE `table`"
4304 21 + sql_ex.field_term_len*4 + 2 + // " FIELDS TERMINATED BY 'str'"
4305 23 + sql_ex.enclosed_len*4 + 2 + // " OPTIONALLY ENCLOSED BY 'str'"
4306 12 + sql_ex.escaped_len*4 + 2 + // " ESCAPED BY 'str'"
4307 21 + sql_ex.line_term_len*4 + 2 + // " LINES TERMINATED BY 'str'"
4308 19 + sql_ex.line_start_len*4 + 2 + // " LINES STARTING BY 'str'"
4309 15 + 22 + // " IGNORE xxx LINES"
4310 3 + (num_fields-1)*2 + field_block_len; // " (field1, field2, ...)"
4311}
4312
4313
4314void Load_log_event::print_query(bool need_db, const char *cs, char *buf,
4315 char **end, char **fn_start, char **fn_end)
4316{
4317 char *pos= buf;
4318
4319 if (need_db && db && db_len)4307 if (need_db && db && db_len)
4320 {4308 {
4321 pos= strmov(pos, "use `");4309 buf->append(STRING_WITH_LEN("use "));
4322 memcpy(pos, db, db_len);4310 append_identifier(thd, buf, db, db_len);
4323 pos= strmov(pos+db_len, "`; ");4311 buf->append(STRING_WITH_LEN("; "));
4324 }4312 }
43254313
4326 pos= strmov(pos, "LOAD DATA ");4314 buf->append(STRING_WITH_LEN("LOAD DATA "));
43274315
4328 if (thd->lex->lock_option == TL_WRITE_CONCURRENT_INSERT)4316 if (thd->lex->lock_option == TL_WRITE_CONCURRENT_INSERT)
4329 pos= strmov(pos, "CONCURRENT ");4317 buf->append(STRING_WITH_LEN("CONCURRENT "));
43304318
4331 if (fn_start)4319 if (fn_start)
4332 *fn_start= pos;4320 *fn_start= buf->length();
43334321
4334 if (check_fname_outside_temp_buf())4322 if (check_fname_outside_temp_buf())
4335 pos= strmov(pos, "LOCAL ");4323 buf->append(STRING_WITH_LEN("LOCAL "));
4336 pos= strmov(pos, "INFILE '");4324 buf->append(STRING_WITH_LEN("INFILE '"));
4337 memcpy(pos, fname, fname_len);4325 buf->append_for_single_quote(fname, fname_len);
4338 pos= strmov(pos+fname_len, "' ");4326 buf->append(STRING_WITH_LEN("' "));
43394327
4340 if (sql_ex.opt_flags & REPLACE_FLAG)4328 if (sql_ex.opt_flags & REPLACE_FLAG)
4341 pos= strmov(pos, "REPLACE ");4329 buf->append(STRING_WITH_LEN("REPLACE "));
4342 else if (sql_ex.opt_flags & IGNORE_FLAG)4330 else if (sql_ex.opt_flags & IGNORE_FLAG)
4343 pos= strmov(pos, "IGNORE ");4331 buf->append(STRING_WITH_LEN("IGNORE "));
43444332
4345 pos= strmov(pos ,"INTO");4333 buf->append(STRING_WITH_LEN("INTO"));
43464334
4347 if (fn_end)4335 if (fn_end)
4348 *fn_end= pos;4336 *fn_end= buf->length();
43494337
4350 pos= strmov(pos ," TABLE `");4338 buf->append(STRING_WITH_LEN(" TABLE "));
4351 memcpy(pos, table_name, table_name_len);4339 if (qualify_db)
4352 pos+= table_name_len;4340 {
4341 append_identifier(thd, buf, qualify_db, strlen(qualify_db));
4342 buf->append(STRING_WITH_LEN("."));
4343 }
4344 append_identifier(thd, buf, table_name, table_name_len);
43534345
4354 if (cs != NULL)4346 if (cs != NULL)
4355 {4347 {
4356 pos= strmov(pos ,"` CHARACTER SET ");4348 buf->append(STRING_WITH_LEN(" CHARACTER SET "));
4357 pos= strmov(pos , cs);4349 buf->append(cs, strlen(cs));
4358 }4350 }
4359 else
4360 pos= strmov(pos, "`");
43614351
4362 /* We have to create all optional fields as the default is not empty */4352 /* We have to create all optional fields as the default is not empty */
4363 pos= strmov(pos, " FIELDS TERMINATED BY ");4353 buf->append(STRING_WITH_LEN(" FIELDS TERMINATED BY "));
4364 pos= pretty_print_str(pos, sql_ex.field_term, sql_ex.field_term_len);4354 pretty_print_str(buf, sql_ex.field_term, sql_ex.field_term_len);
4365 if (sql_ex.opt_flags & OPT_ENCLOSED_FLAG)4355 if (sql_ex.opt_flags & OPT_ENCLOSED_FLAG)
4366 pos= strmov(pos, " OPTIONALLY ");4356 buf->append(STRING_WITH_LEN(" OPTIONALLY "));
4367 pos= strmov(pos, " ENCLOSED BY ");4357 buf->append(STRING_WITH_LEN(" ENCLOSED BY "));
4368 pos= pretty_print_str(pos, sql_ex.enclosed, sql_ex.enclosed_len);4358 pretty_print_str(buf, sql_ex.enclosed, sql_ex.enclosed_len);
43694359
4370 pos= strmov(pos, " ESCAPED BY ");4360 buf->append(STRING_WITH_LEN(" ESCAPED BY "));
4371 pos= pretty_print_str(pos, sql_ex.escaped, sql_ex.escaped_len);4361 pretty_print_str(buf, sql_ex.escaped, sql_ex.escaped_len);
43724362
4373 pos= strmov(pos, " LINES TERMINATED BY ");4363 buf->append(STRING_WITH_LEN(" LINES TERMINATED BY "));
4374 pos= pretty_print_str(pos, sql_ex.line_term, sql_ex.line_term_len);4364 pretty_print_str(buf, sql_ex.line_term, sql_ex.line_term_len);
4375 if (sql_ex.line_start_len)4365 if (sql_ex.line_start_len)
4376 {4366 {
4377 pos= strmov(pos, " STARTING BY ");4367 buf->append(STRING_WITH_LEN(" STARTING BY "));
4378 pos= pretty_print_str(pos, sql_ex.line_start, sql_ex.line_start_len);4368 pretty_print_str(buf, sql_ex.line_start, sql_ex.line_start_len);
4379 }4369 }
43804370
4381 if ((long) skip_lines > 0)4371 if ((long) skip_lines > 0)
4382 {4372 {
4383 pos= strmov(pos, " IGNORE ");4373 char skipbuf[22];
4384 pos= longlong10_to_str((longlong) skip_lines, pos, 10);4374 buf->append(STRING_WITH_LEN(" IGNORE "));
4385 pos= strmov(pos," LINES "); 4375 longlong10_to_str((longlong) skip_lines, skipbuf, 10);
4376 buf->append(skipbuf);
4377 buf->append(STRING_WITH_LEN(" LINES "));
4386 }4378 }
43874379
4388 if (num_fields)4380 if (num_fields)
4389 {4381 {
4390 uint i;4382 uint i;
4391 const char *field= fields;4383 const char *field= fields;
4392 pos= strmov(pos, " (");4384 buf->append(STRING_WITH_LEN(" ("));
4393 for (i = 0; i < num_fields; i++)4385 for (i = 0; i < num_fields; i++)
4394 {4386 {
4395 if (i)4387 if (i)
4396 {4388 {
4397 *pos++= ' ';4389 /*
4398 *pos++= ',';4390 Yes, the space and comma is reversed here. But this is mostly dead
4391 code, at most used when reading really old binlogs from old servers,
4392 so better just leave it as is...
4393 */
4394 buf->append(STRING_WITH_LEN(" ,"));
4399 }4395 }
4400 memcpy(pos, field, field_lens[i]);4396 append_identifier(thd, buf, field, field_lens[i]);
4401 pos+= field_lens[i];
4402 field+= field_lens[i] + 1;4397 field+= field_lens[i] + 1;
4403 }4398 }
4404 *pos++= ')';4399 buf->append(STRING_WITH_LEN(")"));
4405 }4400 }
4406
4407 *end= pos;
4408}4401}
44094402
44104403
4411void Load_log_event::pack_info(Protocol *protocol)4404void Load_log_event::pack_info(THD *thd, Protocol *protocol)
4412{4405{
4413 char *buf, *end;4406 char query_buffer[1024];
4407 String query_str(query_buffer, sizeof(query_buffer), system_charset_info);
44144408
4415 if (!(buf= (char*) my_malloc(get_query_buffer_length(), MYF(MY_WME))))4409 query_str.length(0);
4416 return;4410 print_query(thd, TRUE, NULL, &query_str, 0, 0, NULL);
4417 print_query(TRUE, NULL, buf, &end, 0, 0);4411 protocol->store(query_str.ptr(), query_str.length(), &my_charset_bin);
4418 protocol->store(buf, end-buf, &my_charset_bin);
4419 my_free(buf, MYF(0));
4420}4412}
4421#endif /* defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) */4413#endif /* defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) */
44224414
@@ -4683,7 +4675,13 @@
4683 else if (sql_ex.opt_flags & IGNORE_FLAG)4675 else if (sql_ex.opt_flags & IGNORE_FLAG)
4684 my_b_printf(&cache,"IGNORE ");4676 my_b_printf(&cache,"IGNORE ");
4685 4677
4686 my_b_printf(&cache, "INTO TABLE `%s`", table_name);4678 QUOTED_IDENTIFIER(quoted_table_name,
4679 512,
4680 '`',
4681 system_charset_info,
4682 table_name,
4683 strlen(table_name));
4684 my_b_printf(&cache, "INTO TABLE %s", quoted_table_name.c_ptr());
4687 my_b_printf(&cache, " FIELDS TERMINATED BY ");4685 my_b_printf(&cache, " FIELDS TERMINATED BY ");
4688 pretty_print_str(&cache, sql_ex.field_term, sql_ex.field_term_len);4686 pretty_print_str(&cache, sql_ex.field_term, sql_ex.field_term_len);
46894687
@@ -4872,30 +4870,21 @@
4872 else4870 else
4873 {4871 {
4874 char llbuff[22];4872 char llbuff[22];
4875 char *end;
4876 enum enum_duplicates handle_dup;4873 enum enum_duplicates handle_dup;
4877 bool ignore= 0;4874 bool ignore= 0;
4878 char *load_data_query;4875 char *load_data_query;
4879 int query_buf_len;4876 char query_buffer[1024];
4880 4877 String query_str(query_buffer, sizeof(query_buffer), system_charset_info);
4881 /*4878 query_str.length(0);
4882 We must allocate some extra memory for query cache4879
4883 The query buffer layout is:4880 print_query(thd, FALSE, NULL, &query_str, NULL, NULL, NULL);
4884 buffer :==
4885 <statement> The input statement(s)
4886 '\0' Terminating null char (1 byte)
4887 <length> Length of following current database name (size_t)
4888 <db_name> Name of current database
4889 <flags> Flags struct
4890 */
4891 query_buf_len = get_query_buffer_length() + 1 + sizeof(size_t)
4892 + thd->db_length + QUERY_CACHE_FLAGS_SIZE + 1;
4893
4894 /*4881 /*
4895 Forge LOAD DATA INFILE query which will be used in SHOW PROCESS LIST4882 Forge LOAD DATA INFILE query which will be used in SHOW PROCESS LIST
4896 and written to slave's binlog if binlogging is on.4883 and written to slave's binlog if binlogging is on.
4897 */4884 */
4898 if (!(load_data_query= (char *) thd->alloc(query_buf_len)))4885 if (!(load_data_query= (char *) thd->strmake(query_str.ptr(),
4886 query_str.length() +
4887 sizeof(size_t))))
4899 {4888 {
4900 /*4889 /*
4901 This will set thd->fatal_error in case of OOM. So we surely will notice4890 This will set thd->fatal_error in case of OOM. So we surely will notice
@@ -4904,10 +4893,11 @@
4904 goto error;4893 goto error;
4905 }4894 }
49064895
4907 print_query(FALSE, NULL, load_data_query, &end, NULL, NULL);4896 memcpy(load_data_query + query_str.length() + 1,
4908 *end= 0;4897 (char *) &thd->db_length,
4909 memcpy(end+1, (char *) &thd->db_length, sizeof(size_t));4898 sizeof(size_t));
4910 thd->set_query(load_data_query, (uint) (end - load_data_query));4899
4900 thd->set_query(load_data_query, query_str.length());
49114901
4912 if (sql_ex.opt_flags & REPLACE_FLAG)4902 if (sql_ex.opt_flags & REPLACE_FLAG)
4913 {4903 {
@@ -5072,7 +5062,7 @@
5072*/5062*/
50735063
5074#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)5064#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
5075void Rotate_log_event::pack_info(Protocol *protocol)5065void Rotate_log_event::pack_info(THD *thd, Protocol *protocol)
5076{5066{
5077 char buf1[256], buf[22];5067 char buf1[256], buf[22];
5078 String tmp(buf1, sizeof(buf1), log_cs);5068 String tmp(buf1, sizeof(buf1), log_cs);
@@ -5287,7 +5277,7 @@
5287*/5277*/
52885278
5289#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)5279#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
5290void Intvar_log_event::pack_info(Protocol *protocol)5280void Intvar_log_event::pack_info(THD *thd, Protocol *protocol)
5291{5281{
5292 char buf[256], *pos;5282 char buf[256], *pos;
5293 pos= strmake(buf, get_var_type_name(), sizeof(buf)-23);5283 pos= strmake(buf, get_var_type_name(), sizeof(buf)-23);
@@ -5440,7 +5430,7 @@
5440**************************************************************************/5430**************************************************************************/
54415431
5442#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)5432#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
5443void Rand_log_event::pack_info(Protocol *protocol)5433void Rand_log_event::pack_info(THD *thd, Protocol *protocol)
5444{5434{
5445 char buf1[256], *pos;5435 char buf1[256], *pos;
5446 pos= strmov(buf1,"rand_seed1=");5436 pos= strmov(buf1,"rand_seed1=");
@@ -5564,7 +5554,7 @@
5564**************************************************************************/5554**************************************************************************/
55655555
5566#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)5556#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
5567void Xid_log_event::pack_info(Protocol *protocol)5557void Xid_log_event::pack_info(THD *thd, Protocol *protocol)
5568{5558{
5569 char buf[128], *pos;5559 char buf[128], *pos;
5570 pos= strmov(buf, "COMMIT /* xid=");5560 pos= strmov(buf, "COMMIT /* xid=");
@@ -5651,81 +5641,115 @@
5651**************************************************************************/5641**************************************************************************/
56525642
5653#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)5643#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
5654void User_var_log_event::pack_info(Protocol* protocol)5644static bool
5645user_var_append_name_part(THD *thd, String *buf,
5646 const char *name, size_t name_len)
5655{5647{
5656 char *buf= 0;5648 return buf->append("@") ||
5657 uint val_offset= 4 + name_len;5649 append_identifier(thd, buf, name, name_len) ||
5658 uint event_len= val_offset;5650 buf->append("=");
5651}
56595652
5653void User_var_log_event::pack_info(THD *thd, Protocol* protocol)
5654{
5660 if (is_null)5655 if (is_null)
5661 {5656 {
5662 if (!(buf= (char*) my_malloc(val_offset + 5, MYF(MY_WME))))5657 char buf_mem[FN_REFLEN+7];
5658 String buf(buf_mem, sizeof(buf_mem), system_charset_info);
5659 buf.length(0);
5660 if (user_var_append_name_part(thd, &buf, name, name_len) ||
5661 buf.append("NULL"))
5663 return;5662 return;
5664 strmov(buf + val_offset, "NULL");5663 protocol->store(buf.ptr(), buf.length(), &my_charset_bin);
5665 event_len= val_offset + 4;
5666 }5664 }
5667 else5665 else
5668 {5666 {
5669 switch (type) {5667 switch (type) {
5670 case REAL_RESULT:5668 case REAL_RESULT:
5669 {
5671 double real_val;5670 double real_val;
5671 char buf2[FLOATING_POINT_BUFFER];
5672 char buf_mem[FN_REFLEN + FLOATING_POINT_BUFFER];
5673 String buf(buf_mem, sizeof(buf_mem), system_charset_info);
5672 float8get(real_val, val);5674 float8get(real_val, val);
5673 if (!(buf= (char*) my_malloc(val_offset + FLOATING_POINT_BUFFER,5675 buf.length(0);
5674 MYF(MY_WME))))5676 snprintf(buf2, sizeof(buf2), "%.14g", real_val);
5675 return;5677 if (user_var_append_name_part(thd, &buf, name, name_len) ||
5676 event_len+= sprintf(buf + val_offset, "%.14g", real_val);5678 buf.append(buf2))
5679 return;
5680 protocol->store(buf.ptr(), buf.length(), &my_charset_bin);
5677 break;5681 break;
5682 }
5678 case INT_RESULT:5683 case INT_RESULT:
5679 if (!(buf= (char*) my_malloc(val_offset + 22, MYF(MY_WME))))5684 {
5685 char buf2[22];
5686 char buf_mem[FN_REFLEN + 22];
5687 String buf(buf_mem, sizeof(buf_mem), system_charset_info);
5688 buf.length(0);
5689 if (user_var_append_name_part(thd, &buf, name, name_len) ||
5690 buf.append(buf2, longlong10_to_str(uint8korr(val), buf2, -10)-buf2))
5680 return;5691 return;
5681 event_len= longlong10_to_str(uint8korr(val), buf + val_offset,-10)-buf;5692 protocol->store(buf.ptr(), buf.length(), &my_charset_bin);
5682 break;5693 break;
5694 }
5683 case DECIMAL_RESULT:5695 case DECIMAL_RESULT:
5684 {5696 {
5685 if (!(buf= (char*) my_malloc(val_offset + DECIMAL_MAX_STR_LENGTH,5697 char buf_mem[FN_REFLEN + DECIMAL_MAX_STR_LENGTH];
5686 MYF(MY_WME))))5698 String buf(buf_mem, sizeof(buf_mem), system_charset_info);
5687 return;5699 char buf2[DECIMAL_MAX_STR_LENGTH+1];
5688 String str(buf+val_offset, DECIMAL_MAX_STR_LENGTH, &my_charset_bin);5700 String str(buf2, sizeof(buf2), &my_charset_bin);
5689 my_decimal dec;5701 my_decimal dec;
5702 buf.length(0);
5690 binary2my_decimal(E_DEC_FATAL_ERROR, (uchar*) (val+2), &dec, val[0],5703 binary2my_decimal(E_DEC_FATAL_ERROR, (uchar*) (val+2), &dec, val[0],
5691 val[1]);5704 val[1]);
5692 my_decimal2string(E_DEC_FATAL_ERROR, &dec, 0, 0, 0, &str);5705 my_decimal2string(E_DEC_FATAL_ERROR, &dec, 0, 0, 0, &str);
5693 event_len= str.length() + val_offset;5706 if (user_var_append_name_part(thd, &buf, name, name_len) ||
5707 buf.append(buf2))
5708 return;
5709 protocol->store(buf.ptr(), buf.length(), &my_charset_bin);
5694 break;5710 break;
5695 } 5711 }
5696 case STRING_RESULT:5712 case STRING_RESULT:
5713 {
5697 /* 15 is for 'COLLATE' and other chars */5714 /* 15 is for 'COLLATE' and other chars */
5698 buf= (char*) my_malloc(event_len+val_len*2+1+2*MY_CS_NAME_SIZE+15,5715 char buf_mem[FN_REFLEN + 512 + 1 + 2*MY_CS_NAME_SIZE+15];
5699 MYF(MY_WME));5716 String buf(buf_mem, sizeof(buf_mem), system_charset_info);
5700 CHARSET_INFO *cs;5717 CHARSET_INFO *cs;
5701 if (!buf)5718 buf.length(0);
5702 return;
5703 if (!(cs= get_charset(charset_number, MYF(0))))5719 if (!(cs= get_charset(charset_number, MYF(0))))
5704 {5720 {
5705 strmov(buf+val_offset, "???");5721 if (buf.append("???"))
5706 event_len+= 3;5722 return;
5707 }5723 }
5708 else5724 else
5709 {5725 {
5710 char *p= strxmov(buf + val_offset, "_", cs->csname, " ", NullS);5726 size_t old_len;
5711 p= str_to_hex(p, val, val_len);5727 char *beg, *end;
5712 p= strxmov(p, " COLLATE ", cs->name, NullS);5728 if (user_var_append_name_part(thd, &buf, name, name_len) ||
5713 event_len= p-buf;5729 buf.append("_") ||
5730 buf.append(cs->csname) ||
5731 buf.append(" "))
5732 return;
5733 old_len= buf.length();
5734 if (buf.reserve(old_len + val_len*2 + 2 + sizeof(" COLLATE ") +
5735 MY_CS_NAME_SIZE))
5736 return;
5737 beg= const_cast<char *>(buf.ptr()) + old_len;
5738 end= str_to_hex(beg, val, val_len);
5739 buf.length(old_len + (end - beg));
5740 if (buf.append(" COLLATE ") ||
5741 buf.append(cs->name))
5742 return;
5714 }5743 }
5744 protocol->store(buf.ptr(), buf.length(), &my_charset_bin);
5715 break;5745 break;
5746 }
5716 case ROW_RESULT:5747 case ROW_RESULT:
5717 default:5748 default:
5718 DBUG_ASSERT(1);5749 DBUG_ASSERT(1);
5719 return;5750 return;
5720 }5751 }
5721 }5752 }
5722 buf[0]= '@';
5723 buf[1]= '`';
5724 memcpy(buf+2, name, name_len);
5725 buf[2+name_len]= '`';
5726 buf[3+name_len]= '=';
5727 protocol->store(buf, event_len, &my_charset_bin);
5728 my_free(buf, MYF(0));
5729}5753}
5730#endif /* !MYSQL_CLIENT */5754#endif /* !MYSQL_CLIENT */
57315755
@@ -5843,9 +5867,14 @@
5843 my_b_printf(&cache, "\tUser_var\n");5867 my_b_printf(&cache, "\tUser_var\n");
5844 }5868 }
58455869
5846 my_b_printf(&cache, "SET @`");5870 QUOTED_IDENTIFIER(quoted_name,
5847 my_b_write(&cache, (uchar*) name, (uint) (name_len));5871 512,
5848 my_b_printf(&cache, "`");5872 '`',
5873 system_charset_info,
5874 name,
5875 name_len);
5876 my_b_printf(&cache, "SET @");
5877 my_b_printf(&cache, quoted_name.c_ptr());
58495878
5850 if (is_null)5879 if (is_null)
5851 {5880 {
@@ -5918,9 +5947,17 @@
5918 */5947 */
5919 my_b_printf(&cache, ":=???%s\n", print_event_info->delimiter);5948 my_b_printf(&cache, ":=???%s\n", print_event_info->delimiter);
5920 else5949 else
5921 my_b_printf(&cache, ":=_%s %s COLLATE `%s`%s\n",5950 {
5922 cs->csname, hex_str, cs->name,5951 QUOTED_IDENTIFIER(quoted_charset_name,
5952 512,
5953 '`',
5954 system_charset_info,
5955 cs->name,
5956 strlen(cs->name));
5957 my_b_printf(&cache, ":=_%s %s COLLATE %s%s\n",
5958 cs->csname, hex_str, quoted_charset_name.c_ptr(),
5923 print_event_info->delimiter);5959 print_event_info->delimiter);
5960 }
5924 my_afree(hex_str);5961 my_afree(hex_str);
5925 }5962 }
5926 break;5963 break;
@@ -6065,7 +6102,7 @@
6065#endif 6102#endif
60666103
6067#ifndef MYSQL_CLIENT6104#ifndef MYSQL_CLIENT
6068void Slave_log_event::pack_info(Protocol *protocol)6105void Slave_log_event::pack_info(THD *thd, Protocol *protocol)
6069{6106{
6070 char buf[256+HOSTNAME_LENGTH], *pos;6107 char buf[256+HOSTNAME_LENGTH], *pos;
6071 pos= strmov(buf, "host=");6108 pos= strmov(buf, "host=");
@@ -6444,7 +6481,7 @@
6444*/6481*/
64456482
6446#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)6483#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
6447void Create_file_log_event::pack_info(Protocol *protocol)6484void Create_file_log_event::pack_info(THD *thd, Protocol *protocol)
6448{6485{
6449 char buf[NAME_LEN*2 + 30 + 21*2], *pos;6486 char buf[NAME_LEN*2 + 30 + 21*2], *pos;
6450 pos= strmov(buf, "db=");6487 pos= strmov(buf, "db=");
@@ -6625,7 +6662,7 @@
6625*/6662*/
66266663
6627#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)6664#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
6628void Append_block_log_event::pack_info(Protocol *protocol)6665void Append_block_log_event::pack_info(THD *thd, Protocol *protocol)
6629{6666{
6630 char buf[256];6667 char buf[256];
6631 size_t length;6668 size_t length;
@@ -6776,7 +6813,7 @@
6776*/6813*/
67776814
6778#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)6815#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
6779void Delete_file_log_event::pack_info(Protocol *protocol)6816void Delete_file_log_event::pack_info(THD *thd, Protocol *protocol)
6780{6817{
6781 char buf[64];6818 char buf[64];
6782 size_t length;6819 size_t length;
@@ -6874,7 +6911,7 @@
6874*/6911*/
68756912
6876#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)6913#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
6877void Execute_load_log_event::pack_info(Protocol *protocol)6914void Execute_load_log_event::pack_info(THD *thd, Protocol *protocol)
6878{6915{
6879 char buf[64];6916 char buf[64];
6880 size_t length;6917 size_t length;
@@ -7134,27 +7171,26 @@
71347171
71357172
7136#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)7173#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
7137void Execute_load_query_log_event::pack_info(Protocol *protocol)7174void Execute_load_query_log_event::pack_info(THD *thd, Protocol *protocol)
7138{7175{
7139 char *buf, *pos;7176 char buf_mem[1024];
7140 if (!(buf= (char*) my_malloc(9 + db_len + q_len + 10 + 21, MYF(MY_WME))))7177 char file_id_buf[22];
7141 return;7178 String buf(buf_mem, sizeof(buf_mem), system_charset_info);
7142 pos= buf;7179 buf.real_alloc(9 + db_len + q_len + 10 + 21);
7143 if (db && db_len)7180 if (db && db_len)
7144 {7181 {
7145 pos= strmov(buf, "use `");7182 if (buf.append("use ") ||
7146 memcpy(pos, db, db_len);7183 append_identifier(thd, &buf, db, db_len) ||
7147 pos= strmov(pos+db_len, "`; ");7184 buf.append("; "))
7148 }7185 return;
7149 if (query && q_len)7186 }
7150 {7187 if (query && q_len && buf.append(query, q_len))
7151 memcpy(pos, query, q_len);7188 return;
7152 pos+= q_len;7189 int10_to_str((long) file_id, file_id_buf, 10);
7153 }7190 if (buf.append(" ;file_id=") ||
7154 pos= strmov(pos, " ;file_id=");7191 buf.append(file_id_buf))
7155 pos= int10_to_str((long) file_id, pos, 10);7192 return;
7156 protocol->store(buf, pos-buf, &my_charset_bin);7193 protocol->store(buf.ptr(), buf.length(), &my_charset_bin);
7157 my_free(buf, MYF(MY_ALLOW_ZERO_PTR));
7158}7194}
71597195
71607196
@@ -8096,7 +8132,7 @@
8096#endif8132#endif
80978133
8098#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)8134#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
8099void Rows_log_event::pack_info(Protocol *protocol)8135void Rows_log_event::pack_info(THD *thd, Protocol *protocol)
8100{8136{
8101 char buf[256];8137 char buf[256];
8102 char const *const flagstr=8138 char const *const flagstr=
@@ -8802,7 +8838,7 @@
8802 */8838 */
88038839
8804#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)8840#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
8805void Table_map_log_event::pack_info(Protocol *protocol)8841void Table_map_log_event::pack_info(THD *thd, Protocol *protocol)
8806{8842{
8807 char buf[256];8843 char buf[256];
8808 size_t bytes= my_snprintf(buf, sizeof(buf),8844 size_t bytes= my_snprintf(buf, sizeof(buf),
@@ -8822,9 +8858,21 @@
8822 if (!print_event_info->short_form)8858 if (!print_event_info->short_form)
8823 {8859 {
8824 print_header(&print_event_info->head_cache, print_event_info, TRUE);8860 print_header(&print_event_info->head_cache, print_event_info, TRUE);
8861 QUOTED_IDENTIFIER(db_nam,
8862 512,
8863 '`',
8864 system_charset_info,
8865 m_dbnam,
8866 strlen(m_dbnam));
8867 QUOTED_IDENTIFIER(tbl_nam,
8868 512,
8869 '`',
8870 system_charset_info,
8871 m_tblnam,
8872 strlen(m_tblnam));
8825 my_b_printf(&print_event_info->head_cache,8873 my_b_printf(&print_event_info->head_cache,
8826 "\tTable_map: `%s`.`%s` mapped to number %lu\n",8874 "\tTable_map: %s.%s mapped to number %lu\n",
8827 m_dbnam, m_tblnam, m_table_id);8875 db_nam.c_ptr(), tbl_nam.c_ptr(), m_table_id);
8828 print_base64(&print_event_info->body_cache, print_event_info, TRUE);8876 print_base64(&print_event_info->body_cache, print_event_info, TRUE);
8829 }8877 }
8830}8878}
@@ -10017,7 +10065,7 @@
1001710065
1001810066
10019#ifndef MYSQL_CLIENT10067#ifndef MYSQL_CLIENT
10020void Incident_log_event::pack_info(Protocol *protocol)10068void Incident_log_event::pack_info(THD *thd, Protocol *protocol)
10021{10069{
10022 char buf[256];10070 char buf[256];
10023 size_t bytes;10071 size_t bytes;
1002410072
=== modified file 'Percona-Server/sql/log_event.h'
--- Percona-Server/sql/log_event.h 2012-08-20 03:14:02 +0000
+++ Percona-Server/sql/log_event.h 2012-12-30 12:40:31 +0000
@@ -967,14 +967,15 @@
967 */967 */
968 static void init_show_field_list(List<Item>* field_list);968 static void init_show_field_list(List<Item>* field_list);
969#ifdef HAVE_REPLICATION969#ifdef HAVE_REPLICATION
970 int net_send(Protocol *protocol, const char* log_name, my_off_t pos);970 int net_send(THD *thd, Protocol *protocol, const char* log_name,
971 my_off_t pos);
971972
972 /*973 /*
973 pack_info() is used by SHOW BINLOG EVENTS; as print() it prepares and sends974 pack_info() is used by SHOW BINLOG EVENTS; as print() it prepares and sends
974 a string to display to the user, so it resembles print().975 a string to display to the user, so it resembles print().
975 */976 */
976977
977 virtual void pack_info(Protocol *protocol);978 virtual void pack_info(THD *thd, Protocol *protocol);
978979
979#endif /* HAVE_REPLICATION */980#endif /* HAVE_REPLICATION */
980 virtual const char* get_db()981 virtual const char* get_db()
@@ -1674,7 +1675,7 @@
1674 bool using_trans, bool suppress_use, int error);1675 bool using_trans, bool suppress_use, int error);
1675 const char* get_db() { return db; }1676 const char* get_db() { return db; }
1676#ifdef HAVE_REPLICATION1677#ifdef HAVE_REPLICATION
1677 void pack_info(Protocol* protocol);1678 void pack_info(THD *thd, Protocol* protocol);
1678#endif /* HAVE_REPLICATION */1679#endif /* HAVE_REPLICATION */
1679#else1680#else
1680 void print_query_header(IO_CACHE* file, PRINT_EVENT_INFO* print_event_info);1681 void print_query_header(IO_CACHE* file, PRINT_EVENT_INFO* print_event_info);
@@ -1804,7 +1805,7 @@
18041805
1805#ifndef MYSQL_CLIENT1806#ifndef MYSQL_CLIENT
1806 Slave_log_event(THD* thd_arg, Relay_log_info* rli);1807 Slave_log_event(THD* thd_arg, Relay_log_info* rli);
1807 void pack_info(Protocol* protocol);1808 void pack_info(THD *thd, Protocol* protocol);
1808#else1809#else
1809 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);1810 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
1810#endif1811#endif
@@ -2037,9 +2038,11 @@
2037 const Format_description_log_event* description_event);2038 const Format_description_log_event* description_event);
20382039
2039public:2040public:
2040 uint get_query_buffer_length();2041#ifndef MYSQL_CLIENT
2041 void print_query(bool need_db, const char *cs, char *buf, char **end,2042 void print_query(THD *thd, bool need_db, const char *cs, String *buf,
2042 char **fn_start, char **fn_end);2043 my_off_t *fn_start, my_off_t *fn_end,
2044 const char *qualify_db);
2045#endif
2043 ulong thread_id;2046 ulong thread_id;
2044 ulong slave_proxy_id;2047 ulong slave_proxy_id;
2045 uint32 table_name_len;2048 uint32 table_name_len;
@@ -2087,7 +2090,7 @@
2087 Name_resolution_context *context);2090 Name_resolution_context *context);
2088 const char* get_db() { return db; }2091 const char* get_db() { return db; }
2089#ifdef HAVE_REPLICATION2092#ifdef HAVE_REPLICATION
2090 void pack_info(Protocol* protocol);2093 void pack_info(THD *thd, Protocol* protocol);
2091#endif /* HAVE_REPLICATION */2094#endif /* HAVE_REPLICATION */
2092#else2095#else
2093 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);2096 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
@@ -2186,7 +2189,7 @@
2186#ifndef MYSQL_CLIENT2189#ifndef MYSQL_CLIENT
2187 Start_log_event_v3();2190 Start_log_event_v3();
2188#ifdef HAVE_REPLICATION2191#ifdef HAVE_REPLICATION
2189 void pack_info(Protocol* protocol);2192 void pack_info(THD *thd, Protocol* protocol);
2190#endif /* HAVE_REPLICATION */2193#endif /* HAVE_REPLICATION */
2191#else2194#else
2192 Start_log_event_v3() {}2195 Start_log_event_v3() {}
@@ -2338,7 +2341,7 @@
2338 :Log_event(thd_arg,0,0),val(val_arg),type(type_arg)2341 :Log_event(thd_arg,0,0),val(val_arg),type(type_arg)
2339 {}2342 {}
2340#ifdef HAVE_REPLICATION2343#ifdef HAVE_REPLICATION
2341 void pack_info(Protocol* protocol);2344 void pack_info(THD *thd, Protocol* protocol);
2342#endif /* HAVE_REPLICATION */2345#endif /* HAVE_REPLICATION */
2343#else2346#else
2344 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);2347 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
@@ -2414,7 +2417,7 @@
2414 :Log_event(thd_arg,0,0),seed1(seed1_arg),seed2(seed2_arg)2417 :Log_event(thd_arg,0,0),seed1(seed1_arg),seed2(seed2_arg)
2415 {}2418 {}
2416#ifdef HAVE_REPLICATION2419#ifdef HAVE_REPLICATION
2417 void pack_info(Protocol* protocol);2420 void pack_info(THD *thd, Protocol* protocol);
2418#endif /* HAVE_REPLICATION */2421#endif /* HAVE_REPLICATION */
2419#else2422#else
2420 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);2423 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
@@ -2458,7 +2461,7 @@
2458#ifndef MYSQL_CLIENT2461#ifndef MYSQL_CLIENT
2459 Xid_log_event(THD* thd_arg, my_xid x): Log_event(thd_arg,0,0), xid(x) {}2462 Xid_log_event(THD* thd_arg, my_xid x): Log_event(thd_arg,0,0), xid(x) {}
2460#ifdef HAVE_REPLICATION2463#ifdef HAVE_REPLICATION
2461 void pack_info(Protocol* protocol);2464 void pack_info(THD *thd, Protocol* protocol);
2462#endif /* HAVE_REPLICATION */2465#endif /* HAVE_REPLICATION */
2463#else2466#else
2464 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);2467 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
@@ -2509,7 +2512,7 @@
2509 val_len(val_len_arg), type(type_arg), charset_number(charset_number_arg),2512 val_len(val_len_arg), type(type_arg), charset_number(charset_number_arg),
2510 deferred(false)2513 deferred(false)
2511 { is_null= !val; }2514 { is_null= !val; }
2512 void pack_info(Protocol* protocol);2515 void pack_info(THD *thd, Protocol* protocol);
2513#else2516#else
2514 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);2517 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
2515#endif2518#endif
@@ -2647,7 +2650,7 @@
2647 uint ident_len_arg,2650 uint ident_len_arg,
2648 ulonglong pos_arg, uint flags);2651 ulonglong pos_arg, uint flags);
2649#ifdef HAVE_REPLICATION2652#ifdef HAVE_REPLICATION
2650 void pack_info(Protocol* protocol);2653 void pack_info(THD *thd, Protocol* protocol);
2651#endif /* HAVE_REPLICATION */2654#endif /* HAVE_REPLICATION */
2652#else2655#else
2653 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);2656 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
@@ -2707,7 +2710,7 @@
2707 uchar* block_arg, uint block_len_arg,2710 uchar* block_arg, uint block_len_arg,
2708 bool using_trans);2711 bool using_trans);
2709#ifdef HAVE_REPLICATION2712#ifdef HAVE_REPLICATION
2710 void pack_info(Protocol* protocol);2713 void pack_info(THD *thd, Protocol* protocol);
2711#endif /* HAVE_REPLICATION */2714#endif /* HAVE_REPLICATION */
2712#else2715#else
2713 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);2716 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
@@ -2779,7 +2782,7 @@
2779 Append_block_log_event(THD* thd, const char* db_arg, uchar* block_arg,2782 Append_block_log_event(THD* thd, const char* db_arg, uchar* block_arg,
2780 uint block_len_arg, bool using_trans);2783 uint block_len_arg, bool using_trans);
2781#ifdef HAVE_REPLICATION2784#ifdef HAVE_REPLICATION
2782 void pack_info(Protocol* protocol);2785 void pack_info(THD *thd, Protocol* protocol);
2783 virtual int get_create_or_append() const;2786 virtual int get_create_or_append() const;
2784#endif /* HAVE_REPLICATION */2787#endif /* HAVE_REPLICATION */
2785#else2788#else
@@ -2820,7 +2823,7 @@
2820#ifndef MYSQL_CLIENT2823#ifndef MYSQL_CLIENT
2821 Delete_file_log_event(THD* thd, const char* db_arg, bool using_trans);2824 Delete_file_log_event(THD* thd, const char* db_arg, bool using_trans);
2822#ifdef HAVE_REPLICATION2825#ifdef HAVE_REPLICATION
2823 void pack_info(Protocol* protocol);2826 void pack_info(THD *thd, Protocol* protocol);
2824#endif /* HAVE_REPLICATION */2827#endif /* HAVE_REPLICATION */
2825#else2828#else
2826 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);2829 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
@@ -2861,7 +2864,7 @@
2861#ifndef MYSQL_CLIENT2864#ifndef MYSQL_CLIENT
2862 Execute_load_log_event(THD* thd, const char* db_arg, bool using_trans);2865 Execute_load_log_event(THD* thd, const char* db_arg, bool using_trans);
2863#ifdef HAVE_REPLICATION2866#ifdef HAVE_REPLICATION
2864 void pack_info(Protocol* protocol);2867 void pack_info(THD *thd, Protocol* protocol);
2865#endif /* HAVE_REPLICATION */2868#endif /* HAVE_REPLICATION */
2866#else2869#else
2867 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);2870 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
@@ -2957,7 +2960,7 @@
2957 bool using_trans, bool suppress_use,2960 bool using_trans, bool suppress_use,
2958 int errcode);2961 int errcode);
2959#ifdef HAVE_REPLICATION2962#ifdef HAVE_REPLICATION
2960 void pack_info(Protocol* protocol);2963 void pack_info(THD *thd, Protocol* protocol);
2961#endif /* HAVE_REPLICATION */2964#endif /* HAVE_REPLICATION */
2962#else2965#else
2963 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);2966 void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
@@ -3404,7 +3407,7 @@
3404#endif3407#endif
34053408
3406#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)3409#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
3407 virtual void pack_info(Protocol *protocol);3410 virtual void pack_info(THD *thd, Protocol *protocol);
3408#endif3411#endif
34093412
3410#ifdef MYSQL_CLIENT3413#ifdef MYSQL_CLIENT
@@ -3516,7 +3519,7 @@
3516 flag_set get_flags(flag_set flags_arg) const { return m_flags & flags_arg; }3519 flag_set get_flags(flag_set flags_arg) const { return m_flags & flags_arg; }
35173520
3518#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)3521#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
3519 virtual void pack_info(Protocol *protocol);3522 virtual void pack_info(THD *thd, Protocol *protocol);
3520#endif3523#endif
35213524
3522#ifdef MYSQL_CLIENT3525#ifdef MYSQL_CLIENT
@@ -3953,7 +3956,7 @@
3953#endif3956#endif
39543957
3955#ifndef MYSQL_CLIENT3958#ifndef MYSQL_CLIENT
3956 void pack_info(Protocol*);3959 void pack_info(THD *thd, Protocol*);
3957#endif3960#endif
39583961
3959 Incident_log_event(const char *buf, uint event_len,3962 Incident_log_event(const char *buf, uint event_len,
39603963
=== modified file 'Percona-Server/sql/log_event_old.cc'
--- Percona-Server/sql/log_event_old.cc 2011-06-30 15:37:13 +0000
+++ Percona-Server/sql/log_event_old.cc 2012-12-30 12:40:31 +0000
@@ -2003,7 +2003,7 @@
20032003
20042004
2005#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)2005#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
2006void Old_rows_log_event::pack_info(Protocol *protocol)2006void Old_rows_log_event::pack_info(THD *thd, Protocol *protocol)
2007{2007{
2008 char buf[256];2008 char buf[256];
2009 char const *const flagstr=2009 char const *const flagstr=
20102010
=== modified file 'Percona-Server/sql/log_event_old.h'
--- Percona-Server/sql/log_event_old.h 2007-12-05 19:00:14 +0000
+++ Percona-Server/sql/log_event_old.h 2012-12-30 12:40:31 +0000
@@ -108,7 +108,7 @@
108 flag_set get_flags(flag_set flags_arg) const { return m_flags & flags_arg; }108 flag_set get_flags(flag_set flags_arg) const { return m_flags & flags_arg; }
109109
110#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)110#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
111 virtual void pack_info(Protocol *protocol);111 virtual void pack_info(THD *thd, Protocol *protocol);
112#endif112#endif
113113
114#ifdef MYSQL_CLIENT114#ifdef MYSQL_CLIENT
115115
=== modified file 'Percona-Server/sql/mysql_priv.h'
--- Percona-Server/sql/mysql_priv.h 2012-09-05 22:27:47 +0000
+++ Percona-Server/sql/mysql_priv.h 2012-12-30 12:40:31 +0000
@@ -1462,7 +1462,7 @@
1462/* sql_show.cc */1462/* sql_show.cc */
1463bool mysqld_show_open_tables(THD *thd,const char *wild);1463bool mysqld_show_open_tables(THD *thd,const char *wild);
1464bool mysqld_show_logs(THD *thd);1464bool mysqld_show_logs(THD *thd);
1465void append_identifier(THD *thd, String *packet, const char *name,1465bool append_identifier(THD *thd, String *packet, const char *name,
1466 uint length);1466 uint length);
1467#endif /* MYSQL_SERVER */1467#endif /* MYSQL_SERVER */
1468#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS1468#if defined MYSQL_SERVER || defined INNODB_COMPATIBILITY_HOOKS
14691469
=== modified file 'Percona-Server/sql/sql_base.cc'
--- Percona-Server/sql/sql_base.cc 2012-08-20 03:14:02 +0000
+++ Percona-Server/sql/sql_base.cc 2012-12-30 12:40:31 +0000
@@ -4168,22 +4168,22 @@
4168 entry->file->implicit_emptied= 0;4168 entry->file->implicit_emptied= 0;
4169 if (mysql_bin_log.is_open())4169 if (mysql_bin_log.is_open())
4170 {4170 {
4171 char *query, *end;4171 char query_buf[2*FN_REFLEN + 21];
4172 uint query_buf_size= 20 + share->db.length + share->table_name.length +1;4172 String query(query_buf, sizeof(query_buf), system_charset_info);
4173 if ((query= (char*) my_malloc(query_buf_size,MYF(MY_WME))))4173 query.length(0);
4174 if (query.ptr())
4174 {4175 {
4175 /* this DELETE FROM is needed even with row-based binlogging */4176 /* this DELETE FROM is needed even with row-based binlogging */
4176 end = strxmov(strmov(query, "DELETE FROM `"),4177 query.append("DELETE FROM ");
4177 share->db.str,"`.`",share->table_name.str,"`", NullS);4178 append_identifier(thd, &query, share->db.str, share->db.length);
4179 query.append(".");
4180 append_identifier(thd, &query, share->table_name.str,
4181 share->table_name.length);
4178 int errcode= query_error_code(thd, TRUE);4182 int errcode= query_error_code(thd, TRUE);
4179 if (thd->binlog_query(THD::STMT_QUERY_TYPE,4183 if (thd->binlog_query(THD::STMT_QUERY_TYPE,
4180 query, (ulong)(end-query),4184 query.ptr(), query.length(),
4181 FALSE, FALSE, errcode))4185 FALSE, FALSE, errcode))
4182 {
4183 my_free(query, MYF(0));
4184 goto err;4186 goto err;
4185 }
4186 my_free(query, MYF(0));
4187 }4187 }
4188 else4188 else
4189 {4189 {
@@ -4192,9 +4192,20 @@
4192 DBA on top of warning the client (which will automatically be done4192 DBA on top of warning the client (which will automatically be done
4193 because of MYF(MY_WME) in my_malloc() above).4193 because of MYF(MY_WME) in my_malloc() above).
4194 */4194 */
4195 char q_db_c[512];
4196 char q_table_name_c[512];
4197 String q_db(q_db_c, sizeof(q_db_c), system_charset_info);
4198 String q_table_name(q_table_name_c, sizeof(q_table_name), system_charset_info);
4199 q_db.length(0);
4200 q_table_name.length(0);
4201 append_identifier(thd, &q_db, table_list->db, strlen(table_list->db));
4202 append_identifier(thd,
4203 &q_table_name,
4204 table_list->table_name,
4205 strlen(table_list->table_name));
4195 sql_print_error("When opening HEAP table, could not allocate memory "4206 sql_print_error("When opening HEAP table, could not allocate memory "
4196 "to write 'DELETE FROM `%s`.`%s`' to the binary log",4207 "to write 'DELETE FROM %s.%s' to the binary log",
4197 table_list->db, table_list->table_name);4208 q_db.c_ptr(), q_table_name.c_ptr());
4198 delete entry->triggers;4209 delete entry->triggers;
4199 closefrm(entry, 0);4210 closefrm(entry, 0);
4200 goto err;4211 goto err;
42014212
=== modified file 'Percona-Server/sql/sql_db.cc'
--- Percona-Server/sql/sql_db.cc 2011-07-03 15:47:37 +0000
+++ Percona-Server/sql/sql_db.cc 2012-12-30 12:40:31 +0000
@@ -612,7 +612,6 @@
612 bool silent)612 bool silent)
613{613{
614 char path[FN_REFLEN+16];614 char path[FN_REFLEN+16];
615 char tmp_query[FN_REFLEN+16];
616 long result= 1;615 long result= 1;
617 int error= 0;616 int error= 0;
618 MY_STAT stat_info;617 MY_STAT stat_info;
@@ -719,17 +718,9 @@
719 char *query;718 char *query;
720 uint query_length;719 uint query_length;
721720
722 if (!thd->query()) // Only in replication721 query= thd->query();
723 {722 query_length= thd->query_length();
724 query= tmp_query;723 DBUG_ASSERT(query);
725 query_length= (uint) (strxmov(tmp_query,"create database `",
726 db, "`", NullS) - tmp_query);
727 }
728 else
729 {
730 query= thd->query();
731 query_length= thd->query_length();
732 }
733724
734 ha_binlog_log_query(thd, 0, LOGCOM_CREATE_DB,725 ha_binlog_log_query(thd, 0, LOGCOM_CREATE_DB,
735 query, query_length,726 query, query_length,
@@ -989,18 +980,11 @@
989 {980 {
990 const char *query;981 const char *query;
991 ulong query_length;982 ulong query_length;
992 if (!thd->query())983
993 {984 query= thd->query();
994 /* The client used the old obsolete mysql_drop_db() call */985 query_length= thd->query_length();
995 query= path;986 DBUG_ASSERT(query);
996 query_length= (uint) (strxmov(path, "drop database `", db, "`",987
997 NullS) - path);
998 }
999 else
1000 {
1001 query= thd->query();
1002 query_length= thd->query_length();
1003 }
1004 if (mysql_bin_log.is_open())988 if (mysql_bin_log.is_open())
1005 {989 {
1006 thd->clear_error();990 thd->clear_error();
@@ -1041,9 +1025,16 @@
1041 for (tbl= dropped_tables; tbl; tbl= tbl->next_local)1025 for (tbl= dropped_tables; tbl; tbl= tbl->next_local)
1042 {1026 {
1043 uint tbl_name_len;1027 uint tbl_name_len;
10441028 char quoted_name_c[FN_REFLEN+3];
1045 /* 3 for the quotes and the comma*/1029 String quoted_name(quoted_name_c,
1046 tbl_name_len= strlen(tbl->table_name) + 3;1030 sizeof(quoted_name_c),
1031 system_charset_info);
1032 quoted_name.length(0);
1033 quoted_name.append_identifier(tbl->table_name,
1034 strlen(tbl->table_name),
1035 system_charset_info,
1036 '`');
1037 tbl_name_len= quoted_name.length() + 1; /* +1 for the comma */
1047 if (query_pos + tbl_name_len + 1 >= query_end)1038 if (query_pos + tbl_name_len + 1 >= query_end)
1048 {1039 {
1049 /* These DDL methods and logging protected with LOCK_mysql_create_db */1040 /* These DDL methods and logging protected with LOCK_mysql_create_db */
@@ -1055,9 +1046,7 @@
1055 query_pos= query_data_start;1046 query_pos= query_data_start;
1056 }1047 }
10571048
1058 *query_pos++ = '`';1049 query_pos= strmov(query_pos, quoted_name.c_ptr());
1059 query_pos= strmov(query_pos,tbl->table_name);
1060 *query_pos++ = '`';
1061 *query_pos++ = ',';1050 *query_pos++ = ',';
1062 }1051 }
10631052
10641053
=== modified file 'Percona-Server/sql/sql_insert.cc'
--- Percona-Server/sql/sql_insert.cc 2012-08-13 13:37:18 +0000
+++ Percona-Server/sql/sql_insert.cc 2012-12-30 12:40:31 +0000
@@ -3479,16 +3479,16 @@
3479 if (thd->lex->create_select_in_comment)3479 if (thd->lex->create_select_in_comment)
3480 query.append(STRING_WITH_LEN("/*! "));3480 query.append(STRING_WITH_LEN("/*! "));
3481 if (thd->lex->ignore)3481 if (thd->lex->ignore)
3482 query.append(STRING_WITH_LEN("INSERT IGNORE INTO `"));3482 query.append(STRING_WITH_LEN("INSERT IGNORE INTO "));
3483 else if (thd->lex->duplicates == DUP_REPLACE)3483 else if (thd->lex->duplicates == DUP_REPLACE)
3484 query.append(STRING_WITH_LEN("REPLACE INTO `"));3484 query.append(STRING_WITH_LEN("REPLACE INTO "));
3485 else3485 else
3486 query.append(STRING_WITH_LEN("INSERT INTO `"));3486 query.append(STRING_WITH_LEN("INSERT INTO "));
34873487
3488 query.append(create_table->db, db_len);3488 append_identifier(thd, &query, create_table->db, db_len);
3489 query.append(STRING_WITH_LEN("`.`"));3489 query.append(STRING_WITH_LEN("."));
3490 query.append(create_info->alias, table_len);3490 append_identifier(thd, &query, create_info->alias, table_len);
3491 query.append(STRING_WITH_LEN("` "));3491 query.append(STRING_WITH_LEN(" "));
34923492
3493 /*3493 /*
3494 The insert items.3494 The insert items.
34953495
=== modified file 'Percona-Server/sql/sql_load.cc'
--- Percona-Server/sql/sql_load.cc 2012-02-15 16:21:38 +0000
+++ Percona-Server/sql/sql_load.cc 2012-12-30 12:40:31 +0000
@@ -24,6 +24,7 @@
24#include "sql_repl.h"24#include "sql_repl.h"
25#include "sp_head.h"25#include "sp_head.h"
26#include "sql_trigger.h"26#include "sql_trigger.h"
27#include "sql_show.h"
2728
28class READ_INFO {29class READ_INFO {
29 File file;30 File file;
@@ -606,20 +607,28 @@
606 bool transactional_table,607 bool transactional_table,
607 int errcode)608 int errcode)
608{609{
609 char *load_data_query,610 char *load_data_query;
610 *end,611 my_off_t fname_start,
611 *fname_start,612 fname_end;
612 *fname_end,
613 *p= NULL;
614 size_t pl= 0;
615 List<Item> fv;613 List<Item> fv;
616 Item *item, *val;614 Item *item, *val;
617 String pfield, pfields;
618 int n;615 int n;
619 const char *tbl= table_name_arg;
620 const char *tdb= (thd->db != NULL ? thd->db : db_arg);616 const char *tdb= (thd->db != NULL ? thd->db : db_arg);
621 String string_buf;617 const char *qualify_db= NULL;
622618 char command_buffer[1024];
619 String query_str(command_buffer, sizeof(command_buffer),
620 system_charset_info);
621
622 Load_log_event lle(thd, ex, tdb, table_name_arg, fv, duplicates,
623 ignore, transactional_table);
624
625 /*
626 force in a LOCAL if there was one in the original.
627 */
628 if (thd->lex->local_file)
629 lle.set_fname_outside_temp_buf(ex->file_name, strlen(ex->file_name));
630
631 query_str.length(0);
623 if (!thd->db || strcmp(db_arg, thd->db)) 632 if (!thd->db || strcmp(db_arg, thd->db))
624 {633 {
625 /*634 /*
@@ -627,23 +636,10 @@
627 prefix table name with database name so that it 636 prefix table name with database name so that it
628 becomes a FQ name.637 becomes a FQ name.
629 */638 */
630 string_buf.set_charset(system_charset_info);639 qualify_db= db_arg;
631 string_buf.append(db_arg);
632 string_buf.append("`");
633 string_buf.append(".");
634 string_buf.append("`");
635 string_buf.append(table_name_arg);
636 tbl= string_buf.c_ptr_safe();
637 }640 }
638641 lle.print_query(thd, FALSE, (const char *) ex->cs?ex->cs->csname:NULL,
639 Load_log_event lle(thd, ex, tdb, tbl, fv, duplicates,642 &query_str, &fname_start, &fname_end, qualify_db);
640 ignore, transactional_table);
641
642 /*
643 force in a LOCAL if there was one in the original.
644 */
645 if (thd->lex->local_file)
646 lle.set_fname_outside_temp_buf(ex->file_name, strlen(ex->file_name));
647643
648 /*644 /*
649 prepare fields-list and SET if needed; print_query won't do that for us.645 prepare fields-list and SET if needed; print_query won't do that for us.
@@ -652,23 +648,19 @@
652 {648 {
653 List_iterator<Item> li(thd->lex->field_list);649 List_iterator<Item> li(thd->lex->field_list);
654650
655 pfields.append(" (");651 query_str.append(" (");
656 n= 0;652 n= 0;
657653
658 while ((item= li++))654 while ((item= li++))
659 {655 {
660 if (n++)656 if (n++)
661 pfields.append(", ");657 query_str.append(", ");
662 if (item->name)658 if (item->name)
663 {659 append_identifier(thd, &query_str, item->name, strlen(item->name));
664 pfields.append("`");
665 pfields.append(item->name);
666 pfields.append("`");
667 }
668 else660 else
669 item->print(&pfields, QT_ORDINARY);661 ((Item_user_var_as_out_param *)item)->print_for_load(thd, &query_str);
670 }662 }
671 pfields.append(")");663 query_str.append(")");
672 }664 }
673665
674 if (!thd->lex->update_list.is_empty())666 if (!thd->lex->update_list.is_empty())
@@ -676,39 +668,26 @@
676 List_iterator<Item> lu(thd->lex->update_list);668 List_iterator<Item> lu(thd->lex->update_list);
677 List_iterator<Item> lv(thd->lex->value_list);669 List_iterator<Item> lv(thd->lex->value_list);
678670
679 pfields.append(" SET ");671 query_str.append(" SET ");
680 n= 0;672 n= 0;
681673
682 while ((item= lu++))674 while ((item= lu++))
683 {675 {
684 val= lv++;676 val= lv++;
685 if (n++)677 if (n++)
686 pfields.append(", ");678 query_str.append(", ");
687 pfields.append("`");679 append_identifier(thd, &query_str, item->name, strlen(item->name));
688 pfields.append(item->name);680 query_str.append("=");
689 pfields.append("`");681 val->print(&query_str, QT_ORDINARY);
690 pfields.append("=");
691 val->print(&pfields, QT_ORDINARY);
692 }682 }
693 }683 }
694684
695 p= pfields.c_ptr_safe();685 if (!(load_data_query= (char *)thd->strmake(query_str.ptr(), query_str.length())))
696 pl= strlen(p);
697
698 if (!(load_data_query= (char *)thd->alloc(lle.get_query_buffer_length() + 1 + pl)))
699 return TRUE;686 return TRUE;
700687
701 lle.print_query(FALSE, (const char *) ex->cs?ex->cs->csname:NULL,
702 load_data_query, &end,
703 (char **)&fname_start, (char **)&fname_end);
704
705 strcpy(end, p);
706 end += pl;
707
708 Execute_load_query_log_event688 Execute_load_query_log_event
709 e(thd, load_data_query, end-load_data_query,689 e(thd, load_data_query, query_str.length(),
710 (uint) ((char*) fname_start - load_data_query - 1),690 (uint) (fname_start - 1), (uint) fname_end,
711 (uint) ((char*) fname_end - load_data_query),
712 (duplicates == DUP_REPLACE) ? LOAD_DUP_REPLACE :691 (duplicates == DUP_REPLACE) ? LOAD_DUP_REPLACE :
713 (ignore ? LOAD_DUP_IGNORE : LOAD_DUP_ERROR),692 (ignore ? LOAD_DUP_IGNORE : LOAD_DUP_ERROR),
714 transactional_table, FALSE, errcode);693 transactional_table, FALSE, errcode);
715694
=== modified file 'Percona-Server/sql/sql_repl.cc'
--- Percona-Server/sql/sql_repl.cc 2012-08-20 00:29:22 +0000
+++ Percona-Server/sql/sql_repl.cc 2012-12-30 12:40:31 +0000
@@ -1549,7 +1549,7 @@
1549 description_event)); )1549 description_event)); )
1550 {1550 {
1551 if (event_count >= limit_start &&1551 if (event_count >= limit_start &&
1552 ev->net_send(protocol, linfo.log_file_name, pos))1552 ev->net_send(thd, protocol, linfo.log_file_name, pos))
1553 {1553 {
1554 errmsg = "Net error";1554 errmsg = "Net error";
1555 delete ev;1555 delete ev;
15561556
=== modified file 'Percona-Server/sql/sql_show.cc'
--- Percona-Server/sql/sql_show.cc 2012-08-20 03:14:02 +0000
+++ Percona-Server/sql/sql_show.cc 2012-12-30 12:40:31 +0000
@@ -1036,48 +1036,17 @@
1036 packet target string1036 packet target string
1037 name the identifier to be appended1037 name the identifier to be appended
1038 name_length length of the appending identifier1038 name_length length of the appending identifier
1039
1040 RETURN VALUES
1041 true Error
1042 false Ok
1039*/1043*/
10401044
1041void1045bool
1042append_identifier(THD *thd, String *packet, const char *name, uint length)1046append_identifier(THD *thd, String *packet, const char *name, uint length)
1043{1047{
1044 const char *name_end;
1045 char quote_char;
1046 int q= get_quote_char_for_identifier(thd, name, length);1048 int q= get_quote_char_for_identifier(thd, name, length);
10471049 return packet->append_identifier(name, length, system_charset_info, q);
1048 if (q == EOF)
1049 {
1050 packet->append(name, length, packet->charset());
1051 return;
1052 }
1053
1054 /*
1055 The identifier must be quoted as it includes a quote character or
1056 it's a keyword
1057 */
1058
1059 VOID(packet->reserve(length*2 + 2));
1060 quote_char= (char) q;
1061 packet->append(&quote_char, 1, system_charset_info);
1062
1063 for (name_end= name+length ; name < name_end ; name+= length)
1064 {
1065 uchar chr= (uchar) *name;
1066 length= my_mbcharlen(system_charset_info, chr);
1067 /*
1068 my_mbcharlen can return 0 on a wrong multibyte
1069 sequence. It is possible when upgrading from 4.0,
1070 and identifier contains some accented characters.
1071 The manual says it does not work. So we'll just
1072 change length to 1 not to hang in the endless loop.
1073 */
1074 if (!length)
1075 length= 1;
1076 if (length == 1 && chr == (uchar) quote_char)
1077 packet->append(&quote_char, 1, system_charset_info);
1078 packet->append(name, length, system_charset_info);
1079 }
1080 packet->append(&quote_char, 1, system_charset_info);
1081}1050}
10821051
10831052
10841053
=== modified file 'Percona-Server/sql/sql_string.cc'
--- Percona-Server/sql/sql_string.cc 2012-04-02 02:09:15 +0000
+++ Percona-Server/sql/sql_string.cc 2012-12-30 12:40:31 +0000
@@ -587,6 +587,49 @@
587 return FALSE;587 return FALSE;
588}588}
589589
590bool String::append_identifier(const char *name,
591 uint length,
592 CHARSET_INFO *ci,
593 int quote_char)
594{
595 const char *name_end;
596 char q= (char)quote_char;
597 CHARSET_INFO *lci = ci ? ci : charset();
598
599 if (quote_char == EOF)
600 return append(name, length, charset());
601
602 /*
603 The identifier must be quoted as it includes a quote character or
604 it's a keyword
605 */
606
607 VOID(reserve(length*2 + 2));
608 if (append(&q, 1, lci))
609 return true;
610
611 for (name_end= name+length ; name < name_end ; name+= length)
612 {
613 uchar chr= (uchar) *name;
614 length= my_mbcharlen(lci, chr);
615 /*
616 my_mbcharlen can return 0 on a wrong multibyte
617 sequence. It is possible when upgrading from 4.0,
618 and identifier contains some accented characters.
619 The manual says it does not work. So we'll just
620 change length to 1 not to hang in the endless loop.
621 */
622 if (!length)
623 length= 1;
624 if (length == 1 && chr == (uchar) q &&
625 append(&q, 1, lci))
626 return true;
627 if (append(name, length, lci))
628 return true;
629 }
630 return append(&q, 1, lci);
631}
632
590uint32 String::numchars()633uint32 String::numchars()
591{634{
592 return str_charset->cset->numchars(str_charset, Ptr, Ptr+str_length);635 return str_charset->cset->numchars(str_charset, Ptr, Ptr+str_length);
@@ -1109,39 +1152,47 @@
11091152
11101153
11111154
11121155/*
1113void String::print(String *str)1156 Append characters to a single-quoted string '...', escaping special
1157 characters as necessary.
1158 Does not add the enclosing quotes, this is left up to caller.
1159*/
1160void String::append_for_single_quote(const char *st, uint len)
1114{1161{
1115 char *st= (char*)Ptr, *end= st+str_length;1162 const char *end= st+len;
1116 for (; st < end; st++)1163 for (; st < end; st++)
1117 {1164 {
1118 uchar c= *st;1165 uchar c= *st;
1119 switch (c)1166 switch (c)
1120 {1167 {
1121 case '\\':1168 case '\\':
1122 str->append(STRING_WITH_LEN("\\\\"));1169 append(STRING_WITH_LEN("\\\\"));
1123 break;1170 break;
1124 case '\0':1171 case '\0':
1125 str->append(STRING_WITH_LEN("\\0"));1172 append(STRING_WITH_LEN("\\0"));
1126 break;1173 break;
1127 case '\'':1174 case '\'':
1128 str->append(STRING_WITH_LEN("\\'"));1175 append(STRING_WITH_LEN("\\'"));
1129 break;1176 break;
1130 case '\n':1177 case '\n':
1131 str->append(STRING_WITH_LEN("\\n"));1178 append(STRING_WITH_LEN("\\n"));
1132 break;1179 break;
1133 case '\r':1180 case '\r':
1134 str->append(STRING_WITH_LEN("\\r"));1181 append(STRING_WITH_LEN("\\r"));
1135 break;1182 break;
1136 case '\032': // Ctrl-Z1183 case '\032': // Ctrl-Z
1137 str->append(STRING_WITH_LEN("\\Z"));1184 append(STRING_WITH_LEN("\\Z"));
1138 break;1185 break;
1139 default:1186 default:
1140 str->append(c);1187 append(c);
1141 }1188 }
1142 }1189 }
1143}1190}
11441191
1192void String::print(String *str)
1193{
1194 str->append_for_single_quote(Ptr, str_length);
1195}
11451196
1146/*1197/*
1147 Exchange state of this object and argument.1198 Exchange state of this object and argument.
11481199
=== modified file 'Percona-Server/sql/sql_string.h'
--- Percona-Server/sql/sql_string.h 2012-02-09 15:03:59 +0000
+++ Percona-Server/sql/sql_string.h 2012-12-30 12:40:31 +0000
@@ -32,6 +32,12 @@
32#error Attempt to use server-side sql_string on client. Use client/sql_string.h32#error Attempt to use server-side sql_string on client. Use client/sql_string.h
33#endif 33#endif
3434
35#define QUOTED_IDENTIFIER(str_name, buf_size, q, cs, id_name, id_size) \
36 char buf_##str_name[(buf_size)]; \
37 String str_name((buf_##str_name), (buf_size), (cs)); \
38 str_name.length(0); \
39 str_name.append_identifier((id_name), (id_size), (cs), (q));
40
35class String;41class String;
36int sortcmp(const String *a,const String *b, CHARSET_INFO *cs);42int sortcmp(const String *a,const String *b, CHARSET_INFO *cs);
37String *copy_if_not_alloced(String *a,String *b,uint32 arg_length);43String *copy_if_not_alloced(String *a,String *b,uint32 arg_length);
@@ -284,6 +290,10 @@
284 bool append(IO_CACHE* file, uint32 arg_length);290 bool append(IO_CACHE* file, uint32 arg_length);
285 bool append_with_prefill(const char *s, uint32 arg_length, 291 bool append_with_prefill(const char *s, uint32 arg_length,
286 uint32 full_length, char fill_char);292 uint32 full_length, char fill_char);
293 bool append_identifier(const char *name,
294 uint length,
295 CHARSET_INFO *ci,
296 int quote_char);
287 int strstr(const String &search,uint32 offset=0); // Returns offset to substring or -1297 int strstr(const String &search,uint32 offset=0); // Returns offset to substring or -1
288 int strrstr(const String &search,uint32 offset=0); // Returns offset to substring or -1298 int strrstr(const String &search,uint32 offset=0); // Returns offset to substring or -1
289 bool replace(uint32 offset,uint32 arg_length,const char *to,uint32 length);299 bool replace(uint32 offset,uint32 arg_length,const char *to,uint32 length);
@@ -387,6 +397,7 @@
387 return FALSE;397 return FALSE;
388 }398 }
389 void print(String *print);399 void print(String *print);
400 void append_for_single_quote(const char *st, uint len);
390401
391 /* Swap two string objects. Efficient way to exchange data without memcpy. */402 /* Swap two string objects. Efficient way to exchange data without memcpy. */
392 void swap(String &s);403 void swap(String &s);
393404
=== modified file 'Percona-Server/sql/sql_table.cc'
--- Percona-Server/sql/sql_table.cc 2012-04-02 02:09:15 +0000
+++ Percona-Server/sql/sql_table.cc 2012-12-30 12:40:31 +0000
@@ -1944,6 +1944,7 @@
1944 for (table= tables; table; table= table->next_local)1944 for (table= tables; table; table= table->next_local)
1945 {1945 {
1946 char *db=table->db;1946 char *db=table->db;
1947 size_t db_length= table->db_length;
1947 handlerton *table_type;1948 handlerton *table_type;
1948 enum legacy_db_type frm_db_type= DB_TYPE_UNKNOWN;1949 enum legacy_db_type frm_db_type= DB_TYPE_UNKNOWN;
19491950
@@ -1966,14 +1967,14 @@
1966 built_tmp_query.append("DROP TEMPORARY TABLE IF EXISTS ");1967 built_tmp_query.append("DROP TEMPORARY TABLE IF EXISTS ");
1967 }1968 }
19681969
1969 built_tmp_query.append("`");
1970 if (thd->db == NULL || strcmp(db,thd->db) != 0)1970 if (thd->db == NULL || strcmp(db,thd->db) != 0)
1971 {1971 {
1972 built_tmp_query.append(db);1972 append_identifier(thd, &built_tmp_query, db, db_length);
1973 built_tmp_query.append("`.`");1973 built_tmp_query.append(".");
1974 }1974 }
1975 built_tmp_query.append(table->table_name);1975 append_identifier(thd, &built_tmp_query, table->table_name,
1976 built_tmp_query.append("`,");1976 table->table_name_length);
1977 built_tmp_query.append(",");
1977 }1978 }
19781979
1979 continue;1980 continue;
@@ -1999,15 +2000,15 @@
1999 Don't write the database name if it is the current one (or if2000 Don't write the database name if it is the current one (or if
2000 thd->db is NULL).2001 thd->db is NULL).
2001 */2002 */
2002 built_query.append("`");
2003 if (thd->db == NULL || strcmp(db,thd->db) != 0)2003 if (thd->db == NULL || strcmp(db,thd->db) != 0)
2004 {2004 {
2005 built_query.append(db);2005 append_identifier(thd, &built_query, db, db_length);
2006 built_query.append("`.`");2006 built_query.append(".");
2007 }2007 }
20082008
2009 built_query.append(table->table_name);2009 append_identifier(thd, &built_query, table->table_name,
2010 built_query.append("`,");2010 table->table_name_length);
2011 built_query.append(",");
2011 }2012 }
20122013
2013 if (!drop_temporary)2014 if (!drop_temporary)

Subscribers

People subscribed via source and target branches