Commit graph

12123 commits

Author SHA1 Message Date
Tatiana A. Nurnberg
5622d4261f Bug#33550: mysqldump 4.0 compatibility broken
mysqldump included character_set_client magic
that is unknown before 4.1 even when asked for
an appropriate compatibility mode.

In compatibility (3.23, 4.0) mode, we do not
output charset statements (not even in a
"comment conditional"), nor do we do magic on
the server, even if the server is sufficient
new (4.1+). Table-names will be output converted
to the charset requested by mysqldump; if such
a conversion is not possible (Ivrit -> Latin),
mysqldump will fail.
2009-02-02 18:19:07 +01:00
Tatiana A. Nurnberg
2048bd7117 auto-merge 2009-01-09 23:06:07 +01:00
Georgi Kodinov
7c3ae51647 Bug #41437: Value stored in 'case' lacks charset, causes segfault
When substituting system constant functions with a constant result
the server was not expecting that the function may return NULL.
Fixed by checking for NULL and returning Item_null (in the relevant
collation) if the result of the system constant function was NULL.
2009-01-09 13:50:18 +02:00
Tatiana A. Nurnberg
17bbe30cb0 Bug#41470: DATE_FORMAT() crashes the complete server with a valid date
Passing dubious "year zero" in non-zero date (not "0000-00-00") could
lead to negative value for year internally, while variable was unsigned.
This led to Really Bad Things further down the line.

Now doing calculations with signed type for year internally.
2009-01-08 10:25:31 +01:00
Georgi Kodinov
e56284128f Reverted the fix for bug #25830 because of omissions and non-complete test
case.
2009-01-05 12:37:56 +02:00
Tatiana A. Nurnberg
4c788d93b1 auto-merge 2008-12-30 12:47:34 +01:00
Sergey Glukhov
f67ce47617 Bug#41131 "Questions" fails to increment - ignores statements instead stored procs(5.0 ver)
Added global status variable 'Queries' which represents
total amount of queries executed by server including
statements executed by SPs.
note: It's old behaviour of 'Questions' variable.
2008-12-29 16:06:53 +04:00
Sergey Glukhov
a31795b82d Bug#40953 SELECT query throws "ERROR 1062 (23000): Duplicate entry..." error
Table could be marked dependent because it is
either 1) an inner table of an outer join, or 2) it is a part of
STRAIGHT_JOIN. In case of STRAIGHT_JOIN table->maybe_null should not
be assigned. The fix is to set st_table::maybe_null to 'true' only
for those tables which are used in outer join.
2008-12-24 19:24:11 +04:00
Sergey Glukhov
026e9c3676 Bug#41456 SET PASSWORD hates CURRENT_USER()
init user->user struct with 
thd->security_ctx->priv_user context
if user->user is not initializied
2008-12-24 19:14:59 +04:00
Sergey Glukhov
59543e9f80 Bug#25830 SHOW TABLE STATUS behaves differently depending on table name
replace wild_case_compare with my_wildcmp which is multibyte safe function
2008-12-24 19:01:41 +04:00
Sergey Glukhov
26e804d0a7 Bug#37575 UCASE fails on monthname
The MONTHNAME/DAYNAME functions
returns binary string, so the LOWER/UPPER functions
are not effective on the result of MONTHNAME/DAYNAME call.  
Character set of the MONTHNAME/DAYNAME function
result has been changed to connection character set.
2008-12-23 18:08:04 +04:00
Sergey Petrunia
6147201a17 Merge 2008-12-22 23:28:08 +03:00
Sergey Petrunia
05ae989e76 BUG#40974: Incorrect query results when using clause evaluated using range check
- QUICK_INDEX_MERGE_SELECT deinitializes its rnd_pos() scan when it reaches EOF, but we 
  need to make the deinitialization in QUICK_INDEX_MERGE_SELECT destructor also. This is because
  certain execution strategies can stop scanning without reaching EOF, then then try to do a full
  table scan on this table. Failure to deinitialize caused the full scan to use (already empty) 
  table->sort and produce zero records.
