List:Internals« Previous MessageNext Message »
From:kent Date:November 2 2005 10:40am
Subject:bk commit into 5.1 tree (kent:1.1958)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of kent. When kent 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.1958 05/11/02 11:40:34 kent@stripped +11 -0
  Merge

  mysql-test/r/mysqltest.result
    1.15 05/11/02 11:40:28 kent@stripped +0 -0
    SCCS merged

  sql/structs.h
    1.52 05/11/02 11:16:29 kent@stripped +0 -0
    Auto merged

  sql/sql_show.cc
    1.279 05/11/02 11:16:28 kent@stripped +0 -0
    Auto merged

  sql/mysqld.cc
    1.493 05/11/02 11:16:28 kent@stripped +0 -0
    Auto merged

  mysql-test/t/sp-security.test
    1.25 05/11/02 11:16:27 kent@stripped +0 -0
    Auto merged

  mysql-test/t/sp-security.test
    1.22.2.2 05/11/02 11:16:27 kent@stripped +0 -0
    Turn off EOLN_NATIVE flag

  mysql-test/t/mysqltest.test
    1.19 05/11/02 11:16:26 kent@stripped +0 -0
    Auto merged

  mysql-test/t/myisam.test
    1.50 05/11/02 11:16:26 kent@stripped +0 -0
    Auto merged

  mysql-test/t/information_schema.test
    1.61 05/11/02 11:16:26 kent@stripped +0 -0
    Auto merged

  mysql-test/r/connect.result
    1.19 05/11/02 11:16:26 kent@stripped +0 -0
    Auto merged

  mysql-test/mysql-test-run.pl
    1.42 05/11/02 11:16:26 kent@stripped +0 -0
    Auto merged

  client/mysqltest.c
    1.166 05/11/02 11:16:25 kent@stripped +0 -0
    Auto merged

# 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:	kent
# Host:	c-7d4072d5.010-2112-6f72651.cust.bredbandsbolaget.se
# Root:	/Users/kent/mysql/bk/mysql-5.1/RESYNC

--- 1.492/sql/mysqld.cc	2005-11-01 23:58:14 +01:00
+++ 1.493/sql/mysqld.cc	2005-11-02 11:16:28 +01:00
@@ -5962,9 +5962,7 @@
   {"Com_xa_recover",           (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_XA_RECOVER]),SHOW_LONG_STATUS},
   {"Com_xa_rollback",          (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_XA_ROLLBACK]),SHOW_LONG_STATUS},
   {"Com_xa_start",             (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_XA_START]),SHOW_LONG_STATUS},
-#ifdef HAVE_COMPRESS
   {"Compression",              (char*) 0,                        SHOW_NET_COMPRESSION},
-#endif /* HAVE_COMPRESS */
   {"Connections",              (char*) &thread_id,              SHOW_LONG_CONST},
   {"Created_tmp_disk_tables",  (char*) offsetof(STATUS_VAR, created_tmp_disk_tables), SHOW_LONG_STATUS},
   {"Created_tmp_files",	       (char*) &my_tmp_file_created,	SHOW_LONG},

--- 1.278/sql/sql_show.cc	2005-11-01 23:58:15 +01:00
+++ 1.279/sql/sql_show.cc	2005-11-02 11:16:28 +01:00
@@ -1645,11 +1645,9 @@
 	  value= (value-(char*) &dflt_key_cache_var)+ (char*) dflt_key_cache;
 	  end= longlong10_to_str(*(longlong*) value, buff, 10);
 	  break;
-#ifdef HAVE_COMPRESS
         case SHOW_NET_COMPRESSION:
           end= strmov(buff, thd->net.compress ? "ON" : "OFF");
           break;
-#endif /* HAVE_COMPRESS */
         case SHOW_UNDEF:				// Show never happen
         case SHOW_SYS:
           break;					// Return empty string

--- 1.51/sql/structs.h	2005-10-12 13:55:54 +02:00
+++ 1.52/sql/structs.h	2005-11-02 11:16:29 +01:00
@@ -89,6 +89,7 @@
   uint  extra_length;
   uint	usable_key_parts;		/* Should normally be = key_parts */
   enum  ha_key_alg algorithm;
