Commit 70442e0a authored by unknown's avatar unknown
Browse files

merged


BitKeeper/etc/logging_ok:
  auto-union
configure.in:
  Auto merged
scripts/make_binary_distribution.sh:
  Auto merged
sql/lock.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_handler.cc:
  Auto merged
sql/sql_repl.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
mysql-test/r/create.result:
  merged, need fixing
sql/sql_parse.cc:
  merged (perhaps wrong)
parents 755d2018 ef30cc61
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -1262,16 +1262,10 @@ EOF
    #
    echo -n "making sure specific build files are writable... "
    for file in \
        Docs/include.texi \
        Docs/mysql.info \
        Docs/manual.txt \
        Docs/manual_toc.html \
        Docs/manual.html \
        Docs/INSTALL-BINARY \
        INSTALL-SOURCE \
        COPYING \
        COPYING.LIB \
        MIRRORS
        COPYING
    do
      if test -e $file; then
        chmod +w $file
+0 −7
Original line number Diff line number Diff line
@@ -285,13 +285,6 @@ C_MODE_START int __cxa_pure_virtual() {\
#include <alloca.h>
#endif
#ifdef HAVE_ATOMIC_ADD
#define __SMP__
#ifdef HAVE_LINUX_CONFIG_H
#include <linux/config.h>	/* May define CONFIG_SMP */
#endif
#ifndef CONFIG_SMP
#define CONFIG_SMP
#endif
#if defined(__ia64__)
#define new my_arg_new
#define need_to_restore_new 1
+14 −0
Original line number Diff line number Diff line
@@ -460,3 +460,17 @@ insert into t2 values ();
select * from t1;
select * from t2;
drop table t1,t2;
#
# Bug#10224 - ANALYZE TABLE crashing with simultaneous
# CREATE ... SELECT statement.
# This tests two additional possible errors and a hang if 
# an improper fix is present.
#
create table t1 (a int);
--error 1093
create table t1 select * from t1;
--error 1093
create table t2 union = (t1) select * from t1;
flush tables with read lock;
unlock tables;
drop table t1;
+0 −3
Original line number Diff line number Diff line
@@ -76,9 +76,6 @@ if [ $BASE_SYSTEM != "netware" ] ; then
fi

for i in ChangeLog \
         Docs/manual.html \
         Docs/manual.txt \
         Docs/manual_toc.html \
				 Docs/mysql.info
do
  if [ -f $i ]
+21 −48
Original line number Diff line number Diff line
@@ -82,8 +82,24 @@ static int unlock_external(THD *thd, TABLE **table,uint count);
static void print_lock_error(int error);


MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **tables, uint count,
                              bool ignore_global_read_lock)
/*
  Lock tables.

  SYNOPSIS
    mysql_lock_tables()
    thd                         The current thread.
    tables                      An array of pointers to the tables to lock.
    count                       The number of tables to lock.
    flags                       Options:
      MYSQL_LOCK_IGNORE_GLOBAL_READ_LOCK      Ignore a global read lock
      MYSQL_LOCK_IGNORE_FLUSH                 Ignore a flush tables.

  RETURN
    A lock structure pointer on success.
    NULL on error.
*/

MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **tables, uint count, uint flags)
{
  MYSQL_LOCK *sql_lock;
  TABLE *write_lock_used;
@@ -94,7 +110,8 @@ MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **tables, uint count,
    if (!(sql_lock = get_lock_data(thd,tables,count, 0,&write_lock_used)))
      break;

    if (global_read_lock && write_lock_used && ! ignore_global_read_lock)
    if (global_read_lock && write_lock_used &&
        ! (flags & MYSQL_LOCK_IGNORE_GLOBAL_READ_LOCK))
    {
      /*
	Someone has issued LOCK ALL TABLES FOR READ and we want a write lock
@@ -128,7 +145,7 @@ MYSQL_LOCK *mysql_lock_tables(THD *thd, TABLE **tables, uint count,
      thd->some_tables_deleted=1;		// Try again
      sql_lock->lock_count=0;			// Locks are alread freed
    }
    else if (!thd->some_tables_deleted)
    else if (!thd->some_tables_deleted || (flags & MYSQL_LOCK_IGNORE_FLUSH))
    {
      thd->locked=0;
      break;
@@ -914,47 +931,3 @@ void make_global_read_lock_block_commit(THD *thd)
}

/*
  Set protection against global read lock.

  SYNOPSIS
    set_protect_against_global_read_lock()
    void

  RETURN
    FALSE       OK, no global read lock exists.
    TRUE        Error, global read lock exists already.
*/

my_bool set_protect_against_global_read_lock(void)
{
  my_bool       global_read_lock_exists;

  pthread_mutex_lock(&LOCK_open);
  if (! (global_read_lock_exists= test(global_read_lock)))
    protect_against_global_read_lock++;
  pthread_mutex_unlock(&LOCK_open);
  return global_read_lock_exists;
}


/*
  Unset protection against global read lock.

  SYNOPSIS
    unset_protect_against_global_read_lock()
    void

  RETURN
    void
*/

void unset_protect_against_global_read_lock(void)
{
  pthread_mutex_lock(&LOCK_open);
  protect_against_global_read_lock--;
  pthread_mutex_unlock(&LOCK_open);
  pthread_cond_broadcast(&COND_refresh);
}

Loading