2008-12-19 16:38:39 +03:00
Gleb Shchepa
c1bf0475cf Bug #40761: Assert on sum function on
IF(..., CAST(longtext AS UNSIGNED), signed_val)
            (was: LEFT JOIN on inline view crashes server)

Select from a LONGTEXT column wrapped with an expression
like "IF(..., CAST(longtext_column AS UNSIGNED), smth_signed)"
failed an assertion or crashed the server. IFNULL function was
affected too.

LONGTEXT column item has a maximum length of 32^2-1 bytes,
at the same time this is a maximum possible length of any
MySQL item. CAST(longtext_column AS UNSIGNED) returns some
unsigned numeric result of length 32^2-1, so the result of
IF/IFNULL function of this number and some other signed number
will have text length of (32^2-1)+1=32^2 (one byte for the
minus sign) - there is integer overflow, and the length is
equal to zero. That caused assert/crash.

CAST AS UNSIGNED function has been modified to limit maximal
length of resulting number to 67 (maximal length of DECIMAL
and two characters for minus sign and dot).
2008-12-12 17:16:25 +04:00
Gleb Shchepa
03f9b2cea6 rollback of bug #40761 fix 2008-12-12 14:59:10 +04:00
Gleb Shchepa
ce8ad64dd2 Bug #40761: Assert on sum function on
IF(..., CAST(longtext AS UNSIGNED), signed_val)
            (was: LEFT JOIN on inline view crashes server)

Select from a LONGTEXT column wrapped with an expression
like "IF(..., CAST(longtext_column AS UNSIGNED), smth_signed)"
failed an assertion or crashed the server. IFNULL function was
affected too.

LONGTEXT column item has a maximum length of 32^2-1 bytes,
at the same time this is a maximum possible length of any
MySQL item. CAST(longtext_column AS UNSIGNED) returns some
unsigned numeric result of length 32^2-1, so the result of
IF/IFNULL function of this number and some other signed number
will have text length of (32^2-1)+1=32^2 (one byte for the
minus sign) - there is integer overflow, and the length is
equal to zero. That caused assert/crash.

The bug has been fixed by the same solution as in the CASE
function implementation.
2008-12-12 00:57:32 +04:00
Chad MILLER
cf9126a034 Bug#33812: mysql client incorrectly parsing DELIMITER
Fix parsing of mysql client commands, especially in relation to
single-line comments when --comments was specified.

This is a little tricky, because we need to allow single-line
comments in the middle of statements, but we don't want to allow
client commands in the middle of statements. So in
comment-preservation mode, we go ahead and send single-line
comments to the server immediately when we encounter them on their
own. 

