Commit graph

467 commits

Author SHA1 Message Date
Alexander Nozdrin
cd14c47c99 Manual merge from mysql-trunk-merge. 2009-11-05 23:28:35 +03:00
Alexander Nozdrin
b30c1886dc Manual merge from mysql-5.1. 2009-11-05 11:40:01 +03:00
Alexander Barkov
dcb8bb23c2 Merging mysql-next-mr-merge to mysql-next-mr. 2009-10-21 15:48:22 +05:00
Alexander Nozdrin
bd60794fd8 Merge from mysql-trunk-merge. 2009-10-19 17:36:19 +04:00
Alexander Nozdrin
3251065aef Merge from mysql-5.1. 2009-10-19 17:17:08 +04:00
Georgi Kodinov
7b4ef910f7 Bug #40877: multi statement execution fails in 5.1.30
Implemented the server infrastructure for the fix:

1. Added a function LEX_STRING *thd_query_string(THD) to return
a LEX_STRING structure instead of char *.
This is the function that must be called in innodb instead of 
thd_query()

2. Did some encapsulation in THD : aggregated thd_query and 
thd_query_length into a LEX_STRING and made accessor and mutator 
methods for easy code updating. 

3. Updated the server code to use the new methods where applicable.
2009-10-16 13:29:42 +03:00
Alexander Barkov
3929dddcd7 Backporting WL#4164 Two-byte collation IDs 2009-10-15 15:17:32 +05:00
Alexander Nozdrin
c30d924dd5 Manual merge from mysql-trunk-merge. 2009-10-14 12:25:39 +04:00
Alexander Nozdrin
c69629d269 Merge from mysql-5.1. 2009-10-13 13:42:38 +04:00
Sergey Vojtovich
f1c2f6e84e Merge fix for BUG47073. 2009-10-09 21:21:21 +05:00
Sergey Vojtovich
adbd70aa12 BUG#47073 - valgrind errs, corruption,failed repair of partition,
low myisam_sort_buffer_size

Repair by sort (default) or parallel repair of a MyISAM table
(doesn't matter partitioned or not) as well as bulk inserts
and enable indexes some times didn't failover to repair with
key cache.

The problem was that after unsuccessful attempt, data file was
closed. Whereas repair with key cache requires open data file.
Fixed by reopening data file.

Also fixed a valgrind warning, which may appear during repair
by sort or parallel repair with certain myisam_sort_buffer_size
number of rows and length of an index entry (very dependent).

mysql-test/r/myisam.result:
  A test case for BUG#47073.
mysql-test/t/myisam.test:
  A test case for BUG#47073.
storage/myisam/ha_myisam.cc:
  Reverted fix for BUG25289. Not needed anymore.
storage/myisam/mi_check.c:
  Reopen data file, when repair by sort or parallel repair
  fails.
  
  When repair by sort is requested to rebuild data file, data file
  gets rebuilt while fixing first index. When rebuild is completed,
  info->dfile is pointing to temporary data file, original data file
  is closed.
  
  It may happen that repair has successfully fixed first index and
  rebuilt data file, but failed to fix second index. E.g.
  myisam_sort_buffer_size was big enough to fix first shorter index,
  but not enough to fix subsequent longer index.
  
  In this case we end up with info->dfile pointing to temporary file,
  which is removed and info->dfile is set to -1.
  
  Though repair by sort failed, the upper layer may still want to
  try repair with key cache. But it needs info->dfile pointing to
  valid data file.
storage/myisam/sort.c:
  When performing a copy of IO_CACHE structure, current_pos and
  current_end must be updated separatly to point to memory we're
  copying to (not to memory we're copying from).
  
  As t_file2 is always WRITE cache, proper members are write_pos
  and write_end accordingly.
2009-10-09 21:16:29 +05:00
Ingo Struewing
1f37e3d834 auto-merge 2009-10-01 15:54:11 +02:00
Vladislav Vaintroub
eaba74fee5 Backport http://lists.mysql.com/commits/57778
2677 Vladislav Vaintroub	2008-11-04
CMakeLists.txt files cleanup
- remove SAFEMALLOC and SAFE_MUTEX definitions that were 
present in *each* CMakeLists.txt. Instead, put them into top level 
CMakeLists.txt, but disable on Windows, because
a) SAFEMALLOC does not add any functionality that is not already
present in Debug C runtime ( and 2 safe malloc one on top of the other 
only unnecessarily slows down the server) 
      
b)SAFE_MUTEX does not work on Windows  and have been
explicitely  disabled on Windows with #undef previously.  Fortunately,
ntdll does  pretty good  job identifying l problems with 
CRITICAL_SECTIONs.
DebugBreak()s on using uninited critical section, unlocking unowned 
critical section)
      
