Commit graph

3497 commits

Author SHA1 Message Date
Joerg Bruehe
b61fe56bd7 Fixes related to bug#46587:
archive storage engine headers don't include my_global.h first


During the build of 5.5.3-m3 on older Linux platforms
(kernels 2.4 or early 2.6),
the symptom described in the bug report occurred both
in the "archive" and in the "innobase" storage engine.

This change is the patch proposed in that bug report,
and a similar one in innobase, that latter is aligned
with Vasil Dimov of Innobase, the original author.
2010-03-22 16:19:39 +01:00
Vladislav Vaintroub
057c2b35c3 merge 2010-03-08 00:33:07 +01:00
Vladislav Vaintroub
402cab754a Fix typo (CMAKE_SIZEOF_VOIDP=>CMAKE_SIZEOF_VOID_P) 2010-03-08 00:31:06 +01:00
Marc Alff
8c28d0d1cf local merge 2010-03-07 10:41:51 -07:00
Marc Alff
01b19dbbf4 Bug#51738 Unit test pfs_instr-t crashes
The unit test pfs_instr-t:
- generates a very long (10,000) bytes file name
- calls find_or_create_file.

This leads to a buffer overflow in mysys in my_realpath(),
because my_realpath and mysys file APIs in general do not
test for input parameters: mysys assumes every file name
is less that FN_REFLEN in length.

Calling find_or_create_file with a very long file name is likely
to happen when instrumenting third party code that does not use mysys,
so this test is legitimate.

The fix is to make find_or_create_file in the performance schema
more robust in this case.
2010-03-04 18:36:54 -07:00
Marc Alff
18884b02c0 Bug#51741 Unit test pfs-t failing in mysql-next-mr-bugfixing
The root cause of the failure is that when
Bug#51447 performance schema evil twin files
was fixed, instrumented file names got normalized.

The pfs-t unit test depends on this file normalization,
but it was not updated.

This fix aligns pfs-t.cc lookup_file_by_name()
with the logic in pfs_instr.cc find_or_create_file().
2010-03-04 18:10:27 -07:00
Alexander Nozdrin
0b1d317b23 A follow-up on WL#5154 and WL#5182: remove forgotten options. 2010-03-03 22:22:02 +03:00
Alexander Nozdrin
d3755291ca Manual merge from mysql-next-mr.
Conflicts:
  - sql/sql_base.cc
2010-03-02 17:34:50 +03:00
Alexander Nozdrin
e0d1373a3b Manual merge from mysql-next-mr.
Conflicts:
  - sql/item.cc
2010-03-01 13:06:11 +03:00
Alexander Nozdrin
5867d275a3 Manual merge from mysql-trunk-merge.
Conflicts:
  - sql/share/Makefile.am
2010-03-01 12:39:44 +03:00
Marc Alff
77385a9136 Bug#51612 Un initialized locker_lost variable in pfs_instr.cc
Fixed the missing initialization of locker_lost.

This fix is not strictly necessary, but is desirable to re-align the code
from 5.5 and 6.0, and reduce the spurious code differences.

This will facilitate maintenance and help to apply patches cleanly, for merges.
2010-03-01 17:10:01 -07:00
Alexander Barkov
7a83782f1c Mergine from mysql-next-me 2010-02-27 11:43:32 +04:00
Marc Alff
d6131618bb Bug#51447 performance schema evil twin files
Before this fix, the performance schema file instrumentation would treat:
- a relative path to a file
- an absolute path to the same file
as two different files.

This would lead to:
- separate aggregation counters
- file leaks when a file is removed.

With this fix, a relative and absolute path are resolved to the same file instrument.
2010-02-26 10:39:57 -07:00
Alexey Kopytov
84766b060a Manual merge from mysql-5.1-bugteam to mysql-trunk-merge.
Conflicts:

Text conflict in scripts/Makefile.am
Text conflict in sql/share/Makefile.am
2010-02-26 16:06:31 +03:00
Alexander Barkov
69904fa658 After-fix for WL#2649 Number-to-string conversion.
This change fixes test failure for partition_repair_myisam
and partition_recover_myisam.

The problem was that:
- the file std_data/corrupt_crash.MYI
  contains charsetnr=63 (binary) for index segments.
