Commit graph

61578 commits

Author SHA1 Message Date
Alexey Kopytov
f10885675c 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
c203c8daf8 Auto-merge from mysql-trunk-bugfixing. 2010-03-24 11:10:56 +03:00
Alexey Kopytov
41b6e42421 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
bbe6b90b52 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
7ac059ba8f 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
bdcf08d727 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
a4332c256e Merging the latest changes 2010-03-22 16:29:53 +04:00
Alexander Barkov
177522a4fe 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
e176c4162f Merging with mysql-5.1-bugfixing. 2010-03-22 13:12:57 +01:00
Mats Kindahl
45610a66d9 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
92c7521f27 Merge fix for bug 52060 into tip of 5.1-bugteam. 2010-03-22 10:06:56 +01:00
Gleb Shchepa
2758847bf2 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.
2010-03-22 12:33:25 +04:00
Andrei Elkin
ccdec568c1 bug#51648
comments to rpl_show_slave_running test are added to ease merging
2010-03-22 07:50:19 +02:00
Andrei Elkin
06af918e02 merging bug@51648 to 5.1-bt, pe from local bugfixing branch 2010-03-21 21:30:49 +02:00
Andrei Elkin
e1158e60ac merging bug@51398 to trun-bf from local bf-branch 2010-03-21 19:33:14 +02:00
Vladislav Vaintroub
ad2de79756 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
acc2b9e366 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
22bb602aca Automerge. 2010-03-20 21:36:17 +03:00
Alexey Kopytov
5ab6b0bba0 Streamlined funcs_1.storedproc broken by the patch for bug #8433. 2010-03-20 21:34:51 +03:00
Vladislav Vaintroub
4a39f83ff7 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
84917914e0 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.
2010-03-19 13:09:22 +04:00
Andrei Elkin
30df18909c 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.
2010-03-19 11:06:40 +02:00
Alexey Kopytov
53afccc829 Manual merge. 2010-03-19 11:29:12 +03:00
Martin Hansson
d03133dccf 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
879b705342 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.
2010-03-19 10:21:37 +04:00
Sergey Glukhov
bed0948145 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.
2010-03-19 10:01:02 +04:00
Alexey Kopytov
aef97cadfa 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".
2010-03-18 13:38:29 +03:00
John H. Embretsen
3d89b6698c 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
0d608d5b11 Test suites for engine testing, moved from test-extra so will be available
for general use.
2010-03-17 23:42:07 -07:00
Vladislav Vaintroub
78a965861a 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}
2010-03-17 19:56:22 +01:00
Mats Kindahl
c14807a21a Merging with mysql-5.1-bugteam 2010-03-17 19:15:41 +01:00
Mats Kindahl
2773758986 BUG#49618: Field length stored incorrectly in binary log
for InnoDB
            
The class Field_bit_as_char stores the metadata for the
field incorrecly because bytes_in_rec and bit_len are set
to (field_length + 7 ) / 8 and 0 respectively, while
Field_bit has the correct values field_length / 8 and
field_length % 8.
            
Solved the problem by re-computing the values for the
metadata based on the field_length instead of using the
bytes_in_rec and bit_len variables.
            
To handle compatibility with old server, a table map
flag was added to indicate that the bit computation is
exact. If the flag is clear, the slave computes the
number of bytes required to store the bit field and
compares that instead, effectively allowing replication
*without conversion* from any field length that require
the same number of bytes to store.
2010-03-17 15:28:49 +01:00
Georgi Kodinov
d32f6b13b5 Bug #49838: DROP INDEX and ADD UNIQUE INDEX for same index may corrupt
definition at engine

If a single ALTER TABLE contains both DROP INDEX and ADD INDEX using 
the same index name (a.k.a. index modification) we need to disable 
in-place alter table because we can't ask the storage engine to have 
two copies of the index with the same name even temporarily (if we 
first do the ADD INDEX and then DROP INDEX) and we can't modify 
indexes that are needed by e.g. foreign keys if we first do 
DROP INDEX and then ADD INDEX.
Fixed the problem by disabling in-place ALTER TABLE for these cases.
2010-03-17 16:18:46 +02:00
Luis Soares
148c2c316d Merged bundle from bug report. 2010-03-17 11:10:03 +00:00
Luis Soares
3356ce9899 Merge bundle from bug report. 2010-03-17 11:08:53 +00:00
Luis Soares
229da7c0dd BUG#51426: overflow for auto_increment column causes slave to stop
In BUG#49562 we fixed the case where numeric user var events
would not serialize the flag stating whether the value was signed
or unsigned (unsigned_flag). This fixed the case that the slave
would get an overflow while treating the unsigned values as
signed.
      
In this bug, we find that the unsigned_flag can sometimes change
between the moment that the user value is recorded for binlogging
purposes and the actual binlogging time. Since we take the
unsigned_flag from the runtime variable data, at binlogging time,
and the variable value is comes from the copy taken earlier in
the execution, there may be inconsistency in the
User_var_log_event between the variable value and its
unsigned_flag.
      
