Commit graph

61598 commits

Author SHA1 Message Date
Vladislav Vaintroub
cd35dd73a1 Fix perfschema unittests build on Windows
pthread_t is not defined unless my_pthread.h is included.
2010-04-13 13:48:46 +02:00
unknown
6a5b47a400 Bug#51980 mysqld service crashes with a simple COUNT(DISTINCT) query over a view
Problem: Segmentation fault in add_group_and_distinct_keys() when accessing
field of what is assumed to be an Item_field object.

Cause: In case of views, the item added to list by is_indexed_agg_distinct() 
was not of type Item_field, but Item_ref.

Resolution:  Add the real Item_field object, the one referred to by 
Item_ref object, to the list, instead.

mysql-test/r/count_distinct.result:
  Results for test case for Bug#51980.
mysql-test/t/count_distinct.test:
  Test case for Bug#51980.
  Table needs to contain at least two rows to avoid const table optimization.
sql/sql_select.cc:
  Make sure it is the actual Item_field object that is pushed to the out_args
  list of is_indexed_agg_distinct(), and not Item_ref objects.
2010-04-13 11:38:28 +02:00
Alexander Nozdrin
1b9adec789 Auto-merge from mysql-trunk. 2010-04-12 21:42:15 +04:00
Alexander Nozdrin
fe0828b3b8 Fix compile error (different storage class for mysql_temp_dir_list)
when trying to build innodb as plugin.

The reason for the error is mismatch in mysql_temp_dir_list
declaration between mysqld.h and usage in ha_innodb.cc

Add missing MYSQL_PLUGIN_IMPORT to mysql_tmpdir_list
(variables exported by the server and used by plugin need it).
2010-04-12 17:35:06 +04:00
Alexander Nozdrin
60333fbec9 A post-fix patch for WL#4877/WL#5030:
Fix tons of warnings about mismatch struct and class usage.
2010-04-12 17:17:37 +04:00
Marc Alff
bbf97ab183 Bug#52754 Build break in mysql-trunk, performance schema unit test
Tree cleaup after the last major merges in mysql-trunk:

The files sql/lex_hash.h and sql/sql_yacc.h are automatically
generated, and should not be checked in the configuration management system.
These files are now removed.
No changes are required for .bzrignore, which already listed these files
(and similar files in libmysqld/).

The file storage/perfschema/unittest/pfs_timer-t.cc did not build
after the header files refactoring affecting mysql_priv.h
The file now builds properly using sql_priv.h
2010-04-12 03:31:45 -06:00
Alexander Nozdrin
7d8368c0cd Auto-merge from mysql-trunk. 2010-04-10 12:47:19 +04:00
Alexander Nozdrin
9540aee5a6 Make main.query_cache_debug experimental on Linux due to Bug 52356. 2010-04-10 12:25:57 +04:00
Alexander Nozdrin
b596fc60e7 Update version tag to 5.5.5-m3. 2010-04-10 12:24:06 +04:00
Mats Kindahl
46bd78b9ee WL#5030: Splitting mysql_priv.h
Adding my_global.h first in all files using
NO_EMBEDDED_ACCESS_CHECKS.

Correcting a merge problem resulting from a changed definition
of check_some_access compared to the original patches.
2010-04-07 13:58:40 +02:00
Mats Kindahl
e92b3c587c WL#5030: Splitting mysql_priv.h
Adding include to build on Windows.
2010-04-06 23:00:01 +02:00
Mats Kindahl
6791cfc76a WL#5030: Splitting mysql_priv.h
Adding includes of my_global.h that seems to be necessary on Windows.
2010-04-06 16:08:51 +02:00
Mats Kindahl
87beef91ba WL#5030: Splitting mysql_priv.h
Moving an extern "C" to not cover #includes.
2010-04-06 14:11:07 +02:00
Mats Kindahl
d8e33c9c1e WL#5030: Splitting mysql_priv.h
- Adding include/mysql/innodb_priv.h which was missing before.
- Updated .bzrignore to ignore CMake generated cruft.
2010-04-06 12:55:36 +02:00
Mats Kindahl
6e63f41fdc WL#5030: Splitting mysql_priv.h
Minor fixes required because of changes since patches were developed.
2010-04-05 16:10:10 +02:00
Mats Kindahl
118ad60aa9 WL#5030: Split and remove mysql_priv.h
Fixing merge problem that causes CSV engine to misbehave.
2010-04-01 14:19:08 +02:00
Mats Kindahl
23d8586dbf WL#5030: Split and remove mysql_priv.h
This patch:

