Commit graph

39752 commits

Author SHA1 Message Date
Staale Smedseng
9f04d27027 Bug#35769 typo in mysqlhotcopy documentation
Fixed a number of typos, and made punctuation and
capitalization more consistent in documentation
and help.
2009-04-28 18:16:17 +02:00
Gleb Shchepa
def0470598 backport from 6.0:
Bug #40925: Equality propagation takes non indexed attribute

Query execution plans and execution time of queries like

  select a, b, c from t1
    where a > '2008-11-21' and b = a limit 10

depended on the order of equality operator parameters:
"b = a" and "a = b" are not same. 


An equality propagation algorithm has been fixed:
the substitute_for_best_equal_field function should not
substitute a field for an equal field if both fields belong
to the same table.


mysql-test/r/select.result:
  Added test case for bug #40925.
mysql-test/t/select.test:
  Added test case for bug #40925.
sql/item.cc:
  Bug #40925: Equality propagation takes non indexed attribute
  
  An equality propagation algorithm has been fixed:
  the substitute_for_best_equal_field function should not 
  substitute a field for an equal field if both fields belong
  to the same table.
2009-04-28 05:19:13 +05:00
Patrick Crews
b7a70c8b3d Bug#32784: Timeout in test "innodb_charset": InnoDB much slower than other handlers
Turned off autocommit at the start of this test per Innobase recommendation.
Noted significant reduction in run time for this test w/ a minor increase in other tests' run-times.
2009-04-24 12:58:23 -04:00
Satya B
d5065d1426 Applying InnoDB snashot 5.0-ss4900, part 2. Fixes BUG#43309
1) BUG#43309 - Test main.innodb can't be run twice

Detailed revision comments:

r4701 | vasil | 2009-04-13 17:03:46 +0300 (Mon, 13 Apr 2009) | 6 lines
branches/5.0:

Fix Bug#43309 Test main.innodb can't be run twice

by making the innodb.test reentrant.
2009-04-24 17:27:53 +05:30
Satya B
0e4caf39fe Applying InnoDB snashot 5.0-ss4900 part 1, Fixes BUG#42279
1) BUG#42279 - Race condition in btr_search_drop_page_hash_when_freed()

Detailed revision comments:

