Commit graph

40075 commits

Author SHA1 Message Date
Joerg Bruehe
73f4511394 Get rid of manual pages which aren't used.
This is a partial correction to the original fix for bug#37098
   Get rid of "Installed (but unpackaged)" files in the RPM build
which used a wrong variable.

man/Makefile.am:
  Correction to the original fix:
  The variable to use is "$(mandir)", "$(manlibdir)" was wrong.
2009-08-20 21:08:09 +02:00
Davi Arnaut
c7163c630a Bug#45010: invalid memory reads during parsing some strange statements
The problem is that the lexer could inadvertently skip over the
end of a query being parsed if it encountered a malformed multibyte
character. A specially crated query string could cause the lexer
to jump up to six bytes past the end of the query buffer. Another
problem was that the laxer could use unfiltered user input as
a signed array index for the parser maps (having upper and lower
bounds 0 and 256 respectively).

The solution is to ensure that the lexer only skips over well-formed
multibyte characters and that the index value of the parser maps
is always a unsigned value.

mysql-test/r/ctype_recoding.result:
  Update test case result: ending backtick is not skipped over anymore.
sql/sql_lex.cc:
  Characters being analyzed must be unsigned as they can be
  used as indexes for the parser maps. Only skip over if the
  string is a valid multi-byte sequence.
tests/mysql_client_test.c:
  Add test case for Bug#45010
2009-08-07 23:32:01 -03:00
Ignacio Galarza
a791f20089 Bug #27535 Installing Windows service with --defaults-file option - quotation marks issues
- Remove offensive quotes.
2009-08-06 10:24:28 -04:00
Davi Arnaut
b113183df2 Merge from mysql-5.0. 2009-08-04 10:47:18 -03:00
Alfranio Correia
1dbb3010e7 Post-fix for BUG#43264
Install procedure does not copy *.inc files located under the mysql-test/t directory.
Therefore, this patch moves the rpl_trigger.inc to the mysql-test/include directory.
2009-08-03 14:37:50 +01:00
Alfranio Correia
3e9ddf3da9 auto-merge mysql-5.0-bugteam (local) --> mysql-5.0-bugteam 2009-08-03 10:43:20 +01:00
Alfranio Correia
968ec5eacc BUG#43264 Test rpl_trigger is failing randomly w/ use of copy_file in 5.0
The test case fails sporadically on Windows while trying to overwrite an unused
binary log. The problem stems from the fact that MySQL on Windows does not
immediately unlock/release a file while the process that opened and closed it is
still running. In BUG 38603, this issue was circumvented by stopping the MySQL
process, copying the file and then restarting the MySQL process. 

Unfortunately, such facilities are not available in the 5.0.  Other approaches
such as stopping the slave and issuing change master do not work because the relay
log file and index are not closed when a slave is stopped. So to fix the problem,
we simply don't run on windows the part of the test that was failing.
2009-08-02 23:58:43 +01:00
Ignacio Galarza
09877515f2 Bug#17270 - mysql client tool could not find ../share/charsets folder and fails.
- Define and pass compile time path variables as pre-processor definitions to 
  mimic the makefile build.
- Set new CMake version and policy requirements explicitly.
- Changed DATADIR to MYSQL_DATADIR to avoid conflicting definition in 
  Platform SDK header ObjIdl.h which also defines DATADIR.
2009-07-31 15:22:02 -04:00
Matthias Leich
7fc27f3dd5 Merge latest changes into local tree, no conflicts 2009-07-30 21:38:17 +02:00
Joerg Bruehe
f0d31dbe69 Merge the fix for bug#42213 into 5.0-build. 2009-07-30 17:03:54 +02:00
Matthias Leich
79751dff10 Merge of fix for bug 44493 into GCA tree 2009-07-30 16:24:01 +02:00
Joerg Bruehe
9ff932336e Our autoconf function "MYSQL_STACK_DIRECTION" will not work
correctly if the compiler optimizes too clever.

