List:Commits« Previous MessageNext Message »
From:cbell Date:April 3 2007 9:04pm
Subject:bk commit into 5.1 tree (cbell:1.2491)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of cbell. When cbell does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-04-03 15:04:09-04:00, cbell@mysql_cab_desk. +2 -0
  WL#3762 - Initial SQL
  
  This patch alters the parser to process a list of databases for the BACKUP DATABASE
  and RESTORE DATABASE commands.

  sql/sql_parse.cc@stripped, 2007-04-03 15:04:06-04:00, cbell@mysql_cab_desk. +8 -2
    WL#3762 - Initial SQL
    
    This patch adds example code to process a list of databases for the BACKUP DATABASE
    and RESTORE DATABASE commands.

  sql/sql_yacc.yy@stripped, 2007-04-03 15:04:06-04:00, cbell@mysql_cab_desk. +30 -5
    WL#3762 - Initial SQL
    
    This patch alters the parser to process a list of databases for the BACKUP DATABASE
    and RESTORE DATABASE commands.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	cbell
# Host:	mysql_cab_desk.
# Root:	C:/source/c++/mysql-5.1_WL_3762_alt

--- 1.633/sql/sql_parse.cc	2007-04-03 15:04:22 -04:00
+++ 1.634/sql/sql_parse.cc	2007-04-03 15:04:22 -04:00
@@ -1868,7 +1868,10 @@
           - Pass database name to backup kernel
       */
       printf("\nCaught BACKUP DATABASE command:\n");
-      printf("database name = %s\n", lex->name.str);
+      List_iterator <LEX_STRING> db_list(lex->db_list);
+      LEX_STRING *tmp;
+      while ((tmp= db_list++))
+        printf("database name = %s\n", tmp->str);
       printf("to : %s\n", lex->backup_dir.str);
       send_ok(thd);
     }
@@ -1899,7 +1902,10 @@
           - Pass database name to backup kernel
       */
       printf("\nCaught RESTORE DATABASE command:\n");
-      printf("database name = %s\n", lex->name.str);
+      List_iterator <LEX_STRING> db_list(lex->db_list);
+      LEX_STRING *tmp;
+      while ((tmp= db_list++))
+        printf("database name = %s\n", tmp->str); 
       printf("from : %s\n", lex->backup_dir.str);
       send_ok(thd);
     }

--- 1.546/sql/sql_yacc.yy	2007-04-03 15:04:22 -04:00
+++ 1.547/sql/sql_yacc.yy	2007-04-03 15:04:22 -04:00
@@ -5585,10 +5585,11 @@
 	RESTORE_SYM DATABASE
 	{
 	   Lex->sql_command = SQLCOM_RESTORE_TABLE;
+     Lex->db_list.empty();
 	}
-	FROM TEXT_STRING_sys
+	database_list FROM TEXT_STRING_sys
   {
-	  Lex->backup_dir = $5; 
+	  Lex->backup_dir = $6; 
   } 
   |
 	RESTORE_SYM /* table_or_tables */
@@ -5605,12 +5606,12 @@
 */
 
 backup:
-	BACKUP_SYM DATABASE ident
+	BACKUP_SYM DATABASE
 	{
 	   Lex->sql_command = SQLCOM_BACKUP_TABLE;
-     Lex->name= $3;
+     Lex->db_list.empty();
 	}
-	TO_SYM TEXT_STRING_sys
+	database_list TO_SYM TEXT_STRING_sys
   {
 	  Lex->backup_dir = $6; 
   } 
@@ -5628,6 +5629,30 @@
 	{
 	   Lex->sql_command = SQLCOM_BACKUP_TABLE;
 	};
+
+database_list:
+  '*'
+  {
+    LEX_STRING wild_buff;
+    if (!(wild_buff.str= alloc_root(YYTHD->mem_root, 3)))
+      YYABORT;
+    strmake(wild_buff.str, "*", 1);
+    if (Lex->db_list.push_back((LEX_STRING*)
+         sql_memdup(&wild_buff, sizeof(LEX_STRING))))
+      YYABORT;
+  }
+  | ident 
+  {
+     if (Lex->db_list.push_back((LEX_STRING*)
+         sql_memdup(&$1, sizeof(LEX_STRING))))
+       YYABORT;
+  }
+  | database_list ',' ident
+  {
+     if (Lex->db_list.push_back((LEX_STRING*)
+         sql_memdup(&$3, sizeof(LEX_STRING))))
+       YYABORT;
+  };
 
 checksum:
         CHECKSUM_SYM table_or_tables

Thread
bk commit into 5.1 tree (cbell:1.2491)cbell3 Apr