r4031 | marko | 2009-01-23 15:33:46 +0200 (Fri, 23 Jan 2009) | 8 lines
branches/5.0: btr_search_drop_page_hash_when_freed(): Check if
buf_page_get_gen() returns NULL.  The page may have been evicted
from the buffer pool between buf_page_peek_if_search_hashed() and
buf_page_get_gen(), because the buffer pool mutex will be released
between these two calls. (Bug #42279)

rb://82 approved by Heikki Tuuri
2009-04-24 17:18:20 +05:30
Satya B
55533a7efd merge to latest 5.0-bugteam tree 2009-04-24 16:53:56 +05:30
Satya B
4610c13a24 Fix for BUG#43660- SHOW INDEXES/ANALYZE does NOT update cardinality
for indexes of InnoDB table

Fixes by replacing the PRNG that is used to pick random pages with a 
better one. 

Also adds a configuration option "innodb_use_legacy_cardinality_algorithm"
to enable the fix only when the option is set.

This patch is from http://bugs.mysql.com/file.php?id=11789
2009-04-24 16:33:50 +05:30
Staale Smedseng
e1b22ab9a1 Bug#33146 CHECKSUM TABLE is not interruptable by KILL
QUERY statement
      
Commit 55629 applied to 5.0-bugteam and 5.1-bugteam: 
Check for thd->killed in CHECKSUM loop.
2009-04-23 19:52:39 +02:00
Sergey Vojtovich
f8b219ee29 BUG#36966 - mysqldump.test fails in pushbuild
mysqldump.test is designed to run with concurrent inserts
disabled. It is disabling concurrent inserts at the very
beginning of the test case, and re-enables them at the
bottom of the test. But for some reason (likely incorrect
merge) we enable concurrent inserts in the middle of the test.

The problem is fixed by enabling concurrent inserts only
at the bottom of the test case.
2009-04-21 14:01:13 +05:00
Georgi Kodinov
0804479569 Bug #35087: Inserting duplicate values at one time with DES_ENCRYPT leads
to wrong results
      
3 problems found with DES_ENCRYPT/DES_DECRYPT :

1. The max length was not calculated properly. Fixed in fix_length_and_dec()
2. DES_ENCRYPT had a side effect of sometimes reallocating and changing 
the value of its argument. Fixed by explicitly pre-allocating the necessary
space to pad the argument with trailing '*' (stars) when calculating the 
DES digest.
3. in DES_ENCRYPT the string buffer for the result value was not 
reallocated to the correct size and only string length was assigned to it. 
Fixed by making sure there's enough space to hold the result.
2009-04-17 18:52:57 +03:00
Sergey Glukhov
ff923cc82d Bug#44151 using handler commands on information_schema tables crashes server
information schema tables are based on internal tmp tables which are removed
after each statement execution. So HANDLER comands can not be used with
information schema.


mysql-test/r/handler.result:
  test result
mysql-test/t/handler.test:
  test case
sql/sql_handler.cc:
  information schema tables are based on internal tmp tables which are removed
  after each statement execution. So HANDLER comands can not be used with
  information schema.
2009-04-17 12:41:15 +05:00
Patrick Crews
5b05d360b0 Bug#26887 - main.count_distinct3 fails randomly
Streamlined how we increase the size of our test table.
The new method shows run time decreased by ~60%.
This is not a guarantee that we will not see test timeouts (the random failures noted in the bug),
but it should significantly reduce the chances of this occurring.
2009-04-16 13:47:44 -04:00
Staale Smedseng
9301da563f Bug#42430 Final commit to 5.0-bugteam 2009-04-16 11:40:51 +02:00
Sergey Glukhov
3819daf064 Bug#41268 Help Text for \c is misleading in client command line interface(addon)
fixed message for 'help' command


client/mysql.cc:
  fixed message for 'help' command
2009-04-14 19:16:30 +05:00
Luis Soares
84ae9ecab0 BUG#13684: SP: DROP PROCEDURE|FUNCTION IF EXISTS not binlogged if
routine does not exist 
      
There is an inconsistency with DROP DATABASE IF EXISTS, DROP TABLE IF
EXISTS and DROP VIEW IF EXISTS: those are binlogged even if the DB or
TABLE does not exist, whereas DROP PROCEDURE IF EXISTS does not. It
would be nice or at least consistent if DROP PROCEDURE/STATEMENT
worked the same too.
      
Fixed DROP PROCEDURE|FUNCTION IF EXISTS by adding a call to
mysql_bin_log.write in mysql_execute_command. Checked also if all 
documented "DROP (...) IF EXISTS" get binlogged.
      
NOTE: This is a 5.0 backport patch as requested by support.

mysql-test/r/rpl_drop_if_exists.result:
  Result file for test case added.
mysql-test/r/rpl_sp.result:
  Updated result file for existing test case that has now extra events in
  binary log (the ones from drop if exists procedure/function).
mysql-test/t/rpl_drop_if_exists.test:
  Added test case for asserting validity of proposed patch.
sql/sql_parse.cc:
  Added call mysql_bin_log.write when lex has drop_if_exists enabled for 
  stored procedures.
2009-04-09 11:40:22 +01:00
Sergey Glukhov
1db674f5c7 auotmerge 2009-04-09 14:55:23 +05:00
Sergey Glukhov
920abd58b2 Bug#43833 Simple INSERT crashes the server
The crash happens due to wrong 'digits' variable value(0),
'digits' can not be 0, so the fix is use 1 as min allowed value.


mysql-test/r/insert.result:
  test result
mysql-test/t/insert.test:
  test case
sql/field.cc:
  The crash happens due to wrong 'digits' variable value(0),
  'digits' can not be 0, so the fix is use 1 as min allowed value.
2009-04-09 14:19:31 +05:00
He Zhenxing
3b4ec32d45 Fix compile error on windows for BUG#37145 on 5.0-bugteam 2009-04-09 16:58:18 +08:00
Anurag Shekhar
16e078f56c merging with 5.0-bugteam tree. 2009-04-09 13:30:04 +05:30
He Zhenxing
3308a7f2fd post fix compiling problem after push BUG#37145 to 5.0-bugteam 2009-04-09 15:42:59 +08:00
He Zhenxing
1881ee2da5 auto merge 2009-04-09 07:53:21 +08:00
Anurag Shekhar
dd0a6eb230 Bug #43950 myisamchk shows negative value for 'Max keyfile length'
While printing the Max keyfile length 'llstr' call was used which 
was treating the max_key_file_length as negative.

Changing this to ullstr fixes the problem. 
myisamchk output will differ in 32 bit and 64 bit Operating systems 
so its not possible to have test case for this bug.


myisam/myisamchk.c:
  Replaced llstr by ullstr, while converting 
  share->base.max_key_file_length-1 to string.
2009-04-08 16:45:43 +05:30
He Zhenxing
16641a8820 Auto merge 2009-04-08 16:17:26 +08:00
Satya B
55a149f29d merge to latest 5.0-bugteam 2009-04-07 18:42:51 +05:30
Satya B
10350e2097 Fix for Bug #43973 - backup_myisam.test fails on 6.0-bugteam
The test started failing following the push for BUG#41541.
Some of the algorithms access bytes beyond the input data
and this can affect up to one byte less than "word size"
which is BITS_SAVED / 8. 
      
Fixed by adding (BITS_SAVED / 8) -1 bytes to buffer size
(i.e. Memory Segment #2) to avoid accessing un-allocated data.

myisam/mi_packrec.c:
  Fixed _mi_read_pack_info() method to allocate (BITS_SAVED/8) - 1 
  bytes to the Memory Segment #2
mysql-test/r/myisampack.result:
  Result file for BUG#43973
mysql-test/t/myisampack.test:
  Testcase for BUG#43973
2009-04-07 16:54:32 +05:30
Davi Arnaut
72e978828e Bug#43230: SELECT ... FOR UPDATE can hang with FLUSH TABLES WITH READ LOCK indefinitely
The problem is that a SELECT .. FOR UPDATE statement might open
a table and later wait for a impeding global read lock without
noticing whether it is holding a table that is being waited upon
the the flush phase of the process that took the global read
lock.

The same problem also affected the following statements:

LOCK TABLES .. WRITE
UPDATE .. SET (update and multi-table update)
TRUNCATE TABLE ..
LOAD DATA ..

The solution is to make the above statements wait for a impending
global read lock before opening the tables. If there is no
impending global read lock, the statement raises a temporary
protection against global read locks and progresses smoothly
towards completion.

Important notice: the patch does not try to address all possible
cases, only those which are common and can be fixed unintrusively
enough for 5.0.

mysql-test/r/lock_multi.result:
  Add test case result for Bug#43230
mysql-test/t/lock_multi.test:
  Add test case for Bug#43230
sql/sql_lex.cc:
  Initialize flag.
sql/sql_lex.h:
  Add a flag to the lexer.
sql/sql_parse.cc:
  Wait for the global read lock is a write lock is going to be
  taken. The wait is done before opening tables.
sql/sql_yacc.yy:
  Protect against the GRL if its a SELECT .. FOR UPDATE or LOCK TABLES
  .. WRITE statement.
2009-04-03 16:11:54 -03:00
Chad MILLER
02f8ec4d76 Bug#43876: mysqld_multi introduces --no-defaults which screws up my system
Bug#32136: mysqld_multi --defaults-file not respected while using \
	--mysqld=mysqld_safe

Revert change that adds "--no-defaults" to mysqld_multi.

This closes Bug#43508 and re-opens Bug#32136.
2009-04-02 11:29:28 -04:00
Satya B
b1d74c9b5c merge to 5.0-bugteam 2009-04-02 14:30:44 +05:30
Timothy Smith
ccbd4c0451 auto-merge -build into -bugteam 2009-04-01 22:02:04 -06:00
Ignacio Galarza
209da010e7 Bug#29248 - MyISAMchk & MyISAMpack failing with * wildcard on Windows platform
- Link against setargv.obj for wild-card expansion.
2009-04-01 12:06:29 -04:00
Bernt M. Johnsen
ac8081290e Bug 43355 merged from 5.1 gca 2009-04-01 14:45:04 +02:00
Gleb Shchepa
02884a4d98 Backport bug #37348 fix 5.1 --> 5.0.
Original commentary:

Bug #37348: Crash in or immediately after JOIN::make_sum_func_list
            
The optimizer pulls up aggregate functions which should be aggregated in
an outer select. At some point it may substitute such a function for a field
in the temporary table. The setup_copy_fields function doesn't take this
into account and may overrun the copy_field buffer.
            
Fixed by filtering out the fields referenced through the specialized
reference for aggregates (Item_aggregate_ref).
Added an assertion to make sure bugs that cause similar discrepancy 
don't go undetected.


mysql-test/r/func_group.result:
  Backport bug #37348 fix 5.1 --> 5.0.
mysql-test/t/func_group.test:
  Backport bug #37348 fix 5.1 --> 5.0.
sql/item.cc:
  Backport bug #37348 fix 5.1 --> 5.0.
sql/item.h:
  Backport bug #37348 fix 5.1 --> 5.0.
sql/sql_select.cc:
  Backport bug #37348 fix 5.1 --> 5.0.
2009-04-01 16:02:26 +05:00
Georgi Kodinov
01e647352d merged 5.0-main -> 5.0-bugteam 2009-04-01 12:50:27 +03:00
Ignacio Galarza
f8acc70aac Bug#29248 - MyISAMchk & MyISAMpack failing with * wildcard on Windows platform
- Link against setargv.obj for wild-card expansion.
2009-03-31 17:48:45 -04:00
Bernt M. Johnsen
c517fc2b00 Bug 43355 Prepared for commit on 5.0 gca 2009-03-31 10:38:33 +02:00
Matthias Leich
993239ec2e merge of fix for bug 43383 into actual tree 2009-03-30 16:12:27 +02:00
Joerg Bruehe
a293acdacf Merge a polishing of an old bug fix,
more for completeness than for relevance.

Also, update copyright notices.

support-files/mysql.spec.sh:
  Using the occasion of the (late) merge,
  correct the copyright notices.
  
  Note the merge is in 2009, but the code changes were all done in 2008.
2009-03-30 16:09:37 +02:00
Joerg Bruehe
7bb4fe0959 Merge the main tree into 5.0-build 2009-03-30 15:42:04 +02:00
Georgi Kodinov
f56ad8c82c tree name changed 2009-03-27 16:29:56 +02:00
Georgi Kodinov
5f2bda83dd fixed a compilation warning 2009-03-27 16:25:16 +02:00
Staale Smedseng
2c65a31a7c Merge from 5.0-bugteam 2009-03-27 14:11:52 +01:00
Alexey Kopytov
dcac05be55 Automerge. 2009-03-27 15:58:34 +03:00
Staale Smedseng
50ed1ef752 Bug#39953 Triggers are not working properly with multi table
updates

Attempt to execute trigger or stored function with multi-UPDATE
which used - but didn't update - a table that was also used by
the calling statement led to an error. Read-only reference to
tables used in the calling statement should be allowed.
 
This problem was caused by the fact that check for conflicting
use of tables in SP/triggers was performed in open_tables(),
and in case of multi-UPDATE we didn't know exact lock type at
this stage.

We solve the problem by moving this check to lock_tables(), so
it can be performed after exact lock types for tables used by
multi-UPDATE are determined.


mysql-test/r/trigger.result:
  Results for the added test case is added.
mysql-test/t/trigger.test:
  A new test case is added, verifying correct table multi-update
  conflict resolution, both read-only and write.
sql/sql_base.cc:
  The check for conflicting use of tables in SP/triggers is moved
  to lock_tables(), to be performed after the exact lock types
  have been determined. Also, an assert is added to open_ltable()
  to ensure this func is not used in a prelocked context.
2009-03-27 12:09:15 +01:00
Alexey Kopytov
0b60184b90 Fix for bug #43432: Union on floats does unnecessary rounding
UNION could convert fixed-point FLOAT(M,D)/DOUBLE(M,D) columns  
to FLOAT/DOUBLE when aggregating data types from the SELECT  
substatements. While there is nothing particularly wrong with  
this behavior, especially when M is greater than the hardware  
precision limits, it could be confusing in cases when all  
SELECT statements in a union have the same  
FLOAT(M,D)/DOUBLE(M,D) columns with equal precision  
specifications listed in the same position.  
  
Since the manual is quite vague on what data type should be  
returned in such cases, the bug was fixed by implementing the  
most 'expected' behavior: do not convert FLOAT(M,D)/DOUBLE(M,D)  
to anything else if all SELECT statements in a UNION have the  
same precision for that column.  

mysql-test/r/union.result:
  Added a test case for bug #43432.
mysql-test/t/union.test:
  Added a test case for bug #43432.
sql/field.cc:
  Replaced FLT_DIG+6 and DBL_DIG+7 with a symbolic constant.
sql/item.cc:
  Do not convert FLOAT(M,D)/DOUBLE(M,D) 
  to anything else if all SELECT statements in a UNION have the 
  same precision for that column.
sql/mysql_priv.h:
  Added a symbolic constant for FLT_DIG+6 and DBL_DIG+7.
2009-03-27 13:12:50 +03:00
Ramil Kalimullin
c2c47b67fd Fix for bug #26288: savepoint not deleted, comit on empty transaction
Problem: commit doesn't delete savepoints if there are no changes 
in the transaction.

Fix: delete them in such cases.


mysql-test/r/innodb_mysql.result:
  Fix for bug #26288: savepoint not deleted, comit on empty transaction
    - test result.
mysql-test/t/innodb_mysql.test:
  Fix for bug #26288: savepoint not deleted, comit on empty transaction
    - test case.
sql/handler.cc:
  Fix for bug #26288: savepoint not deleted, comit on empty transaction
    - call transaction.cleanup() even if nht is 0 to delete 
  possible savepoints.
2009-03-27 10:24:32 +04:00
He Zhenxing
51a9116638 BUG#37145 Killing a statement doing DDL may log binlog event with error code 1053
When the thread executing a DDL was killed after finished its
execution but before writing the binlog event, the error code in
the binlog event could be set wrongly to ER_SERVER_SHUTDOWN or
ER_QUERY_INTERRUPTED.

This patch fixed the problem by ignoring the kill status when
constructing the event for DDL statements.

This patch also included the following changes in order to
provide the test case.

 1) modified mysqltest to support variable for connection command

 2) modified mysql-test-run.pl, add new variable MYSQL_SLAVE to
    run mysql client against the slave mysqld.
