Commit graph

59530 commits

Author SHA1 Message Date
Magne Mahre
0eb255ee8d Bug#35589 SET PASSWORD caused a crash
Bug#35591 FLUSH PRIVILEGES caused a crash

A race condition on the privilege hash tables (proc_priv_hash
and func_priv_hash) caused one thread to try to delete elements
that had already been deleted by another thread.

The bug was caused by reading and saving the pointers to 
the hash tables outside mutex protection.  This led to an
inconsistency where a thread copied a pointer to a hash,
another thread did the same, the first thread then deleted
the hash, and the second then crashed when it in turn tried to
delete the deleted hash.

The fix is to ensure that operations on the shared hash structures
happens under mutex protection (moving the locking up a little)
2009-12-08 13:19:38 +01:00
He Zhenxing
4805375113 Auto merge 2009-12-07 21:30:24 +08:00
Alexander Barkov
164c7df5b3 Bug#47756 Setting 2byte collation ID with 'set names' crashes the server
The problem is not actually related to 2byte collation IDs.
The same crash happens if you change the collation ID in
mysql-test/str_data/Index.xml to a value smaller than 256.

Crash happened in SQL parser, because the "ident_map" and "state_map"
arrays were not initialized in loadable utf8 collations.

Fix: adding proper initialization of the "ident_map" and "state_map"
members for loadable utf8 collations.
2009-12-07 16:11:53 +04:00
He Zhenxing
b90be61738 Merge from trunk-bugfixing 2009-12-05 10:46:29 +08:00
He Zhenxing
0dcc854520 Auto merge from 5.1-rep-semisync 2009-12-05 10:28:53 +08:00
Alexander Nozdrin
9651888e0e Auto-merge from mysql-next-mr. 2009-12-04 15:39:09 +03:00
He Zhenxing
dae2b44427 Postfix after merge patch for Bug#49020
plugin/semisync/CMakeLists.txt:
  Add mysqlservices to link libraries
plugin/semisync/Makefile.am:
  Add mysqlservices to link libraries
2009-12-04 17:54:11 +08:00
He Zhenxing
e35e781680 Auto merge fixes for Bug#49020 2009-12-04 16:05:35 +08:00
He Zhenxing
5f71056f0e Auto merge postfix of Bug#49020 2009-12-04 13:46:06 +08:00
He Zhenxing
30d2870a9c Post fix for previous patch of Bug#49020
Added back n_frees, use 'clear' instead of 'free' since memory is
not freed here.


plugin/semisync/semisync_master.cc:
  Added back n_frees, use 'clear' instead of 'free' in the message since memory is not freed here.
2009-12-04 13:43:38 +08:00
He Zhenxing
f73b44d617 Auto Merge fix for Bug#49170 2009-12-04 10:05:43 +08:00
He Zhenxing
9e6430c54f Auto merge fix for Bug#49020 2009-12-04 10:04:14 +08:00
He Zhenxing
c926610d7c Bug#49020 Semi-sync master crashed with free_pool == NULL, assertion `free_pool_'
Before this patch, semisync assumed transactions running in parallel
can not be larger than max_connections, but this is not true when
the event scheduler is executing events, and cause semisync run out
of preallocated transaction nodes.

Fix the problem by allocating transaction nodes dynamically.

This patch also fixed a possible deadlock when running UNINSTALL
PLUGIN rpl_semi_sync_master and updating in parallel. Fixed by
releasing the internal Delegate lock before unlock the plugins.

mysql-test/suite/rpl/t/rpl_semi_sync_event.test:
  Add test case for bug#49020
plugin/semisync/semisync_master.cc:
  Allocating TranxNode dynamically
plugin/semisync/semisync_master.h:
  Allocating TranxNode dynamically
sql/rpl_handler.cc:
  Unlock plugins after we have released the Delegate lock to avoid possible deadlock when uninstalling semisync master plugin and doing update in parallel.
2009-12-04 09:46:33 +08:00
He Zhenxing
db1fee989d Bug#49170 Inconsistent placement of semisync plugin prevents it from getting tested
Add $basedir/lib/plugin to the search paths for semisync plugins.
2009-12-04 09:43:39 +08:00
Marc Alff
560e76c567 Merge mysql-next-mr (revno 2937) --> mysql-next-mr-marc 2009-12-03 02:57:30 -07:00
Alexander Nozdrin
87bd812fc8 Auto-merge from mysql-next-mr. 2009-12-03 12:20:54 +03:00
Marc Alff
203d9f1eab Merge mysql-next-mr (revno 2927) --> mysql-next-mr-marc 2009-12-02 11:36:20 -07:00
Alexander Nozdrin
20b95d0831 Auto-merge from mysql-next-mr. 2009-12-02 19:00:26 +03:00
Alexander Nozdrin
69877233a8 Fix merge mistake. 2009-12-02 18:59:00 +03:00
Alexander Nozdrin
988b25cee1 Manual merge from mysql-next-mr.
Conflicts:
  - sql/sql_yacc.yy
2009-12-02 18:50:14 +03:00
Tor Didriksen
e22de3a3f2 Bug #49130 Running mtr tests with valgrind and debug produces lots of warnings
Use safe output formats for strings that are not null terminated.