This has happaned on HP-UX 11.23 (IA64) at optimization
level "+O2", causing bug#42213:
   Check for "stack overrun" doesn't work, server crashes

Fix it by adding a pragma that prevents this optimization.
As a result, it should be safe to use "+O2" on this platform
(unless there is some other, optimizer-related, bug which
is just currently masked because we use resudec optimization).


config/ac-macros/misc.m4:
  Our autoconf function "MYSQL_STACK_DIRECTION" is meant to
  determine whether the stack grows towards higher or towards
  lower addresses.
  It does this by comparing the addresses of a variable
  (which is local to a recursive function) on different
  nesting levels.
  
  This approach requires that the function is really
  implemented as a recursive function, with each nested call
  allocating a new stack frame containing the local variable.
  If, however, the compiler is optimizing so clever that the
  recursive function is implemented by a loop, then this
  test will not produce correct results.
  
  This has happened on HP-UX 11.23 (IA64) when HP's compiler
  was called with optimization "+O2" (not with "+O1"),
  reported as bug#42213.
  
  Rather than starting a race with the compiler and making
  the function so complicated that this optimization does
  not happen, the idea is to prevent the optimization
  by adding a pragma. For HP, this is "#pragma noinline".
  
  If we encounter other compilers which also optimize
  too clever, we may add their pragmas here.
  
  It is a debatable issue whether such pragmas should be
  guarded by conditional compiling or not, the reviewers
  voted to do it.
  It seems HP has different compilers, "ANSI C" and "aCC",
  on the affected platform "__HP_cc" ("ANSI C") is predefined.
  To be on the safe side, the pragma will also take effect
  if HP's "aCC" compiler is used, or any other compiler on HP-UX.
2009-07-30 16:12:26 +02:00
Alexey Kopytov
bac18522e6 Automerge. 2009-07-28 23:14:04 +04:00
Alexey Kopytov
baefaa1e58 Bug #45031: invalid memory reads in my_real_read using protocol
compression 
 
Since uint3korr() may read 4 bytes depending on build flags and 
platform, allocate 1 extra "safety" byte in the network buffer 
for cases when uint3korr() in my_real_read() is called to read
last 3 bytes in the buffer. 
 
It is practically hard to construct a reliable and reasonably 
small test case for this bug as that would require constructing 
input stream such that a certain sequence of bytes in a 
compressed packet happens to be the last 3 bytes of the network 
buffer. 


sql/net_serv.cc:
  Allocate 1 extra "safety" byte in the network buffer for cases 
  when uint3korr() is used to read last 3 bytes in the buffer.
2009-07-28 22:35:55 +04:00
Davi Arnaut
e265609834 Bug#46385: [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted t
The maximum value of the max_join_size variable is set by converting
a signed type (long int) with negative value (-1) to a wider unsigned
type (unsigned long long), which yields the largest possible value of
the wider unsigned type -- as per the language conversion rules. But,
depending on build options, the type of the max_join_size might be a
shorter type (ha_rows - unsigned long) which causes the warning to be
thrown once the large value is truncated to fit.

The solution is to ensure that the maximum value of the variable is
always set to the maximum value of integer type of max_join_size.

Furthermore, it would be interesting to always have a fixed type for
this variable, but this would incur in a change of behavior which is
not acceptable for a GA version. See Bug#35346.

sql/mysqld.cc:
  Set max value for type.
2009-07-27 20:31:48 -03:00
Davi Arnaut
d5e84db34c Bug#20023: mysql_change_user() resets the value of SQL_BIG_SELECTS
Post-merge fix: test case could fail due to a conversion of the
max_join_size value to a integer. Fixed by preserving the value
as a string for comparison purposes.

tests/mysql_client_test.c:
  Preserve max_join_size value as a string instead of converting
  it to a integer -- value can be larger then the type used.
