MySQL Lists are EOL. Please join:

List:Internals« Previous MessageNext Message »
From:Vadim Tkachenko Date:July 22 2005 3:49pm
Subject:bk commit into 5.0-hp tree (vtkachenko:1.1879)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0-hp repository of vtkachenko. When vtkachenko 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.1879 05/07/22 17:49:26 vtkachenko@stripped +16 -0
  Merge melody.mysql.com:/users/vtkachenko/bk/HP/mysql-5.0.10-release
  into melody.mysql.com:/users/vtkachenko/bk/HP/mysql-5.0-hp

  sql/sql_yacc.yy
    1.411 05/07/22 17:49:21 vtkachenko@stripped +0 -0
    Auto merged

  sql/sql_show.cc
    1.252 05/07/22 17:49:20 vtkachenko@stripped +0 -0
    Auto merged

  sql/sql_parse.cc
    1.442 05/07/22 17:49:20 vtkachenko@stripped +0 -0
    Auto merged

  sql/sql_lex.h
    1.191 05/07/22 17:49:19 vtkachenko@stripped +0 -0
    Auto merged

  sql/set_var.cc
    1.123 05/07/22 17:49:19 vtkachenko@stripped +0 -0
    Auto merged

  sql/mysqld.cc
    1.468 05/07/22 17:49:18 vtkachenko@stripped +0 -0
    Auto merged

  sql/mysql_priv.h
    1.308 05/07/22 17:49:17 vtkachenko@stripped +0 -0
    Auto merged

  sql/ha_myisam.cc
    1.156 05/07/22 17:49:16 vtkachenko@stripped +0 -0
    Auto merged

  sql/ha_innodb.h
    1.100 05/07/22 17:49:16 vtkachenko@stripped +0 -0
    Auto merged

  sql/ha_innodb.cc
    1.219 05/07/22 17:49:15 vtkachenko@stripped +0 -0
    Auto merged

  myisam/myisamdef.h
    1.82 05/07/22 17:49:14 vtkachenko@stripped +0 -0
    Auto merged

  myisam/mi_open.c
    1.96 05/07/22 17:49:14 vtkachenko@stripped +0 -0
    Auto merged

  myisam/mi_extra.c
    1.50 05/07/22 17:49:13 vtkachenko@stripped +0 -0
    Auto merged

  libmysql/Makefile.shared
    1.65 05/07/22 17:49:13 vtkachenko@stripped +0 -0
    Auto merged

  include/my_sys.h
    1.162 05/07/22 17:49:13 vtkachenko@stripped +0 -0
    Auto merged

  configure.in
    1.320 05/07/22 17:49:12 vtkachenko@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:	vtkachenko
# Host:	melody.mysql.com
# Root:	/users/vtkachenko/bk/HP/mysql-5.0-hp/RESYNC

--- 1.319/configure.in	2005-07-09 16:10:43 +02:00
+++ 1.320/configure.in	2005-07-22 17:49:12 +02:00
@@ -1,23 +1,23 @@
 dnl -*- ksh -*-
 dnl Process this file with autoconf to produce a configure script.
 
-AC_PREREQ(2.58)dnl		Minimum Autoconf version required.
+AC_PREREQ(2.57)dnl		Minimum Autoconf version required.
 
 AC_INIT(sql/mysqld.cc)
 AC_CANONICAL_SYSTEM
 # Don't forget to also update the NDB lines below.
-AM_INIT_AUTOMAKE(mysql, 5.0.9-beta)
+AM_INIT_AUTOMAKE(mysql, 5.0.10-beta)
 AM_CONFIG_HEADER(config.h)
 
 PROTOCOL_VERSION=10
 DOT_FRM_VERSION=6
 # See the libtool docs for information on how to do shared lib versions.
-SHARED_LIB_VERSION=14:0:0
+SHARED_LIB_VERSION=15:0:0
 
 # ndb version
 NDB_VERSION_MAJOR=5
 NDB_VERSION_MINOR=0
-NDB_VERSION_BUILD=9
+NDB_VERSION_BUILD=10
 NDB_VERSION_STATUS="beta"
 
 # Set all version vars based on $VERSION. How do we do this more elegant ?
@@ -1978,7 +1978,7 @@
 
 if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no"
 then
