Commit graph

946 commits

Author SHA1 Message Date
Alexander Barkov
344ddc85fa Merging mysql-next-mr-merge to mysql-next-mr. 2009-10-21 15:48:22 +05:00
Sergey Glukhov
7741d9b50d WL#751 Error message construction, backport 2009-10-15 17:23:43 +05:00
Alexander Nozdrin
ca08f10ccd Manual merge from mysql-trunk-merge. 2009-10-14 12:25:39 +04:00
Davi Arnaut
fc3740368a Bug#45567: Fast ALTER TABLE broken for enum and set
The problem was that appending values to the end of an existing
ENUM or SET column was being treated as table data modification,
preventing a immediately (fast) table alteration that occurs when
only table metadata is being modified.

The cause was twofold: adding a enumeration or set members to the 
end of the list of valid member values was not being considered
a "compatible" table alteration, and for SET columns, the check
was being done upon the max display length and not the underlying
(pack) length of the field.

The solution is to augment the function that checks wether two ENUM
or SET fields are compatible -- by comparing the pack lengths and
performing a limited comparison of the member values.
2009-09-29 07:58:42 -03:00
Marc Alff
08ffe21317 Merge mysql-next-mr --> mysql-trunk-signal 2009-09-17 03:20:11 -06:00
Marc Alff
d5fd452d7c WL#2110 (SIGNAL)
WL#2265 (RESIGNAL)

Manual merge of SIGNAL and RESIGNAL to mysql-trunk-signal,
plus required dependencies.
2009-09-10 03:18:29 -06:00
Staale Smedseng
f59ef9eafa Merge from 5.0 for 43414 2009-08-28 18:21:54 +02:00
Staale Smedseng
2217de2513 Bug #43414 Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2
      
This patch fixes a number of GCC warnings about variables used
before initialized. A new macro UNINIT_VAR() is introduced for
use in the variable declaration, and LINT_INIT() usage will be
gradually deprecated. (A workaround is used for g++, pending a
patch for a g++ bug.)
      
GCC warnings for unused results (attribute warn_unused_result)
for a number of system calls (present at least in later
Ubuntus, where the usual void cast trick doesn't work) are
also fixed.
2009-08-28 17:51:31 +02:00
Davi Arnaut
31afccc407 Bug#45261: Crash, stored procedure + decimal
The problem was that creating a DECIMAL column from a decimal
value could lead to a failed assertion as decimal values can
have a higher precision than those attached to a table. The
assert could be triggered by creating a table from a decimal
with a large (> 30) scale. Also, there was a problem in
calculating the number of digits in the integral and fractional
parts if both exceeded the maximum number of digits permitted
by the new decimal type.

The solution is to ensure that truncation procedure is executed
when deducing a DECIMAL column from a decimal value of higher
precision. If the integer part is equal to or bigger than the
maximum precision for the DECIMAL type (65), the integer part
is truncated to fit and the fractional becomes zero. Otherwise,
the fractional part is truncated to fit into the space left
after the integer part is copied.

This patch borrows code and ideas from Martin Hansson's patch.
2009-08-24 16:47:08 -03:00
Satya B
ad951044e0 Fix for BUG#45816 - assertion failure with index containing double
column on partitioned table
      
      
An assertion 'ASSERT_COULUMN_MARKED_FOR_READ' is failed if the query 
is executed with index containing double column on partitioned table.
The problem is that assertion expects all the fields which are read,
to be in the read_set.
      
In this query only the field 'a' is in the readset as the tables in
the query are joined by the field 'a' and so the assertion fails 
expecting other field 'b'.
      
Since the function cmp() is just comparison of two parameters passed, 
the assertion is not required.
      
Fixed by removing the assertion in the double fields comparision
function and also fixed the index initialization to do ordered
index scan with RW LOCK which ensures all the fields from a key are in
the read_set.
 

Note: this bug is not reproducible with other datatypes because the
      assertion doesn't exist in comparision function for other 
      datatypes.
2009-08-06 17:01:26 +05:30
Gleb Shchepa
e642140b18 Bug# 30946: mysqldump silently ignores --default-character-set
when used with --tab

1) New syntax: added CHARACTER SET clause to the
  SELECT ... INTO OUTFILE (to complement the same clause in
  LOAD DATA INFILE).
  mysqldump is updated to use this in --tab mode.

2) ESCAPED BY/ENCLOSED BY field parameters are documented as
   accepting CHAR argument, however SELECT .. INTO OUTFILE
   silently ignored rests of multisymbol arguments.
   For the symmetrical behavior with LOAD DATA INFILE the
   server has been modified to fail with the same error:

     ERROR 42000: Field separator argument is not what is
                  expected; check the manual

3) Current LOAD DATA INFILE recognizes field/line separators
   "as is" without converting from client charset to data
   file charset. So, it is supposed, that input file of
   LOAD DATA INFILE consists of data in one charset and
   separators in other charset. For the compatibility with
   that [buggy] behaviour SELECT INTO OUTFILE implementation
   has been saved "as is" too, but the new warning message
   has been added:

     Non-ASCII separator arguments are not fully supported

   This message warns on field/line separators that contain
   non-ASCII symbols.
