List:Commits« Previous MessageNext Message »
From:Gleb Shchepa Date:April 12 2012 6:40am
Subject:bzr push into mysql-trunk branch (gleb.shchepa:3866 to 3867) WL#6168
View as plain text  
 3867 Gleb Shchepa	2012-04-12
      WL#6168: FLUSH TABLES ... FOR EXPORT -- parser
      
      This WL introduces the new "FLUSH TABLES ... FOR EXPORT" syntax for the
      larger WL5522.
      
      The "FOR EXPORT" option is mutually exclusive with the old
      "WITH READ LOCK" lock.
      
      A temporary implementation for the "FLUSH TABLES .... FOR EXPORT" command
      just copies the behaviour of "FLUSH TABLES ... WITH READ LOCK".
      
      Further logic of the "FOR EXPORT" lock will be implemented by the WL6169.
     @ mysql-test/r/flush_table.result
        WL#6168: FLUSH TABLES ... FOR EXPORT -- parser
     @ mysql-test/suite/perfschema/r/digest_table_full.result
        WL#6168: FLUSH TABLES ... FOR EXPORT -- parser
        
        New "EXPORT" token requires updates of performance schema digest tests.
     @ mysql-test/suite/perfschema/r/statement_digest.result
        WL#6168: FLUSH TABLES ... FOR EXPORT -- parser
        
        New "EXPORT" token requires updates of performance schema digest tests.
     @ mysql-test/suite/perfschema/r/statement_digest_consumers.result
        WL#6168: FLUSH TABLES ... FOR EXPORT -- parser
        
        New "EXPORT" token requires updates of performance schema digest tests.
     @ mysql-test/suite/perfschema/r/statement_digest_long_query.result
        WL#6168: FLUSH TABLES ... FOR EXPORT -- parser
        
        New "EXPORT" token requires updates of performance schema digest tests.
     @ mysql-test/t/flush_table.test
        WL#6168: FLUSH TABLES ... FOR EXPORT -- parser
     @ sql/lex.h
        WL#6168: FLUSH TABLES ... FOR EXPORT -- parser
        
        New keyword has been introduced: "EXPORT".
     @ sql/sql_yacc.yy
        WL#6168: FLUSH TABLES ... FOR EXPORT -- parser
        
        New "FLUSH TABLES ... FOR EXPORT" syntax has been added
        (with a placeholder semantic that copies the
        "FLUSH TABLES ... WITHE READ LOCK" implementation).

    modified:
      mysql-test/r/flush_table.result
      mysql-test/suite/perfschema/r/digest_table_full.result
      mysql-test/suite/perfschema/r/statement_digest.result
      mysql-test/suite/perfschema/r/statement_digest_consumers.result
      mysql-test/suite/perfschema/r/statement_digest_long_query.result
      mysql-test/t/flush_table.test
      sql/lex.h
      sql/sql_yacc.yy
 3866 Gleb Shchepa	2012-04-11
      Bug #13893310: RPL_MTS_DEBUG IS FAILING IN PB
      
      Minor after-push update of test results (the new SQL_AFTER_MTS_GAPS keyword has changed performance schema digests).

    modified:
      mysql-test/suite/perfschema/r/digest_table_full.result
      mysql-test/suite/perfschema/r/statement_digest.result
      mysql-test/suite/perfschema/r/statement_digest_consumers.result
      mysql-test/suite/perfschema/r/statement_digest_long_query.result
=== modified file 'mysql-test/r/flush_table.result'
--- a/mysql-test/r/flush_table.result	2009-11-30 15:55:03 +0000
+++ b/mysql-test/r/flush_table.result	2012-04-12 06:38:47 +0000
@@ -128,3 +128,37 @@ drop table t1;
 FLUSH TABLES WITH READ LOCK ;
 FLUSH TABLES WITH READ LOCK ;
 UNLOCK TABLES;