This is still slightly flawed, in that it does not handle a
single-line comment with leading spaces, followed by a client-side
command when --comment has been enabled. But this isn't a new
problem, and it is quite an edge condition. Fixing it would require
a more extensive overall of how the mysql client parses commands.
2008-12-11 12:26:03 -05:00
Alexey Kopytov
764b9717ef Pull from mysql-5.0-bugteam. 2008-12-10 19:14:32 +03:00
Alexey Kopytov
33bac53782 Fix for a test failure on Solaris/x86/gcc introduced by the patch for bug #27483.
Removed values with more than 15 significant digits from the test case. Results of 
reading/printing such values using system library functions depend on implementation 
and thus are not portable.
2008-12-10 16:07:32 +03:00
Luis Soares
9383631e59 push to 5.0-bugteam tree. 2008-12-10 10:53:22 +00:00
V Narayanan
2453e20f7d updating with mysql-5.0-bugteam 2008-12-10 14:26:57 +05:30
Georgi Kodinov
d506265f2c backported the fix for bug #34773 to 5.0 2008-12-09 20:35:02 +02:00
Sergey Glukhov
c5c64a30d4 Bug#31399 Wrong query result when doing join buffering over BIT fields
if table has bit fields then uneven bits(if exist) are stored into null bits place.
So we need to copy null bits in case of uneven bit field presence.
2008-12-09 16:59:47 +04:00
Sergey Glukhov
d2b5e0bb94 Bug#31291 ALTER TABLE CONVERT TO CHARACTER SET does not change some data types
added ability for TINY[MEDIUM] text fields 
to be converted to greater subtype during
alter if necessary(altered charset)
2008-12-09 16:38:52 +04:00
Sergey Glukhov
904c7c4409 automerge 2008-12-09 16:11:01 +04:00
Sergey Glukhov
0661c210d3 bug#35558 Wrong server metadata blows up the client
the problem: FORMAT func max_length value was calculated incorrectly
the fix: correct calculation of max_length
2008-12-09 14:00:43 +04:00
Sergey Glukhov
eb46763654 Bug#35796 SHOW CREATE TABLE and default value for BIT field
show default value for BIT field in printable format
2008-12-09 13:53:23 +04:00
Sergey Vojtovich
53e83e6e21 Merge. 2008-12-09 12:53:19 +04:00
Alexey Kopytov
b713958132 Fixed type_float failures in --ps-protocol mode introduced by the test case for bug #27483.
The reason for the failures was bug #21205 (fixed in 6.0 by dtoa, but still present in 5.0/5.1).
2008-12-09 11:05:36 +03:00
Andrei Elkin
0ec3e14e98 merge 5.0->5.0-bugteam for a local tree containing bug#33420 Test 'rpl_packet' fails randomly. 2008-12-08 16:29:13 +02:00
Andrei Elkin
cea55f3dc6 Bug #33420 Test 'rpl_packet' fails randomly with changed "Exec_Master_Log_Pos"
Bug #41173 rpl_packet fails sporadically on pushbuild: query 'DROP TABLE t1' failed


The both issues appeared to be a race between the SQL thread executing CREATE table t1
and the IO thread that is expected to stop at the consequent big size event.
The two events need serialization which is implemented.
The early bug required back-porting a part fixes for bug#38350 exclusively for 5.0 version.
2008-12-04 18:36:45 +02:00
Luis Soares
5726574b0c BUG#38826 Race in MYSQL_LOG::purge_logs is impossible to debug in production
BUG#39325 Server crash inside MYSQL_LOG::purge_first_log halts replicaiton

The patch reverses the order of the purging and updating events for log and relay-log.info/index files respectively.
This solves the problem of having holes caused by crashes happening between updating info/index files and purging logs.

NOTE: This is a combined patch for BUG#38826 and BUG#39325. This patch is based on bugteam tree and takes into account reviewers suggestions.
2008-12-04 01:01:03 +00:00
Alexey Kopytov
5f7869a22a Fix for bug #27483: Casting 'scientific notation type' to 'unsigned
bigint' fails on windows.

Visual Studio does not take into account some x86 hardware limitations
which leads to incorrect results when converting large DOUBLE values
to BIGINT UNSIGNED ones.

Fixed by adding a workaround for double->ulonglong conversion on
Windows.
2008-12-03 19:15:39 +03:00
V Narayanan
d5bfbfb9c3 merging with mysql-5.0-bugteam tree. 2008-12-03 17:52:55 +05:30
Tatiana A. Nurnberg
e979ff9ad0 auto-merge 2008-12-03 07:38:26 +01:00
Tatiana A. Nurnberg
83f6af41c7 auto-merge 2008-12-03 07:19:26 +01:00
Georgi Kodinov
f0c49a6a7d addendum to the fix for bug #39920 : post-merge test suite fixes 2008-12-01 17:41:06 +02:00
Georgi Kodinov
d21c85037f merged bug 39920 to 5.0-bugteam 2008-12-01 16:41:22 +02:00
Georgi Kodinov
8f36a23c00 Bug #39920: MySQL cannot deal with Leap Second expression in string literal.
Updated MySQL time handling code to react correctly on UTC leap second additions.
MySQL functions that return the OS current time, like e.g. CURDATE(), NOW() etc
will return :59:59 instead of :59:60 or 59:61.
As a result the reader will receive :59:59 for 2 or 3 consecutive seconds 
during the leap second.
This fix will not affect the values returned by UNIX_TIMESTAMP() for leap seconds.
But note that when converting the value returned by UNIX_TIMESTAMP() to broken 
down time the correction of leap seconds will still be applied.
Note that this fix will make a difference *only* if the OS is specially configured
to return leap seconds from the OS time calls or when using a MySQL time zone 
defintion that has leap seconds.
Even after this change date/time literals (or other broken down time 
representations) with leap seconds (ending on :59:60 or 59:61) will still be 
considered illegal and discarded by the server with an error or 
a warning depending on the sql mode.
Added a test case to demonstrate the effect of the fix.
2008-12-01 16:18:35 +02:00
Georgi Kodinov
be5e6ee031 Addendum to bug #37339 : make the test case portable to windows
by using and taking out a full path.
2008-12-01 13:34:53 +02:00
Matthias Leich
b9f919e143 Merge of last pushes into GCA tree, no conflicts
Diff to actual 5.0-bugteam is revno: 2725 only
2008-11-28 19:47:08 +01:00
Gleb Shchepa
228c913ee5 Bug #33461: SELECT ... FROM <view> USE INDEX (...) throws
an error