2009-07-31 22:14:52 +05:00
Staale Smedseng
27eff2bcac Merge from 5.0-bugteam for 43414 2009-06-09 18:44:26 +02:00
Staale Smedseng
dae006c17f Bug #43414 Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2
      
Compiling MySQL with gcc 4.3.2 and later produces a number of 
warnings, many of which are new with the recent compiler
versions.
      
This bug will be resolved in more than one patch to limit the
size of changesets. This is the first patch, fixing a number 
of the warnings, predominantly "suggest using parentheses 
around && in ||", and empty for and while bodies.
2009-06-09 18:11:21 +02:00
Staale Smedseng
53d9b3d92d Bug #43414 Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2

Compiling MySQL with gcc 4.3.2 and later produces a number of 
warnings, many of which are new with the recent compiler
versions.

This bug will be resolved in more than one patch to limit the
size of changesets. This is the first patch, fixing a number 
of the warnings, predominantly "suggest using parentheses 
around && in ||", and empty for and while bodies.
2009-06-09 14:55:30 +02:00
Alexey Kopytov
12f18228b4 Bug #44792: valgrind warning when casting from time to time
Field_time::get_time() did not initialize some members of 
MYSQL_TIME which led to valgrind warnings when those members 
were accessed in Protocol_simple::store_time(). 
 
It is unlikely that this bug could result in wrong data 
being returned, since Field_time::get_time() initializes the 
'day' member of MYSQL_TIME to 0, so the value of 'day' 
in Protocol_simple::store_time() would be 0 regardless 
of the values for 'year' and 'month'.
2009-05-15 12:16:00 +04:00
Alexey Kopytov
3c87aeeff0 Automerge. 2009-05-15 12:42:57 +04:00
Sergey Glukhov
c641d962b3 5.0-bugteam->5.1-bugteam merge 2009-04-09 14:38:50 +05:00
Sergey Glukhov
db992986fe 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.
2009-04-09 14:19:31 +05:00
Alexey Kopytov
94926217d8 Manual merge. 2009-03-27 13:40:35 +03:00
Alexey Kopytov
afb2b6de68 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.
2009-03-27 13:12:50 +03:00
Georgi Kodinov
8c25823f94 merged 5.1-main -> 5.1-bugteam 2009-01-05 18:10:20 +02:00
Joerg Bruehe
c7d03ca35b Merge main 5.1 into 5.1-build 2008-12-10 21:14:50 +01:00
Alexey Kopytov
d4adb11088 Merge from mysql-5.0-bugteam to mysql-5.1-bugteam. 2008-12-09 13:56:46 +03:00
Alexey Kopytov
66fa3c09a3 Added a missing bit from the original patch for bug #27483 which was lost when re-applying
the patch manually to another tree.
2008-12-09 13:19:46 +03:00
Sergey Glukhov
8a43bcc33a 5.0-bugteam->5.1-bugteam merge 2008-11-27 17:05:38 +04:00
Sergey Glukhov
7b488c46a0 Bug#40365 Prepared statements may insert invalid dates.
set DATE|DATETIME value to 0 if ALLOW_INVALID_DATES sql_mode is not enabled.
2008-11-27 16:41:25 +04:00
Build Team
366adeab08 Added "Sun Microsystems, Inc." to copyright headers on files modified
since Oct 1st
2008-11-10 21:21:49 +01:00
Ramil Kalimullin
adf630dcee Fix for bug#23113: Different behavior on altering ENUM fields between 5.0 and 5.1
Problem: mysqld doesn't detect that enum data must be reinserted performing
'ALTER TABLE' in some cases.

Fix: reinsert data altering an enum field if enum values are changed.
2008-10-24 13:00:03 +05:00
Kristofer Pettersson
53cf8914e4 Merge 5.0-bugteam -> 5.1-bugteam 2008-09-20 16:52:34 +02:00
Kristofer Pettersson
18b3eacbc6 Bug#38469 invalid memory read and/or crash with utf8 text field, stored procedure, uservar
A stored procedure involving substrings could crash the server on certain
platforms because of invalid memory reads.
          
During storing the new blob-field value, the cached value's address range
overlapped that of the new field value. This caused problems when the 
cached value storage was reallocated to provide access for a new 
characater set representation. The patch checks the address ranges, and if
they overlap, the new field value is copied to a new storage before it is
converted to the new character set.
2008-09-20 10:51:03 +02:00
Alexander Barkov
4bf1aa826a Bug#35720 ucs2 + pad_char_to_full_length = failure
Problem: with @@sql_mode=pad_char_to_full_length
a CHAR column returned additional garbage
after trailing space characters due to
incorrect my_charpos() call.
Fix: call my_charpos() with correct arguments.
2008-09-15 15:29:31 +05:00
Davi Arnaut
58daa8d50a Silence warning due to unused function. 2008-07-22 14:53:36 -03:00
Mats Kindahl
2a089557a6 BUG#37426: RBR breaks for CHAR() UTF-8 fields > 85 chars
In order to handle CHAR() fields, 8 bits were reserved for
the size of the CHAR field. However, instead of denoting the
number of characters in the field, field_length was used which
denotes the number of bytes in the field.