+  struct st_plugin_int *parser;         /* Fulltext [pre]parser */
   KEY_PART_INFO *key_part;
   char	*name;				/* Name of key */
   /*
@@ -135,6 +136,7 @@
   byte	*cache,*cache_pos,*cache_end,*read_positions;
   IO_CACHE *io_cache;
   bool print_error, ignore_not_found_rows;
+  bool first; /* used only with rr_index_read */
 } READ_RECORD;
 
 

--- 1.60/mysql-test/t/information_schema.test	2005-10-21 10:14:45 +02:00
+++ 1.61/mysql-test/t/information_schema.test	2005-11-02 11:16:26 +01:00
@@ -499,8 +499,8 @@
 #
 
 grant select on test.* to mysqltest_4@localhost;
-connect (user4,localhost,mysqltest_4,,);
-connection user4;
+connect (user10261,localhost,mysqltest_4,,);
+connection user10261;
 SELECT TABLE_NAME, COLUMN_NAME, PRIVILEGES FROM INFORMATION_SCHEMA.COLUMNS 
 where COLUMN_NAME='TABLE_NAME';
 connection default;

--- 1.41/mysql-test/mysql-test-run.pl	2005-11-01 23:58:13 +01:00
+++ 1.42/mysql-test/mysql-test-run.pl	2005-11-02 11:16:26 +01:00
@@ -190,7 +190,6 @@
 our $opt_ssl;
 our $opt_skip_ssl;
 our $opt_ssl_supported;
-our $opt_with_openssl;           # Deprecated flag
 our $opt_ps_protocol;
 
 our $opt_current_test;
@@ -484,8 +483,7 @@
              # Control what engine/variation to run
              'embedded-server'          => \$opt_embedded_server,
              'ps-protocol'              => \$opt_ps_protocol,
-             'with-openssl'             => \$opt_with_openssl,
-             'ssl'                      => \$opt_ssl,
+             'ssl|with-openssl'         => \$opt_ssl,
              'skip-ssl'                 => \$opt_skip_ssl,
              'compress'                 => \$opt_compress,
              'bench'                    => \$opt_bench,