+
+#
+# WL#6168: FLUSH TABLES ... FOR EXPORT -- parser
+#
+
+# new "EXPORT" keyword is a valid user variable name:
+SET @export = 10;
+# new "EXPORT" keyword is a valid SP parameter name:
+CREATE PROCEDURE p1(export INT) BEGIN END;
+DROP PROCEDURE p1;
+# new "EXPORT" keyword is a valid local variable name:
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE export INT;
+END|
+DROP PROCEDURE p1;
+# new "EXPORT" keyword is a valid SP name:
+CREATE PROCEDURE export() BEGIN END;
+DROP PROCEDURE export;
+# new FLUSH TABLES ... FOR EXPORT syntax:
+FLUSH TABLES FOR EXPORT;
+ERROR 42000: No tables used near 'FOR EXPORT' at line 1
+CREATE TABLE t1 (i INT);
+CREATE TABLE t2 LIKE t1;
+FLUSH TABLES t1, t2 FOR EXPORT;
+UNLOCK TABLES;
+DROP TABLES t1, t2;
+# new "EXPORT" keyword is a valid table name:
+CREATE TABLE export (i INT);
+# it's ok to lock the "export" table for export:
+FLUSH TABLE export FOR EXPORT;
+UNLOCK TABLES;
+DROP TABLE export;
+# End of 5.6 tests

=== modified file 'mysql-test/suite/perfschema/r/digest_table_full.result'
--- a/mysql-test/suite/perfschema/r/digest_table_full.result	2012-04-11 19:37:50 +0000
+++ b/mysql-test/suite/perfschema/r/digest_table_full.result	2012-04-12 06:38:47 +0000
@@ -86,7 +86,7 @@ SELECT DIGEST, DIGEST_TEXT, COUNT_STAR,
 SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest;
 DIGEST	DIGEST_TEXT	COUNT_STAR	SUM_ROWS_AFFECTED	SUM_WARNINGS	SUM_ERRORS
 NULL	NULL	38	30	1	2
-a938a1f31256fd2ec1bc3cda9b7a8519	TRUNCATE TABLE performance_schema . events_statements_summary_by_digest  	1	0	0	0
+df69f68a97126df376bddb7763a1754c	TRUNCATE TABLE performance_schema . events_statements_summary_by_digest  	1	0	0	0
 SHOW VARIABLES LIKE "performance_schema_digests_size";
 Variable_name	Value
 performance_schema_digests_size	2

=== modified file 'mysql-test/suite/perfschema/r/statement_digest.result'
--- a/mysql-test/suite/perfschema/r/statement_digest.result	2012-04-11 19:37:50 +0000
+++ b/mysql-test/suite/perfschema/r/statement_digest.result	2012-04-12 06:38:47 +0000
@@ -85,30 +85,30 @@ Warning	1265	Data truncated for column '
 SELECT DIGEST, DIGEST_TEXT, COUNT_STAR, SUM_ROWS_AFFECTED, SUM_WARNINGS,
 SUM_ERRORS FROM performance_schema.events_statements_summary_by_digest;
 DIGEST	DIGEST_TEXT	COUNT_STAR	SUM_ROWS_AFFECTED	SUM_WARNINGS	SUM_ERRORS