-Also, remove occationally used -D_DEBUG (added by compiler 
anyway)


sql/udf_example.c:
  use unixish end of line
2009-09-30 15:35:01 +02:00
Vladislav Vaintroub
b73763e0f9 Backport of the patch
http://lists.mysql.com/commits/57725

Vladislav Vaintroub	2008-11-03
Cleanup CMakeLists.txt(s) - remove winsock2 (ws2_32) from 
TARGET_LINK_LIBRARIES. 
      
Every exe or dll linked with mysys needs ws2_32, because
mysys uses winsock function WSAStartup in my_init().
However, there is no need to explicitely add ws2_32 to
the list of TARGET_LINK_LIBRARIES multiple times. 
Visual Studio comes with a handy pragma that tells linker
to add library. So patch replaces bunch of ws2_32 in 
CMakeLists with  single pragma comment(lib,"ws2_32")
in my_init.c
      
Additionally, reference to non-existing "debug" library
has been removed from TARGET_LINK_LIBRARIES. The correct
name of the library is "dbug".
2009-09-30 03:39:37 +02:00
Ingo Struewing
4d57b851a0 WL#4259 - Debug Sync Facility
Backport from 6.0 to 5.1.
Only those sync points are included, which are used in debug_sync.test.

  The Debug Sync Facility allows to place synchronization points
  in the code:
  
  open_tables(...)
  
  DEBUG_SYNC(thd, "after_open_tables");
  
  lock_tables(...)
  
  When activated, a sync point can
  
  - Send a signal and/or
  - Wait for a signal
  
  Nomenclature:
  
  - signal:            A value of a global variable that persists
                       until overwritten by a new signal. The global
                       variable can also be seen as a "signal post"
                       or "flag mast". Then the signal is what is
                       attached to the "signal post" or "flag mast".
  
  - send a signal:     Assign the value (the signal) to the global
                       variable ("set a flag") and broadcast a
                       global condition to wake those waiting for
                       a signal.
  
  - wait for a signal: Loop over waiting for the global condition until
                       the global value matches the wait-for signal.
  
  Please find more information in the top comment in debug_sync.cc
  or in the worklog entry.


.bzrignore:
  WL#4259 - Debug Sync Facility
  Added the symbolic link libmysqld/debug_sync.cc.
CMakeLists.txt:
  WL#4259 - Debug Sync Facility
  Added definition for ENABLED_DEBUG_SYNC.
configure.in:
  WL#4259 - Debug Sync Facility
  Added definition for ENABLED_DEBUG_SYNC.
include/my_sys.h:
  WL#4259 - Debug Sync Facility
  Added definition for the DEBUG_SYNC_C macro.
libmysqld/CMakeLists.txt:
  WL#4259 - Debug Sync Facility
  Added sql/debug_sync.cc.
libmysqld/Makefile.am:
  WL#4259 - Debug Sync Facility
  Added sql/debug_sync.cc.
mysql-test/include/have_debug_sync.inc:
  WL#4259 - Debug Sync Facility
  New include file.
mysql-test/mysql-test-run.pl:
  WL#4259 - Debug Sync Facility
  Added option --debug_sync_timeout.
mysql-test/r/debug_sync.result:
  WL#4259 - Debug Sync Facility
  New test result.
mysql-test/r/have_debug_sync.require:
  WL#4259 - Debug Sync Facility
  New require file.
mysql-test/t/debug_sync.test:
  WL#4259 - Debug Sync Facility
  New test file.
mysys/my_static.c:
  WL#4259 - Debug Sync Facility
  Added definition for debug_sync_C_callback_ptr.
mysys/thr_lock.c:
  WL#4259 - Debug Sync Facility
  Added sync point "wait_for_lock".
sql/CMakeLists.txt:
  WL#4259 - Debug Sync Facility
  Added debug_sync.cc and debug_sync.h.
sql/Makefile.am:
  WL#4259 - Debug Sync Facility
  Added debug_sync.cc and debug_sync.h.
sql/debug_sync.cc:
  WL#4259 - Debug Sync Facility
  New source file.
