Commit graph

55258 commits

Author SHA1 Message Date
Georgi Kodinov
f0d5f30ccf Bug #39656: Behaviour different for agg functions with & without where -
ONLY_FULL_GROUP_BY

The check for non-aggregated columns in queries with aggregate function, but without
GROUP BY was treating all the parts of the query as if they are in the SELECT list.
Fixed by ignoring the non-aggregated fields in the WHERE clause.
2008-11-24 17:30:47 +02:00
Vladislav Vaintroub
042b9c30df merge 2008-11-22 01:22:20 +01:00
Vladislav Vaintroub
286d73c3e9 merge 2008-11-22 01:10:38 +01:00
Ingo Struewing
3ea684935b Bug#28234 - global/session scope - documentation vs implementation
Several system variables did not behave like system variables should do.
When trying to SET them or use them in SELECT, they were reported as
"unknown system variable". But they appeared in SHOW VARIABLES.

This has been fixed by removing the "fixed_vars" array of variables
and integrating the variables into the normal system variables chain.
All of these variables do now behave as read-only global-only
variables. Trying to SET them tells they are read-only, trying to
SELECT the session value tells they are global only. Selecting the
global value works. It delivers the same value as SHOW VARIABLES.
2008-11-22 00:22:21 +01:00
Matthias Leich
0d66d04bf4 Fox for Bug#40889 funcs_1: wrong code within triggers_03e_db_level.inc causes warnings 2008-11-21 22:36:29 +01:00
Matthias Leich
f572b81ac8 - Fix for Bug#39854 events_scheduling fails sporadically on pushbuild
- restore original state of event_scheduler at the end of the test
- minor fixes around comments, formatting
2008-11-21 22:28:23 +01:00
Horst Hunger
20b6f563dc Due to merges. 2008-11-21 17:36:18 +01:00
Horst Hunger
e886b712f5 Fix for bug#36873 containing the review results. 2008-11-21 15:36:13 +01:00
Alexey Botchkov
ac1ca6b9ca warning of notused function fixed 2008-11-21 18:15:11 +04:00
Ramil Kalimullin
5a8fd4a3ce Auto-merge 2008-11-21 17:32:45 +04:00
Ramil Kalimullin
ca31fa3591 Auto-merge 2008-11-21 17:20:58 +04:00
Sergey Glukhov
30b795dfcb null merge 2008-11-21 16:43:06 +04:00
Sergey Glukhov
a72c980c74 Bug#34760 Character set autodetection appears to fail
the problem is the same as reported in bug#20835,
so the fix is backport of bug#20835 patch.
2008-11-21 16:39:59 +04:00
Vladislav Vaintroub
d0eae54036 Fix broken link in embedded server (Windows) 2008-11-21 11:15:26 +01:00
Ramil Kalimullin
a78629c40c Fix for bug#36772: When using UTF8, CONVERT with GROUP BY
returns truncated results

Problem: performig conversion from {INT, DECIMAL, REAL} to CHAR
we incorrectly set its max length in some cases that may lead
to truncated results returned.

Fix: properly set CONVERT({INT, DECIMAL, REAL}, CHAR) result's
max length.
2008-11-21 13:48:22 +04:00
Vladislav Vaintroub
2928ebc464 merge 2008-11-21 10:00:21 +01:00
Chad MILLER
91684ef0a0 Merge update for bug 39178 fix. 2008-11-20 09:58:30 -05:00
Chad MILLER
d53d88b074 Update to change for bug 39178. Revert error-handling change, perhaps
temporarily if yassl maintainer has plans for other error handling.
2008-11-20 09:51:01 -05:00
Ramil Kalimullin
0b28a456ff Fix for bug#40770: Server Crash when running with triggers including
variable settings (rpl_sys)

Problem: under certain conditions (e.g. user variables usage in triggers)
accessing a user defined variable we may use a variables hash table that
belongs to already deleted thread. It happens if
thd= new THD;
has the same address as just deleted thd as we use
if (stored_thd == thd)
to check.
That may lead to unpredictable results, server crash etc.

Fix: use thread_id instead of thd address to distinguish threads.

Note: no simple and repeatable test case.
2008-11-20 15:25:26 +04:00
Ramil Kalimullin
f7df5c982c Null-merge 2008-11-20 14:51:38 +04:00
Ramil Kalimullin
240d0633b3 Fix for bug#40875: Memory leak in FEDERATED handler
Problem: memory leak occurs when we open a federated table
that has its share in the hash.

Fix: free not used memory.

Note: the fix should NOT be merged to 5.1 (the code changed).
2008-11-20 14:08:36 +04:00
Staale Smedseng
e60c8c8b68 A fix for Bug#22891 "session level max_allowed_packet can be
set but is ignored".
                                  