-  CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-Wcheck//'`
+  CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-ansi//; s/-pedantic//; s/-Wcheck//'`
 fi
 
 AC_TRY_COMPILE(
@@ -2013,7 +2013,7 @@
 AC_LANG_CPLUSPLUS
 if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no"
 then
-  CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-Wcheck//'`
+  CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-ansi//; s/-pedantic//; s/-Wcheck//'`
 fi
 AC_TRY_COMPILE(
 [#undef inline
@@ -2046,7 +2046,7 @@
 AC_LANG_CPLUSPLUS
 if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no"
 then
-  CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-Wcheck//'`
+  CXXFLAGS=`echo "$CXXFLAGS -Werror" | sed -e 's/-fbranch-probabilities//; s/-Wall//; s/-ansi//; s/-pedantic//; s/-Wcheck//'`
 fi
 AC_TRY_COMPILE(
 [#undef inline

--- 1.161/include/my_sys.h	2005-07-09 16:10:43 +02:00
+++ 1.162/include/my_sys.h	2005-07-22 17:49:13 +02:00
@@ -263,7 +263,7 @@
 extern char	wild_many,wild_one,wild_prefix;
 extern const char *charsets_dir;
 extern char *defaults_extra_file;
-extern  const char *defaults_instance;
+extern const char *defaults_group_suffix;
 
 extern my_bool timed_mutexes;
 
@@ -554,7 +554,6 @@
 extern void my_once_free(void);
 extern char *my_once_strdup(const char *src,myf myflags);
 extern char *my_once_memdup(const char *src, uint len, myf myflags);
-extern my_string my_tempnam(const char *dir,const char *pfx,myf MyFlags);
 extern File my_open(const char *FileName,int Flags,myf MyFlags);
 extern File my_register_filename(File fd, const char *FileName,
 				 enum file_type type_of_file,
@@ -786,8 +785,9 @@
 extern char *strdup_root(MEM_ROOT *root,const char *str);
 extern char *strmake_root(MEM_ROOT *root,const char *str,uint len);
 extern char *memdup_root(MEM_ROOT *root,const char *str,uint len);
-extern void get_defaults_files(int argc, char **argv,
-                               char **defaults, char **extra_defaults);
+extern int get_defaults_options(int argc, char **argv,
+                                char **defaults, char **extra_defaults,
+                                char **group_suffix);
 extern int load_defaults(const char *conf_file, const char **groups,
 			 int *argc, char ***argv);
 extern int modify_defaults_file(const char *file_location, const char *option,

--- 1.49/myisam/mi_extra.c	2005-06-04 13:15:45 +02:00
+++ 1.50/myisam/mi_extra.c	2005-07-22 17:49:13 +02:00
@@ -248,7 +248,7 @@
       error=1;					/* Not possibly if not lock */
       break;
     }
-    if (share->state.key_map)
+    if (mi_is_any_key_active(share->state.key_map))
     {
       MI_KEYDEF *key=share->keyinfo;
       uint i;
@@ -256,7 +256,7 @@
       {
         if (!(key->flag & HA_NOSAME) && info->s->base.auto_key != i+1)
         {
-          share->state.key_map&= ~ ((ulonglong) 1 << i);
+          mi_clear_key_active(share->state.key_map, i);
           info->update|= HA_STATE_CHANGED;
         }
       }

--- 1.95/myisam/mi_open.c	2005-07-09 16:10:44 +02:00
+++ 1.96/myisam/mi_open.c	2005-07-22 17:49:14 +02:00
@@ -192,14 +192,14 @@
     }
     share->state_diff_length=len-MI_STATE_INFO_SIZE;
 
-    mi_state_info_read(disk_cache, &share->state);
+    mi_state_info_read((uchar*) disk_cache, &share->state);
     len= mi_uint2korr(share->state.header.base_info_length);
     if (len != MI_BASE_INFO_SIZE)
     {
       DBUG_PRINT("warning",("saved_base_info_length: %d  base_info_length: %d",
 			    len,MI_BASE_INFO_SIZE))
     }
-    disk_pos=my_n_base_info_read(disk_cache+base_pos, &share->base);
+    disk_pos=my_n_base_info_read((uchar*) disk_cache + base_pos, &share->base);
     share->state.state_length=base_pos;
 
     if (!(open_flags & HA_OPEN_FOR_REPAIR) &&
@@ -868,7 +868,7 @@
 }
 
 
-char *mi_state_info_read(char *ptr, MI_STATE_INFO *state)
+char *mi_state_info_read(uchar *ptr, MI_STATE_INFO *state)
 {
   uint i,keys,key_parts,key_blocks;
   memcpy_fixed(&state->header,ptr, sizeof(state->header));
@@ -934,7 +934,7 @@
     }
     else if (my_read(file, buff, state->state_length,MYF(MY_NABP)))
       return (MY_FILE_ERROR);
-    mi_state_info_read(buff, state);
+    mi_state_info_read((uchar*) buff, state);
   }
   return 0;
 }
@@ -979,7 +979,7 @@
 }
 
 
-char *my_n_base_info_read(char *ptr, MI_BASE_INFO *base)
+char *my_n_base_info_read(uchar *ptr, MI_BASE_INFO *base)
 {
   base->keystart = mi_sizekorr(ptr);			ptr +=8;
   base->max_data_file_length = mi_sizekorr(ptr);	ptr +=8;
@@ -1209,7 +1209,7 @@
 {
   MYISAM_SHARE *share= info->s;
 
-  share->state.key_map= 0;
+  mi_clear_all_keys_active(share->state.key_map);
   return 0;
 }
 
@@ -1245,7 +1245,7 @@
     error= HA_ERR_CRASHED;
   }
   else
-    share->state.key_map= ((ulonglong) 1L << share->base.keys) - 1;
+    mi_set_all_keys_active(share->state.key_map, share->base.keys);
   return error;
 }
 
@@ -1270,6 +1270,6 @@
 {
   MYISAM_SHARE *share= info->s;
 
-  return (! share->state.key_map && share->base.keys);
+  return (! mi_is_any_key_active(share->state.key_map) && share->base.keys);
 }
 

--- 1.81/myisam/myisamdef.h	2005-06-04 13:15:46 +02:00
+++ 1.82/myisam/myisamdef.h	2005-07-22 17:49:14 +02:00
@@ -689,10 +689,10 @@
 
 
 uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite);
-char *mi_state_info_read(char *ptr, MI_STATE_INFO *state);
+char *mi_state_info_read(uchar *ptr, MI_STATE_INFO *state);
 uint mi_state_info_read_dsk(File file, MI_STATE_INFO *state, my_bool pRead);
 uint mi_base_info_write(File file, MI_BASE_INFO *base);
-char *my_n_base_info_read(char *ptr, MI_BASE_INFO *base);
+char *my_n_base_info_read(uchar *ptr, MI_BASE_INFO *base);
 int mi_keyseg_write(File file, const HA_KEYSEG *keyseg);
 char *mi_keyseg_read(char *ptr, HA_KEYSEG *keyseg);
 uint mi_keydef_write(File file, MI_KEYDEF *keydef);

--- 1.155/sql/ha_myisam.cc	2005-06-23 11:13:00 +02:00
+++ 1.156/sql/ha_myisam.cc	2005-07-22 17:49:16 +02:00
@@ -44,6 +44,29 @@
 ** MyISAM tables
 *****************************************************************************/
 
+/* MyISAM handlerton */
+
+static handlerton myisam_hton= {
+  "MyISAM",
+  0,       /* slot */
+  0,       /* savepoint size. */
+  0,       /* close_connection */
+  0,       /* savepoint */
+  0,       /* rollback to savepoint */
+  0,       /* release savepoint */
+  0,       /* commit */
+  0,       /* rollback */
+  0,       /* prepare */
+  0,       /* recover */
+  0,       /* commit_by_xid */
+  0,       /* rollback_by_xid */
+  /*
+    MyISAM doesn't support transactions and doesn't have
+    transaction-dependent context: cursors can survive a commit.
+  */
+  HTON_NO_FLAGS
+};
+
 // collect errors printed by mi_check routines
 
 static void mi_check_print_msg(MI_CHECK *param,	const char* msg_type,
@@ -123,6 +146,17 @@
 
 }
 
+
+ha_myisam::ha_myisam(TABLE *table_arg)
+  :handler(&myisam_hton, table_arg), file(0),
+  int_table_flags(HA_NULL_IN_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER |
+                  HA_DUPP_POS | HA_CAN_INDEX_BLOBS | HA_AUTO_PART_KEY |
+                  HA_FILE_BASED | HA_CAN_GEOMETRY | HA_READ_RND_SAME |
+                  HA_CAN_INSERT_DELAYED | HA_CAN_BIT_FIELD),
+  can_enable_indexes(1)
+{}
+
+
 static const char *ha_myisam_exts[] = {
   ".MYI",
   ".MYD",
@@ -606,7 +640,7 @@
 	!(share->state.changed & STATE_NOT_OPTIMIZED_KEYS))))
   {
     ulonglong key_map= ((local_testflag & T_CREATE_MISSING_KEYS) ?
-			((ulonglong) 1L << share->base.keys)-1 :
+			mi_get_mask_all_keys_active(share->base.keys) :
 			share->state.key_map);
     uint testflag=param.testflag;
     if (mi_test_if_sort_rep(file,file->state->records,key_map,0) &&
@@ -907,7 +941,7 @@
 {
   int error;
 
-  if (file->s->state.key_map == set_bits(ulonglong, file->s->base.keys))
+  if (mi_is_all_keys_active(file->s->state.key_map, file->s->base.keys))
   {
     /* All indexes are enabled already. */
     return 0;
@@ -1006,8 +1040,8 @@
   if (! rows || (rows > MI_MIN_ROWS_TO_USE_WRITE_CACHE))
     mi_extra(file, HA_EXTRA_WRITE_CACHE, (void*) &size);
 
-  can_enable_indexes= (file->s->state.key_map ==
-                       set_bits(ulonglong, file->s->base.keys));
+  can_enable_indexes= mi_is_all_keys_active(file->s->state.key_map,
+                                            file->s->base.keys);
 
   if (!(specialflag & SPECIAL_SAFE_MODE))
   {
@@ -1260,7 +1294,7 @@
     share->db_options_in_use= info.options;
     block_size= myisam_block_size;
     share->keys_in_use.set_prefix(share->keys);
-    share->keys_in_use.intersect(info.key_map);
+    share->keys_in_use.intersect_extended(info.key_map);
     share->keys_for_keyread.intersect(share->keys_in_use);
     share->db_record_offset= info.record_offset;
     if (share->key_parts)

--- 1.307/sql/mysql_priv.h	2005-07-09 16:10:45 +02:00
+++ 1.308/sql/mysql_priv.h	2005-07-22 17:49:17 +02:00
@@ -475,6 +475,11 @@
 #include "protocol.h"
 #include "sql_udf.h"
 class user_var_entry;
+enum enum_var_type
+{
+  OPT_DEFAULT= 0, OPT_SESSION, OPT_GLOBAL
+};
+class sys_var;
 #include "item.h"
 extern my_decimal decimal_zero;
 typedef Comp_creator* (*chooser_compare_func_creator)(bool invert);
@@ -735,7 +740,7 @@
 bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create);
 TABLE *open_ltable(THD *thd, TABLE_LIST *table_list, thr_lock_type update);
 TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT* mem,
-		  bool *refresh);
+		  bool *refresh, uint flags);
 TABLE *reopen_name_locked_table(THD* thd, TABLE_LIST* table);
 TABLE *find_locked_table(THD *thd, const char *db,const char *table_name);
 bool reopen_table(TABLE *table,bool locked);
@@ -787,7 +792,6 @@
 extern uint des_default_key;
 extern pthread_mutex_t LOCK_des_key_file;
 bool load_des_key_file(const char *file_name);
-void free_des_key_file();
 #endif /* HAVE_OPENSSL */
 
 /* sql_do.cc */
@@ -1078,6 +1082,7 @@
 extern const char *myisam_recover_options_str;
 extern const char *in_left_expr_name, *in_additional_cond;
 extern const char * const triggers_file_ext;
+extern const char * const trigname_file_ext;
 extern Eq_creator eq_creator;
 extern Ne_creator ne_creator;
 extern Gt_creator gt_creator;
@@ -1152,8 +1157,11 @@
        LOCK_error_log, LOCK_delayed_insert, LOCK_uuid_generator,
        LOCK_delayed_status, LOCK_delayed_create, LOCK_crypt, LOCK_timezone,
        LOCK_slave_list, LOCK_active_mi, LOCK_manager, LOCK_global_read_lock,
-       LOCK_global_system_variables, LOCK_user_conn, 
+       LOCK_global_system_variables, LOCK_user_conn,
        LOCK_bytes_sent, LOCK_bytes_received;
+#ifdef HAVE_OPENSSL
+extern pthread_mutex_t LOCK_des_key_file;
+#endif
 extern rw_lock_t LOCK_grant, LOCK_sys_init_connect, LOCK_sys_init_slave;
 extern pthread_cond_t COND_refresh, COND_thread_count, COND_manager;
 extern pthread_attr_t connection_attrib;
@@ -1330,12 +1338,9 @@
 extern void sql_cache_free();
 extern int sql_cache_hit(THD *thd, char *inBuf, uint length);
 
-/* item.cc */
+/* item_func.cc */
 Item *get_system_var(THD *thd, enum_var_type var_type, LEX_STRING name,
 		     LEX_STRING component);
-Item *get_system_var(THD *thd, enum_var_type var_type, const char *var_name,
-		     uint length, const char *item_name);
-/* item_func.cc */
 int get_var_with_binlog(THD *thd, LEX_STRING &name,
                         user_var_entry **out_entry);
 /* log.cc */

--- 1.467/sql/mysqld.cc	2005-07-12 19:39:57 +02:00
+++ 1.468/sql/mysqld.cc	2005-07-22 17:49:18 +02:00
@@ -448,6 +448,9 @@
 		LOCK_crypt, LOCK_bytes_sent, LOCK_bytes_received,
 	        LOCK_global_system_variables,
 		LOCK_user_conn, LOCK_slave_list, LOCK_active_mi;
+#ifdef HAVE_OPENSSL
+pthread_mutex_t LOCK_des_key_file;
+#endif
 rw_lock_t	LOCK_grant, LOCK_sys_init_connect, LOCK_sys_init_slave;
 pthread_cond_t COND_refresh,COND_thread_count;
 pthread_t signal_thread;
@@ -676,7 +679,11 @@
   end_thr_alarm(0);			 // Abort old alarms.
   end_slave();
 
-  /* First signal all threads that it's time to die */
+  /*
+    First signal all threads that it's time to die
+    This will give the threads some time to gracefully abort their
+    statements and inform their clients that the server is about to die.
+  */
 
   THD *tmp;
   (void) pthread_mutex_lock(&LOCK_thread_count); // For unlink from list
@@ -703,9 +710,13 @@
   (void) pthread_mutex_unlock(&LOCK_thread_count); // For unlink from list
 
   if (thread_count)
-    sleep(1);					// Give threads time to die
+    sleep(2);					// Give threads time to die
 
-  /* Force remaining threads to die by closing the connection to the client */
+  /*
+    Force remaining threads to die by closing the connection to the client
+    This will ensure that threads that are waiting for a command from the
+    client on a blocking read call are aborted.
+  */
 
   for (;;)
   {
@@ -720,8 +731,9 @@
 #ifndef __bsdi__				// Bug in BSDI kernel
     if (tmp->vio_ok())
     {
-      sql_print_error(ER(ER_FORCING_CLOSE),my_progname,
-		      tmp->thread_id,tmp->user ? tmp->user : "");
+      if (global_system_variables.log_warnings)
+        sql_print_warning(ER(ER_FORCING_CLOSE),my_progname,
+                          tmp->thread_id,tmp->user ? tmp->user : "");
       close_connection(tmp,0,0);
     }
 #endif
@@ -883,7 +895,7 @@
     unireg_end();
 
 #ifdef __NETWARE__
-  if(!event_flag)
+  if (!event_flag)
     pthread_join(select_thread, NULL);		// wait for main thread
 #endif /* __NETWARE__ */
 
@@ -1037,7 +1049,6 @@
 #ifdef HAVE_OPENSSL
   if (ssl_acceptor_fd)
     my_free((gptr) ssl_acceptor_fd, MYF(MY_ALLOW_ZERO_PTR));
-  free_des_key_file();
 #endif /* HAVE_OPENSSL */
 #ifdef USE_REGEX
   regex_end();
@@ -1109,6 +1120,9 @@
   (void) pthread_mutex_destroy(&LOCK_bytes_sent);
   (void) pthread_mutex_destroy(&LOCK_bytes_received);
   (void) pthread_mutex_destroy(&LOCK_user_conn);
+#ifdef HAVE_OPENSSL
+  (void) pthread_mutex_destroy(&LOCK_des_key_file);
+#endif
 #ifdef HAVE_REPLICATION
   (void) pthread_mutex_destroy(&LOCK_rpl_status);
   (void) pthread_cond_destroy(&COND_rpl_status);
@@ -2612,6 +2626,9 @@
   (void) pthread_mutex_init(&LOCK_global_system_variables, MY_MUTEX_INIT_FAST);
   (void) pthread_mutex_init(&LOCK_global_read_lock, MY_MUTEX_INIT_FAST);
   (void) pthread_mutex_init(&LOCK_uuid_generator, MY_MUTEX_INIT_FAST);
+#ifdef HAVE_OPENSSL
+  (void) pthread_mutex_init(&LOCK_des_key_file,MY_MUTEX_INIT_FAST);
+#endif
   (void) my_rwlock_init(&LOCK_sys_init_connect, NULL);
   (void) my_rwlock_init(&LOCK_sys_init_slave, NULL);
   (void) my_rwlock_init(&LOCK_grant, NULL);
@@ -4338,7 +4355,8 @@
   OPT_ENABLE_LARGE_PAGES,
   OPT_TIMED_MUTEXES,
   OPT_OLD_STYLE_USER_LIMITS,
-  OPT_LOG_SLOW_ADMIN_STATEMENTS
+  OPT_LOG_SLOW_ADMIN_STATEMENTS,
+  OPT_TABLE_LOCK_WAIT_TIMEOUT
 };
 
 
@@ -5600,6 +5618,11 @@
    "The number of open tables for all threads.", (gptr*) &table_cache_size,
    (gptr*) &table_cache_size, 0, GET_ULONG, REQUIRED_ARG, 64, 1, 512*1024L,
    0, 1, 0},
+  {"table_lock_wait_timeout", OPT_TABLE_LOCK_WAIT_TIMEOUT, "Timeout in "
+    "seconds to wait for a table level lock before returning an error. Used"
+     " only if the connection has active cursors.",
+   (gptr*) &table_lock_wait_timeout, (gptr*) &table_lock_wait_timeout,
+   0, GET_ULONG, REQUIRED_ARG, 50, 1, 1024 * 1024 * 1024, 0, 1, 0},
   {"thread_cache_size", OPT_THREAD_CACHE_SIZE,
    "How many threads we should keep in a cache for reuse.",
    (gptr*) &thread_cache_size, (gptr*) &thread_cache_size, 0, GET_ULONG,
@@ -5733,6 +5756,7 @@
   {"Com_show_status",	       (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_STATUS]), SHOW_LONG_STATUS},
   {"Com_show_storage_engines", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_STORAGE_ENGINES]), SHOW_LONG_STATUS},
   {"Com_show_tables",	       (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_TABLES]), SHOW_LONG_STATUS},