sql/debug_sync.h:
  WL#4259 - Debug Sync Facility
  New header file.
sql/mysqld.cc:
  WL#4259 - Debug Sync Facility
  Added opt_debug_sync_timeout.
  Added calls to debug_sync_init() and debug_sync_end().
  Fixed a purecov comment (unrelated).
sql/set_var.cc:
  WL#4259 - Debug Sync Facility
  Added server variable "debug_sync".
sql/set_var.h:
  WL#4259 - Debug Sync Facility
  Added declaration for server variable "debug_sync".
sql/share/errmsg.txt:
  WL#4259 - Debug Sync Facility
  Added error messages ER_DEBUG_SYNC_TIMEOUT and ER_DEBUG_SYNC_HIT_LIMIT.
sql/sql_base.cc:
  WL#4259 - Debug Sync Facility
  Added sync points "after_flush_unlock" and "before_lock_tables_takes_lock".
sql/sql_class.cc:
  WL#4259 - Debug Sync Facility
  Added initialization for debug_sync_control to THD::THD.
  Added calls to debug_sync_init_thread() and debug_sync_end_thread().
sql/sql_class.h:
  WL#4259 - Debug Sync Facility
  Added element debug_sync_control to THD.
storage/myisam/myisamchk.c:
  Fixed a typo in an error message string (unrelated).
2009-09-29 17:38:40 +02:00
Georgi Kodinov
134441342e Fixed Sun Studio 8 compilation failures as suggested by Jorgen and reviewed
by Svoj over e-mail.
2009-09-28 16:55:01 +03:00
Vladislav Vaintroub
7ddb103b8e merge 2009-09-23 22:15:22 +02:00
Staale Smedseng
d6ca0cbb23 Merge from 5.0 2009-09-17 17:25:52 +02:00
Alexander Nozdrin
80c91e4298 Merge from mysql-5.1-bugteam. 2009-09-16 10:52:43 +04:00
Vladislav Vaintroub
716099e07c This is the downport of
Bug#24509 - 2048 file descriptor limit on windows needs increasing, also 
WL#3049 - improved Windows I/O
                        
The patch replaces the use of the POSIX I/O interfaces in mysys on Windows with 
the Win32 API calls (CreateFile, WriteFile, etc). The Windows HANDLE for the open 
file is stored in the my_file_info struct, along with a flag for append mode 
because the Windows API does not support opening files in append mode in all cases)
The default max open files has been increased to 16384 and can be increased further
by setting --max-open-files=<value> during the server start.
                              
Another major change in this patch that almost all Windows specific file IO code
has been moved to a new file my_winfile.c, greatly reducing the amount of code 
in #ifdef blocks within mysys, thus improving readability.
                               
                                    
Minor enhancements:
- my_(f)stat() is changed to use __stati64 structure with  64 file size
and timestamps. It will return correct file size now (C runtime implementation
used to report outdated information)
- my_lock on Windows is prepared to handle additional timeout parameter
- after review : changed __WIN__ to _WIN32 in the new and changed code.

client/mysqlbinlog.cc:
  fileno -> my_fileno
client/readline.cc:
  fileno -> my_fileno
include/config-win.h:
  Increase OS_FILE_LIMIT for Windows.
  Remove O_SHARE - Windows does not support it. Its definition conflicts with
  O_SHORT_LIVED, that has different semantics.
include/my_dir.h:
  Use stat64 for stat() family of functions on Windows, because of 64 bit file size.
include/my_global.h:
  Increased default value for open file limit to 16K
include/my_sys.h:
  - my_file_info got new structure members - file handle and open flags
  - 2 new Windows-only mysys functions : my_get_osfhandle and my_osmaperr,
    modelled after Windows C runtime functions _get_osfhandle and _dosmaperr
libmysql/CMakeLists.txt:
  new files my_winfile.c and my_winerr.c
mysql-test/suite/large_tests/r/lock_tables_big.result:
  test for more then 2048 open file descriptors on Windows
mysql-test/suite/large_tests/t/lock_tables_big.test:
  test for more then 2048 open file descriptors on Windows
mysys/CMakeLists.txt:
  new files my_winfile.c and my_winerr.c
mysys/Makefile.am:
  new files my_winfile.c and my_winerr.c
mysys/default_modify.c:
  fileno -> my_fileno
mysys/my_chsize.c:
  implementation of chsize on Windows now moved to my_winfile.c