This patch makes @@session.max_allowed_packed and
@@session.net_buffer_length read-only as suggested in the bug
report. The user will have to use SET GLOBAL (and reconnect)
to alter the session values of these variables.
                            
The error string ER_VARIABLE_IS_READONLY is introduced.
                            
Tests are modified accordingly.
2008-11-20 08:51:48 +01:00
Matthias Leich
177c0c2a3c Fix for Bug#26890 main.multi_update times out
The test itself is not faulty. The testcase timeout
problem happens if this IMHO mid size resource
(space in vardir, virtual memory, amount of disk I/O)
consuming test meets a weak (excessive disk I/O caused
by parallel applications or paging) testing box.

The modifications:
- Move the most time and disk I/O consuming subtest
  for Bug 1820 into its own script (multi_update2)
  This will reduce the likelihood that we exceed the
  testcase timeout.
- Replace error numbers with error names
- Minor improvements of the formatting

-
2008-11-19 19:17:26 +01:00
Vladislav Vaintroub
7d5e156c78 Bug#39494 : key_buffer_size > 4GB does not work on 64 bit Windows
Cache size  is truncated via 32bit ulong  in  ha_init_key_cache() and 
ha_resize_key_cache() 

This change fixes the cast to size_t instead of ulong. This cast is safe,
because key_buffer_size parameter is limited to SIZE_T_MAX
2008-11-19 16:02:38 +01:00
Alexey Botchkov
b8cd1725b1 Bug#38293 Libmysqld crash in mysql_library_init if language file missing
additional fix - the 'debug' keyword removed
2008-11-19 15:51:31 +04:00
Alexey Botchkov
a24dce13c6 merging 2008-11-19 14:01:21 +04:00
Alexey Botchkov
70e8a4fd54 Bug#38293 Libmysqld crash in mysql_library_init if language file missing
That's a Win-specific error.
    When we create libmysqld.dll we have many libraries like mysys, dbug,
    strings, etc linked into that dll, so the application built upon
    this library shouldn't link these libraries to itself, rather use
    those inside the dll.

    Fixed by redirecting calls into the libmysqld.dll

per-file comments:
  dbug/dbug.c
Bug#38293 Libmysqld crash in mysql_library_init if language file missing
    fake _db_something definitions added

  include/my_dbug.h
Bug#38293 Libmysqld crash in mysql_library_init if language file missing
  fake _db_something declarations added

  libmysqld/examples/CMakeLists.txt
Bug#38293 Libmysqld crash in mysql_library_init if language file missing
    superfluous libraries removed from linking

  libmysqld/libmysqld.def
Bug#38293 Libmysqld crash in mysql_library_init if language file missing
    set of mysys functions added to the export section
2008-11-19 13:57:23 +04:00
Alexey Botchkov
63b02e2b07 merging 2008-11-19 13:29:45 +04:00
Chad MILLER
a6fb36d46e Merge fix for bug 39178. 2008-11-18 12:04:36 -05:00
Chad MILLER
918a8c469f Bug#39178: non-RSA keys in connection to a RSA-keyed yaSSL-using server \
using crashes server

When the server is configured to use a RSA key, and when the client sends
a cipher-suite list that contains a non-RSA key as acceptable, the server 
would try to process that key even though it was impossible.

Now, yaSSL sets its own acceptable-cipher list according to what kind of
key the server is started with, and will never explore and try to pair 
impossible combinations.

This involves a partial import of the current YaSSL tree, not the whole
thing, so as to try to avoid introducing new bugs.