2009-07-27 12:31:28 -03:00
Satya B
e8a97ae267 merging with mysql-5.0-bugteam 2009-07-27 11:49:28 +05:30
Gleb Shchepa
dc0a87fdc2 Bug #38816: kill + flush tables with read lock + stored
procedures causes crashes!

The problem of that bugreport was mostly fixed by the
patch for bug 38691.
However, attached test case focused on another crash or
valgrind warning problem: SHOW PROCESSLIST query accesses
freed memory of SP instruction that run in a parallel
connection.

Changes of thd->query/thd->query_length in dangerous
places have been guarded with the per-thread
LOCK_thd_data mutex (the THD::LOCK_delete mutex has been
renamed to THD::LOCK_thd_data).


sql/ha_myisam.cc:
  Bug #38816: kill + flush tables with read lock + stored
              procedures causes crashes!
  
  Modification of THD::query/query_length has been guarded
  with the a THD::set_query() method call/LOCK_thd_data
  mutex.
  Unnecessary locking with the global LOCK_thread_count
  mutex has been removed.
sql/log_event.cc:
  Bug #38816: kill + flush tables with read lock + stored
              procedures causes crashes!
  
  Modification of THD::query/query_length has been guarded
  with the THD::set_query()) method call/LOCK_thd_data
  mutex.
sql/slave.cc:
  Bug #38816: kill + flush tables with read lock + stored
              procedures causes crashes!
  
  Modification of THD::query/query_length has been guarded
  with the THD::set_query() method call/LOCK_thd_data mutex.
  
  The THD::LOCK_delete mutex has been renamed to
  THD::LOCK_thd_data.
sql/sp_head.cc:
  Bug #38816: kill + flush tables with read lock + stored
              procedures causes crashes!
  
  Modification of THD::query/query_length has been guarded
  with the a THD::set_query() method call/LOCK_thd_data
  mutex.
sql/sql_class.cc:
  Bug #38816: kill + flush tables with read lock + stored
              procedures causes crashes!
  
  The new THD::LOCK_thd_data mutex and THD::set_query()
  method has been added to guard modifications of THD::query/
  THD::query_length fields, also the Statement::set_statement()
  method has been overloaded in the THD class.
  
  The THD::LOCK_delete mutex has been renamed to
  THD::LOCK_thd_data.
sql/sql_class.h:
  Bug #38816: kill + flush tables with read lock + stored
              procedures causes crashes!
  
  The new THD::LOCK_thd_data mutex and THD::set_query()
  method has been added to guard modifications of THD::query/
  THD::query_length fields, also the Statement::set_statement()
  method has been overloaded in the THD class.
  
  The THD::LOCK_delete mutex has been renamed to
  THD::LOCK_thd_data.
sql/sql_insert.cc:
  Bug #38816: kill + flush tables with read lock + stored
              procedures causes crashes!
  
  Modification of THD::query/query_length has been guarded
  with the a THD::set_query() method call/LOCK_thd_data
  mutex.
sql/sql_parse.cc:
  Bug #38816: kill + flush tables with read lock + stored
              procedures causes crashes!
  
  Modification of THD::query/query_length has been guarded
  with the a THD::set_query() method call/LOCK_thd_data mutex.
sql/sql_repl.cc:
  Bug #38816: kill + flush tables with read lock + stored
              procedures causes crashes!
  
  The THD::LOCK_delete mutex has been renamed to
  THD::LOCK_thd_data.
sql/sql_show.cc:
  Bug #38816: kill + flush tables with read lock + stored
              procedures causes crashes!
  
  Inter-thread read of THD::query/query_length field has
  been protected with a new per-thread LOCK_thd_data
  mutex in the mysqld_list_processes function.
2009-07-24 20:58:58 +05:00
Alexey Kopytov
85c97e6c69 Automerge. 2009-07-24 16:13:31 +04:00
Alexey Kopytov
885292e424 Bug #46075: Assertion failed: 0, file .\protocol.cc, line 416
In create_myisam_from_heap() mark all errors as fatal except 
HA_ERR_RECORD_FILE_FULL for a HEAP table.