mysys/my_create.c:
  - my_sopen->my_win_open
  - close open file before removing (won't generally work on Windows otherwise)
mysys/my_file.c:
  On Windows, files returned by my_open will not start with 0, but 2048 
  (making it simple to detect incompatible mix of CRT and mysys  io functions)
mysys/my_fopen.c:
  fileno->my_win_fileno , fclose->my_win_fclose, fdopen->my_win_fdopen
  Check for legal filename is done by my_win_[f]open functions
mysys/my_fstream.c:
  fileno->my_fileno
mysys/my_lib.c:
  Windows stat() functions are moved to my_winfile.c
mysys/my_lock.c:
  Move Windows code under #ifdef to a separate function win_lock().
  Add a parameter for lock wait timeout
mysys/my_mmap.c:
   _get_osfhandle->my_get_osfhandle
mysys/my_open.c:
  my_sopen->my_win_open (simpler interface)
mysys/my_pread.c:
  moved most windows specific code to my_win_file.c
  Use my_win_pread
mysys/my_quick.c:
  Use my_win_read/my_win_write
mysys/my_read.c:
  Moved most of windows specific code to my_win_file.c
  Use my_win_read()
mysys/my_seek.c:
  On Windows, use my_win_lseek() in my_seek()/my_tell()
  Removed dead code (synchronization of lseeks)
  Improved DBUG tracing (file position is ulonglong, not ulong)
mysys/my_static.c:
  Removed array initialization. my_file_info_default is global variable
  thus it is initialized with all zeros anyway
mysys/my_sync.c:
  _commit->my_win_fsync
mysys/my_winerr.c:
  New file my_winerr.c
  Exports my_osmaperr modelled after undocumented C runtime
  function _dosmaperr(). The problem with _dosmaperr() used previously is that 
  1) it is nowhere documented and thus code relying on it is not guaranteed to work
     in subsequent releases on the C runtime
  2) it is present only in static C runtime (mysqld does not link if compiled with
    /MD)
mysys/my_winfile.c:
  New file my_winfile.c
  Implements ANSI/Posix file IO routines, when possible using native Windows IO, without
  C runtime (C runtime dropped because of the 2048 file descriptor limit).
mysys/my_write.c:
  write->my_win_write
mysys/mysys_priv.h:
  Declaration of Windows Posix functions (private to mysys, shall not be visible
  outside)
storage/innobase/handler/ha_innodb.cc:
  mysys native Windows IO : correct innodb tmp file handling
  mysql_tmpfile does not return valid CRT file descriptor, thus
  it is not possible to dup() it. Instead, the native file handle has 
  to be duplicated and then converted to CRT descriptor.
storage/myisam/mi_locking.c:
  _commit->my_sync
2009-09-11 22:26:35 +02:00
Satya B
421531dfb2 merge mysql-5.0-bugteam to mysql-5.1-bugteam 2009-09-03 23:54:38 +05:30
Staale Smedseng
5be4c38226 Merge from 5.0 for 43414 2009-08-28 18:21:54 +02:00
Davi Arnaut
169f7da04c Fix for a few assorted compiler warnings.
client/mysql.cc:
  Remove leading whitespace.
  Remove extra text after #else directive.
client/mysqldump.c:
  Function does not take a parameter.
mysys/array.c:
  buffer is a uchar pointer.
sql/item.cc:
  Assert if it should not happen.
storage/myisam/mi_check.c:
  Cast to expected type. This is probably a bug, but it is
  casted in a similar way in another part of the code.
storage/ndb/include/mgmapi/ndb_logevent.h:
  Apply fix from cluster team.
tests/mysql_client_test.c:
  Remove extraneous slash.
2009-08-28 12:06:59 -03:00
Alexander Nozdrin
09d01ba615 Merge from mysql-5.1-bugteam 2009-08-26 19:43:32 +04:00
Mattias Jonsson
a4e832d69d Bug#46639: 1030 (HY000): Got error 124 from storage engine on
INSERT ... SELECT ...

Problem was that when bulk insert is used on an empty
table/partition, it disables the indexes for better
performance, but in this specific case it also tries
to read from that partition using an index, which is
not possible since it has been disabled.

Solution was to allow index reads on disabled indexes
if there are no records.

Also reverted the patch for bug#38005, since that was a workaround
in the partitioning engine instead of a fix in myisam.

mysql-test/r/partition.result:
  Bug#46639: 1030 (HY000): Got error 124 from storage engine on
  INSERT ... SELECT ...
  
  updated result file