-a938a1f31256fd2ec1bc3cda9b7a8519	TRUNCATE TABLE performance_schema . events_statements_summary_by_digest  	1	0	0	0
-e7f8dc15f1156f57978116e457cc7488	SELECT ? FROM t1  	1	0	0	0
-29c3f8abab7962fe1f664a51fca9effc	SELECT ? FROM `t1`  	1	0	0	0
-ca50ee9fccc00a2c95e44ef3feea866a	SELECT ?, ... FROM t1  	2	0	0	0
-3b8d5477aa795a19c9e9183e4ad04e6b	SELECT ? FROM t2  	1	0	0	0
-8067bb511c3620aac5388c5674b328a0	SELECT ?, ... FROM t2  	2	0	0	0
-a58cc957ffdd32c2cffeffa65b6c9324	INSERT INTO t1 VALUES (?)  	1	1	0	0
-439869529508fe62007c6f97890a43ae	INSERT INTO t2 VALUES (?)  	1	1	0	0
-a9f32e4c511753d7317a014630050274	INSERT INTO t3 VALUES (...)  	4	4	0	0
-55351862b4cc299bfd9958920936dc34	INSERT INTO t4 VALUES (...)  	1	1	0	0
-976ba1912e3bf2d29fb0eefed75c9f89	INSERT INTO t5 VALUES (...)  	1	1	0	0
-de71aea3aaab6826e52c690197c28a42	INSERT INTO t1 VALUES (?) /* , ... */  	2	7	0	0
-51a351f92e6fd34cef43add51eef65fe	INSERT INTO t3 VALUES (...) /* , ... */  	1	3	0	0
-85ec05195fd87103b8e751c559abe9d4	INSERT INTO t5 VALUES (...) /* , ... */  	1	3	0	0
-c72a99dab537b00f123fcb1c87c74115	INSERT INTO t1 VALUES ( NULL )  	1	1	0	0
-799c87eedbd26b27146c7f01cf275a9a	INSERT INTO t6 VALUES (...)  	5	5	0	0
-e50a377fe96a344be8496148bcd60407	SELECT ? + ?  	3	0	0	0
-08bcb063d9c3c6ac9e150ec7c727eea7	SELECT ?  	1	0	0	0
-30046d97cfdc44c95bdaa7f3987d0a20	CREATE SCHEMA statements_digest_temp  	2	2	0	0
-8e40e6461f3ab4454ddb8f21b5cda3ba	DROP SCHEMA statements_digest_temp  	2	0	0	0
-2fb7a70cbcfbc2e1900375406b9e4fca	SELECT ? FROM t11  	1	0	0	1
-1cfadd74d3e5f992ae8ae694c86fc9ec	CREATE TABLE t11 ( c CHARACTER (?) )  	2	0	0	1
-367c6d0eb00c1a6e553deddc195a6061	INSERT INTO t11 VALUES (?)  	1	1	1	0
-756f25d54bb3daf92c54903b6584586c	SHOW WARNINGS  	1	0	0	0
+df69f68a97126df376bddb7763a1754c	TRUNCATE TABLE performance_schema . events_statements_summary_by_digest  	1	0	0	0
+022248d8c22d296805854a9c5aed3cea	SELECT ? FROM t1  	1	0	0	0
+c4015f343d9d522202e0ba2e199cb31e	SELECT ? FROM `t1`  	1	0	0	0
+6e002221da34a62d06c0a3de15552f8f	SELECT ?, ... FROM t1  	2	0	0	0
+1149dd3df18aa69c79ba8279bd1d575f	SELECT ? FROM t2  	1	0	0	0
+52fbbb8de84d19b46d466df95f11d5c9	SELECT ?, ... FROM t2  	2	0	0	0
+ca653ca7ee8621171483d4eafaf0bcd8	INSERT INTO t1 VALUES (?)  	1	1	0	0
+3c350bf7a0dbc0679d87d424f116ec43	INSERT INTO t2 VALUES (?)  	1	1	0	0
+29766a1ac6cf526f30b22a1a936bb7ac	INSERT INTO t3 VALUES (...)  	4	4	0	0
+9a165cef0e7b305d032a6e749eb54ddb	INSERT INTO t4 VALUES (...)  	1	1	0	0
+037314008352a4c508439531a8c182aa	INSERT INTO t5 VALUES (...)  	1	1	0	0
+29af044602e8cc2badbc94a873a1e068	INSERT INTO t1 VALUES (?) /* , ... */  	2	7	0	0
+13d3eb930b1809c9b37e6d33be4beb7e	INSERT INTO t3 VALUES (...) /* , ... */  	1	3	0	0
+a271bef26f2dfc822ed211dbccf0fc8f	INSERT INTO t5 VALUES (...) /* , ... */  	1	3	0	0
+1c6540b559c072cf76704e2b256d8b00	INSERT INTO t1 VALUES ( NULL )  	1	1	0	0
+889f652cba112f84004344b34e29dcfc	INSERT INTO t6 VALUES (...)  	5	5	0	0
+5f569314aa69ff48f90b872847d0caf2	SELECT ? + ?  	3	0	0	0
+8910152bacf362872020350d04058cda	SELECT ?  	1	0	0	0
+3335dee57850bd3d6b263678348aed61	CREATE SCHEMA statements_digest_temp  	2	2	0	0
+2b5c38c2b011a933e36fd4b70a98dbf8	DROP SCHEMA statements_digest_temp  	2	0	0	0
+f34c231564ea1d2720123c2bc2992f07	SELECT ? FROM t11  	1	0	0	1
+7c0c81b221856473bb73bb6f172ea78f	CREATE TABLE t11 ( c CHARACTER (?) )  	2	0	0	1
+7cee18bf00e2ffcbb510966c5ceeb947	INSERT INTO t11 VALUES (?)  	1	1	1	0
+36bf274ab64ffea44bc7e2887055c796	SHOW WARNINGS  	1	0	0	0
 ####################################
 # CLEANUP
 ####################################