sql/item_func.cc:
  Use "%*.s" rather than "%s" format.
sql/protocol.cc:
  Use "%*.s" rather than "%s" format.
sql/sql_test.cc:
  Improve output from print_where()
   - output (nil) predicate if predicate is null
   - also output pointer value, for tracing of assignment and copying of predicates
sql/sql_view.cc:
  Use "%*.s" rather than "%s" format.
2009-12-02 11:00:44 +01:00
Mikael Ronstrom
055030457e BUG#49180, fixed MAXVALUE problem 2009-12-02 08:14:22 +01:00
Evgeny Potemkin
987e146604 Bug#33546: Slowdown on re-evaluation of constant expressions.
Constant expressions in WHERE/HAVING/ON clauses aren't cached and evaluated
for each row. This causes slowdown of query execution especially if constant
UDF/SP function are used.
      
Now WHERE/HAVING/ON expressions are analyzed in the top-bottom direction with
help of the compile function. When analyzer meets a constant item it
sets a flag for the tree transformer to cache the item and doesn't allow tree
walker to go deeper. Thus, the topmost item of a constant expression if
cached. This is done after all other optimizations were applied to
WHERE/HAVING/ON expressions
      
A helper function called cache_const_exprs is added to the JOIN class.
It calls compile method with caching analyzer and transformer on WHERE,
HAVING, ON expressions if they're present.
The cache_const_expr_analyzer and cache_const_expr_transformer functions are
added to the Item class. The first one check if the item can be cached and
the second caches it if so.
A new Item_cache_datetime class is derived from the Item_cache class.
It caches both int and string values of the underlying item independently to
avoid DATETIME aware int-to-string conversion. Thus it completely relies on
the ability of the underlying item to correctly convert DATETIME value from
int to string and vice versa.


mysql-test/r/func_like.result:
  A test case result is corrected after fixing bug#33546.
mysql-test/r/func_time.result:
  A test case result is corrected after fixing bug#33546.
mysql-test/r/select.result:
  Added a test case for the bug#33546.
mysql-test/r/subselect.result:
  A test case result is corrected after fixing bug#33546.
mysql-test/r/udf.result:
  Added a test case for the bug#33546.
mysql-test/t/select.test:
  Added a test case for the bug#33546.
mysql-test/t/udf.test:
  Added a test case for the bug#33546.
sql/item.cc:
  Bug#33546: Slowdown on re-evaluation of constant expressions.
  The cache_const_expr_analyzer and cache_const_expr_transformer functions are
  added to the Item class. The first one check if the item can be cached and
  the second caches it if so.
  Item_cache_datetime class implementation is added.
sql/item.h:
  Bug#33546: Slowdown on re-evaluation of constant expressions.
  Item_ref and Item_cache classes now returns basic_const_item
  from underlying item.
  The cache_const_expr_analyzer and cache_const_expr_transformer functions are
  added to the Item class.
sql/sql_select.cc:
  Bug#33546: Slowdown on re-evaluation of constant expressions.
          
  A helper function called cache_const_exprs is added to the JOIN class.
  It calls compile method with caching analyzer and transformer on WHERE,
  HAVING, ON expressions if they're present.
sql/sql_select.h:
  Bug#33546: Slowdown on re-evaluation of constant expressions.
  A helper function called cache_const_exprs is added to the JOIN class.
2009-12-02 00:25:51 +03:00
Evgeny Potemkin
9e5d1bb664 Auto-merged fix for the bug#34384. 2009-12-01 22:41:39 +03:00
Andrei Elkin
0eda48463c Manual resolving for the following files
Text conflict in mysql-test/collections/default.experimental
Text conflict in mysql-test/r/show_check.result
Text conflict in mysql-test/r/sp-code.result
Text conflict in mysql-test/suite/binlog/r/binlog_tmp_table.result
Text conflict in mysql-test/suite/rpl/t/disabled.def
Text conflict in mysql-test/t/show_check.test
Text conflict in mysys/my_delete.c
Text conflict in sql/item.h
Text conflict in sql/item_cmpfunc.h
Text conflict in sql/log.cc
Text conflict in sql/mysqld.cc
Text conflict in sql/repl_failsafe.cc
Text conflict in sql/slave.cc
Text conflict in sql/sql_parse.cc
Text conflict in sql/sql_table.cc
Text conflict in sql/sql_yacc.yy
Text conflict in storage/myisam/ha_myisam.cc

Corrected results for
 stm_auto_increment_bug33029.reject      2009-12-01
		20:01:49.000000000 +0300
       <andrei> @@ -42,9 +42,6 @@
       <andrei>  RETURN i;
       <andrei>  END//
       <andrei>  CALL p1();
       <andrei> -Warnings:
       <andrei> -Note   1592    Statement may not be safe to log in statement
		format.
       <andrei> -Note   1592    Statement may not be safe to log in statement
		format.

