List:Commits« Previous MessageNext Message »
From:Patrick Galbraith Date:March 14 2006 9:18am
Subject:bk commit into 5.1 tree (patg:1.2119)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of patg. When patg 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
  1.2119 06/03/14 09:17:48 patg@stripped +5 -0
  WL# 3031 added new tests, and accomodated 'if exists' in "DROP SERVER..." 
  statement.

  mysql-test/t/federated_server3.test
    1.1 06/03/14 09:17:10 patg@stripped +33 -0
    WL #3031 First draft of test, "CREATE/ALTER/DROP" server syntax test.

  mysql-test/t/federated_server3.test
    1.0 06/03/14 09:17:10 patg@stripped +0 -0
    BitKeeper file
/Users/patg/mysql-build/mysql-5.1-wl3031/mysql-test/t/federated_server3.test

  mysql-test/t/federated_server.test
    1.1 06/03/14 09:17:04 patg@stripped +82 -0
    WL# 3031 First draft of test

  mysql-test/t/federated_server.test
    1.0 06/03/14 09:17:04 patg@stripped +0 -0
    BitKeeper file
/Users/patg/mysql-build/mysql-5.1-wl3031/mysql-test/t/federated_server.test

  sql/sql_yacc.yy
    1.451 06/03/14 09:17:03 patg@stripped +4 -3
    WL #3031 Needed to accomodate 'if exists' in "DROP SERVER" statement

  sql/sql_parse.cc
    1.518 06/03/14 09:17:02 patg@stripped +10 -3
    WL #3031 Needed to accomodate 'if exists' in "DROP SERVER" syntax

  sql/mysqld.cc
    1.530 06/03/14 09:17:02 patg@stripped +1 -0
    WL #3031 Small change

# 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:	patg
# Host:	radha.local
# Root:	/Users/patg/mysql-build/mysql-5.1-wl3031

--- 1.529/sql/mysqld.cc	2006-02-10 03:28:58 +01:00
+++ 1.530/sql/mysqld.cc	2006-03-14 09:17:02 +01:00
@@ -3643,6 +3643,7 @@
   if (servers_init(0))
   {
   }
+
   if (!opt_noacl)
   {
     plugin_load();

--- 1.517/sql/sql_parse.cc	2006-02-10 03:28:59 +01:00
+++ 1.518/sql/sql_parse.cc	2006-03-14 09:17:02 +01:00
@@ -4936,9 +4936,16 @@
     DBUG_PRINT("info", ("case SQLCOM_DROP_SERVER"));
     if ((err_code= drop_server(thd, &lex->server_options)))
     {
-      DBUG_PRINT("info", ("problem dropping server %s",
-                          lex->server_options.server_name));
-      my_error(err_code, MYF(0), lex->server_options.server_name);
+      if (! lex->drop_if_exists && err_code == ER_FOREIGN_SERVER_EXISTS)
+      {
+        DBUG_PRINT("info", ("problem dropping server %s",
+                            lex->server_options.server_name));
+        my_error(err_code, MYF(0), lex->server_options.server_name);
+      }
+      else
+      {
+        send_ok(thd, 0);
+      }
       break;
     }
     send_ok(thd, 1);

--- 1.450/sql/sql_yacc.yy	2006-03-05 05:43:18 +01:00
+++ 1.451/sql/sql_yacc.yy	2006-03-14 09:17:03 +01:00
@@ -7776,11 +7776,12 @@
             LEX *lex= Lex;
             lex->alter_tablespace_info->ts_cmd_type= DROP_LOGFILE_GROUP;
           }
-        | DROP SERVER_SYM ident_or_text
+        | DROP SERVER_SYM if_exists ident_or_text
         {
           Lex->sql_command = SQLCOM_DROP_SERVER;
-          Lex->server_options.server_name= $3.str;
-          Lex->server_options.server_name_length= $3.length;
+          Lex->drop_if_exists= $3;
+          Lex->server_options.server_name= $4.str;
+          Lex->server_options.server_name_length= $4.length;
         }
 	;
 
--- New file ---
+++ mysql-test/t/federated_server.test	06/03/14 09:17:04
# should work with embedded server after mysqltest is fixed
-- source include/not_embedded.inc
source include/federated.inc;

connection slave;
create database first_db;
create database second_db;

use first_db;

DROP TABLE IF EXISTS first_db.t1;
CREATE TABLE first_db.t1 (
    `id` int(20) NOT NULL,
    `name` varchar(32) NOT NULL default ''
    )
  DEFAULT CHARSET=latin1;

use second_db;
DROP TABLE IF EXISTS second_db.t1;
CREATE TABLE second_db.t1 (
    `id` int(20) NOT NULL,
    `name` varchar(32) NOT NULL default ''
    )
  DEFAULT CHARSET=latin1;

connection master;

drop server if exists 'server_one';
eval create server 'server_one' foreign data wrapper 'mysql' options
  (HOST 'localhost',
  DATABASE 'first_db',
  USER 'root',
  PASSWORD '',
  PORT $SLAVE_MYPORT,
  SOCKET '',
  OWNER 'root');

drop server if exists 'server_two';
eval create server 'server_two' foreign data wrapper 'mysql' options
  (HOST 'localhost',
  DATABASE 'second_db',
  USER 'root',
  PASSWORD '',
  PORT $SLAVE_MYPORT,
  SOCKET '',
  OWNER 'root');

select * from mysql.servers;

DROP TABLE IF EXISTS federated.old;
CREATE TABLE federated.old (
    `id` int(20) NOT NULL,
    `name` varchar(32) NOT NULL default ''
    )
  ENGINE="FEDERATED" DEFAULT CHARSET=latin1
  CONNECTION='mysql://root@stripped:$SLAVE_MYPORT/first_db/t1';

INSERT INTO federated.old (id, name) values (1, 'first_db first value');

SELECT * FROM federated.old;

DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
    `id` int(20) NOT NULL,
    `name` varchar(32) NOT NULL default ''
    )
  ENGINE="FEDERATED" DEFAULT CHARSET=latin1
  CONNECTION='server_one';

INSERT INTO federated.t1 (id, name) values (1, 'First db record');

SELECT * FROM federated.t1;

drop table federated.t1;

connection slave;
drop table first_db.t1;
drop table second_db.t1;
drop database first_db;
drop database second_db;

source include/federated_cleanup.inc;

--- New file ---
+++ mysql-test/t/federated_server3.test	06/03/14 09:17:10
# should work with embedded server after mysqltest is fixed
--disable-warnings
drop server if exists 'server_one';
--enable-warnings
eval create server 'server_one' foreign data wrapper 'mysql' options
  (HOST 'localhost',
  DATABASE 'first_db',
  USER 'root',
  PASSWORD '',
  PORT 5553,
  SOCKET '',
  OWNER 'root');

--disable-warnings
drop server if exists 'server_two';
--enable-warnings
eval create server 'server_two' foreign data wrapper 'mysql' options
  (HOST 'localhost',
  DATABASE 'second_db',
  USER 'root',
  PASSWORD '',
  PORT 5554,
  SOCKET '',
  OWNER 'root');

select * from mysql.servers;

eval alter server 'server_one' options (HOST '127.0.0.1', PORT $SLAVE_MYPORT);

select * from mysql.servers;

drop server 'server_one';
drop server 'server_two';

Thread
bk commit into 5.1 tree (patg:1.2119)Patrick Galbraith14 Mar