- Moves all definitions from the mysql_priv.h file into
  header files for the component where the variable is
  defined
- Creates header files if the component lacks one
- Eliminates all include directives from mysql_priv.h
- Eliminates all circular include cycles
- Rename time.cc to sql_time.cc
- Rename mysql_priv.h to sql_priv.h
2010-03-31 16:05:33 +02:00
Alexander Nozdrin
d7dd2fc92f Fix use of uninitialized variable. 2010-03-26 11:09:14 +03:00
Alexey Kopytov
0025c2d7e9 Fixed mysqld--help-win broken by the merge from trunk main. 2010-03-24 23:29:38 +03:00
Alexey Kopytov
d95c1e3b47 Manual merge of mysql-trunk into mysql-trunk-merge.
Conflicts:

Text conflict in client/mysqlbinlog.cc
Text conflict in mysql-test/Makefile.am
Text conflict in mysql-test/collections/default.daily
Text conflict in mysql-test/r/mysqlbinlog_row_innodb.result
Text conflict in mysql-test/suite/rpl/r/rpl_typeconv_innodb.result
Text conflict in mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
Text conflict in mysql-test/suite/rpl/t/rpl_row_create_table.test
Text conflict in mysql-test/suite/rpl/t/rpl_slave_skip.test
Text conflict in mysql-test/suite/rpl/t/rpl_typeconv_innodb.test
Text conflict in mysys/charset.c
Text conflict in sql/field.cc
Text conflict in sql/field.h
Text conflict in sql/item.h
Text conflict in sql/item_func.cc
Text conflict in sql/log.cc
Text conflict in sql/log_event.cc
Text conflict in sql/log_event_old.cc
Text conflict in sql/mysqld.cc
Text conflict in sql/rpl_utility.cc
Text conflict in sql/rpl_utility.h
Text conflict in sql/set_var.cc
Text conflict in sql/share/Makefile.am
Text conflict in sql/sql_delete.cc
Text conflict in sql/sql_plugin.cc
Text conflict in sql/sql_select.cc
Text conflict in sql/sql_table.cc
Text conflict in storage/example/ha_example.h
Text conflict in storage/federated/ha_federated.cc
Text conflict in storage/myisammrg/ha_myisammrg.cc
Text conflict in storage/myisammrg/myrg_open.c
2010-03-24 18:03:44 +03:00
Alexander Nozdrin
6da92d8f19 Auto-merge from mysql-trunk. 2010-03-24 11:14:54 +03:00
Alexander Nozdrin
ae715642f4 Auto-merge from mysql-trunk-bugfixing. 2010-03-24 11:10:56 +03:00
Alexey Kopytov
abc6846d5b Mark all main.plugin* tests as experimental on Solaris
as done in 6.0 due to bug #47146.
2010-03-23 23:34:12 +03:00
Alexey Kopytov
dea8e4c07e Fixed the incorrectly merged rpl.rpl_show_slave_running test in
mysql-trunk-merge (by copying the .result/.test files from mysql-pe).
2010-03-23 10:28:57 +03:00
Alexey Kopytov
074583a730 Manual merge of mysql-5.1-bugteam into mysql-trunk-merge.
Conflicts:

Text conflict in mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
Text conflict in sql/item_func.cc
2010-03-22 16:28:51 +03:00
Alexander Nozdrin
3695436631 Make mysqlbinlog_row, mysqlbinlog_row_innodb and mysqlbinlog_row_myisam
experimental due to Bug 52202.
2010-03-22 16:00:38 +03:00
Alexander Barkov
a35418784b Merging the latest changes 2010-03-22 16:29:53 +04:00
Alexander Barkov
84fc3da40f Bug #51976 LDML collations issue
Problem: caseup_multiply and casedn_multiply members      
were not initialized for a dynamic collation, so          
UPPER() and LOWER() functions returned empty strings.      
Fix: initializing the members properly.

Adding tests:
  mysql-test/r/ctype_ldml.result
  mysql-test/t/ctype_ldml.test

Applying the fix:
  mysys/charset.c