(Updated to avoid many whitespace changes and make diff smaller.)
2008-11-18 11:45:44 -05:00
Sergey Vojtovich
c411255507 Merge. 2008-11-18 15:38:28 +04:00
Sergey Vojtovich
0001121ccb Merge. 2008-11-18 15:10:52 +04:00
Alexey Botchkov
631d21499f merging 2008-11-18 14:17:46 +04:00
Kristofer Pettersson
1125dfd67f Automerge 2008-11-18 12:33:38 +01:00
Alexey Botchkov
d5f4fcb6c8 merging 2008-11-18 13:52:03 +04:00
Patrick Crews
b98e2e865e Bug#33970 Test main.csv_alter_table disabled.
Re-enabling this test in 5.1 tree since the bug that caused disabling
(Bug#33696 CSV storage engine allows nullable colums via ALTER TABLE statements)
doesn't appear in 5.1 (6.0 only)

Recorded .result file and removed test from the main.disabled.def file.
2008-11-17 15:25:27 -05:00
Alexey Botchkov
58701cae11 Bug#34517 SHOW GLOBAL STATUS does not work properly in embedded server.
GLOBAL STATUS is calculated by studying the list of threads. In the
        embedded server threads were not linked to the internal list, so the
        calculation always returns 0. Fixed by 'linking' the embedded-server
        threads to the same list

per-file comments:
  libmysqld/lib_sql.cc
Bug#34517 SHOW GLOBAL STATUS does not work properly in embedded server.
    Add newly created 'threads' to the internal thread list.
    Remove them from the list as they're freed.

  mysql-test/r/information_schema.result
Bug#34517 SHOW GLOBAL STATUS does not work properly in embedded server.
    test result

  mysql-test/t/information_schema.test
Bug#34517 SHOW GLOBAL STATUS does not work properly in embedded server.
    test case added
2008-11-17 20:06:03 +04:00
Alexey Botchkov
ef3600b80b merging 2008-11-17 19:43:10 +04:00
Alexey Botchkov
56dc6b2ecd Bug#31616 div_precision_increment description looks wrong
Item_func_div didn't calculate the precision of the result properly.
  The result of 5/0.0001 is 5000 so we have to add decimals of the divisor
  to the planned precision.

per-file comments:
  mysql-test/r/type_newdecimal.result
Bug#31616 div_precision_increment description looks wrong
    test result fixed

  mysql-test/t/type_newdecimal.test
Bug#31616 div_precision_increment description looks wrong
    test case

  sql/item_func.cc
Bug#31616 div_precision_increment description looks wrong
    precision must be increased with args[1]->decimals parameter
2008-11-17 19:41:09 +04:00
Kristofer Pettersson
b3bb760c1d Automerge 2008-11-17 15:22:29 +01:00
Kristofer Pettersson
11493dfde4 Bug#40778 thd_security_context has bad architecture; allocates on unprotected memroot
The function thd_security_context allocates memory on an unprotected MEM_ROOT if the
message length becomes longer than requested and the initial buffer memory needs to
be reallocated.
                  
This patch fixes the design error by copying parts of the reallocated buffer 
to the destination buffer. This works because the destination buffer isn't
owned by the String object and thus isn't freed when a new buffer is allocated.
Any new memory allocated by the String object is reclaimed when the object
is destroyed at the end of the function call.
2008-11-17 15:17:21 +01:00
Mattias Jonsson
93f88cb908 merge 2008-11-15 00:26:48 +01:00
Mattias Jonsson
c0240bca20 Bug#40595: Non-matching rows not released with READ-COMMITTED on tables
with partitions

Pre push fix, optimized replace_regex, to cut 2 seconds
from test time.
2008-11-14 23:51:17 +01:00
Matthias Leich
3da7ffe6ac Fix for Bug#40644 main.group_concat_max_len_func random failures
+ minor improvements
2008-11-14 19:20:16 +01:00
Gleb Shchepa
fa430818c3 manual merge 5.0-bugteam --> 5.1-bugteam (bug 40021)
sql_view.cc: required_view_parameters has been decreased by 2 
(not by 1) because its value was incorrect: 16 instead of 15
(minor performance issue).
2008-11-14 21:37:27 +04:00
Gleb Shchepa
b82094a0f8 Bug #40021: Renaming view fails, archived .frm for view is
missing after downgrade

Obsolete arc/ directory and view .frm file backup support
has been removed by the patch for bug 17823. However, that
bugfix caused a problem with "live downgrades" of the
server: if we rename some view 4 times under 5.1.29/5.0.72
and then try to rename it under 5.1.28/5.0.70 on the same
database, the server fails with a error:

  query 'RENAME TABLE ... TO ...' failed: 6: Error on
  delete of '....frm-0001' (Errcode: 2)

Also .frm file of that view may be lost (renamed to .frm~).

The server failed because it tried to rename latest 3
backup .frm files renaming the view: the server used an
integer value of the "revision" field of .frm file to
extract those file names. After the fix for bug 17823 those
files were not created/maintained any more, however the
"revision" field was incremented as usual. So, the server
failed renaming non existent files.

This fix solves the problem by removing the support for
"revision" .frm file field:
1. New server silently ignores existent "revision" fields
   in old .frm files and never write it down;
2. Old server assumes, that missing "revision" field in new
   .frm files means default value of 0.
3. Accordingly to the fix for bug 17823 the new server
   drops arc/ directory on alter/rename view, so after
   "live downgrade" old server begins maintenance of the
   arc/ directory from scratch without conflicts with .frm
   files.
2008-11-14 21:25:57 +04:00
Matthias Leich
15d03999d8 Fix for Bug#39979 main.events_time_zone does not clean up
+ minor improvements.
2008-11-14 17:18:20 +01:00
Ramil Kalimullin
de1fe9054f Auto-merge 2008-11-14 13:48:01 +04:00
Tatiana A. Nurnberg
b3de270125 auto-merge 2008-11-14 09:11:34 +01:00
Ramil Kalimullin
ee3594b2d7 Test case for bug #34774: key prefix on text field in federated
tables can cause server to crash!

The bug will be fixed by patch for #34779: "crash in checksum table
on federated tables with blobs containing nulls"

Only a test case commited.
2008-11-14 11:42:29 +04:00