+  {"Com_show_triggers",	       (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_TRIGGERS]), SHOW_LONG_STATUS},
   {"Com_show_variables",       (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_VARIABLES]), SHOW_LONG_STATUS},
   {"Com_show_warnings",        (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_WARNS]), SHOW_LONG_STATUS},
   {"Com_slave_start",	       (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SLAVE_START]), SHOW_LONG_STATUS},
@@ -7088,4 +7112,6 @@
 template class I_List<i_string>;
 template class I_List<i_string_pair>;
 template class I_List<NAMED_LIST>;
+template class I_List<Statement>;
+template class I_List_iterator<Statement>;
 #endif

--- 1.190/sql/sql_lex.h	2005-07-19 18:06:43 +02:00
+++ 1.191/sql/sql_lex.h	2005-07-22 17:49:19 +02:00
@@ -53,7 +53,7 @@
 
   SQLCOM_SHOW_DATABASES, SQLCOM_SHOW_TABLES, SQLCOM_SHOW_FIELDS,
   SQLCOM_SHOW_KEYS, SQLCOM_SHOW_VARIABLES, SQLCOM_SHOW_LOGS, SQLCOM_SHOW_STATUS,
-  SQLCOM_SHOW_INNODB_STATUS, SQLCOM_SHOW_MUTEX_STATUS,
+  SQLCOM_SHOW_INNODB_STATUS, SQLCOM_SHOW_MUTEX_STATUS, SQLCOM_SHOW_MUTEX_FLUSH,
   SQLCOM_SHOW_PROCESSLIST, SQLCOM_SHOW_MASTER_STAT, SQLCOM_SHOW_SLAVE_STAT,
   SQLCOM_SHOW_GRANTS, SQLCOM_SHOW_CREATE, SQLCOM_SHOW_CHARSETS,
   SQLCOM_SHOW_COLLATIONS, SQLCOM_SHOW_CREATE_DB, SQLCOM_SHOW_TABLE_STATUS,