Even after the fix for bug 28701 visible behaviors of
SELECT FROM a view and SELECT FROM a regular table are
little bit different:

1. "SELECT FROM regular table USE/FORCE/IGNORE(non
   existent index)" fails with a "ERROR 1176 (HY000):
   Key '...' doesn't exist in table '...'"

2. "SELECT FROM view USING/FORCE/IGNORE(any index)" fails
   with a "ERROR 1221 (HY000): Incorrect usage of
   USE/IGNORE INDEX and VIEW".  OTOH "SHOW INDEX FROM
   view" always returns empty result set, so from the point
   of same behaviour view we trying to use/ignore non
   existent index.

To harmonize the behaviour of USE/FORCE/IGNORE(index)
clauses in SELECT from a view and from a regular table the
"ERROR 1221 (HY000): Incorrect usage of USE/IGNORE INDEX
and VIEW" message has been replaced with the "ERROR 1176
(HY000): Key '...' doesn't exist in table '...'" message
like for tables and non existent keys.
2008-11-28 20:13:12 +04:00
Georgi Kodinov
ccc3404f1b merged bug 37339 to 5.0-bugteam 2008-11-28 16:32:04 +02:00
Georgi Kodinov
0708ad5f98 Bug #37339: SHOW VARIABLES not working properly with multi-byte datadir
The SHOW VARIABLES LIKE .../SELECT @@/SELECT ... FROM INFORMATION_SCHEMA.VARIABLES
were assuming that all the system variables are in system charset (UTF-8).
However the variables that are settable through command line will have a different
character set (character_set_filesystem).
Fixed the server to remember the correct character set of basedir, datadir, tmpdir,
ssl, plugin_dir, slave_load_tmpdir, innodb variables; init_connect and init_slave 
variables and use it when processing data.
2008-11-28 16:25:16 +02:00
Sergey Vojtovich
85d4cbae24 BUG#37245 - Full text search problem
Certain boolean mode queries with truncation operator did
not return matching records and calculate relevancy
incorrectly.
2008-11-28 18:17:13 +04:00
Sergey Glukhov
68066aa5a1 error code is changed to satisfy Win NT 2008-11-28 17:12:43 +04:00
Sergey Glukhov
17cd69ccf4 pushbuild failure fixes 2008-11-28 14:50:13 +04:00
Tatiana A. Nurnberg
99fe5e523e auto-merge 2008-11-27 17:17:16 +01:00
Sergey Glukhov
63bca358ca Bug#37284 Crash in Field_string::type()
The bug is repeatable with latest(1.0.1) InnoDB plugin on Linux, Win,
If MySQL is compiled with valgrind there are errors about
using of uninitialized variable(orig_table).
The fix is to set field->orig_table correct value.
2008-11-27 18:54:23 +04:00
Sergey Glukhov
2fb574214e Bug#37460 Assertion failed: !table->file || table->file->inited == handler::NONE
enable uncacheable flag if we update a view with check option
and check option has a subselect, otherwise, the check option
can be evaluated after the subselect was freed as independent
(See full_local in JOIN::join_free())
2008-11-27 17:57:34 +04:00