Not doing so could lead to problems, e.g. in a case when a
temporary MyISAM table gets overrun due to its MAX_ROWS limit
while executing INSERT/REPLACE IGNORE ... SELECT. 
The SELECT execution was aborted, but the error was 
converted to a warning due to IGNORE clause, so neither 'ok' 
nor 'error' packet could be sent back to the client. This 
condition led to hanging client when using 5.0 server, or 
assertion failure in 5.1.


mysql-test/r/insert_select.result:
  Added a test case for bug #46075.
mysql-test/t/insert_select.test:
  Added a test case for bug #46075.
sql/sql_select.cc:
  In create_myisam_from_heap() mark all errors as fatal except 
  HA_ERR_RECORD_FILE_FULL for a HEAP table.
2009-07-24 15:50:45 +04:00
V Narayanan
74d4c3315c merging with mysql-5.0-bugteam 2009-07-24 12:28:17 +05:30
Satya B
559e2f1c1e merge to mysql-5.0-bugteam 2009-07-24 11:15:31 +05:30
Staale Smedseng
1e32574c65 Bug #45770 errors reading server SSL files are printed, but
not logged
        
Errors encountered during initialization of the SSL subsystem
are printed to stderr, rather than to the error log.
        
This patch adds a parameter to several SSL init functions to
report the error (if any) out to the caller. The function
init_ssl() in mysqld.cc is moved after the initialization of
the log subsystem, so that any error messages can be logged to
the error log. Printing of messages to stderr has been 
retained to get diagnostic output in a client context.


include/violite.h:
  Adding an enumeration for the various errors that can
  occur during initialization of the SSL module.
sql/mysqld.cc:
  Adding more logging of SSL init errors, and moving
  init_ssl() till after initialization of logging 
  subsystem.
vio/viosslfactories.c:
  Define error strings, provide an access method for these
  strings, and maintain an error parameter in several funcs
  to return the error (if any) to the caller.
2009-07-23 13:38:11 +02:00
Joerg Bruehe
886c982730 Merge the bug fix for 37808 ("make_binary_distribution.sh")
into 5.0-build.
2009-07-21 19:37:28 +02:00
Evgeny Potemkin
dbe855d0e3 Merged corrected fix for the bug#46051. 2009-07-18 18:11:33 +04:00
Evgeny Potemkin
5032380084 Bug#46051: Incorrectly market field caused wrong result.
When during the optimization an item is moved to the upper select
the item's context left unchanged. This caused wrong result in the 
PS/SP mode.
The Item_ident::remove_dependence_processor now sets the context
of the select to which the item is moved to.

mysql-test/r/subselect.result:
  The test case for the bug#46051 is adjusted.
mysql-test/t/subselect.test:
  The test case for the bug#46051 is adjusted.
sql/item.cc:
  Bug#46051: Incorrectly market field caused wrong result.
  The Item_ident::remove_dependence_processor now sets the context
  of the select to which the item is moved to.
2009-07-18 18:09:56 +04:00
Evgeny Potemkin
a50270a912 Merged fix for the bug#46051. 2009-07-17 18:45:32 +04:00
Satya B
342553252f Fix for BUG#18828 - If InnoDB runs out of undo slots,
it returns misleading 'table is full'

Innodb returns a misleading error message "table is full" 
when the number of active concurrent transactions is greater
than 1024.

Fixed by adding errorcode "ER_TOO_MANY_CONCURRENT_TRXS" to the
error codes. Innodb should return HA_TOO_MANY_CONCURRENT_TRXS
to mysql which is then mapped to ER_TOO_MANY_CONCURRENT_TRXS


Note: testcase is not written as this was reproducible only by
      changing innodb code.

extra/perror.c:
  Add error number and message for HA_ERR_TOO_MANY_CONCURRENT_TRXS
include/my_base.h:
  Add error number and message for HA_ERR_TOO_MANY_CONCURRENT_TRXS