- the new .frm file contains charsetnr=8 (latin1) for
  the same segments.
As a result REPAIR refused to repair frm+MYI files
with different segment definition.

This fix restores the old behavior for frm and MYI files:
they now store charsetnr=63 for numeric/datetime data types.
2010-02-26 10:28:44 +04:00
Jon Olav Hauglid
8a5956c928 merge from mysql-next-mr-bugfixing 2010-02-25 13:29:14 +01:00
Jon Olav Hauglid
e60ef89317 Followup to Bug#45225 Locking: hang if drop table with no timeout
This patch prevents system threads and system table accesses from
using user-specified values for "lock_wait_timeout". Instead all
such accesses are done using the default value (1 year).

This prevents background tasks (such as replication, events, 
accessing stored function definitions, logging, reading time-zone
information, etc.) from failing in cases where the global value
of "lock_wait_timeout" is set very low.

The patch also simplifies the open tables API. Rather than adding
another convenience function for opening and locking system tables,
this patch removes most of the existing convenience functions for
open_and_lock_tables_derived(). Before, open_and_lock_tables() was
a convenience function that enforced derived tables handling, while
open_and_lock_tables_derived() was the main function where derived
tables handling was optional. Now, this convencience function is
gone and the main function is renamed to open_and_lock_tables(). 

No test case added as it would have required the use of --sleep to
check that system threads and system tables have a different timeout
value from the user-specified "lock_wait_timeout" system variable.
2010-02-24 18:04:00 +01:00
Alexander Nozdrin
b3018e8613 Manual merge from mysql-trunk-merge.
Conflicts:
  - client/mysql.cc
  - client/mysqldump.c
  - configure.in
  - mysql-test/r/csv.result
  - mysql-test/r/func_time.result
  - mysql-test/r/show_check.result
  - mysql-test/r/sp-error.result
  - mysql-test/r/sp.result
  - mysql-test/r/sp_trans.result
  - mysql-test/r/type_blob.result
  - mysql-test/r/type_timestamp.result
  - mysql-test/r/warnings.result
  - mysql-test/suite/rpl/r/rpl_sp.result
  - sql/mysql_priv.h
  - sql/mysqld.cc
  - sql/sp.cc
  - sql/sql_base.cc
  - sql/sql_table.cc
  - sql/sql_trigger.cc
  - sql/sql_view.cc
  - sql/table.h
  - sql/share/errmsg.txt
  - mysql-test/suite/sys_vars/r/log_bin_trust_routine_creators_basic.result
2010-02-24 16:52:27 +03:00
Vladislav Vaintroub
0faa8ef87a Fix typo
HAVE_IBGCC_ATOMIC_BUILTINS=>HAVE_IB_GCC_ATOMIC_BUILTINS.
Due to the typo, detection of atomics was broken. 
It also lead to valgrind error during shutdown 
(access to freed memory),which is likely present 
in all builds where atomics are not used.
2010-02-24 02:06:08 +01:00
Alexey Kopytov
0afa209018 Manual merge of mysql-5.1-bugteam to mysql-trunk-merge. 2010-02-22 00:33:11 +03:00
Sergey Glukhov
4b260b668d Bug#33717 INSERT...(default) fails for enum. Crashes CSV tables, loads spaces for MyISAM
Table corruption happens during table reading in ha_tina::find_current_row() func.
Field::store() method returns error(true) if stored value is 0.
The fix:
added special case for enum type which correctly processes 0 value.
Additional fix:
INSERT...(default) and INSERT...() have the same behaviour now for enum type.


mysql-test/r/csv.result:
  test result
mysql-test/r/default.result:
  result fix
mysql-test/t/csv.test:
  test case
sql/item.cc:
  Changes:
  do not print warning for 'enum' type if there is no default value.
  set default value.
storage/csv/ha_tina.cc:
  Table corruption happens during table reading in ha_tina::find_current_row() func.
  Field::store() method returns error(true) if stored value is 0.
  The fix:
  added special case for enum type which correctly processes 0 value.