2010-03-22 16:27:59 +04:00
Mats Kindahl
cd7d8f98f8 Merging with mysql-5.1-bugfixing. 2010-03-22 13:12:57 +01:00
Mats Kindahl
f172ddd655 BUG#49618: Field length stored incorrectly in binary log
for InnoDB

Patch to fix result files for the binlog suite under row-
based replication.
2010-03-22 13:10:18 +01:00
John H. Embretsen
be16e48633 Merge fix for bug 52060 into tip of 5.1-bugteam. 2010-03-22 10:06:56 +01:00
Gleb Shchepa
8feadddbe4 Bug #49910: Behavioural change in SELECT/WHERE on YEAR(4) data type
(Original patch by Sinisa Milivojevic)

The YEAR(4) value of 2000 was equal to the "bad" YEAR(4) value of 0000.                              

The get_year_value() function has been modified to not adjust bad                                    
YEAR(4) value to 2000.


mysql-test/r/type_year.result:
  Test case for bug #49910.
mysql-test/t/type_year.test:
  Test case for bug #49910.
sql/item_cmpfunc.cc:
  Bug #49910: Behavioural change in SELECT/WHERE on YEAR(4) data type                                  
  
  The get_year_value() function has been modified to not adjust bad                                    
  YEAR(4) value to 2000.
2010-03-22 12:33:25 +04:00
Andrei Elkin
e66128972d bug#51648
comments to rpl_show_slave_running test are added to ease merging
2010-03-22 07:50:19 +02:00
Andrei Elkin
402d6ce67f merging bug@51648 to 5.1-bt, pe from local bugfixing branch 2010-03-21 21:30:49 +02:00
Andrei Elkin
0b7367e2d8 merging bug@51398 to trun-bf from local bf-branch 2010-03-21 19:33:14 +02:00
Vladislav Vaintroub
fa083b75c3 Fix cmake build on OSX/i386 (many innodb tests fail
in optimized build) 
Unlike in autotools build, innodb was compiled with 
-DUNIV_MUST_NOT_INLINE set.  this exposed what
seems to be a bug in gcc backend.

The fix is to remove extra definition.
2010-03-21 13:52:57 +01:00
Alexey Kopytov
5d407d0c1a Manual merge of mysql-5.1-bugteam to mysql-trunk-merge.
Conflicts:

Text conflict in mysql-test/r/partition_innodb.result
Text conflict in sql/field.h
Text conflict in sql/item.h
Text conflict in sql/item_cmpfunc.h
Text conflict in sql/item_sum.h
Text conflict in sql/log_event_old.cc
Text conflict in sql/protocol.cc
Text conflict in sql/sql_select.cc
Text conflict in sql/sql_yacc.yy
2010-03-20 23:23:42 +03:00
Alexey Kopytov
1ba0848634 Automerge. 2010-03-20 21:36:17 +03:00
Alexey Kopytov
0a7b4fe1dd Streamlined funcs_1.storedproc broken by the patch for bug #8433. 2010-03-20 21:34:51 +03:00
Vladislav Vaintroub
b1073a2213 Fix errors when building release
- package some more perl scripts on Windows (mysqlhotcopy and mysqldumpslow)
- do not try to pack .map files (no more produced)
- (CMake-unrelated) fix debug build on FreeBSD, trying to use uninitialized attribute
MY_MUTEX_INIT_FAST
2010-03-19 18:33:48 +01:00
Sergey Glukhov
ad6e00e3b2 Bug#51242 HAVING clause on table join produce incorrect results
The problem is that when we make conditon for
grouped result const part of condition is cut off.
It happens because some parts of 'having' condition
which refer to outer join become const after
make_join_statistics. These parts may be lost
during further having condition transformation
in JOIN::exec. The fix is adding 'having'
condition check for const tables after
make_join_statistics is performed.


mysql-test/r/having.result:
  test case
mysql-test/t/having.test:
  test result
sql/sql_select.cc:
  added 'having' condition check for const tables
  after make_join_statistics is performed.
2010-03-19 13:09:22 +04:00
Andrei Elkin
c3cd608aef Bug #51648 DBUG_SYNC_POINT is not defined on all platforms and mtr cant pre-check that
DBUG_SYNC_POINT has at least one strong limitation that it's not defined
on all platforms. It has issues cooperating with @@debug.
All in all its functionality is superseded by DEBUG_SYNC facility and
there is no reason to maintain the old less flexible one.