sql/ha_innodb.cc:
  Return HA_ERR_TOO_MANY_CONCURRENT_TRXS to mysql server
sql/handler.cc:
  Add error number and message for HA_ERR_TOO_MANY_CONCURRENT_TRXS
sql/share/errmsg.txt:
  Add error message for ER_TOO_MANY_CONCURRENT_TRXS
2009-07-17 14:13:53 +05:30
V Narayanan
5558847226 merging with mysql-5.0-bugteam 2009-07-17 13:10:22 +05:30
Evgeny Potemkin
63e6a59d73 Bug#46051: Incorrectly market field caused wrong result.
In a subselect all fields from outer selects are marked as dependent on
selects they are belong to. In some cases optimizer substitutes it for an
equivalent expression. For example "a_field IN (SELECT outer_field)" is
substituted with "a_field = outer_field". As we moved the outer_field to the
upper select it's not really outer anymore. But it was left marked as outer.
If exists an index over a_field optimizer choose wrong execution plan and thus
return wrong result.

Now the Item_in_subselect::single_value_transformer function removes dependent
marking from fields when a subselect is optimized away.

mysql-test/r/subselect.result:
  Added a test case for the bug#46051.
mysql-test/t/subselect.test:
  Added a test case for the bug#46051.
sql/item_subselect.cc:
  Bug#46051: Incorrectly market field caused wrong result.
  Now the Item_in_subselect::single_value_transformer function removes dependent
  marking from fields when a subselect is optimized away.
2009-07-16 19:43:46 +04:00
Georgi Kodinov
1a4bc9a1e4 Bug #46042: backported the fix for the valgrind warning from 5.1 2009-07-16 16:13:26 +03:00
Georgi Kodinov
7a91bf8c91 Bug #46003 and bug #46034: backported the fixes from azalea. 2009-07-16 15:19:22 +03:00
Joerg Bruehe
692fb3702b Merge main 5.0 into 5.0-build 2009-07-16 13:00:31 +02:00
Georgi Kodinov
e2099d3dad tree name changed 2009-07-13 20:39:58 +03:00
Georgi Kodinov
42cab12a93 Addendum to the fix for bug #46080: fixed the error handling 2009-07-13 14:17:14 +03:00
V Narayanan
5a0a258ec6 Bug#43572 Handle failures from hash_init
This patch is a follow up to http://lists.mysql.com/commits/76678.
When an allocation failure occurs for the buffer in the dynamic
array, an error condition was being set. The dynamic array is
usable even if the memory allocation fails. Since in most cases
the thread can continue to work without any problems the error
condition should not be set here.

This patch adds logic to remove the error condition from being set
when the memory allocation for the buffer in dynamic array fails.

mysys/array.c:
  Bug#43572 Handle failures from hash_init
  
  Remove the MY_WME flag from the call to malloc in order to
  prevent the error status from being set in the init_dynamic_array
  method. Since this memory allocation failure is no longer
  fatal this method has been modified to return FALSE
  (indicate success) irrespective of array->buffer being
  allocated.
2009-07-12 11:18:53 +05:30
Georgi Kodinov
924c8c5bfb Addendum to the fix for bug #46080: fixed the test case 2009-07-10 17:03:09 +03:00
Georgi Kodinov
5beae1f8dc Bug #46080: group_concat(... order by) crashes server when
sort_buffer_size cannot allocate

The NULL return from tree_insert() (on low memory) was not
checked for in Item_func_group_concat::add(). As a result
on low memory conditions a crash happens.

Fixed by properly checking the return code.
2009-07-10 15:00:34 +03:00
Georgi Kodinov
55f514ad05 fixed the CPU checking code. 2009-07-10 16:00:17 +03:00
Georgi Kodinov
af7d059586 merge 5.0-main -> 5.0-bugteam 2009-07-10 15:58:38 +03:00
Joerg Bruehe
9313d74e91 Merge main 5.0 into 5.0-build. 2009-07-09 23:10:50 +02:00
Georgi Kodinov
c80fc3501b fixed check-cpu to correctly recognize mac CPUs 2009-07-08 16:50:17 +03:00
Georgi Kodinov
097c7b38c8 Bug #45287: phase 2 : 5.0 64 bit compilation warnings
Fixed various compilation warnings when compiling on a 
 64 bit windows.