@@ -772,7 +772,7 @@
   uint8 create_view_algorithm;
   uint8 create_view_check;
   bool drop_if_exists, drop_temporary, local_file, one_shot_set;
-  bool in_comment, ignore_space, verbose, no_write_to_binlog;
+  bool in_comment, ignore_space, verbose, flush, no_write_to_binlog;
   bool tx_chain, tx_release;
   /*
     Special JOIN::prepare mode: changing of query is prohibited.

--- 1.441/sql/sql_parse.cc	2005-07-09 16:10:46 +02:00
+++ 1.442/sql/sql_parse.cc	2005-07-22 17:49:20 +02:00
@@ -775,29 +775,19 @@
       return (ER_OUT_OF_RESOURCES);
     thd->host_or_ip= thd->ip;
     vio_in_addr(net->vio,&thd->remote.sin_addr);
-#if !defined(HAVE_SYS_UN_H) || defined(HAVE_mit_thread)
-    /* Fast local hostname resolve for Win32 */
-    if (!strcmp(thd->ip,"127.0.0.1"))
+    if (!(specialflag & SPECIAL_NO_RESOLVE))
     {
-      thd->host= (char*) my_localhost;
-      thd->host_or_ip= my_localhost;
-    }
-    else
-#endif
-    {
-      if (!(specialflag & SPECIAL_NO_RESOLVE))
-      {
-	vio_in_addr(net->vio,&thd->remote.sin_addr);
-	thd->host=ip_to_hostname(&thd->remote.sin_addr,&connect_errors);
-	/* Cut very long hostnames to avoid possible overflows */
-	if (thd->host)
-	{
-	  thd->host[min(strlen(thd->host), HOSTNAME_LENGTH)]= 0;
-	  thd->host_or_ip= thd->host;
-	}
-	if (connect_errors > max_connect_errors)
-	  return(ER_HOST_IS_BLOCKED);
+      vio_in_addr(net->vio,&thd->remote.sin_addr);
+      thd->host=ip_to_hostname(&thd->remote.sin_addr,&connect_errors);
+      /* Cut very long hostnames to avoid possible overflows */
+      if (thd->host)
+      {
+        if (thd->host != my_localhost)
+          thd->host[min(strlen(thd->host), HOSTNAME_LENGTH)]= 0;
+        thd->host_or_ip= thd->host;
       }
+      if (connect_errors > max_connect_errors)
+        return(ER_HOST_IS_BLOCKED);
     }
     DBUG_PRINT("info",("Host: %s  ip: %s",
 		       thd->host ? thd->host : "unknown host",
@@ -2104,6 +2094,7 @@
   case SCH_TABLE_NAMES:
   case SCH_TABLES:
   case SCH_VIEWS:
+  case SCH_TRIGGERS:
 #ifdef DONT_ALLOW_SHOW_COMMANDS
     my_message(ER_NOT_ALLOWED_COMMAND,
                ER(ER_NOT_ALLOWED_COMMAND), MYF(0)); /* purecov: inspected */
@@ -2151,7 +2142,7 @@
       TABLE_LIST **query_tables_last= lex->query_tables_last;
       sel= new SELECT_LEX();
       sel->init_query();
-      if(!sel->add_table_to_list(thd, table_ident, 0, 0, TL_READ, 
+      if (!sel->add_table_to_list(thd, table_ident, 0, 0, TL_READ, 
                                  (List<String> *) 0, (List<String> *) 0))
         DBUG_RETURN(1);
       lex->query_tables_last= query_tables_last;
@@ -2193,6 +2184,8 @@
   TABLE_LIST *table_list= (TABLE_LIST*) select_lex->table_list.first;
   table_list->schema_select_lex= sel;
   table_list->schema_table_reformed= 1;
+  statistic_increment(thd->status_var.com_stat[lex->orig_sql_command],
+                      &LOCK_status);
   DBUG_RETURN(0);
 }
 
@@ -2302,8 +2295,8 @@
     Don't reset warnings when executing a stored routine.
   */
   if ((all_tables || &lex->select_lex != lex->all_selects_list ||
-       lex->spfuns.records || lex->spprocs.records) &&
-      !thd->spcont)
+       lex->sroutines.records) && !thd->spcont ||
+      lex->time_zone_tables_used)
     mysql_reset_errors(thd, 0);
 
 #ifdef HAVE_REPLICATION
@@ -2366,9 +2359,10 @@
     my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--read-only");
     DBUG_RETURN(-1);
   }
+  if(lex->orig_sql_command == SQLCOM_END)
+    statistic_increment(thd->status_var.com_stat[lex->sql_command],
+                        &LOCK_status);
 
-  statistic_increment(thd->status_var.com_stat[lex->sql_command],
-		      &LOCK_status);
   switch (lex->sql_command) {
   case SQLCOM_SELECT:
   {
@@ -2383,10 +2377,12 @@
     select_result *result=lex->result;
     if (all_tables)
     {
-      res= check_table_access(thd,
-			      lex->exchange ? SELECT_ACL | FILE_ACL :
-			      SELECT_ACL,
-			      all_tables, 0);
+      if (lex->orig_sql_command != SQLCOM_SHOW_STATUS_PROC &&
+          lex->orig_sql_command != SQLCOM_SHOW_STATUS_FUNC)
+        res= check_table_access(thd,
+                                lex->exchange ? SELECT_ACL | FILE_ACL :
+                                SELECT_ACL,
+                                all_tables, 0);
     }
     else
       res= check_access(thd,
@@ -5214,7 +5210,6 @@
 {
   SELECT_LEX *select_lex= lex->current_select;
   select_lex->init_select();
-  lex->orig_sql_command= SQLCOM_END;
   lex->wild= 0;
   if (select_lex == &lex->select_lex)
   {
@@ -5237,6 +5232,11 @@
   select_lex->init_query();
   select_lex->init_select();
   select_lex->parent_lex= lex;
+  /*
+    Don't evaluate this subquery during statement prepare even if
+    it's a constant one. The flag is switched off in the end of
+    mysql_stmt_prepare.
+  */
   if (thd->current_arena->is_stmt_prepare())
     select_lex->uncacheable|= UNCACHEABLE_PREPARE;
   if (move_down)
@@ -5591,8 +5591,14 @@
   new_field->flags= type_modifier;
   new_field->unireg_check= (type_modifier & AUTO_INCREMENT_FLAG ?
 			    Field::NEXT_NUMBER : Field::NONE);
-  new_field->decimals= decimals ? (uint) set_zone(atoi(decimals),0,
-						  NOT_FIXED_DEC-1) : 0;
+  new_field->decimals= decimals ? (uint)atoi(decimals) : 0;
+  if (new_field->decimals >= NOT_FIXED_DEC)
+  {
+    my_error(ER_TOO_BIG_SCALE, MYF(0), new_field->decimals, field_name,
+             NOT_FIXED_DEC-1);
+    DBUG_RETURN(NULL);
+  }
+
   new_field->sql_type=type;
   new_field->length=0;
   new_field->change=change;
@@ -5613,11 +5619,6 @@
     length=0; /* purecov: inspected */
   sign_len=type_modifier & UNSIGNED_FLAG ? 0 : 1;
 
-  if (new_field->length && new_field->decimals &&
-      new_field->length < new_field->decimals+1 &&
-      new_field->decimals != NOT_FIXED_DEC)
-    new_field->length=new_field->decimals+1; /* purecov: inspected */
-
   switch (type) {
   case FIELD_TYPE_TINY:
     if (!length) new_field->length=MAX_TINYINT_WIDTH+sign_len;
@@ -5643,22 +5644,24 @@
     break;
   case FIELD_TYPE_NEWDECIMAL:
     if (!length)
+      new_field->length= 10;
+    if (new_field->length > DECIMAL_MAX_PRECISION)
     {
-      if (!(new_field->length= new_field->decimals))
-        new_field->length= 10;                  // Default length for DECIMAL
+      my_error(ER_TOO_BIG_PRECISION, MYF(0), new_field->length, field_name,
+               DECIMAL_MAX_PRECISION);
+      DBUG_RETURN(NULL);
     }
-    new_field->pack_length=
-      my_decimal_get_binary_size(new_field->length, new_field->decimals);
-    if (new_field->length <= DECIMAL_MAX_PRECISION &&
-        new_field->length >= new_field->decimals)
+    if (new_field->length < new_field->decimals)
     {
-      new_field->length=
-        my_decimal_precision_to_length(new_field->length, new_field->decimals,
-                                       type_modifier & UNSIGNED_FLAG);
-      break;
+      my_error(ER_SCALE_BIGGER_THAN_PRECISION, MYF(0), field_name);
+      DBUG_RETURN(NULL);
     }
-    my_error(ER_WRONG_FIELD_SPEC, MYF(0), field_name);
-    DBUG_RETURN(NULL);
+    new_field->length=
+      my_decimal_precision_to_length(new_field->length, new_field->decimals,
+                                     type_modifier & UNSIGNED_FLAG);
+    new_field->pack_length=
+      my_decimal_get_binary_size(new_field->length, new_field->decimals);
+    break;
   case MYSQL_TYPE_VARCHAR:
     /*
       Long VARCHAR's are automaticly converted to blobs in mysql_prepare_table
@@ -6861,7 +6864,7 @@
   /*
     Is there tables of subqueries?
   */
-  if (&lex->select_lex != lex->all_selects_list)
+  if (&lex->select_lex != lex->all_selects_list || lex->time_zone_tables_used)
   {
     DBUG_PRINT("info",("Checking sub query list"));
     for (table= tables; table; table= table->next_global)

--- 1.251/sql/sql_show.cc	2005-07-09 16:10:46 +02:00
+++ 1.252/sql/sql_show.cc	2005-07-22 17:49:20 +02:00
@@ -21,6 +21,7 @@
 #include "sql_select.h"                         // For select_describe
 #include "repl_failsafe.h"
 #include "sp_head.h"
+#include "sql_trigger.h"
 #include <my_dir.h>
 
 #ifdef HAVE_BERKELEY_DB
@@ -1773,6 +1774,7 @@
     break;
   case SQLCOM_SHOW_TABLES:
   case SQLCOM_SHOW_TABLE_STATUS:
+  case SQLCOM_SHOW_TRIGGERS:
     index_field_values->db_value= lex->current_select->db;
     index_field_values->table_value= wild;
     break;
@@ -1795,7 +1797,7 @@
   ident_table.length= strlen(table);
   table_ident= new Table_ident(thd, ident_db, ident_table, 1);
   sel->init_query();
-  if(!sel->add_table_to_list(thd, table_ident, 0, 0, TL_READ,
+  if (!sel->add_table_to_list(thd, table_ident, 0, 0, TL_READ,
                              (List<String> *) 0, (List<String> *) 0))
     return 1;
   return 0;
@@ -2454,6 +2456,7 @@
     {
       const char *tmp_buff;
       byte *pos;
+      bool is_blob;
       uint flags=field->flags;
       char tmp[MAX_FIELD_WIDTH];
       char tmp1[MAX_FIELD_WIDTH];
@@ -2532,12 +2535,14 @@
                    "NO" : "YES");
       table->field[6]->store((const char*) pos,
                              strlen((const char*) pos), cs);
-      if (field->has_charset())
+      is_blob= (field->type() == FIELD_TYPE_BLOB);
+      if (field->has_charset() || is_blob)
       {
-        table->field[8]->store((longlong) field->field_length/
-                               field->charset()->mbmaxlen);
+        longlong c_octet_len= is_blob ? (longlong) field->max_length() :
+          (longlong) field->max_length()/field->charset()->mbmaxlen;
+        table->field[8]->store(c_octet_len);
         table->field[8]->set_notnull();
-        table->field[9]->store((longlong) field->field_length);
+        table->field[9]->store((longlong) field->max_length());
         table->field[9]->set_notnull();
       }
 
@@ -2565,6 +2570,17 @@
         case FIELD_TYPE_LONG:
         case FIELD_TYPE_LONGLONG:
         case FIELD_TYPE_INT24:
+        {
+          table->field[10]->store((longlong) field->max_length() - 1);
+          table->field[10]->set_notnull();
+          break;
+        }
+        case FIELD_TYPE_BIT:
+        {
+          table->field[10]->store((longlong) field->max_length());
+          table->field[10]->set_notnull();
+          break;
+        }
         case FIELD_TYPE_FLOAT:  
         case FIELD_TYPE_DOUBLE:
         {
@@ -3040,6 +3056,73 @@
 }
 
 
+static bool store_trigger(THD *thd, TABLE *table, const char *db,
+                          const char *tname, LEX_STRING *trigger_name,
+                          enum trg_event_type event,
+                          enum trg_action_time_type timing,
+                          LEX_STRING *trigger_stmt)
+{
+  CHARSET_INFO *cs= system_charset_info;
+  restore_record(table, s->default_values);
+  table->field[1]->store(db, strlen(db), cs);
+  table->field[2]->store(trigger_name->str, trigger_name->length, cs);
+  table->field[3]->store(trg_event_type_names[event].str,
+                         trg_event_type_names[event].length, cs);
+  table->field[5]->store(db, strlen(db), cs);
+  table->field[6]->store(tname, strlen(tname), cs);
+  table->field[9]->store(trigger_stmt->str, trigger_stmt->length, cs);
+  table->field[10]->store("ROW", 3, cs);
+  table->field[11]->store(trg_action_time_type_names[timing].str,
+                          trg_action_time_type_names[timing].length, cs);
+  table->field[14]->store("OLD", 3, cs);
+  table->field[15]->store("NEW", 3, cs);
+  return schema_table_store_record(thd, table);
+}
+
+
+static int get_schema_triggers_record(THD *thd, struct st_table_list *tables,
+				      TABLE *table, bool res,
+				      const char *base_name,
+				      const char *file_name)
+{
+  DBUG_ENTER("get_schema_triggers_record");
+  /*
+    res can be non zero value when processed table is a view or
+    error happened during opening of processed table.
+  */
+  if (res)
+  {
+    if (!tables->view)
+      push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+                   thd->net.last_errno, thd->net.last_error);
+    thd->clear_error();
+    DBUG_RETURN(0);
+  }
+  if (!tables->view && tables->table->triggers)
+  {
+    Table_triggers_list *triggers= tables->table->triggers;
+    int event, timing;
+    for (event= 0; event < (int)TRG_EVENT_MAX; event++)
+    {
+      for (timing= 0; timing < (int)TRG_ACTION_MAX; timing++)
+      {
+        LEX_STRING trigger_name;
+        LEX_STRING trigger_stmt;
+        if (triggers->get_trigger_info(thd, (enum trg_event_type) event,
+                                       (enum trg_action_time_type)timing,
+                                       &trigger_name, &trigger_stmt))
+          continue;
+        if (store_trigger(thd, table, base_name, file_name, &trigger_name,
+                         (enum trg_event_type) event,
+                         (enum trg_action_time_type) timing, &trigger_stmt))
+          DBUG_RETURN(1);
+      }
+    }
+  }
+  DBUG_RETURN(0);
+}
+
+
 void store_key_column_usage(TABLE *table, const char*db, const char *tname,
                             const char *key_name, uint key_len, 
                             const char *con_type, uint con_len, longlong idx)
@@ -3924,6 +4007,29 @@
 };
 
 
+ST_FIELD_INFO triggers_fields_info[]=
+{
+  {"TRIGGER_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0},
+  {"TRIGGER_SCHEMA",NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
+  {"TRIGGER_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Trigger"},
+  {"EVENT_MANIPULATION", 6, MYSQL_TYPE_STRING, 0, 0, "Event"},
+  {"EVENT_OBJECT_CATALOG", FN_REFLEN, MYSQL_TYPE_STRING, 0, 1, 0},
+  {"EVENT_OBJECT_SCHEMA",NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0},
+  {"EVENT_OBJECT_TABLE", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, "Table"},
+  {"ACTION_ORDER", 4, MYSQL_TYPE_LONG, 0, 0, 0},
+  {"ACTION_CONDITION", 65535, MYSQL_TYPE_STRING, 0, 1, 0},
+  {"ACTION_STATEMENT", 65535, MYSQL_TYPE_STRING, 0, 0, "Statement"},
+  {"ACTION_ORIENTATION", 9, MYSQL_TYPE_STRING, 0, 0, 0},
+  {"ACTION_TIMING", 6, MYSQL_TYPE_STRING, 0, 0, "Timing"},
+  {"ACTION_REFERENCE_OLD_TABLE", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, 0},
+  {"ACTION_REFERENCE_NEW_TABLE", NAME_LEN, MYSQL_TYPE_STRING, 0, 1, 0},
+  {"ACTION_REFERENCE_OLD_ROW", 3, MYSQL_TYPE_STRING, 0, 0, 0},
+  {"ACTION_REFERENCE_NEW_ROW", 3, MYSQL_TYPE_STRING, 0, 0, 0},
+  {"CREATED", 0, MYSQL_TYPE_TIMESTAMP, 0, 1, "Created"},
+  {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
+};
+
+
 ST_FIELD_INFO variables_fields_info[]=
 {
   {"Variable_name", 80, MYSQL_TYPE_STRING, 0, 0, "Variable_name"},
@@ -3974,6 +4080,8 @@
    fill_open_tables, make_old_format, 0, -1, -1, 1},
   {"STATUS", variables_fields_info, create_schema_table, fill_status, 
    make_old_format, 0, -1, -1, 1},
+  {"TRIGGERS", triggers_fields_info, create_schema_table, 
+   get_all_tables, make_old_format, get_schema_triggers_record, 5, 6, 0},
   {"VARIABLES", variables_fields_info, create_schema_table, fill_variables,
    make_old_format, 0, -1, -1, 1},
   {0, 0, 0, 0, 0, 0, 0, 0, 0}

--- 1.410/sql/sql_yacc.yy	2005-07-19 18:52:55 +02:00
+++ 1.411/sql/sql_yacc.yy	2005-07-22 17:49:21 +02:00
@@ -6403,6 +6403,8 @@
           { Lex->sql_command = SQLCOM_SHOW_INNODB_STATUS; WARN_DEPRECATED("SHOW INNODB STATUS", "SHOW ENGINE INNODB STATUS"); }
         | MUTEX_SYM STATUS_SYM
           { Lex->sql_command = SQLCOM_SHOW_MUTEX_STATUS; }
+	| MUTEX_SYM FLUSH_SYM
+	  { Lex->sql_command = SQLCOM_SHOW_MUTEX_FLUSH;  }	
 	| opt_full PROCESSLIST_SYM
 	  { Lex->sql_command= SQLCOM_SHOW_PROCESSLIST;}
         | opt_var_type  VARIABLES wild_and_where

--- 1.218/sql/ha_innodb.cc	2005-07-15 22:59:02 +02:00
+++ 1.219/sql/ha_innodb.cc	2005-07-22 17:49:15 +02:00
@@ -219,7 +219,14 @@
   innobase_xa_prepare,		/* prepare */
   innobase_xa_recover,		/* recover */
   innobase_commit_by_xid,	/* commit_by_xid */
-  innobase_rollback_by_xid	/* rollback_by_xid */
+  innobase_rollback_by_xid,     /* rollback_by_xid */
+  /*
+    For now when one opens a cursor, MySQL does not create an own
+    InnoDB consistent read view for it, and uses the view of the
+    currently active transaction. Therefore, cursors can not
+    survive COMMIT or ROLLBACK statements, which free this view.
+  */
+  HTON_CLOSE_CURSORS_AT_COMMIT
 };
 
 /*********************************************************************
@@ -769,6 +776,24 @@
 	return(trx);
 }
 
+
+/*************************************************************************
+Construct ha_innobase handler. */
+
+ha_innobase::ha_innobase(TABLE *table_arg)
+  :handler(&innobase_hton, table_arg),
+  int_table_flags(HA_REC_NOT_IN_SEQ |
+                  HA_NULL_IN_KEY |
+                  HA_CAN_INDEX_BLOBS |
+                  HA_CAN_SQL_HANDLER |
+                  HA_NOT_EXACT_COUNT |
+                  HA_PRIMARY_KEY_IN_READ_INDEX |
+                  HA_TABLE_SCAN_ON_INDEX),
+  last_dup_key((uint) -1),
+  start_of_scan(0),
+  num_write_row(0)
+{}
+
 /*************************************************************************
 Updates the user_thd field in a handle and also allocates a new InnoDB
 transaction handle if needed, and updates the transaction fields in the
@@ -5526,7 +5551,7 @@
 	external_lock(). To be safe, update the thd of the current table
 	handle. */
 
-	if(length > 64000 - 3) {
+	if (length > 64000 - 3) {
 		return((char*)comment); /* string too long */
 	}
 
@@ -5564,7 +5589,7 @@
 
 		if (str) {
 			char* pos	= str + length;
-			if(length) {
+			if (length) {
 				memcpy(str, comment, length);
 				*pos++ = ';';
 				*pos++ = ' ';
@@ -5622,7 +5647,7 @@
 		flen = ftell(file);
 		if (flen < 0) {
 			flen = 0;
-		} else if(flen > 64000 - 1) {
+		} else if (flen > 64000 - 1) {
 			flen = 64000 - 1;
 		}
 

--- 1.99/sql/ha_innodb.h	2005-07-12 19:39:37 +02:00
+++ 1.100/sql/ha_innodb.h	2005-07-22 17:49:16 +02:00
@@ -81,19 +81,7 @@
 
 	/* Init values for the class: */
  public:
-  	ha_innobase(TABLE *table): handler(table),
-	  int_table_flags(HA_REC_NOT_IN_SEQ |
-			  HA_NULL_IN_KEY |
-			  HA_CAN_INDEX_BLOBS |
-			  HA_CAN_SQL_HANDLER |
-			  HA_NOT_EXACT_COUNT |
-			  HA_PRIMARY_KEY_IN_READ_INDEX |
-			  HA_TABLE_SCAN_ON_INDEX),
-	  last_dup_key((uint) -1),
-	  start_of_scan(0),
-	  num_write_row(0)
-  	{
-  	}
+  	ha_innobase(TABLE *table_arg);
   	~ha_innobase() {}
 	/*
 	  Get the row type from the storage engine.  If this method returns

--- 1.122/sql/set_var.cc	2005-07-12 19:40:16 +02:00
+++ 1.123/sql/set_var.cc	2005-07-22 17:49:19 +02:00
@@ -376,6 +376,8 @@
 sys_var_bool_ptr	sys_sync_frm("sync_frm", &opt_sync_frm);
 sys_var_long_ptr	sys_table_cache_size("table_cache",
 					     &table_cache_size);
+sys_var_long_ptr	sys_table_lock_wait_timeout("table_lock_wait_timeout",
+                                                    &table_lock_wait_timeout);
 sys_var_long_ptr	sys_thread_cache_size("thread_cache_size",
 					      &thread_cache_size);
 sys_var_thd_enum	sys_tx_isolation("tx_isolation",
@@ -686,6 +688,7 @@
 #endif
   &sys_sync_frm,
   &sys_table_cache_size,
+  &sys_table_lock_wait_timeout,
   &sys_table_type,
   &sys_thread_cache_size,
   &sys_time_format,
@@ -979,6 +982,7 @@
   {"system_time_zone",        system_time_zone,                     SHOW_CHAR},
 #endif
   {"table_cache",             (char*) &table_cache_size,            SHOW_LONG},
+  {"table_lock_wait_timeout", (char*) &table_lock_wait_timeout,     SHOW_LONG },
   {sys_table_type.name,	      (char*) &sys_table_type,	            SHOW_SYS},
   {sys_thread_cache_size.name,(char*) &sys_thread_cache_size,       SHOW_SYS},
 #ifdef HAVE_THR_SETCONCURRENCY
@@ -1659,15 +1663,7 @@
 
 /*
   Return an Item for a variable.  Used with @@[global.]variable_name
-
   If type is not given, return local value if exists, else global
-
-  We have to use netprintf() instead of my_error() here as this is
-  called on the parsing stage.
-
-  TODO:
-    With prepared statements/stored procedures this has to be fixed
-    to create an item that gets the current value at fix_fields() stage.
 */
 
 Item *sys_var::item(THD *thd, enum_var_type var_type, LEX_STRING *base)

--- 1.64/libmysql/Makefile.shared	2005-05-20 23:04:05 +02:00
+++ 1.65/libmysql/Makefile.shared	2005-07-22 17:49:13 +02:00
@@ -84,6 +84,7 @@
 DEFS =			-DDEFAULT_CHARSET_HOME="\"$(MYSQLBASEdir)\"" \
 			-DDATADIR="\"$(MYSQLDATAdir)\"" \
 			-DDEFAULT_HOME_ENV=MYSQL_HOME \
+			-DDEFAULT_GROUP_SUFFIX_ENV=MYSQL_GROUP_SUFFIX \
 			-DSHAREDIR="\"$(MYSQLSHAREdir)\"" $(target_defs)
 
 # The automatic dependencies miss this
Thread
bk commit into 5.0-hp tree (vtkachenko:1.1879)Vadim Tkachenko22 Jul