mysql-test/t/partition.test:
  Bug#46639: 1030 (HY000): Got error 124 from storage engine on
  INSERT ... SELECT ...
  
  Added testcase
sql/ha_partition.cc:
  Bug#46639: 1030 (HY000): Got error 124 from storage engine on
  INSERT ... SELECT ...
  
  reverted the patch for bug#38005, since that was a workaround
  around this problem, not needed after fixing it in myisam.
storage/myisam/mi_search.c:
  Bug#46639: 1030 (HY000): Got error 124 from storage engine on
  INSERT ... SELECT ...
  
  Return HA_ERR_END_OF_FILE instead of HA_ERR_WRONG_INDEX
  when there are no rows.
2009-08-21 17:38:29 +02:00
Guilhem Bichot
eceba8912c merge of 5.1-main into mysql-trunk.
Changes to ha_innodb.cc are not propagated to plugin, they will come back
via Oracle/Innobase if needed.
2009-08-12 15:44:34 +02:00
Sergey Vojtovich
24e418df69 Merge mysql-5.1-innodb_plugin to mysql-5.1. 2009-08-11 18:05:25 +05:00
Guilhem Bichot
b57e4dbd88 Creation of mysql-trunk = {summit + "Innodb plugin replacing the builtin"}:
bzr branch mysql-5.1-performance-version mysql-trunk # Summit
cd mysql-trunk
bzr merge mysql-5.1-innodb_plugin # which is 5.1 + Innodb plugin 
bzr rm innobase # remove the builtin
Next step: build, test fixes.
2009-08-04 13:25:19 +02:00
Gleb Shchepa
2bc6b6a800 Merge from 5.0
******
manual merge 5.0-bugteam --> 5.1-bugteam (bug 38816)
2009-07-24 21:04:55 +05:00
Sergey Vojtovich
058cd62565 Merge 5.1-bugteam -> 5.1-innodb_plugin. 2009-07-14 15:06:04 +05:00
Satya B
02e70f1691 Bug#35111 - Truncate a MyISAM partitioned table does not reset
the auto_increment value
      
This is an alternative patch that instead of allowing RECREATE TABLE
on TRUNCATE TABLE it implements reset_auto_increment that is called
after delete_all_rows.

Note: this bug was fixed by Mattias Jonsson:
Pusing this patch: http://lists.mysql.com/commits/70370


mysql-test/suite/parts/r/partition_auto_increment_memory.result:
  Bug#35111: Truncate a MyISAM partitioned table does not reset
  the auto_increment value
mysql-test/suite/parts/r/partition_auto_increment_myisam.result:
  Bug#35111: Truncate a MyISAM partitioned table does not reset
  the auto_increment value
sql/ha_partition.cc:
  Bug#35111: Truncate a MyISAM partitioned table does not reset
  the auto_increment value
  
  Added reset_auto_increment, to be used after delete_all_rows
  to simulate truncate.
storage/heap/ha_heap.cc:
  Bug#35111: Truncate a MyISAM partitioned table does not reset
  the auto_increment value
  
  Added reset_auto_increment, to be used after delete_all_rows
  to simulate truncate
storage/heap/ha_heap.h:
  Bug#35111: Truncate a MyISAM partitioned table does not reset
  the auto_increment value
  
  Added reset_auto_increment, to be used after delete_all_rows
  to simulate truncate
storage/myisam/ha_myisam.cc:
  Bug#35111: Truncate a MyISAM partitioned table does not reset
  the auto_increment value
  
  Added reset_auto_increment, to be used after delete_all_rows
  to simulate truncate.
storage/myisam/ha_myisam.h:
  Bug#35111: Truncate a MyISAM partitioned table does not reset
  the auto_increment value
  
  Added reset_auto_increment, to be used after delete_all_rows
  to simulate truncate.
2009-07-08 17:41:34 +05:30
Staale Smedseng
300a8721fa Merge from 5.0 2009-06-29 16:00:47 +02:00
Mikael Ronstrom
a22c8c5be5 Merge MySQL 5.1.35 into MySQL 5.4 2009-06-11 12:07:59 +02:00
Vladislav Vaintroub
768bbae90e Backport WL#3653 to 5.1 to enable bundled innodb plugin.
Remove custom DLL loader code from innodb plugin code, use 
symbols exported from mysqld.


