diff options
author | monty@hundin.mysql.fi <> | 2001-09-08 11:47:34 +0300 |
---|---|---|
committer | monty@hundin.mysql.fi <> | 2001-09-08 11:47:34 +0300 |
commit | e24bdfa8bbd7963e63bbcae87e809e6f4925b785 (patch) | |
tree | 519c781289c4f4c0769d932057d293ba813f2b8c | |
parent | 228de3b0015c35ea1700a483969018aac3d65c9d (diff) | |
download | mariadb-git-e24bdfa8bbd7963e63bbcae87e809e6f4925b785.tar.gz |
More debug info
Fix DBUG_ASSERT()
Optimization for BDB tables
Fix for BDB under Win98
-rw-r--r-- | Docs/manual.texi | 3 | ||||
-rw-r--r-- | bdb/os_win32/os_rename.c | 2 | ||||
-rw-r--r-- | configure.in | 6 | ||||
-rw-r--r-- | include/dbug.h | 2 | ||||
-rw-r--r-- | mysys/thr_lock.c | 2 | ||||
-rw-r--r-- | sql/ha_berkeley.cc | 14 | ||||
-rw-r--r-- | sql/lock.cc | 11 | ||||
-rw-r--r-- | sql/sql_select.cc | 2 | ||||
-rw-r--r-- | sql/violite.c | 6 |
9 files changed, 27 insertions, 21 deletions
diff --git a/Docs/manual.texi b/Docs/manual.texi index 2537255008c..a437a143cab 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -32592,9 +32592,6 @@ The following conditions hold for an @code{INSERT ... SELECT} statement: @itemize @minus @item -The query cannot contain an @code{ORDER BY} clause. - -@item The target table of the @code{INSERT} statement cannot appear in the @code{FROM} clause of the @code{SELECT} part of the query because it's forbidden in ANSI SQL to @code{SELECT} from the same table into which you are diff --git a/bdb/os_win32/os_rename.c b/bdb/os_win32/os_rename.c index c824820462c..cd53ec02022 100644 --- a/bdb/os_win32/os_rename.c +++ b/bdb/os_win32/os_rename.c @@ -47,7 +47,7 @@ __os_rename(dbenv, old, new) */ if (MoveFileEx(old, new, MOVEFILE_REPLACE_EXISTING) != TRUE) ret = __os_win32_errno(); - if (ret == ENOENT && MoveFile(old, new) == TRUE) + if ((ret == ENOENT || ret == EIO) && MoveFile(old, new) == TRUE) ret = 0; } if (ret != 0) diff --git a/configure.in b/configure.in index 121d54009f1..ddf2aa396e3 100644 --- a/configure.in +++ b/configure.in @@ -797,10 +797,8 @@ case $SYSTEM_TYPE in *darwin*) if test "$ac_cv_prog_gcc" = "yes" then - CFLAGS="$CFLAGS -traditional-cpp -DHAVE_DARWIN_THREADS" - CXXFLAGS="$CXXFLAGS -traditional-cpp -DHAVE_DARWIN_THREADS" - CFLAGS="$CFLAGS -traditional-cpp -DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE" - CXXFLAGS="$CXXFLAGS -traditional-cpp -DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE" + CFLAGS="$CFLAGS -traditional-cpp -DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ" + CXXFLAGS="$CXXFLAGS -traditional-cpp -DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ" MAX_C_OPTIMIZE="-O" with_named_curses="" fi diff --git a/include/dbug.h b/include/dbug.h index d86b83f4de8..3c86cbb8ac2 100644 --- a/include/dbug.h +++ b/include/dbug.h @@ -66,7 +66,7 @@ extern void _db_unlock_file(); #define DEBUGGER_ON _no_db_=0 #define DBUG_LOCK_FILE { _db_lock_file(); } #define DBUG_UNLOCK_FILE { _db_unlock_file(); } -#define DBUG_ASSERT(A) A +#define DBUG_ASSERT(A) assert(A) #else /* No debugger */ #define DBUG_ENTER(a1) diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c index d2b3960d6b5..10c803378df 100644 --- a/mysys/thr_lock.c +++ b/mysys/thr_lock.c @@ -736,7 +736,7 @@ void thr_unlock(THR_LOCK_DATA *data) data->type == TL_WRITE_ALLOW_WRITE)); else { - DBUG_PRINT("lock",("No locks to free")); + DBUG_PRINT("lock",("No waiting read locks to free")); } } else if (data && diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc index 7ee72803dd9..ac4088ed6a9 100644 --- a/sql/ha_berkeley.cc +++ b/sql/ha_berkeley.cc @@ -1181,9 +1181,11 @@ int ha_berkeley::remove_key(DB_TXN *trans, uint keynr, const byte *record, DBUG_ENTER("remove_key"); DBUG_PRINT("enter",("index: %d",keynr)); - if (keynr == primary_key || - ((table->key_info[keynr].flags & (HA_NOSAME | HA_NULL_PART_KEY)) == - HA_NOSAME)) + if (keynr == active_index && cursor) + error=cursor->c_del(cursor,0); + else if (keynr == primary_key || + ((table->key_info[keynr].flags & (HA_NOSAME | HA_NULL_PART_KEY)) == + HA_NOSAME)) { // Unique key dbug_assert(keynr == primary_key || prim_key->data != key_buff2); error=key_file[keynr]->del(key_file[keynr], trans, @@ -1312,7 +1314,10 @@ int ha_berkeley::index_init(uint keynr) an active cursor at this point */ if (cursor) + { + DBUG_PRINT("note",("Closing active cursor")); cursor->c_close(cursor); + } active_index=keynr; if ((error=key_file[keynr]->cursor(key_file[keynr], transaction, &cursor, table->reginfo.lock_type > @@ -1659,12 +1664,13 @@ int ha_berkeley::external_lock(THD *thd, int lock_type) if (!thd->transaction.bdb_lock_count++) { changed_rows=0; + transaction=0; // Safety /* First table lock, start transaction */ if ((thd->options & (OPTION_NOT_AUTO_COMMIT | OPTION_BEGIN | OPTION_TABLE_LOCK)) && !thd->transaction.all.bdb_tid) { - DBUG_ASSERT(thd->transaction.stmt.bdb_tid != 0); + DBUG_ASSERT(thd->transaction.stmt.bdb_tid == 0); /* We have to start a master transaction */ DBUG_PRINT("trans",("starting transaction all")); if ((error=txn_begin(db_env, 0, diff --git a/sql/lock.cc b/sql/lock.cc index a8b26c3b17d..7bac2d54631 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -169,8 +169,11 @@ static int lock_external(TABLE **tables,uint count) void mysql_unlock_tables(THD *thd, MYSQL_LOCK *sql_lock) { DBUG_ENTER("mysql_unlock_tables"); - thr_multi_unlock(sql_lock->locks,sql_lock->lock_count); - VOID(unlock_external(thd,sql_lock->table,sql_lock->table_count)); + if (sql_lock->lock_count) + { + thr_multi_unlock(sql_lock->locks,sql_lock->lock_count); + VOID(unlock_external(thd,sql_lock->table,sql_lock->table_count)); + } my_free((gptr) sql_lock,MYF(0)); DBUG_VOID_RETURN; } @@ -213,7 +216,7 @@ void mysql_unlock_read_tables(THD *thd, MYSQL_LOCK *sql_lock) if (i != found) { thr_multi_unlock(lock,i-found); - sql_lock->lock_count-=found; + sql_lock->lock_count= found; } /* Then to the same for the external locks */ @@ -232,7 +235,7 @@ void mysql_unlock_read_tables(THD *thd, MYSQL_LOCK *sql_lock) if (i != found) { VOID(unlock_external(thd,table,i-found)); - sql_lock->table_count-=found; + sql_lock->table_count=found; } DBUG_VOID_RETURN; } diff --git a/sql/sql_select.cc b/sql/sql_select.cc index b30cb6bb639..b6c261d1463 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -2516,6 +2516,7 @@ static void join_free(JOIN *join) { JOIN_TAB *tab,*end; + DBUG_ENTER("join_free"); if (join->table) { @@ -2556,6 +2557,7 @@ join_free(JOIN *join) join->tmp_table_param.copy_funcs.delete_elements(); delete [] join->tmp_table_param.copy_field; join->tmp_table_param.copy_field=0; + DBUG_VOID_RETURN; } diff --git a/sql/violite.c b/sql/violite.c index 0d96c71969c..d551b9b8632 100644 --- a/sql/violite.c +++ b/sql/violite.c @@ -154,7 +154,7 @@ int vio_read(Vio * vio, gptr buf, int size) { int r; DBUG_ENTER("vio_read"); - DBUG_PRINT("enter", ("sd=%d, buf=%p, size=%d", vio->sd, buf, size)); + DBUG_PRINT("enter", ("sd=%d size=%d", vio->sd, size)); #if defined( __WIN__) || defined(OS2) if (vio->type == VIO_TYPE_NAMEDPIPE) { @@ -188,7 +188,7 @@ int vio_write(Vio * vio, const gptr buf, int size) { int r; DBUG_ENTER("vio_write"); - DBUG_PRINT("enter", ("sd=%d, buf=%p, size=%d", vio->sd, buf, size)); + DBUG_PRINT("enter", ("sd=%d size=%d", vio->sd, size)); #if defined( __WIN__) || defined(OS2) if ( vio->type == VIO_TYPE_NAMEDPIPE) { @@ -303,7 +303,7 @@ int vio_keepalive(Vio* vio, my_bool set_keep_alive) int r=0; uint opt = 0; DBUG_ENTER("vio_keepalive"); - DBUG_PRINT("enter", ("sd=%d, set_keep_alive=%d", vio->sd, (int) + DBUG_PRINT("enter", ("sd=%d set_keep_alive=%d", vio->sd, (int) set_keep_alive)); if (vio->type != VIO_TYPE_NAMEDPIPE) { |