@@ -1152,13 +1150,6 @@
 
 sub check_ssl_support () {
 
-
-  # Convert deprecated --with-openssl to --ssl
-  if ( $opt_with_openssl )
-  {
-    $opt_ssl= 1;
-  }
-
   if ($opt_skip_ssl)
   {
     mtr_report("Skipping SSL");
@@ -2679,7 +2670,7 @@
 
   force                 Continue to run the suite after failure
   with-ndbcluster       Use cluster, and enable test cases that requres it
-  skip-ndb[cluster]     Use cluster, and enable test cases that requres it
+  skip-ndb[cluster]     Skip the ndb test cases, don't start cluster
   do-test=PREFIX        Run test cases which name are prefixed with PREFIX
   start-from=PREFIX     Run test cases starting from test prefixed with PREFIX
   suite=NAME            Run the test suite named NAME. The default is "main"

--- 1.14/mysql-test/r/mysqltest.result	2005-09-30 16:51:29 +02:00
+++ 1.15/mysql-test/r/mysqltest.result	2005-11-02 11:40:28 +01:00
@@ -344,6 +344,18 @@
 mysqltest: At line 1: Invalid integer argument "10!"
 mysqltest: At line 1: End of line junk detected: "!"
 mysqltest: At line 1: Invalid integer argument "a"
+mysqltest: At line 1: Syntax error in connect - expected '(' found 'mysqltest: At line 1: Missing connection host
+mysqltest: At line 1: Missing connection host
+mysqltest: At line 1: Missing connection user
+mysqltest: At line 1: Missing connection user
+mysqltest: At line 1: Missing connection password
+mysqltest: At line 1: Missing connection db
+mysqltest: At line 1: Could not open connection 'con2': Unknown database 'illegal_db'
+mysqltest: At line 1: Illegal argument for port: 'illegal_port'
+mysqltest: At line 1: Illegal option to connect: SMTP
+mysqltest: In included file "./var/tmp/con.sql": At line 7: Connection limit exhausted - increase MAX_CONS in mysqltest.c
+mysqltest: In included file "./var/tmp/con.sql": At line 3: connection 'test_con1' not found in connection pool
+mysqltest: In included file "./var/tmp/con.sql": At line 2: Connection test_con1 already exists
 Output from mysqltest-x.inc
 Output from mysqltest-x.inc
 Output from mysqltest-x.inc

--- 1.18/mysql-test/t/mysqltest.test	2005-09-28 11:28:36 +02:00
+++ 1.19/mysql-test/t/mysqltest.test	2005-11-02 11:16:26 +01:00
@@ -358,11 +358,11 @@
 # Missing delimiter
 # The comment will be "sucked into" the sleep command since
 # delimiter is missing until after "show status"
---system echo "sleep 4" > var/log/mysqltest.sql
---system echo "# A comment" >> var/log/mysqltest.sql
---system echo "show status;" >> var/log/mysqltest.sql
+--system echo "sleep 4" > var/tmp/mysqltest.sql
+--system echo "# A comment" >> var/tmp/mysqltest.sql
+--system echo "show status;" >> var/tmp/mysqltest.sql
 --error 1
---exec $MYSQL_TEST < var/log/mysqltest.sql 2>&1
+--exec $MYSQL_TEST < var/tmp/mysqltest.sql 2>&1
 
 #
 # Extra delimiter
@@ -805,6 +805,66 @@
 --exec echo "save_master_pos; sync_with_master 10 !;" | $MYSQL_TEST 2>&1
 --error 1
 --exec echo "save_master_pos; sync_with_master a;" | $MYSQL_TEST 2>&1
+
+# ----------------------------------------------------------------------------
+# Test connect
+# ----------------------------------------------------------------------------
+
+--error 1
+--exec echo "connect;" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "connect ();" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "connect (con2);" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "connect (con2,);" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "connect (con2,localhost);" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "connect (con2, localhost, root);" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "connect (con2,  localhost, root,);" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "connect (con2,localhost,root,,illegal_db);" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "connect (con1,localhost,root,,,illegal_port,);" | $MYSQL_TEST 2>&1
+--error 1
+--exec echo "connect (con1,localhost,root,,,,,SMTP POP);" | $MYSQL_TEST 2>&1
+
+# Repeat connect/disconnect
+--exec echo "let \$i=100;"                              > var/tmp/con.sql
+--exec echo "while (\$i)"                              >> var/tmp/con.sql
+--exec echo "{"                                        >> var/tmp/con.sql
+--exec echo " connect (test_con1,localhost,root,,); "  >> var/tmp/con.sql
+--exec echo " disconnect test_con1; "                  >> var/tmp/con.sql
+--exec echo " dec \$i;                               " >> var/tmp/con.sql
+--exec echo "}"                                        >> var/tmp/con.sql
+--exec echo "source var/tmp/con.sql;" | $MYSQL_TEST 2>&1
+
+# Repeat connect/disconnect, exceed max number of connections
+--exec echo "let \$i=200;"                              > var/tmp/con.sql
+--exec echo "while (\$i)"                              >> var/tmp/con.sql
+--exec echo "{"                                        >> var/tmp/con.sql
+--exec echo " connect (test_con1,localhost,root,,); "  >> var/tmp/con.sql
+--exec echo " disconnect test_con1; "                  >> var/tmp/con.sql
+--exec echo " dec \$i;                               " >> var/tmp/con.sql
+--exec echo "}"                                        >> var/tmp/con.sql
+--error 1
+--exec echo "source var/tmp/con.sql;" | $MYSQL_TEST 2>&1
+
+# Select disconnected connection
+--exec echo "connect (test_con1,localhost,root,,);"    > var/tmp/con.sql
+--exec echo "disconnect test_con1; "                  >> var/tmp/con.sql
+--exec echo "connection test_con1;"                   >> var/tmp/con.sql
+--error 1
+--exec echo "source var/tmp/con.sql;" | $MYSQL_TEST 2>&1
+
+# Connection name already used
+--exec echo "connect (test_con1,localhost,root,,);"    > var/tmp/con.sql
+--exec echo "connect (test_con1,localhost,root,,);"   >> var/tmp/con.sql
+--error 1
+--exec echo "source var/tmp/con.sql;" | $MYSQL_TEST 2>&1
+
 
 
 # ----------------------------------------------------------------------------

--- 1.49/mysql-test/t/myisam.test	2005-09-21 13:53:08 +02:00
+++ 1.50/mysql-test/t/myisam.test	2005-11-02 11:16:26 +01:00
@@ -703,6 +703,7 @@
 select * from t1;
 check table t1;
 drop table t1;
+disconnect con1;
 
 # Same test with dynamic record length
 create table t1 (a int, b varchar(30) default "hello");
@@ -727,7 +728,9 @@
 select a from t1;
 check table t1;
 drop table t1;
+disconnect con1;
 set global concurrent_insert=@save_concurrent_insert;
+
 
 # BUG#9622 - ANALYZE TABLE and ALTER TABLE .. ENABLE INDEX produce
 # different statistics on the same table with NULL values.

--- 1.165/client/mysqltest.c	2005-11-01 23:58:13 +01:00
+++ 1.166/client/mysqltest.c	2005-11-02 11:16:25 +01:00
@@ -77,7 +77,6 @@
 #define PAD_SIZE	128
 #define MAX_CONS	128
 #define MAX_INCLUDE_DEPTH 16
-#define LAZY_GUESS_BUF_SIZE 8192
 #define INIT_Q_LINES	  1024
 #define MIN_VAR_ALLOC	  32
 #define BLOCK_STACK_DEPTH  32
@@ -317,8 +316,6 @@
 Q_ENABLE_METADATA, Q_DISABLE_METADATA,
 Q_EXEC, Q_DELIMITER,
 Q_DISABLE_ABORT_ON_ERROR, Q_ENABLE_ABORT_ON_ERROR,
-Q_DISABLE_SSL, Q_ENABLE_SSL,
-Q_DISABLE_COMPRESS, Q_ENABLE_COMPRESS,
 Q_DISPLAY_VERTICAL_RESULTS, Q_DISPLAY_HORIZONTAL_RESULTS,
 Q_QUERY_VERTICAL, Q_QUERY_HORIZONTAL,
 Q_START_TIMER, Q_END_TIMER,
@@ -405,10 +402,6 @@
   "delimiter",
   "disable_abort_on_error",
   "enable_abort_on_error",
-  "disable_ssl",
-  "enable_ssl",
-  "disable_compress",
-  "enable_compress",
   "vertical_results",
   "horizontal_results",
   "query_vertical",
@@ -1845,23 +1838,29 @@
   DBUG_VOID_RETURN;
 }
 
-
-int select_connection_name(const char *name)
+struct connection * find_connection_by_name(const char *name)
 {
   struct connection *con;
-  DBUG_ENTER("select_connection2");
-  DBUG_PRINT("enter",("name: '%s'", name));
-
   for (con= cons; con < next_con; con++)
   {
     if (!strcmp(con->name, name))
     {
-      cur_con= con;
-      DBUG_RETURN(0);
+      return con;
     }
   }
-  die("connection '%s' not found in connection pool", name);
-  DBUG_RETURN(1);				/* Never reached */
+  return 0; /* Connection not found */
+}
+
+
+int select_connection_name(const char *name)
+{
+  struct connection *con;
+  DBUG_ENTER("select_connection2");
+  DBUG_PRINT("enter",("name: '%s'", name));
+
+  if (!(cur_con= find_connection_by_name(name)))
+    die("connection '%s' not found in connection pool", name);
+  DBUG_RETURN(0);
 }
 
 
@@ -1891,7 +1890,7 @@
   DBUG_PRINT("enter",("name: '%s'",p));
 
   if (!*p)
-    die("Missing connection name in connect");
+    die("Missing connection name in disconnect");
   name= p;
   while (*p && !my_isspace(charset_info,*p))
     p++;
@@ -1914,6 +1913,14 @@
       }
 #endif
       mysql_close(&con->mysql);