=== modified file 'mysql-test/suite/perfschema/r/statement_digest_consumers.result'
--- a/mysql-test/suite/perfschema/r/statement_digest_consumers.result	2012-04-11 19:37:50 +0000
+++ b/mysql-test/suite/perfschema/r/statement_digest_consumers.result	2012-04-12 06:38:47 +0000
@@ -98,30 +98,30 @@ Warning	1265	Data truncated for column '
 ####################################
 SELECT digest, digest_text, count_star FROM performance_schema.events_statements_summary_by_digest;
 digest	digest_text	count_star
-a938a1f31256fd2ec1bc3cda9b7a8519	TRUNCATE TABLE performance_schema . events_statements_summary_by_digest  	1
-e7f8dc15f1156f57978116e457cc7488	SELECT ? FROM t1  	1
-29c3f8abab7962fe1f664a51fca9effc	SELECT ? FROM `t1`  	1
-ca50ee9fccc00a2c95e44ef3feea866a	SELECT ?, ... FROM t1  	2
-3b8d5477aa795a19c9e9183e4ad04e6b	SELECT ? FROM t2  	1
-8067bb511c3620aac5388c5674b328a0	SELECT ?, ... FROM t2  	2
-a58cc957ffdd32c2cffeffa65b6c9324	INSERT INTO t1 VALUES (?)  	1
-439869529508fe62007c6f97890a43ae	INSERT INTO t2 VALUES (?)  	1
-a9f32e4c511753d7317a014630050274	INSERT INTO t3 VALUES (...)  	4
-55351862b4cc299bfd9958920936dc34	INSERT INTO t4 VALUES (...)  	1
-976ba1912e3bf2d29fb0eefed75c9f89	INSERT INTO t5 VALUES (...)  	1
-de71aea3aaab6826e52c690197c28a42	INSERT INTO t1 VALUES (?) /* , ... */  	2
-51a351f92e6fd34cef43add51eef65fe	INSERT INTO t3 VALUES (...) /* , ... */  	1
-85ec05195fd87103b8e751c559abe9d4	INSERT INTO t5 VALUES (...) /* , ... */  	1
-c72a99dab537b00f123fcb1c87c74115	INSERT INTO t1 VALUES ( NULL )  	1
-799c87eedbd26b27146c7f01cf275a9a	INSERT INTO t6 VALUES (...)  	5
-e50a377fe96a344be8496148bcd60407	SELECT ? + ?  	3
-08bcb063d9c3c6ac9e150ec7c727eea7	SELECT ?  	1
-30046d97cfdc44c95bdaa7f3987d0a20	CREATE SCHEMA statements_digest_temp  	2
-8e40e6461f3ab4454ddb8f21b5cda3ba	DROP SCHEMA statements_digest_temp  	2
-2fb7a70cbcfbc2e1900375406b9e4fca	SELECT ? FROM t11  	1
-1cfadd74d3e5f992ae8ae694c86fc9ec	CREATE TABLE t11 ( c CHARACTER (?) )  	2
-367c6d0eb00c1a6e553deddc195a6061	INSERT INTO t11 VALUES (?)  	1
-756f25d54bb3daf92c54903b6584586c	SHOW WARNINGS  	1
+df69f68a97126df376bddb7763a1754c	TRUNCATE TABLE performance_schema . events_statements_summary_by_digest  	1
+022248d8c22d296805854a9c5aed3cea	SELECT ? FROM t1  	1
+c4015f343d9d522202e0ba2e199cb31e	SELECT ? FROM `t1`  	1
+6e002221da34a62d06c0a3de15552f8f	SELECT ?, ... FROM t1  	2
+1149dd3df18aa69c79ba8279bd1d575f	SELECT ? FROM t2  	1
+52fbbb8de84d19b46d466df95f11d5c9	SELECT ?, ... FROM t2  	2
+ca653ca7ee8621171483d4eafaf0bcd8	INSERT INTO t1 VALUES (?)  	1
+3c350bf7a0dbc0679d87d424f116ec43	INSERT INTO t2 VALUES (?)  	1
+29766a1ac6cf526f30b22a1a936bb7ac	INSERT INTO t3 VALUES (...)  	4
+9a165cef0e7b305d032a6e749eb54ddb	INSERT INTO t4 VALUES (...)  	1
+037314008352a4c508439531a8c182aa	INSERT INTO t5 VALUES (...)  	1
+29af044602e8cc2badbc94a873a1e068	INSERT INTO t1 VALUES (?) /* , ... */  	2
+13d3eb930b1809c9b37e6d33be4beb7e	INSERT INTO t3 VALUES (...) /* , ... */  	1
+a271bef26f2dfc822ed211dbccf0fc8f	INSERT INTO t5 VALUES (...) /* , ... */  	1
+1c6540b559c072cf76704e2b256d8b00	INSERT INTO t1 VALUES ( NULL )  	1
+889f652cba112f84004344b34e29dcfc	INSERT INTO t6 VALUES (...)  	5
+5f569314aa69ff48f90b872847d0caf2	SELECT ? + ?  	3
+8910152bacf362872020350d04058cda	SELECT ?  	1
+3335dee57850bd3d6b263678348aed61	CREATE SCHEMA statements_digest_temp  	2
+2b5c38c2b011a933e36fd4b70a98dbf8	DROP SCHEMA statements_digest_temp  	2
+f34c231564ea1d2720123c2bc2992f07	SELECT ? FROM t11  	1
+7c0c81b221856473bb73bb6f172ea78f	CREATE TABLE t11 ( c CHARACTER (?) )  	2
+7cee18bf00e2ffcbb510966c5ceeb947	INSERT INTO t11 VALUES (?)  	1
+36bf274ab64ffea44bc7e2887055c796	SHOW WARNINGS  	1
 SELECT digest, digest_text FROM performance_schema.events_statements_current;
 digest	digest_text
 ####################################