Fixed with adding debug_sync_set_action() function as a facility to set up
a sync-action in the server sources code and re-writing existing simulations
(found 3) to use it.
Couple of tests have been reworked as well.

The patch offers a pattern for setting sync-points in replication threads
where the standard DEBUG_SYNC does not suffice to reach goals.





mysql-test/extra/rpl_tests/rpl_get_master_version_and_clock.test:
  rewriting the test from GET_LOCK()-based to DEBUG_SYNC-based;
  a pattern of usage DEBUG_SYNC for replication testing is provided.
mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result:
  results are changed.
mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test:
  rewriting the test from GET_LOCK()-based to DEBUG_SYNC-based;
  limiting the test to run only with MIXED binlog-format as the test last
  some 10 secs sensitively contributing to the total of tests run.
mysql-test/suite/rpl/t/rpl_show_slave_running.test:
  rewriting the test from GET_LOCK()-based to DEBUG_SYNC-based.
sql/debug_sync.cc:
  adding debug_sync_set_action() function as a facility to set up
  a sync-action in the server sources code.
sql/debug_sync.h:
  externalizing debug_sync_set_action().
sql/item_func.cc:
  purging sources from DBUG_SYNC_POINT.
sql/mysql_priv.h:
  purging sources from DBUG_SYNC_POINT.
sql/slave.cc:
  rewriting failure simulations to base on DEBUG_SYNC rather than GET_LOCK()-based DBUG_SYNC_POINT.
sql/sql_repl.cc:
  removing an orphan failure simulation line because no counterpart in tests existing.
2010-03-19 11:06:40 +02:00
Alexey Kopytov
72afe82ab9 Manual merge. 2010-03-19 11:29:12 +03:00
Martin Hansson
a76b8f9a1d Post-push fix to disable a subset of the test case for Bug#47762.
This has been back-ported from 6.0 as the problems proved to afflict 
5.1 as well.
The fix exposed two new bugs. They were reported as follows.
      
Bug no 52174: Sometimes wrong plan when reading a MAX value 
from non-NULL index
      
Bug no 52173: Reading NULL value from non-NULL index gives wrong 
result in embedded server 
      
Both bugs taken together affect a much smaller class of queries than #47762, 
so the fix stays for now.
2010-03-19 09:23:44 +01:00
Sergey Glukhov
d1c2e8508f Bug#51598 Inconsistent behaviour with a COALESCE statement inside an IN comparison
Optimizer erroneously translated LEFT JOIN into INNER JOIN.
It leads to cutting rows with NULL right side. It happens
because Item_row uses not_null_tables() method form the
base(Item) class and does not calculate 'null tables'
properly. The fix is adding calculation of 'not null tables'
to Item_row.


mysql-test/r/join_outer.result:
  test result
mysql-test/t/join_outer.test:
  test case
sql/item_row.cc:
  adding calculation of 'not null tables' to Item_row.
sql/item_row.h:
  adding calculation of 'not null tables' to Item_row.
2010-03-19 10:21:37 +04:00
Sergey Glukhov
caa1ccb0c3 Bug#51494 crash with join, explain and 'sounds like' operator
The crash happens because of discrepancy between values of
conts_tables and join->const_table_map(make_join_statisctics).
Calculation of conts_tables used condition with
HA_STATS_RECORDS_IS_EXACT flag check. Calculation of
join->const_table_map does not use this flag check.
In case of MERGE table without union with index
the table does not become const table and
thus join_read_const_table() is not called
for the table. join->const_table_map supposes
this table is const and later in make_join_select
this table is used for making&calculation const
condition. As table record buffer is not populated
it leads to crash.
The fix is adding a check if an engine supports
HA_STATS_RECORDS_IS_EXACT flag before updating
join->const_table_map.


mysql-test/r/merge.result:
  test result
mysql-test/t/merge.test:
  test case
sql/sql_select.cc:
  adding a check if an engine supports
  HA_STATS_RECORDS_IS_EXACT flag before updating
  join->const_table_map.
2010-03-19 10:01:02 +04:00
Alexey Kopytov
2acfdc5092 Bug #8433: Overflow must be an error
All numeric operators and functions on integer, floating point 
and DECIMAL values now throw an 'out of range' error rather 
than returning an incorrect value or NULL,  when the result is 
out of supported range for the corresponding data type. 
 
