diff options
-rw-r--r-- | acinclude.m4 | 55 | ||||
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | innobase/btr/btr0cur.c | 44 | ||||
-rw-r--r-- | myisam/mi_locking.c | 8 | ||||
-rw-r--r-- | myisam/myisamchk.c | 14 | ||||
-rw-r--r-- | sql/ha_myisam.cc | 9 | ||||
-rw-r--r-- | sql/sql_acl.cc | 2 |
7 files changed, 90 insertions, 44 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index 3bee4e7a874..6ca600d29f3 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -709,20 +709,37 @@ AC_DEFUN(MYSQL_CHECK_VIO, [ ]) AC_DEFUN(MYSQL_FIND_OPENSSL, [ - for d in /usr/ssl/include /usr/local/ssl/include /usr/include \ + incs="$1" + libs="$2" + case "$incs---$libs" in + ---) + for d in /usr/ssl/include /usr/local/ssl/include /usr/include \ /usr/include/ssl /opt/ssl/include /opt/openssl/include \ /usr/local/ssl/include /usr/local/include ; do - if test -f $d/openssl/ssl.h ; then - OPENSSL_INCLUDE=-I$d - fi - done + if test -f $d/openssl/ssl.h ; then + OPENSSL_INCLUDE=-I$d + fi + done - for d in /usr/ssl/lib /usr/local/ssl/lib /usr/lib/openssl \ + for d in /usr/ssl/lib /usr/local/ssl/lib /usr/lib/openssl \ /usr/lib /usr/lib64 /opt/ssl/lib /opt/openssl/lib /usr/local/lib/ ; do - if test -f $d/libssl.a ; then - OPENSSL_LIB=$d - fi - done + if test -f $d/libssl.a ; then + OPENSSL_LIB=$d + fi + done + ;; + ---* | *---) + AC_MSG_ERROR([if either 'includes' or 'libs' is specified, both must be specified]) + ;; + * ) + if test -f $incs/openssl/ssl.h ; then + OPENSSL_INCLUDE=-I$incs + fi + if test -f $libs/libssl.a ; then + OPENSSL_LIB=$libs + fi + ;; + esac # On RedHat 9 we need kerberos to compile openssl for d in /usr/kerberos/include @@ -752,11 +769,23 @@ AC_MSG_CHECKING(for OpenSSL) [openssl="$withval"], [openssl=no]) - openssl_libs="" - openssl_includes="" + AC_ARG_WITH([openssl-includes], + [ + --with-openssl-includes=DIR + Find OpenSSL headers in DIR], + [openssl_includes="$withval"], + [openssl_includes=""]) + + AC_ARG_WITH([openssl-libs], + [ + --with-openssl-libs=DIR + Find OpenSSL libraries in DIR], + [openssl_libs="$withval"], + [openssl_libs=""]) + if test "$openssl" = "yes" then - MYSQL_FIND_OPENSSL + MYSQL_FIND_OPENSSL([$openssl_includes], [$openssl_libs]) #force VIO use vio_dir="vio" vio_libs="../vio/libvio.la" diff --git a/configure.in b/configure.in index 38847b5217e..64d291dccf7 100644 --- a/configure.in +++ b/configure.in @@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! -AM_INIT_AUTOMAKE(mysql, 4.0.14) +AM_INIT_AUTOMAKE(mysql, 4.0.15) AM_CONFIG_HEADER(config.h) PROTOCOL_VERSION=10 diff --git a/innobase/btr/btr0cur.c b/innobase/btr/btr0cur.c index 8402993e971..29a8fd44b9e 100644 --- a/innobase/btr/btr0cur.c +++ b/innobase/btr/btr0cur.c @@ -1107,6 +1107,10 @@ btr_cur_pessimistic_insert( if (big_rec_vec == NULL) { + if (n_extents > 0) { + fil_space_release_free_extents(index->space, + n_extents); + } return(DB_TOO_BIG_RECORD); } } @@ -1784,21 +1788,6 @@ btr_cur_pessimistic_update( trx->id); } - page_cursor = btr_cur_get_page_cur(cursor); - - /* Store state of explicit locks on rec on the page infimum record, - before deleting rec. The page infimum acts as a dummy carrier of the - locks, taking care also of lock releases, before we can move the locks - back on the actual record. There is a special case: if we are - inserting on the root page and the insert causes a call of - btr_root_raise_and_insert. Therefore we cannot in the lock system - delete the lock structs set on the root page even if the root - page carries just node pointers. */ - - lock_rec_store_on_page_infimum(rec); - - btr_search_update_hash_on_delete(cursor); - if (flags & BTR_NO_UNDO_LOG_FLAG) { /* We are in a transaction rollback undoing a row update: we must free possible externally stored fields @@ -1819,10 +1808,6 @@ btr_cur_pessimistic_update( ext_vect = mem_heap_alloc(heap, sizeof(ulint) * rec_get_n_fields(rec)); n_ext_vect = btr_push_update_extern_fields(ext_vect, rec, update); - page_cur_delete_rec(page_cursor, mtr); - - page_cur_move_to_prev(page_cursor); - if ((rec_get_converted_size(new_entry) >= page_get_free_space_of_empty() / 2) || (rec_get_converted_size(new_entry) >= REC_MAX_DATA_SIZE)) { @@ -1833,10 +1818,31 @@ btr_cur_pessimistic_update( mem_heap_free(heap); + err = DB_TOO_BIG_RECORD; + goto return_after_reservations; } } + page_cursor = btr_cur_get_page_cur(cursor); + + /* Store state of explicit locks on rec on the page infimum record, + before deleting rec. The page infimum acts as a dummy carrier of the + locks, taking care also of lock releases, before we can move the locks + back on the actual record. There is a special case: if we are + inserting on the root page and the insert causes a call of + btr_root_raise_and_insert. Therefore we cannot in the lock system + delete the lock structs set on the root page even if the root + page carries just node pointers. */ + + lock_rec_store_on_page_infimum(rec); + + btr_search_update_hash_on_delete(cursor); + + page_cur_delete_rec(page_cursor, mtr); + + page_cur_move_to_prev(page_cursor); + rec = btr_cur_insert_if_possible(cursor, new_entry, &dummy_reorganized, mtr); ut_a(rec || optim_err != DB_UNDERFLOW); diff --git a/myisam/mi_locking.c b/myisam/mi_locking.c index cbde05d31f5..22772a3dd2e 100644 --- a/myisam/mi_locking.c +++ b/myisam/mi_locking.c @@ -39,6 +39,14 @@ int mi_lock_database(MI_INFO *info, int lock_type) if (share->options & HA_OPTION_READ_ONLY_DATA || info->lock_type == lock_type) DBUG_RETURN(0); + if (lock_type == F_EXTRA_LCK) + { + ++share->w_locks; + ++share->tot_locks; + info->lock_type= lock_type; + DBUG_RETURN(0); + } + flag=error=0; pthread_mutex_lock(&share->intern_lock); if (share->kfile >= 0) /* May only be false on windows */ diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c index a7df01e0169..882f868e326 100644 --- a/myisam/myisamchk.c +++ b/myisam/myisamchk.c @@ -878,10 +878,7 @@ static int myisamchk(MI_CHECK *param, my_string filename) param->error_printed=0; goto end2; } - share->w_locks++; /* Mark for writeinfo */ - share->tot_locks++; - info->lock_type= F_EXTRA_LCK; /* Simulate as locked */ - info->tmp_lock_type=lock_type; + mi_lock_database(info, F_EXTRA_LCK); datafile=info->dfile; if (param->testflag & (T_REP_ANY | T_SORT_RECORDS | T_SORT_INDEX)) @@ -1057,8 +1054,7 @@ static int myisamchk(MI_CHECK *param, my_string filename) VOID(lock_file(param, share->kfile,0L,F_UNLCK,"indexfile",filename)); info->update&= ~HA_STATE_CHANGED; } - share->w_locks--; - share->tot_locks--; + mi_lock_database(info, F_UNLCK); end2: if (mi_close(info)) { @@ -1412,6 +1408,12 @@ static int mi_sort_records(MI_CHECK *param, param->error_printed=0; DBUG_RETURN(-1); } + if (share->data_file_type == COMPRESSED_RECORD) + { + mi_check_print_error(param,"Can't sort read-only table '%s'", name); + param->error_printed=0; + DBUG_RETURN(-1); + } if (!(param->testflag & T_SILENT)) { printf("- Sorting records for MyISAM-table '%s'\n",name); diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 595123f7ac1..9059ad803f8 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -559,7 +559,8 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool optimize) strmov(fixed_name,file->filename); // Don't lock tables if we have used LOCK TABLE - if (!thd->locked_tables && mi_lock_database(file,F_WRLCK)) + if (!thd->locked_tables && + mi_lock_database(file, table->tmp_table ? F_EXTRA_LCK : F_WRLCK)) { mi_check_print_error(¶m,ER(ER_CANT_LOCK),my_errno); DBUG_RETURN(HA_ADMIN_FAILED); @@ -999,9 +1000,9 @@ int ha_myisam::delete_table(const char *name) int ha_myisam::external_lock(THD *thd, int lock_type) { - if (!table->tmp_table) - return mi_lock_database(file,lock_type); - return 0; + return mi_lock_database(file, !table->tmp_table ? + lock_type : ((lock_type == F_UNLCK) ? + F_UNLCK : F_EXTRA_LCK)); } diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index d773aa5bc71..755a72bec32 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -725,7 +725,7 @@ static void acl_insert_user(const char *user, const char *host, ulong privileges) { ACL_USER acl_user; - acl_user.user=strdup_root(&mem,user); + acl_user.user=*user ? strdup_root(&mem,user) : 0; update_hostname(&acl_user.host,strdup_root(&mem,host)); acl_user.password=0; acl_user.access=privileges; |