2009-03-27 13:19:50 +08:00
Leonard Zhou
f606cfeae3 Merge 2009-03-27 11:19:48 +08:00
Davi Arnaut
96e02e5716 Bug#33899: Deadlock in mysql_real_query with shared memory connections
The problem is that the read and write methods of the shared
memory transport (protocol) didn't react to asynchronous close
events, which could lead to a lock up as the client would wait
(until time out) for a server response that will never come.

The solution is to also wait for close events while waiting
for I/O from or to the server.

mysql-test/r/shm.result:
  Add test case result for Bug#33899
mysql-test/t/shm.test:
  Add test case for Bug#33899
vio/viosocket.c:
  Also wait for close events.
2009-03-26 20:17:27 -03:00
Matthias Leich
c9e9b9583e Fix for Bug#43383 main.variables-big : Weak testing code and result
including modifications according to code review
+ backport of the fix for
  Bug 41932 funcs_1: is_collation_character_set_applicability path
                     too long for tar
  which was missing in 5.0 (just a renaming of two files)
2009-03-26 19:12:19 +01:00
Leonard Zhou
944915cabe BUG#35515 Aliases of variables in binary log are ignored with NAME_CONST.
When add an aliase name after NAME_CONST, the aliase name will be overwrite.
      
NAME_CONST will re-set the field's name only if there isn't an aliase in the
function fix-fields().
If there is an aliase, NAME_CONST doesn't re-set the field's name and keeps the old
name.

mysql-test/r/func_misc.result:
  Test result.
mysql-test/r/rpl_name_const.result:
  Test case.
mysql-test/t/func_misc.test:
  Add NAME_CONST test.
mysql-test/t/rpl_name_const.test:
  Test result.
sql/item.cc:
  Re-set field's name if the name is autogenerated, that mean without aliase.
2009-03-26 15:38:17 +08:00