=== modified file 'mysql-test/suite/perfschema/r/statement_digest_long_query.result'
--- a/mysql-test/suite/perfschema/r/statement_digest_long_query.result	2012-04-11 19:37:50 +0000
+++ b/mysql-test/suite/perfschema/r/statement_digest_long_query.result	2012-04-12 06:38:47 +0000
@@ -8,5 +8,5 @@ SELECT 1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1
 ####################################
 SELECT digest, digest_text, count_star FROM events_statements_summary_by_digest;
 digest	digest_text	count_star
-04926b9f44daeaf022a8c35932cb6e77	TRUNCATE TABLE events_statements_summary_by_digest  	1
-431eaac14d752b504e8f6c0bb5ad3afe	SELECT ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ?
  + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ...	1
+30a63b7e9b7ebb497030100f6a80d7b1	TRUNCATE TABLE events_statements_summary_by_digest  	1
+e7705259dae33df48399104e0222ad91	SELECT ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ?
  + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ...	1

=== modified file 'mysql-test/t/flush_table.test'
--- a/mysql-test/t/flush_table.test	2009-11-30 15:55:03 +0000
+++ b/mysql-test/t/flush_table.test	2012-04-12 06:38:47 +0000
@@ -127,3 +127,60 @@ FLUSH TABLES WITH READ LOCK ;
 UNLOCK TABLES;
 
 # End of 4.1 tests
+
+--echo
+--echo #
+--echo # WL#6168: FLUSH TABLES ... FOR EXPORT -- parser
+--echo #
+--echo
+
+--echo # new "EXPORT" keyword is a valid user variable name:
+
+SET @export = 10;
+
+--echo # new "EXPORT" keyword is a valid SP parameter name:
+
+CREATE PROCEDURE p1(export INT) BEGIN END;
+DROP PROCEDURE p1;
+
+--echo # new "EXPORT" keyword is a valid local variable name:
+
+DELIMITER |;
+CREATE PROCEDURE p1()
+BEGIN
+  DECLARE export INT;
+END|
+DELIMITER ;|
+DROP PROCEDURE p1;
+
+--echo # new "EXPORT" keyword is a valid SP name:
+
+CREATE PROCEDURE export() BEGIN END;
+DROP PROCEDURE export;
+
+--echo # new FLUSH TABLES ... FOR EXPORT syntax:
+
+--error ER_PARSE_ERROR
+FLUSH TABLES FOR EXPORT;
+
+CREATE TABLE t1 (i INT);
+CREATE TABLE t2 LIKE t1;
+
+FLUSH TABLES t1, t2 FOR EXPORT;
+UNLOCK TABLES;
+
+DROP TABLES t1, t2;
+
+--echo # new "EXPORT" keyword is a valid table name:
+
+CREATE TABLE export (i INT);
+
+--echo # it's ok to lock the "export" table for export:
+
+FLUSH TABLE export FOR EXPORT;
+UNLOCK TABLES;
+
+DROP TABLE export;
+
+--echo # End of 5.6 tests
+