2009-07-16 15:37:38 +03:00
Georgi Kodinov
b7445ff687 automerge 2009-07-15 17:00:26 +03:00
Georgi Kodinov
45b687c087 Bug #45287: phase 1 : 32 bit compilation warnings
Fixed the following problems:
1. cmake 2.6 warning because of a changed default on
how the dependencies to libraries with a specified 
path are resolved.
Fixed by requiring cmake 2.6.
2. Removed an obsolete pre-NT4 hack including defining
Windows system defines to alter the behavior of windows.h.
3. Disabled warning C4065 on compiling sql_yacc.cc because
of a know incompatibility in some of the newer bison binaries.
2009-07-15 16:46:25 +03:00
Anurag Shekhar
c77b836ab8 Bug#37740 Server crashes on execute statement with full text search and
match against.


Server crashes when executing prepared statement with duplicating
MATCH() function calls in SELECT and ORDER BY expressions, e.g.:
SELECT MATCH(a) AGAINST('test') FROM t1 ORDER BY MATCH(a) AGAINST('test')

This query gets optimized by the server, so the value returned
by MATCH() from the SELECT list is reused for ORDER BY purposes.
To make this optimization server is comparing items from
SELECT and ORDER BY lists. We were getting server crash because
comparision function for MATCH() item is not intended to be called
at this point of execution.

In 5.0 and 5.1 this problem is workarounded by resetting MATCH()
item to the state as it was during PREPARE.

In 6.0 correct comparision function will be implemented and
duplicating MATCH() items from the ORDER BY list will be
optimized.

mysql-test/r/fulltext.result:
  Updated with the test case for Bug#37740
mysql-test/t/fulltext.test:
  A test case for Bug#37740.
sql/item_func.h:
  True initialization of 'table' happens in ::fix_fields(). As
  Item_func_match::eq() may be called before ::fix_fields(), it is
  expected that 'table' is initialized to 0 when it is reused.
  
  This is mostly affecting prepared statements, when the same item
  doesn't get destroyed, but rather cleaned up and reused.
2009-07-15 15:00:58 +05:30
Georgi Kodinov
7cf4e36f2d automerge 2009-07-14 11:47:22 +03:00
Georgi Kodinov
410e1a72b9 Bug #40113: Embedded SELECT inside UPDATE or DELETE can timeout
without error

When using quick access methods for searching rows in UPDATE or 
DELETE there was no check if a fatal error was not already sent 
to the client while evaluating the quick condition.
As a result a false OK (following the error) was sent to the 
client and the error was thus transformed into a warning.

Fixed by checking for errors sent to the client during 
SQL_SELECT::check_quick() and treating them as real errors.

Fixed a wrong test case in group_min_max.test
Fixed a wrong return code in mysql_update() and mysql_delete()

mysql-test/r/bug40113.result:
  Bug #40013: test case
mysql-test/r/group_min_max.result:
  Bug #40013: fixed a wrong test case
mysql-test/t/bug40113-master.opt:
  Bug #40013: test case
mysql-test/t/bug40113.test:
  Bug #40013: test case
mysql-test/t/group_min_max.test:
  Bug #40013: fixed a wrong test case
sql/sql_delete.cc:
  Bug #40113: check for errors evaluating the quick select
sql/sql_update.cc:
  Bug #40113: check for errors evaluating the quick select
2009-07-13 18:11:16 +03:00
unknown
006d97dc97 Raise version number after cloning 5.0.84 2009-07-07 11:47:23 +02:00
Georgi Kodinov
2a9da3fac5 tree name change 2009-07-07 10:49:38 +03:00