Since UTF-8 fields can have three bytes per character (and
has been extended to have four bytes per character in 6.0),
an extra two bits have been encoded in the field metadata
work for fields of type Field_string (i.e., CHAR fields).

Since the metadata word is filled, the extra bits have been
encoded in the upper 4 bits of the real type (the most 
significant byte of the metadata word) by computing the
bitwise xor of the extra two bits. Since the upper 4 bits
of the real type always is 1111 for Field_string, this 
means that for fields of length <256, the encoding is
identical to the encoding used in pre-5.1.26 servers, but
for lengths of 256 or more, an unrecognized type is formed,
causing an old slave (that does not handle lengths of 256
or more) to stop.
2008-06-30 22:11:18 +02:00
gshchepa/uchum@host.loc
ebc6e02dee Merge host.loc:/work/bugs/5.0-bugteam-30059
into  host.loc:/work/bk/5.1-bugteam
2008-05-13 17:01:02 +05:00
gshchepa/uchum@host.loc
1c45081b52 Partial rollback of fix for bug #30059: End-space truncation is inconsistent
or incorrect.

For better conformance with standard, truncation procedure of CHAR columns
has been changed to ignore truncation of trailing whitespace characters
(note has been removed).

Finally, for columns with non-binary charsets:

1. CHAR(N) columns silently ignore trailing whitespace truncation;
2. VARCHAR and TEXT columns issue Note about truncation.

BLOBs and other columns with BINARY charset are unaffected.
2008-05-06 21:43:46 +05:00
cmiller@zippy.cornsilk.net
c27dd4372c Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-build
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-build
2008-04-10 17:48:33 -04:00
cmiller@zippy.cornsilk.net
82d8a99c05 Fix mismerge. 2008-04-10 15:55:37 -04:00
cmiller@zippy.cornsilk.net
59fc28cfc4 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug15776/my51-bug15776
into  zippy.cornsilk.net:/home/cmiller/work/mysql/bug15776-encore/my51-bug15776-encore
2008-04-09 18:24:50 -04:00
cmiller@zippy.cornsilk.net
cc2f6266c3 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug15776/my50-bug15776
into  zippy.cornsilk.net:/home/cmiller/work/mysql/bug15776/my51-bug15776
2008-04-09 18:09:42 -04:00
cmiller@zippy.cornsilk.net
b506166a0c Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug15776/my50-bug15776
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-build
2008-04-09 12:27:51 -04:00
cmiller@zippy.cornsilk.net
3e2457b71a Follow-up to B-g#15776, test failures on 64-bit linux.
Make maximum blob size to be 2**32-1, regardless of word size.

Fix failure of timestamp with size of 2**31-1.  The method of
rounding up to the nearest even number would overflow.
2008-04-09 12:27:30 -04:00
cmiller@zippy.cornsilk.net
c83c18c058 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug15776/my50-bug15776
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-build
2008-04-02 10:56:49 -04:00
cmiller@zippy.cornsilk.net
a878c1b9c1 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug15776/my50-bug15776
into  zippy.cornsilk.net:/home/cmiller/work/mysql/bug15776/my51-bug15776
2008-03-31 14:32:56 -04:00
istruewing@stella.local
eabe082d6f Manual merge 2008-03-14 12:02:11 +01:00
bar@mysql.com/bar.myoffice.izhnet.ru
f83cc8e6db Bug#23924 general_log truncates queries with character set introducers.
Problem: logging of utf8-incompatible binary strings didn't work
Fix: hex-encoding of incompatible sequences.
2008-02-29 17:56:50 +04:00
kaa@kaamos.(none)
58240614f7 Merge kaamos.(none):/data/src/opt/bug31236/my51-bug31236
into  kaamos.(none):/data/src/opt/mysql-5.1-opt
2008-02-20 00:37:51 +03:00
kaa@kaamos.(none)
8d222210c7 Fix for bug #31236: Inconsistent division by zero behavior for
floating point numbers

Some math functions did not check if the result is a valid number
(i.e. neither of +-inf or nan).

Fixed by validating the result where necessary and returning NULL in
case of invalid result.
2008-02-20 00:33:43 +03:00
kaa@kaamos.(none)
5647dee192 Merge kaamos.(none):/data/src/mysql-5.1
into  kaamos.(none):/data/src/opt/mysql-5.1-opt
2008-02-17 14:57:01 +03:00
kaa@kaamos.(none)
9f194149b8 Merge kaamos.(none):/data/src/opt/mysql-5.0-opt
into  kaamos.(none):/data/src/opt/mysql-5.1-opt
2008-02-13 12:12:00 +03:00
gshchepa/uchum@host.loc
2e9f2b678c Fixed bug#15409: Columns with 64-element SET may not be updated with integers.
SET column storing procedure has been modified to be 64bit-clean.
2008-02-08 16:04:01 +04:00