=== modified file 'sql/lex.h'
--- a/sql/lex.h	2012-04-11 16:52:28 +0000
+++ b/sql/lex.h	2012-04-12 06:38:47 +0000
@@ -210,6 +210,7 @@ static SYMBOL symbols[] = {
   { "EXISTS",		SYM(EXISTS)},
   { "EXIT",             SYM(EXIT_SYM)},
   { "EXPANSION",	SYM(EXPANSION_SYM)},
+  { "EXPORT",	        SYM(EXPORT_SYM)},
   { "EXCHANGE",         SYM(EXCHANGE_SYM)},
   { "EXPLAIN",		SYM(DESCRIBE)},
   { "EXTENDED",		SYM(EXTENDED_SYM)},

=== modified file 'sql/sql_yacc.yy'
--- a/sql/sql_yacc.yy	2012-04-11 16:52:28 +0000
+++ b/sql/sql_yacc.yy	2012-04-12 06:38:47 +0000
@@ -1182,6 +1182,7 @@ bool my_yyoverflow(short **a, YYSTYPE **
 %token  EXISTS                        /* SQL-2003-R */
 %token  EXIT_SYM
 %token  EXPANSION_SYM
+%token  EXPORT_SYM
 %token  EXTENDED_SYM
 %token  EXTENT_SIZE_SYM
 %token  EXTRACT_SYM                   /* SQL-2003-N */
@@ -1824,7 +1825,7 @@ bool my_yyoverflow(short **a, YYSTYPE **
         opt_column_list grant_privileges grant_ident grant_list grant_option
         object_privilege object_privilege_list user_list rename_list
         clear_privileges flush_options flush_option
-        opt_with_read_lock flush_options_list
+        opt_flush_lock flush_options_list
         equal optional_braces
         opt_mi_check_type opt_to mi_check_types normal_join
         table_to_table_list table_to_table opt_table_list opt_as
@@ -12255,11 +12256,11 @@ flush_options:
             YYPS->m_mdl_type= MDL_SHARED_HIGH_PRIO;
           }
           opt_table_list {}
-          opt_with_read_lock {}
+          opt_flush_lock {}
         | flush_options_list
         ;
 
-opt_with_read_lock:
+opt_flush_lock:
           /* empty */ {}
         | WITH READ_SYM LOCK_SYM
           {
@@ -12272,6 +12273,30 @@ opt_with_read_lock:
               tables->open_type= OT_BASE_ONLY;      /* Ignore temporary tables. */
             }
           }
+        | FOR_SYM
+          {
+            if (Lex->query_tables == NULL) // Table list can't be empty
+            {
+              my_parse_error(ER(ER_NO_TABLES_USED));
+              MYSQL_YYABORT;
+            } 
+          }
+          EXPORT_SYM
+          {
+            /*
+              Following code is a temporary copy of the "WITH READ LOCK" logic
+              from the previous rule.
+              TODO: Runtime: replace with the "FOR EXPORT" implementation.
+            */
+            TABLE_LIST *tables= Lex->query_tables;
+            Lex->type|= REFRESH_READ_LOCK;
+            for (; tables; tables= tables->next_global)
+            {
+              tables->mdl_request.set_type(MDL_SHARED_NO_WRITE);
+              tables->required_type= FRMTYPE_TABLE; /* Don't try to flush views. */
+              tables->open_type= OT_BASE_ONLY;      /* Ignore temporary tables. */
+            }
+          }
         ;
 
 flush_options_list:
@@ -13534,6 +13559,7 @@ keyword_sp:
         | EVERY_SYM                {}
         | EXCHANGE_SYM             {}
         | EXPANSION_SYM            {}
+        | EXPORT_SYM               {}
         | EXTENDED_SYM             {}
         | EXTENT_SIZE_SYM          {}
         | FAULTS_SYM               {}

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (gleb.shchepa:3866 to 3867) WL#6168Gleb Shchepa12 Apr