There should be indeed no Note present because there is in fact autoincrement 
top-level query in sp() that triggers inserting in yet another auto-inc table.
(todo: alert DaoGang to improve the test).
2009-12-01 21:07:18 +02:00
Alexander Nozdrin
273454b969 A patch for Bug#48915 (After having switched off the ipv6 support in OS,
mysqld crashed in network_init()).

The problem was that current_thd was not ready at that point in mysqld life,
so ER() macro could not be used.

The fix is to use ER_DEFAULT() macro, which is intented for such cases.
2009-12-01 19:59:31 +03:00
Mattias Jonsson
ad36684576 merge 2009-12-01 13:36:12 +01:00
Marc Alff
f2d67abbc0 WL#2360 Performance schema
Part 1: Instrumentation interface
2009-11-30 17:49:15 -07:00
Andrei Elkin
80cb81069b fixing the prev "auto"-merge that carried a piece of deprecated code (existing in 5.1) 2009-11-30 18:07:33 +02:00
Andrei Elkin
3962da934f merging from 5.1 to rep+2 starting at gca(5.1, next-mr) == build@mysql.com-20091104182209-iui387z35159aoyw 2009-11-30 14:34:39 +02:00
Horst.Hunger
f9837a17c7 fix for ipv6. 2009-11-30 10:49:37 +01:00
Serge Kozlov
13dad4ebd2 WL#3894, post-push fix. 2009-11-28 17:53:48 +03:00
Serge Kozlov
11faf99c29 Backport for WL#3894 2009-11-28 02:34:47 +03:00
Horst.Hunger
940b876e24 last fix? 2009-11-27 17:37:39 +01:00
Tor Didriksen
91c81a1614 Bug#49165 Remove unused/confusing code/comments in setup_conds()
sql/sql_base.cc:
  Query_arena *arena and backup are both unused.
  Removing those, allows us to remove select_lex->conds_processed_with_permanent_arena
sql/sql_lex.cc:
  conds_processed_with_permanent_arena is unused
sql/sql_lex.h:
  conds_processed_with_permanent_arena was unused
2009-11-27 15:23:20 +01:00
Tor Didriksen
aa70ca7156 backport of:
------------------------------------------------------------
        revno: 2617.81.1
        revision-id: tor.didriksen@sun.com-20090924061133-qo02zotz3yypmfpk
        parent: davi.arnaut@sun.com-20090923203724-tvz7x8dauzp686v7
        committer: Tor Didriksen <tor.didriksen@sun.com>
        branch nick: 6.0-codebase-bf-opt
        timestamp: Thu 2009-09-24 08:11:33 +0200
        message:
          Bug#47511 Segmentation fault during cleanup in sql_union (events_bugs.test)
          


sql/sql_lex.h:
  Ensure that fields used during cleanup() are always initialized by constructors.
2009-11-30 09:54:46 +01:00
He Zhenxing
8a66b18c34 Merge fix of bug#48351 from 5.1-rep-semisync 2009-11-29 10:10:09 +08:00
Tor Didriksen
1574c6d081 Use vsnprintf() rather than my_vsnprintf() in DbugVfprintf,
since support for "%g" and "%f" has not been backported yet.

dbug/dbug.c:
  Use vsnprintf rather than my_vsnprintf.
2009-11-27 15:40:33 +01:00
Horst.Hunger
373c18df9b another patch to fix differences. 2009-11-27 13:08:38 +01:00
He Zhenxing
886a489bc3 Bug#48351 Inconsistent library names for semisync plugin
The semisync plugin library names on Unix like systems were prefixed with
'lib', which did not follow the conventions.

Fix the problem by removing the 'lib' prefix on Unix systems.


mysql-test/mysql-test-run.pl:
  Remove 'lib' prefix for semisync plugin library names
plugin/semisync/Makefile.am:
  Remove 'lib' prefix for semisync plugin library names
plugin/semisync/plug.in:
  Remove 'lib' prefix for semisync plugin library names
2009-11-27 16:49:45 +08:00
Horst.Hunger
37771cb78e No more socket and no more diffs in result files. 2009-11-27 09:02:32 +01:00
Serge Kozlov
9e3b092c92 Backport for WL#4416 2009-11-27 02:32:01 +03:00
Horst.Hunger
ae6c0509f5 Forgotten to add the windows version of the tests. Done with that patch. 2009-11-26 13:03:36 +01:00
Horst.Hunger
88eeaa05de Improvements to reduce the output for better reading and more stability. 2009-11-26 09:03:04 +01:00
Alexander Nozdrin
1792de0af9 Update result files. 2009-11-25 17:12:30 +03:00
Alexander Nozdrin
3c11750e36 Auto-merge from mysql-next-mr. 2009-11-25 16:46:45 +03:00
Alik
d19168a962 Fix typo (s/_WIN_/__WIN__). 2009-11-25 15:58:15 +03:00
Alexey Botchkov
17a5964999 merging. 2009-11-25 16:28:10 +04:00
Alexander Nozdrin
a413e3363f Auto-merge (pull) from mysql-next-mr. 2009-11-26 11:46:29 +03:00
Alexander Nozdrin
52c66b5671 Manual merge/pull from mysql-next-mr.
Conflicts:
  - sql/sql_insert.cc
2009-11-25 18:03:05 +03:00