storage/innodb_plugin/handler/ha_innodb.cc:
  Remove a Win32 workaround for current_thd.
  The original  problem that innodb plugin used
  value of TLS variable across DLL boundaries is 
  solved in MySQL server (current_thd is a function
  not TLS variable now)
storage/innodb_plugin/handler/handler0alter.cc:
  Remove custom delay loader
storage/innodb_plugin/handler/handler0vars.h:
  Remove custom delay loader
storage/innodb_plugin/handler/i_s.cc:
  Remove custom delay loader
storage/innodb_plugin/handler/win_delay_loader.cc:
  Remove custom delay loader
storage/innodb_plugin/plug.in:
  Remove commented out MYSQL_PLUGIN_STATIC, 
  CMake would not parse that correctly
2009-06-10 10:59:49 +02:00
Tatiana A. Nurnberg
406f018d33 auto-merge 2009-06-05 01:30:08 +02:00
Sergey Glukhov
c8a7b79142 5.0-bugteam->5.1-bugteam merge 2009-05-27 15:42:19 +05:00
Sergey Glukhov
d31b6e4784 Bug#43940 64-bit windows myisamchk doesn't support key_buffer_size > 4G
The fix is to allow myisamchk to use >4G key_buffer_size on win64


include/myisam.h:
  use ulonglong instead of ulong for use_buffers
storage/myisam/myisamchk.c:
  use ulonglong instead of ulong for use_buffers
2009-05-27 13:11:28 +05:00
Anurag Shekhar
da0fe3cb31 Bug #39802 On Windows, 32-bit time_t should be enforced
This patch fixes compilation warning, "conversion from 'time_t' to 'ulong', 
possible loss of data". 
The fix is to typecast time_t to ulong before assigning it to ulong. 
Backported this from 6.0-bugteam tree.


storage/archive/ha_archive.cc:
  type casting time_t to ulong before assigning.
storage/federated/ha_federated.cc:
  type casting time_t to ulong before assigning.
storage/innobase/handler/ha_innodb.cc:
  type casting time_t to ulong before assigning.
storage/myisam/ha_myisam.cc:
  type casting time_t to ulong before assigning.