We fix this by also copying the unsigned_flag of the
user_var_entry when its value is copied, for binlogging
purposes. Later, at binlogging time, we use the copied
unsigned_flag and not the one in the runtime user_var_entry
instance.
2010-03-17 00:06:13 +00:00
Andrei Elkin
cf206a57f6 Bug #51398 Test "rpl_heartbeat_basic" fails "while waiting for slave_received_heartbeats"
Non-determinism of the test was caused by lack of setting a proper value to hb period,
actually fixed by BUG@50767.

These fixes aim at possible non-determinism in comparison of received
hb events by master and slave in the circular part of the test.
Even though the HB periods ratio was choosen to be as high as 10, it's still incorrect 
to compare number of hb-events basing only a relation between their periods.

Yet another issue is relatively short 60 secs timeout of wait_for_status_var.inc
makes valgrind runs to fail. 
Fixed with deploying wait_for_slave_io_to_start afront of calling wait_for_status_var.

The test is made runnable only with MIXED binlog-format as it has close to 1 min
total exec time and there is nothing format specific in it.
2010-03-16 21:23:55 +02:00
Mattias Jonsson
26a8eda499 merge 2010-03-16 17:20:42 +01:00
Alexander Nozdrin
f977e21d26 Skip perfschema.misc if "var" is a symlink (due to Bug 51447). 2010-03-16 17:19:45 +03:00
Mats Kindahl
a9d145acb8 Merging with mysql-trunk-bugfixing 2010-03-15 22:50:22 +01:00
Mats Kindahl
dc35b61fb4 Merging with mysql-trunk-bugfixing 2010-03-15 22:40:28 +01:00
Konstantin Osipov
a9520bcf76 A post-review fix for type-aware metadata locks.
DDL no longer aborts mysql_lock_tables(), and hence
we no longer need to support need_reopen flag of this
call. 
Remove the flag, and all the code in the server
that was responsible for handling the case when
it was set. This allowed to simplify: 
open_and_lock_tables_derived(), the delayed thread,
multi-update.

Rename MYSQL_LOCK_IGNORE_FLUSH to MYSQL_OPEN_IGNORE_FLUSH,
since we now only support this flag in open_table().

Rename MYSQL_LOCK_PERF_SCHEMA to MYSQL_LOCK_LOG_TABLE,
to avoid confusion.

Move the wait for the global read lock for cases
when we do updates in SELECT f1() or DO (UPDATE) to 
open_table() from mysql_lock_tables(). When waiting
for the read lock, we could raise need_reopen flag,
which is no longer present in mysql_lock_tables().
Since the block responsible for waiting for GRL
was moved, MYSQL_LOCK_IGNORE_GLOBAL_READ_LOCK
was renamed to MYSQL_OPEN_IGNORE_GLOBAL_READ_LOCK.
2010-03-16 00:20:20 +03:00
Vladislav Vaintroub
74211ed907 merge 2010-03-15 20:04:19 +01:00
Alexander Nozdrin
9cc2d7764e Auto-merge from mysql-trunk. 2010-03-15 20:10:17 +03:00
Alexander Nozdrin
fa2d2c1832 A patch for Bug#52071 (rpl_ndb.rpl_ndb_ctype_ucs2_def fails).
Use new command line options instead of deprecated and removed ones.
2010-03-15 20:00:20 +03:00
Alexander Nozdrin
d9a074e1fd Enable ndb and rpl_ndb test suites in daily builds. 2010-03-15 19:43:26 +03:00
Magnus Blåudd
a9541803fa Merge 2010-03-15 15:04:12 +01:00
Magnus Blåudd
fda5004d36 Merge in fix for bug#42589 2010-03-15 14:57:20 +01:00
Jon Olav Hauglid
dd69b281f0 Bug #51160 Deadlock around SET GLOBAL EVENT_SCHEDULER = ON|OFF
This deadlock could occour betweeen one connection executing
SET GLOBAL EVENT_SCHEDULER= ON and another executing SET GLOBAL
EVENT_SCHEDULER= OFF. The bug was introduced by WL#4738.

The first connection would hold LOCK_event_metadata (protecting
the global variable) while trying to lock LOCK_global_system_variables
starting the event scheduler thread (in THD:init()).

The second connection would hold LOCK_global_system_variables
while trying to get LOCK_event_scheduler after stopping the event
scheduler inside event_scheduler_update().

This patch fixes the problem by not using LOCK_event_metadata to
protect the event_scheduler variable. It is still protected using
LOCK_global_system_variables. This fixes the deadlock as it removes 
one of the two mutexes used to produce it.

However, this patch opens up the possibility that the event_scheduler
variable and the real event_scheduler state can become out of sync
(e.g. variable = OFF, but scheduler running). But this can only
happen under very unlikely conditions - two concurrent SET GLOBAL
statments, with one thread interrupted at the exact wrong moment.
This is preferable to having the possibility of a deadlock.

This patch also fixes a bug where it was possible to exit create_event()
without releasing LOCK_event_metadata if running out of memory during
its exection.

No test case added since a repeatable test case would have required
excessive use of new sync points. Instead we rely on the fact that
this bug was easily reproduceable using RGQ tests.
2010-03-15 14:52:25 +01:00
Alexander Nozdrin
27bb4377c6 Auto-merge from mysql-trunk. 2010-03-15 13:22:26 +03:00