2010-02-17 16:13:42 +04:00
Vladislav Vaintroub
5b77604cc2 merge 2010-02-16 23:19:47 +01:00
Konstantin Osipov
3a856d4425 A fix and a test case for Bug#47648 "main.merge fails sporadically".
If a prepared statement used both a MyISAMMRG table and a stored 
function or trigger, execution could fail with "No such table"
error or crash. 
The error would come from a failure of the MyISAMMRG engine
to meet the expectations of the prelocking algorithm, 
in particular maintain lex->query_tables_own_last pointer
in sync with lex->query_tables_last pointer/the contents
of lex->query_tables. When adding merge children, the merge
engine would extend the table list. Then, when adding 
prelocked tables, the prelocking algorithm would use a pointer
to the last merge child to assign to lex->query_tables_own_last.
Then, when merge children were removed at the end of
open_tables(), lex->query_tables_own_last
was not updated, and kept pointing
to a removed merge child.

The fix ensures that query_tables_own_last is always in
sync with lex->query_tables_last.

This is a regression introduced by WL#4144 and present only
in next-4284 tree and 6.0.

mysql-test/r/merge.result:
  Update results (Bug#47648).
mysql-test/t/merge.test:
  Add a test case for Bug#47648.
  Update the result file to reflect a fix of another bug
  in MyISAMMRG code: not maintaining lex->query_tables_own_last
  allowed a stored function or trigger to modify a merge table
  which was already updated by the main statement.
  It is not allowed for other storage engines, and should
  not be allowed for MyISAMMRG.
storage/myisammrg/ha_myisammrg.cc:
  When adding children to the list of tables to open,
  make sure that we properly set lex->query_tables_own_last.
  When removing the children, update lex->query_tables_own_last
  if necessary.
2010-02-15 19:35:53 +03:00
Alexander Nozdrin
a8ef1bafb1 Manual merge from mysql-next-mr.
Conflicts:
  - sql/log_event.cc
  - sql/sql_class.h
2010-02-15 14:16:49 +03:00
Vladislav Vaintroub
e3a4741d05 merge 2010-02-13 17:01:32 +01:00
Georgi Kodinov
792fc9f784 Bug #35250: readline check breaks when doing vpath build
Fixed several (obvious) places that don't work with vpath
build.
2010-02-12 18:28:35 +02:00
Vladislav Vaintroub
7257047dce merge 2010-02-06 17:13:42 +01:00
Konstantin Osipov
a72f90bc43 Merge next-mr -> next-4284.
mysql-test/t/disabled.def:
  Restore disabled ssl tests: SSL certificates were updated.
  Disable sp_sync.test, the test case can't work in next-4284.
mysql-test/t/partition_innodb.test:
  Disable parsing of the test case for Bug#47343, 
  the test can not work in next-4284.
mysql-test/t/ps_ddl.test:
  Update results (CREATE TABLE IF NOT EXISTS takes
  into account existence of the temporary table).
2010-02-06 13:28:06 +03:00
Marc Alff
ae7615c091 Merge mysql-next-mr (revno 2996) --> mysql-next-mr-marc 2010-02-05 08:10:20 -07:00
Konstantin Osipov
e7b332ba83 Merge next-mr -> next-4284. 2010-02-05 01:08:08 +03:00
Konstantin Osipov
a9e22b5896 Merge next-mr -> next-4284-merge. 2010-02-04 20:34:15 +03:00
Alexander Nozdrin
1ab31553ca Manual merge from mysql-trunk-merge.
Conflicts:
  - mysql-test/t/bug46080.test
2010-02-03 19:21:17 +03:00
Alexander Nozdrin
cf55cf596e Manual merge from mysql-5.1-bugteam.
Conflicts:
  - mysql-test/collections/default.experimental
  - mysql-test/suite/rpl/r/rpl_sp.result
2010-02-03 17:01:48 +03:00
Konstantin Osipov
c8555bdb35 Merge next-mr -> next-4284 2010-02-03 16:43:03 +03:00
Konstantin Osipov
056ac55aa0 Merge next-mr -> next-4284. 2010-02-03 03:06:42 +03:00
Konstantin Osipov
a6daa9ada0 Merge next-mr -> next-4284.
Fix Bug#50555 "handler commands crash server in my_hash_first()"
as a post-merge fix (the new handler tests are not passing 
otherwise).
- in hash.c, don't call calc_hash if ! my_hash_inited().
- add tests and results for the test case for Bug#50555


mysys/hash.c:
  Assert that the hash is initialized when it's used.
sql/set_var.cc:
  Check that the hash is initalized before using it (Bug#50555)
2010-02-02 16:58:15 +03:00
Davi Arnaut
2db684572e Fix for valgrind warning: check whether pointer was initialized.
storage/myisammrg/ha_myisammrg.cc:
  myisam pointer is not relevant if a error was raised.
2010-02-02 11:17:58 -02:00
Konstantin Osipov
c6c1ddabaf Merge next-mr -> next-4284. 2010-02-02 12:22:17 +03:00
Konstantin Osipov
665100b69d Merge next-mr -> next-4284. 2010-02-02 02:22:16 +03:00
Vladislav Vaintroub
da91b8d73e Cleanup casing in MYSQL_ADD_PLUGIN, patch provided by Kent 2010-02-01 23:46:02 +01:00
Sergey Vojtovich
8aeafbd53f Merge fix for BUG48438 to mysql-5.1-bugteam. 2010-02-12 16:47:43 +04:00
Sergey Vojtovich
6bc7d3830b Merge fix for BUG48757 to mysql-5.1-bugteam. 2010-02-12 16:38:00 +04:00
Sergey Vojtovich
e3eafe84f5 Merge fix for BUG49628 to mysql-5.1-bugteam. 2010-02-12 16:37:05 +04:00
Sergey Vojtovich
91f0212c68 BUG#48757 - missing .ARZ file causes server crash
Server crashes when accessing ARCHIVE table with missing
.ARZ file.

When opening a table, ARCHIVE didn't properly pass through
error code from lower level azopen() to higher level open()
method.

mysql-test/r/archive.result:
  A test case for BUG#48757.
mysql-test/t/archive.test:
  A test case for BUG#48757.
storage/archive/ha_archive.cc:
  Pass through error code from azopen().
2010-02-12 16:33:03 +04:00
Sergey Vojtovich
62933c50df BUG#49628 - corrupt table after legal SQL, LONGTEXT column
Bulk REPLACE or bulk INSERT ... ON DUPLICATE KEY UPDATE may
break dynamic record MyISAM table.

The problem is limited to bulk REPLACE and INSERT ... ON
DUPLICATE KEY UPDATE, because only these operations may
be done via UPDATE internally and may request write cache.

When flushing write cache, MyISAM may write remaining
cached data at wrong position. Fixed by requesting write
cache to seek to a correct position.

mysql-test/r/myisam.result:
  A test case for BUG#49628.
mysql-test/t/myisam.test:
  A test case for BUG#49628.
storage/myisam/mi_dynrec.c:
  delete_dynamic_record() may change data file position.
  IO cache must be notified as it may still have cached
  data, which has to be flushed later.
2010-02-12 16:30:04 +04:00
Alexander Nozdrin
d4e2209dac Manual merge from mysql-trunk-merge.
Conflicts:
  - storage/archive/ha_archive.cc
2010-01-28 01:13:10 +03:00
Sergey Vojtovich
cb2d6a0016 Merge fix for bug50351 to mysql-5.1-bugteam. 2010-02-09 15:47:07 +04:00
Sergey Vojtovich
dac9e51811 BUG#50351 - ft_min_word_len=2 Causes query to hang
Performing fulltext prefix search (a word with truncation
operator) may cause a dead-loop. ft_min_word_len value
doesn't matter actually.

The problem was introduced along with "smarter index merge"
optimization.

mysql-test/r/fulltext.result:
  A test case for BUG#50351.
mysql-test/t/fulltext.test:
  A test case for BUG#50351.
storage/myisam/ft_boolean_search.c:
  When going up to first-level tree, we need to restore docid[0],
  so it informs fulltext index merge not to enter this second-level
  tree again (avoiding dead-loop).
2010-02-02 15:08:49 +04:00
Marc Alff
a1917ee687 Bug#44210 Performance schema: pool-of-threads threads instrumentation is missing
WL#5136 Pool of threads

Added an explicit delete_thread() API in the instrumentation,
to be used by the pool of threads implementations.
2010-01-26 16:42:54 -07:00
Alexey Kopytov
4a1b59b7ab Manual merge of mysql-5.1-bugteam into mysql-trunk-merge. 2010-01-24 00:09:23 +03:00