+      my_free(con->name, MYF(0));
+      /*
+         When the connection is closed set name to "closed_connection"
+         to make it possible to reuse the connection name.
+         The connection slot will not be reused
+       */
+      if (!(con->name = my_strdup("closed_connection", MYF(MY_WME))))
+        die("Out of memory");
       DBUG_RETURN(0);
     }
   }
@@ -1929,18 +1936,22 @@
    ) are delimiters/terminators
 */
 
-char* safe_get_param(char *str, char** arg, const char *msg)
+char* safe_get_param(char *str, char** arg, const char *msg, bool required)
 {
   DBUG_ENTER("safe_get_param");
+  if(!*str)
+  {
+    if (required)
+      die(msg);
+    *arg= str;
+    DBUG_RETURN(str);
+  }
   while (*str && my_isspace(charset_info,*str))
     str++;
   *arg= str;
-  for (; *str && *str != ',' && *str != ')' ; str++)
-  {
-    if (my_isspace(charset_info,*str))
-      *str= 0;
-  }
-  if (!*str)
+  while (*str && *str != ',' && *str != ')')
+    str++;
+  if (required && !*arg)
     die(msg);
 
   *str++= 0;
@@ -2125,13 +2136,39 @@
 }
 
 
+/*
+  Open a new connection to MySQL Server with the parameters
+  specified
+
+  SYNOPSIS
+   do_connect()
+    q	       called command
+
+  DESCRIPTION
+    connect(<name>,<host>,<user>,<pass>,<db>,[<port>,<sock>[<opts>]]);
+
+      <name> - name of the new connection
+      <host> - hostname of server
+      <user> - user to connect as
+      <pass> - password used when connecting
+      <db>   - initial db when connected
+      <port> - server port
+      <sock> - server socket
+      <opts> - options to use for the connection
+               SSL - use SSL if available
+               COMPRESS - use compression if available
+
+ */
+
 int do_connect(struct st_query *q)
 {
   char *con_name, *con_user,*con_pass, *con_host, *con_port_str,
-    *con_db, *con_sock;
-  char *p= q->first_argument;
+    *con_db, *con_sock, *con_options;
+  char *con_buf, *p;
   char buff[FN_REFLEN];
   int con_port;
+  bool con_ssl= 0;
+  bool con_compress= 0;
   int free_con_sock= 0;
   int error= 0;
   int create_conn= 1;
@@ -2139,57 +2176,97 @@
   DBUG_ENTER("do_connect");
   DBUG_PRINT("enter",("connect: %s",p));
 
+  /* Make a copy of query before parsing, safe_get_param will modify */
+  if (!(con_buf= my_strdup(q->first_argument, MYF(MY_WME))))
+    die("Could not allocate con_buf");
+  p= con_buf;
+
   if (*p != '(')
     die("Syntax error in connect - expected '(' found '%c'", *p);
   p++;
-  p= safe_get_param(p, &con_name, "missing connection name");
-  p= safe_get_param(p, &con_host, "missing connection host");
-  p= safe_get_param(p, &con_user, "missing connection user");
-  p= safe_get_param(p, &con_pass, "missing connection password");
-  p= safe_get_param(p, &con_db, "missing connection db");
-  if (!*p || *p == ';')				/* Default port and sock */
-  {
-    con_port= port;
-    con_sock= (char*) unix_sock;
-  }
-  else
+  p= safe_get_param(p, &con_name, "Missing connection name", 1);
+  p= safe_get_param(p, &con_host, "Missing connection host", 1);
+  p= safe_get_param(p, &con_user, "Missing connection user", 1);
+  p= safe_get_param(p, &con_pass, "Missing connection password", 1);
+  p= safe_get_param(p, &con_db, "Missing connection db", 1);
+
+  /* Port */
+  VAR* var_port;
+  p= safe_get_param(p, &con_port_str, "Missing connection port", 0);
+  if (*con_port_str)
   {
-    VAR* var_port, *var_sock;
-    p= safe_get_param(p, &con_port_str, "missing connection port");
     if (*con_port_str == '$')
     {
       if (!(var_port= var_get(con_port_str, 0, 0, 0)))
-	die("Unknown variable '%s'", con_port_str+1);
+        die("Unknown variable '%s'", con_port_str+1);
       con_port= var_port->int_val;
     }
     else
+    {
       con_port= atoi(con_port_str);
-    p= safe_get_param(p, &con_sock, "missing connection socket");
+      if (con_port == 0)
+        die("Illegal argument for port: '%s'", con_port_str);
+    }
+  }
+  else
+  {
+    con_port= port;
+  }
+
+  /* Sock */
+  VAR *var_sock;
+  p= safe_get_param(p, &con_sock, "Missing connection socket", 0);
+  if (*con_sock)
+  {
     if (*con_sock == '$')
     {
       if (!(var_sock= var_get(con_sock, 0, 0, 0)))
-	die("Unknown variable '%s'", con_sock+1);
+        die("Unknown variable '%s'", con_sock+1);
       if (!(con_sock= (char*)my_malloc(var_sock->str_val_len+1, MYF(0))))
-	die("Out of memory");
+        die("Out of memory");
       free_con_sock= 1;
       memcpy(con_sock, var_sock->str_val, var_sock->str_val_len);
       con_sock[var_sock->str_val_len]= 0;
     }
   }
+  else
+  {
+    con_sock= (char*) unix_sock;
+  }
+
+  /* Options */
+  p= safe_get_param(p, &con_options, "Missing options", 0);
+  while (*con_options)
+  {
+    char* str= con_options;
+    while (*str && !my_isspace(charset_info, *str))
+      str++;
+    *str++= 0;
+    if (!strcmp(con_options, "SSL"))
+      con_ssl= 1;
+    else if (!strcmp(con_options, "COMPRESS"))
+      con_compress= 1;
+    else
+      die("Illegal option to connect: %s", con_options);
+    con_options= str;
+  }
   q->last_argument= p;
 
   if (next_con == cons_end)
     die("Connection limit exhausted - increase MAX_CONS in mysqltest.c");
 
+  if (find_connection_by_name(con_name))
+    die("Connection %s already exists", con_name);
+
   if (!mysql_init(&next_con->mysql))
     die("Failed on mysql_init()");
-  if (opt_compress)
+  if (opt_compress || con_compress)
     mysql_options(&next_con->mysql,MYSQL_OPT_COMPRESS,NullS);
   mysql_options(&next_con->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
   mysql_options(&next_con->mysql, MYSQL_SET_CHARSET_NAME, charset_name);
 
 #ifdef HAVE_OPENSSL
-  if (opt_use_ssl)
+  if (opt_use_ssl || con_ssl)
     mysql_ssl_set(&next_con->mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
 		  opt_ssl_capath, opt_ssl_cipher);
 #endif
@@ -2220,6 +2297,7 @@
   }
   if (free_con_sock)
     my_free(con_sock, MYF(MY_WME));
+  my_free(con_buf, MYF(MY_WME));
   DBUG_RETURN(error);
 }
 