2009-05-13 15:41:24 +05:30
Sergey Vojtovich
6a43ad1d53 Merge to 5.1-bugteam. 2009-04-30 19:41:43 +05:00
Narayanan V
bb668b284d merging with mysql-5.1-bugteam 2009-04-30 18:22:48 +05:30
Narayanan V
db83fda90d BUG#37631 - Incorrect key file for table after upgrading from 5.0 to 5.1
This patch adds corrections to the original patch
submitted 2009-04-08 (http://lists.mysql.com/commits/71607):

- fixed that the original patch didn't work because of an
  incorrect condition;
- added a test case.

mysql-test/r/upgrade.result:
  Bug#37631 Incorrect key file for table after upgrading from 5.0 to 5.1
  
  Result file for test case
mysql-test/std_data/bug37631.MYD:
  Bug#37631 Incorrect key file for table after upgrading from 5.0 to 5.1
  
  table created in mysql 4.0
mysql-test/std_data/bug37631.MYI:
  Bug#37631 Incorrect key file for table after upgrading from 5.0 to 5.1
  
  table created in mysql 4.0
mysql-test/std_data/bug37631.frm:
  Bug#37631 Incorrect key file for table after upgrading from 5.0 to 5.1
  
  table created in mysql 4.0
mysql-test/t/upgrade.test:
  Bug#37631 Incorrect key file for table after upgrading from 5.0 to 5.1
  
  Adds test for checking that upgrade works
  on a table which is created by a mysql
  server version <= 4.0.
storage/myisam/ha_myisam.cc:
  Bug#37631 Incorrect key file for table after upgrading from 5.0 to 5.1
  
  Fix the conformance checker to relax checking
  for the correct version of the tables (for tables
  created by mysql server version <= 4.0)
2009-04-30 18:16:49 +05:30
Satya B
a5badbfe6d Fix for BUG#40827 - Killing insert-select to MyISAM can cause table corruption
Killing the insert-select statement corrupts the MyISAM table only
when the destination table is empty and when it has indexes. When 
we bulk insert huge data and if the destination table is empty we 
disable the indexes for fast inserts, data is then inserted and 
indexes are re-enabled after bulk_insert operation
                        
Killing the query, aborts the repair table operation during enable
indexes phase leading to table corruption.
                      
We now truncate the table when we detect that enable indexes is
killed for bulk insert query.As we have an empty table before the 
operation, we can fix by truncating the table.

mysql-test/r/myisam.result:
  Result file for BUG#40827
mysql-test/t/myisam.test:
  Testcase for BUG#40827
storage/myisam/ha_myisam.cc:
  Fixed end_bulk_insert() method to truncate the table when we detect enable 
  index operation is killed.
2009-04-30 12:40:12 +05:30
Martin Hansson
45cbd32697 Bug#43737: Select query return bad result
A bug in the initialization of key segment information made it point
to the wrong bit, since a bit index was used when its int value
was needed. This lead to misinterpretation of bit columns
read from MyISAM record format when a NULL bit pushed them over
a byte boundary.
Fixed by using the int value of the bit instead.


mysql-test/r/myisam.result:
  Bug#43737: Test result.
mysql-test/t/myisam.test:
  Bug#43737: Test case.
storage/myisam/mi_open.c:
  Bug#43737: fix.
2009-04-29 14:00:34 +02:00
Alexey Botchkov
0e88c80580 merging 2009-04-29 07:59:10 +05:00
Sergey Vojtovich
509a9cee1c BUG#42907 - Multi-term boolean fulltext query containing a
single quote fails in 5.1.x

Performing fulltext prefix search (a word with truncation
operator) may cause a dead-loop.

The problem was in smarter index merge algorithm - it was writing
record reference to an incorrect memory area.

mysql-test/r/fulltext.result:
  A test case for BUG#42907.
mysql-test/t/fulltext.test:
  A test case for BUG#42907.
storage/myisam/ft_boolean_search.c:
  Fixed incorrect memory update by _mi_dpointer() when performing
  fulltext prefix search.
2009-04-23 16:24:08 +05:00
Satya B
24146bb2ab BUG#40827 - Killing insert-select to MyISAM can cause table corruption
Killing insert-select statement on MyISAM corrupts the table.
                  
Killing the insert-select statement corrupts the MyISAM table only
when the destination table is empty and when it has indexes. When 
we bulk insert huge data and if the destination table is empty we 
disable the indexes for fast inserts, data is then inserted and 
indexes are re-enabled after bulk_insert operation
                  
Killing the query, aborts the repair table operation during enable
indexes phase leading to table corruption.
                
We now truncate the table when we detect that enable indexes is
killed for bulk insert query.As we have an empty table before the 
operation, we can fix by truncating the table.

mysql-test/r/myisam.result:
  Result file for BUG#40827
mysql-test/t/myisam.test:
  Testcase for BUG#40827
storage/myisam/ha_myisam.cc:
  Fixed end_bulk_insert() method to truncate the table when we detect enable 
  index operation is killed.
2009-04-16 17:02:56 +05:30
Narayanan V
cce39fe8cf merging with mysql-5.1-bugteam tree 2009-04-09 14:04:34 +05:30
Narayanan V
53f8922307 Bug#38848 myisam_use_mmap causes widespread myisam corruption on windows
Currently the memory map is being created
with a size that is greater than the size 
of the underlying datafile. This can cause
varying behaviour,

e.g. 

In windows the size of the datafile
is increased, while on linux it remains
the same.

This fix removes the increment margin to
the size that is used while creating the
memory map.

storage/myisam/mi_dynrec.c:
  remove MEMMAP_EXTRA_MARGIN that is used as
  the increment margin to the underlying 
  datafile size while creating the mmap.
storage/myisam/mi_packrec.c:
  The size of the underlying datafile is
  increased by MEMMAP_EXTRA_MARGIN when
  using a packed record format. Hence in 
  this case the size of the memory map should 
  be incremented by the same factor.
2009-04-09 13:48:23 +05:30
Anurag Shekhar
b1b8ab5159 merging with 5.0 bugteam tree 2009-04-09 13:36:47 +05:30
Narayanan V
92aee5a6c6 Bug#37631 Incorrect key file for table after upgrading from 5.0 to 5.1
The conformance checker was not taking into
account, and, making concessions for acceptable
incompatibilites in tables created by
versions earlier than 4.1.

The current patch relaxes the conformance
checker to ignore differences in key_alg
and language for tables created by versions
earlier than 4.1.

storage/myisam/ha_myisam.cc:
  Modify check_definition to ignore differences
  in key_alg and language for tables created
  by versions earlier than 4.1.
2009-04-08 12:25:19 +05:30