Some test cases in the test suite had to be updated 
accordingly either because the test case itself relied on a 
value returned in case of a numeric overflow, or because a 
numeric overflow was the root cause of the corresponding bugs. 
The latter tests are no longer relevant, since the expressions 
used to trigger the corresponding bugs are not valid anymore. 
However, such test cases have been adjusted and kept "for the 
record". 

mysql-test/r/func_math.result:
  Added test cases for bug #8433. 
  Updated results of the test case for bug #31236.
mysql-test/r/func_misc.result:
  Streamlined test cases.
mysql-test/r/func_test.result:
  Streamlined test cases.
mysql-test/r/select.result:
  Streamlined test cases.
mysql-test/r/sp.result:
  Streamlined test cases.
mysql-test/r/strict.result:
  Streamlined test cases.
mysql-test/r/type_newdecimal.result:
  Streamlined test cases.
mysql-test/suite/sys_vars/r/sql_slave_skip_counter_basic.result:
  Streamlined test cases.
mysql-test/suite/sys_vars/t/sql_slave_skip_counter_basic.test:
  Streamlined test cases.
mysql-test/t/func_math.test:
  Added test cases for bug #8433. 
  Updated results of the test case for bug #31236.
mysql-test/t/func_misc.test:
  Streamlined test cases.
mysql-test/t/func_test.test:
  Streamlined test cases.
mysql-test/t/select.test:
  Streamlined test cases.
mysql-test/t/sp.test:
  Streamlined test cases.
mysql-test/t/strict.test:
  Streamlined test cases.
mysql-test/t/type_newdecimal.test:
  Streamlined test cases.
sql/item_create.cc:
  Changed Item_func_cot() to be defined as a standalone Item
  rather than a combination of "1 / TAN(x)".
sql/item_func.cc:
  Throw an 'out of range' error rather than returning an  
  incorrect value or NULL,  when the result of a numeric 
  operator or a function is out of supported range for  
  the corresponding data type.
sql/item_func.h:
  Added validation helpers as inline methods of Item_func.
sql/share/errmsg-utf8.txt:
  New ER_DATA_OUT_OF_RANGE error.
2010-03-18 13:38:29 +03:00
John H. Embretsen
b453707680 Bug#52060 - test udf fails on Snow Leopard
reverse DNS lookup of "localhost" returns "broadcasthost" on Snow Leopard, and NULL on most others.
Simply ignore the output, as this is not an essential part of UDF testing.
2010-03-18 11:26:27 +01:00
Omer BarNir
c92b9b7315 Test suites for engine testing, moved from test-extra so will be available
for general use.


mysql-test/Makefile.am:
  Adding directories of additional test suites
mysql-test/mysql-stress-test.pl:
  Adding check for additional errors checking during test run
2010-03-17 23:42:07 -07:00
Vladislav Vaintroub
c8e32a8331 Bug #52149 - packaging differences in CMake build
Corrected some packaging bugs:
- install mysqlservices library
- install libmysqlclient_r.so.{16,16.0.0} as links
  to libmysqlclient.so
- install libmysqld-debug.a
- install my_safe_process, my_safe_kill and
  symlinks to mysql-test-run.pl (mtr, mysql-test-run)
  into correct place ${INSTALL_MYSQLTESTDIR}


cmake/install_layout.cmake:
  Fix typo
cmake/install_macros.cmake:
  Refactor INSTALL_SYMLINK to allow arbitrary symlink paths.
  Old version of this macro would make link extension the same 
  as in target. This was not sufficient in some scenarios 
  (would not allow for example libmysqlclient_r.so.16=>./libmysqlclient.so 
  link)
libmysql/CMakeLists.txt:
  Install extra symlinks to libmysqlclient.so
  (libmysqlclient_r.so.16 and libmysqlclient_r.so.16.0.0)
  for backward compatiblity.
libmysqld/CMakeLists.txt:
  install libmysqld-debug.a
libservices/CMakeLists.txt:
  install mysqlservices library
mysql-test/lib/My/SafeProcess/CMakeLists.txt:
  install my_safe_process, my_safe_kill into  correct place
2010-03-17 19:56:22 +01:00