@@ -4026,12 +4104,6 @@
       case Q_DISABLE_QUERY_LOG:  disable_query_log=1; break;
       case Q_ENABLE_ABORT_ON_ERROR:  abort_on_error=1; break;
       case Q_DISABLE_ABORT_ON_ERROR: abort_on_error=0; break;
-#ifdef HAVE_OPENSSL
-      case Q_ENABLE_SSL:  opt_use_ssl=1; break;
-      case Q_DISABLE_SSL: opt_use_ssl=0; break;
-#endif
-      case Q_ENABLE_COMPRESS:  opt_compress=1; break;
-      case Q_DISABLE_COMPRESS: opt_compress=0; break;
       case Q_ENABLE_RESULT_LOG:  disable_result_log=0; break;
       case Q_DISABLE_RESULT_LOG: disable_result_log=1; break;
       case Q_ENABLE_WARNINGS:    disable_warnings=0; break;

--- 1.22.2.1/mysql-test/t/sp-security.test	2005-10-12 13:55:54 +02:00
+++ 1.25/mysql-test/t/sp-security.test	2005-11-02 11:16:27 +01:00
@@ -413,4 +413,28 @@
 revoke usage on *.* from mysqltest_1@localhost;
 drop user mysqltest_1@localhost;
 
+#
+# BUG#12812 create view calling a function works without execute right
+#           on function
+delimiter |;
+--disable_warnings
+drop function if exists bug12812|
+--enable_warnings
+create function bug12812() returns char(2)
+begin
+  return 'ok';
+end;
+create user user_bug12812@localhost IDENTIFIED BY 'ABC'|
+--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
+connect (test_user_12812,localhost,user_bug12812,ABC,test)|
+--error 1370
+SELECT test.bug12812()|
+--error 1370
+CREATE VIEW v1 AS SELECT test.bug12812()|
+# Cleanup
+connection default|
+disconnect test_user_12812|
+DROP USER user_bug12812@localhost|
+drop function bug12812|
+delimiter ;|
 # End of 5.0 bugs.

--- 1.18/mysql-test/r/connect.result	2005-10-12 13:55:54 +02:00
+++ 1.19/mysql-test/r/connect.result	2005-11-02 11:16:26 +01:00
@@ -9,6 +9,7 @@
 help_relation
 help_topic
 host
+plugin
 proc
 procs_priv
 tables_priv
@@ -36,6 +37,7 @@
 help_relation
 help_topic
 host
+plugin
 proc
 procs_priv
 tables_priv
@@ -71,6 +73,7 @@
 help_relation
 help_topic
 host
+plugin
 proc
 procs_priv
 tables_priv
Thread
bk commit into 5.1 tree (kent:1.1958)kent2 Nov