diff options
author | Michael Widenius <monty@askmonty.org> | 2011-11-21 19:13:14 +0200 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2011-11-21 19:13:14 +0200 |
commit | a8d03ab23519d4afc288a6490676ddb8745e3e72 (patch) | |
tree | e55f53ff3cc4b044769ca269561a933e3c93f05f /storage/archive | |
parent | 04f3ecf632816a940e2838949e0216d638436fd8 (diff) | |
parent | 13fefeb04ade34418cd9d99aa93bffb69fdae27e (diff) | |
download | mariadb-git-a8d03ab23519d4afc288a6490676ddb8745e3e72.tar.gz |
Initail merge with MySQL 5.1 (XtraDB still needs to be merged)
Fixed up copyright messages.
Diffstat (limited to 'storage/archive')
-rwxr-xr-x | storage/archive/CMakeLists.txt | 3 | ||||
-rw-r--r-- | storage/archive/Makefile.am | 2 | ||||
-rw-r--r-- | storage/archive/archive_reader.c | 15 | ||||
-rw-r--r-- | storage/archive/azio.c | 9 | ||||
-rw-r--r-- | storage/archive/ha_archive.cc | 32 |
5 files changed, 45 insertions, 16 deletions
diff --git a/storage/archive/CMakeLists.txt b/storage/archive/CMakeLists.txt index 893a5dcf4f9..8c4d46fbbb8 100755 --- a/storage/archive/CMakeLists.txt +++ b/storage/archive/CMakeLists.txt @@ -1,4 +1,5 @@ -# Copyright (C) 2006 MySQL AB +# Copyright (c) 2006-2008 MySQL AB, 2009 Sun Microsystems, Inc. +# Use is subject to license terms. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/storage/archive/Makefile.am b/storage/archive/Makefile.am index 83df8bae0db..c21242744ce 100644 --- a/storage/archive/Makefile.am +++ b/storage/archive/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (C) 2005-2006 MySQL AB +# Copyright (c) 2005, 2010, Oracle and/or its affiliates # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/storage/archive/archive_reader.c b/storage/archive/archive_reader.c index 0cf795cefdf..53c304559b0 100644 --- a/storage/archive/archive_reader.c +++ b/storage/archive/archive_reader.c @@ -1,3 +1,18 @@ +/* Copyright (c) 2007, 2010, Oracle and/or its affiliates + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + #include "azlib.h" #include <string.h> #include <assert.h> diff --git a/storage/archive/azio.c b/storage/archive/azio.c index fc54d98ab15..08c84c7c888 100644 --- a/storage/archive/azio.c +++ b/storage/archive/azio.c @@ -116,6 +116,15 @@ int az_open (azio_stream *s, const char *path, int Flags, File fd) errno = 0; s->file = fd < 0 ? my_open(path, Flags, MYF(0)) : fd; + DBUG_EXECUTE_IF("simulate_archive_open_failure", + { + if (s->file >= 0) + { + my_close(s->file, MYF(0)); + s->file= -1; + my_errno= EMFILE; + } + }); if (s->file < 0 ) { diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc index f052f8ca82f..ec26ef65321 100644 --- a/storage/archive/ha_archive.cc +++ b/storage/archive/ha_archive.cc @@ -1,17 +1,20 @@ -/* Copyright (C) 2003 MySQL AB +/* + Copyright (c) 2004, 2011, Oracle and/or its affiliates - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; version 2 of + the License. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ #ifdef USE_PRAGMA_IMPLEMENTATION #pragma implementation // gcc: Class implementation @@ -876,7 +879,7 @@ int ha_archive::write_row(uchar *buf) */ azflush(&(share->archive_write), Z_SYNC_FLUSH); /* - Set the position of the local read thread to the beginning postion. + Set the position of the local read thread to the beginning position. */ if (read_data_header(&archive)) { @@ -1123,7 +1126,7 @@ int ha_archive::unpack_row(azio_stream *file_to_read, uchar *record) ptr+= table->s->null_bytes; for (Field **field=table->field ; *field ; field++) { - if (!((*field)->is_null())) + if (!((*field)->is_null_in_record(record))) { ptr= (*field)->unpack(record + (*field)->offset(table->record[0]), ptr); } @@ -1605,11 +1608,12 @@ int ha_archive::check(THD* thd, HA_CHECK_OPT* check_opt) azflush(&(share->archive_write), Z_SYNC_FLUSH); pthread_mutex_unlock(&share->mutex); + if (init_archive_reader()) + DBUG_RETURN(HA_ADMIN_CORRUPT); /* Now we will rewind the archive file so that we are positioned at the start of the file. */ - init_archive_reader(); read_data_header(&archive); while (!(rc= get_row(&archive, table->record[0]))) count--; |