Commit graph

193 commits

Author SHA1 Message Date
gkodinov/kgeorge@magare.gmz
4202454baa Bug #27530:
The function CRC32() returns unsigned integer.
But the metadata (the unsigned flag) for the 
function was set incorrectly.
As a result type arithmetics based on the 
function's metadata (like finding the concise
type of an temporary table column to hold the result)
returned incorrect results.
Fixed by returning correct type information.

This fix is based on code contributed by Martin Friebe
(martin@hybyte.com) on 2007-03-30.
2007-04-11 13:58:16 +03:00
gkodinov/kgeorge@magare.gmz
4a6efcd664 Bug #26537: item_unhex() was not expected
to return NULL for non-NULL arguments.
This is not the case as it can return NULL
for invalid hexidecimal strings.
Fixed by setting the maybe_null flag.
2007-03-02 12:14:50 +02:00
evgen@moonbone.local
8bb16e1e9c Merge moonbone.local:/work/latest-4.1-opt-mysql
into  moonbone.local:/work/latest-5.0-opt-mysql
2007-01-12 16:43:52 +03:00
evgen@moonbone.local
fc0e206cb5 Bug#23409: Arguments of the ENCODE() and the DECODE() functions were not printed
correctly.

The Item_func::print method was used to print the Item_func_encode and the
Item_func_decode objects. The last argument to ENCODE and DECODE functions
is a plain C string and thus Item_func::print wasn't able to print it.

The print() method is added to the Item_func_encode class. It correctly
prints the Item_func_encode and the Item_func_decode objects.
2007-01-11 16:45:38 +03:00
kent@mysql.com/kent-amd64.(none)
226a5c833f Many files:
Changed header to GPL version 2 only
2006-12-23 20:17:15 +01:00
kroki/tomash@moonlight.intranet
9e7f682116 Add 5.0 part of fix for bug 17047. 2006-11-16 14:06:51 +03:00
msvensson@shellback.(none)
d463972da7 Merge shellback.(none):/home/msvensson/mysql/mysql-5.0
into  shellback.(none):/home/msvensson/mysql/mysql-5.0-maint
2006-08-31 11:57:36 +02:00
kostja@bodhi.local
f8d34e1030 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.local:/opt/local/work/mysql-5.0-14897
2006-08-30 00:45:33 +04:00
kroki/tomash@moonlight.intranet
b6bee0a394 BUG#21166: Prepared statement causes signal 11 on second execution
Changes in an item tree done by optimizer weren't properly
registered and went unnoticed, which resulted in preliminary freeing
of used memory.
2006-08-24 15:49:12 +04:00
tsmith/tim@siva.hindu.god
b8521714af Merge siva.hindu.god:/usr/home/tim/m/bk/b20536-41
into  siva.hindu.god:/usr/home/tim/m/bk/41
2006-08-23 16:30:05 -06:00
tsmith/tim@siva.hindu.god
bf8fc6e82a Merge siva.hindu.god:/usr/home/tim/m/bk/b20536-50
into  siva.hindu.god:/usr/home/tim/m/bk/50
2006-08-23 13:43:28 -06:00
tsmith/tim@siva.hindu.god
9228972cd4 Manual merge, and add --echo End of 5.0 tests to ctype_ucs 2006-08-14 18:59:43 -06:00
tsmith/tim@siva.hindu.god
72d55f3878 Bug #20536: md5() with GROUP BY and UCS2 return different results on myisam/innodb
Make the encryption functions MD5(), SHA1() and ENCRYPT() return binary results.
    
Make MAKE_SET() and EXPORT_SET() use the correct character set for their default separator strings.
2006-08-11 17:09:19 -06:00
msvensson@neptunus.(none)
7280f63100 Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
2006-08-03 09:32:58 +02:00
msvensson@neptunus.(none)
31be565d2e Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
2006-08-01 20:24:30 +02:00
gkodinov/kgeorge@macbook.gmz
f5b0dd6a00 Bug #21086: server crashes when VIEW defined with a SELECT with COLLATE clause is called
When executing INSERT over a view with calculated columns it was assuming all
  elements of the fields collection are actually Item_field instances.
  This may not be true when inserting into a view and that view has columns that are 
  such expressions that allow updating (like setting a collation for example).
  Corrected to access field information through the filed_for_view_update() function and 
  retrieve correctly the field info even for "update-friendly" non-Item_field items.
2006-07-25 18:42:49 +03:00
igor@olga.mysql.com
d1c109ef12 Merge olga.mysql.com:/home/igor/mysql-4.1-opt
into  olga.mysql.com:/home/igor/mysql-5.0-opt
2006-07-19 13:44:37 -07:00
igor@olga.mysql.com
f201828dd8 Fixed bug #17526: incorrect print method
for class Item_func_trim. 
For 4.1 it caused wrong output for EXPLAIN EXTENDED commands
if expressions with the TRIM function of two arguments were used.
For 5.0 it caused an error message when trying to select
from a view with the TRIM function of two arguments.
This unexpected error message was due to the fact that the
print method for the class Item_func_trim was inherited from
the class Item_func. Yet the TRIM function does not take a list
of its arguments. Rather it takes the arguments in the form:
  [{BOTH | LEADING | TRAILING} [remstr] FROM] str) |
  [remstr FROM] str
2006-07-19 12:36:55 -07:00
jimw@rama.(none)
9f308f676a Merge bk-internal:/home/bk/mysql-5.0-maint
into  rama.(none):/home/jimw/my/mysql-5.0-18539
2006-07-17 12:21:30 -07:00
evgen@moonbone.local
8394aec4e6 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0
into  moonbone.local:/work/tmp_merge-5.0-opt-mysql
2006-07-13 18:16:16 +04:00
jimw@rama.(none)
9c18b5752c Bug #18539: uncompress(d) is null: impossible?
The UNCOMPRESS() function was not marked as maybe_null, even though
  it returns NULL on invalid data. This confused the optimizer.
2006-07-10 19:50:40 -07:00
igor@olga.mysql.com
f6d6ac1e0f Merge olga.mysql.com:/home/igor/mysql-4.1-opt
into  olga.mysql.com:/home/igor/mysql-5.0-opt
2006-07-06 13:40:08 -07:00
igor@olga.mysql.com
0e3d2dafd6 Fixed bug #18243.
The implementation of the method Item_func_reverse::val_str
for the REVERSE function modified the argument of the function.
This led to wrong results for expressions that contained
REVERSE(ref) if ref occurred somewhere else in the expressions.
2006-07-06 11:11:49 -07:00
kroki@mysql.com
821b540f2e Merge mysql.com:/home/tomash/src/mysql_ab/mysql-5.0
into  mysql.com:/home/tomash/src/mysql_ab/mysql-5.0-bug20570
2006-07-04 23:55:52 +04:00
kroki@mysql.com
dbdecef495 Bug#20570: CURRENT_USER() in a VIEW with SQL SECURITY DEFINER returns
invoker name

The bug was fixed similar to how context switch is handled in
Item_func_sp::execute_impl(): we store pointer to current
Name_resolution_context in Item_func_current_user class, and use
its Security_context in Item_func_current_user::fix_fields().
2006-07-02 14:35:45 +04:00
gluh@eagle.intranet.mysql.r18.ru
b1892278c7 Bug#19599 duplication of information_schema column value in a CONCAT expr with user var
mark result string using String::mark_as_const()
which prevents CONCAT from reusing it as a buffer
for concatenation result.
2006-06-06 12:51:04 +05:00
jimw@mysql.com
7d54b004a2 Bug #13975: "same string" + 0 has 2 different results
The 'decimals' member of Item_func was being improperly initialized,
  which resulted in improper results when handling large numeric values.
2006-05-18 10:34:01 -07:00
jimw@mysql.com
80aafdd398 Bug #17043: Casting trimmed string to decimal loses precision
Results of string functions were being converted to decimals by first
  being converted to integers, resulting in a loss of precision.
2006-03-14 02:04:43 -08:00
gluh@eagle.intranet.mysql.r18.ru
33e7d20f37 Fix for bug#16678 FORMAT gives wrong result if client run with default-character-set=utf8
calculate Item_func_format::max_length using charset->mbmaxlen
2006-03-06 12:52:38 +04:00
msvensson@neptunus.(none)
a626b51dad BUG#9535 Warning for "create table t as select uuid();"
- Set max_length of Item_func_uuid to max_length*system_charset_info->mbmaxlen
    Note! Item_func_uuid should be set to use 'ascii' charset when hex(), format(), md5()
etc will use 'ascii'
    - Comitting again, the old patch seems to have been lost.
2005-12-07 15:45:31 +01:00
bar@mysql.com
0f73558ee3 Merge mysql.com:/usr/home/bar/mysql-4.1.b10446
into  mysql.com:/usr/home/bar/mysql-5.0
2005-11-29 09:25:51 +04:00
bar@mysql.com
e6708aa0df Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/usr/home/bar/mysql-5.0.b14146
2005-11-25 10:08:00 +04:00
bar@mysql.com
2f72e05903 Bug#10446 Illegal mix of collations:
item_strfunc.h, item_strfunc.cc, item.cc:
  Try to convert a const item into destination 
  character set. If conversion happens without
  data loss, then cache the converted value
  and return it during val_str().
  Otherwise, if conversion loses data, return
  Illeral mix of collations error, as it happened
  previously.
ctype_recoding.result, ctype_recoding.test:
  Fixing tests accordingly.
2005-11-21 17:26:31 +04:00
guilhem@mysql.com
1379dd180f Merge mysql.com:/home/mysql_src/mysql-4.1-gca
into  mysql.com:/home/mysql_src/mysql-5.0-release
2005-11-10 15:13:12 +01:00
guilhem@mysql.com
2df7d97281 Declaring some class members public for BUG#12377:
"Item_date_add_interval needs to have the int_type member as Public".
As explained in the bug report, this change is is to help http://search.cpan.org/~philips/DBIx-MyParse-0.20/
So please keep those members public.
2005-11-10 15:12:22 +01:00
bar@mysql.com
1946d68f99 Bug#14146 CHAR(...USING ...) and CONVERT(CHAR(...) USING...) produce different results
ctype_utf8.result, ctype_utf8.test:
  Adding test case.
item_strfunc.cc:
item_strfunc.h:
  Moving the well formed checking code into a method,
  to reuse in several Item_func_xxx. Reusing the new
  method in Item_func_char and Item_func_charset_conv.
2005-11-07 12:34:19 +04:00
bar@mysql.com
a167ddc6e7 Bug#13233
select distinct char(column) fails with utf8
ctype_utf8.result, ctype_utf8.test:
  Adding test case
sql_yacc.yy:
  Adding new syntax.
item_strfunc.h:
  Fixing wrong max_length calculation.
  Also, adding CHAR(x USING charset),
  for easier migrating from 4.1 to 5.0,
  according to Monty's suggestion.
2005-10-21 14:41:56 +05:00
bar@mysql.com
7c81d7fc69 ctype_utf8.result, ctype_utf8.test:
New syntax: CHAR(x USING charset)
  Adding test case.
sql_yacc.yy:
  New syntax: CHAR(x USING charset)
  Adding new parser rule.
item_strfunc.h:
  New syntax: CHAR(x USING charset)
  Adding a new constructor.
2005-10-13 19:24:47 +05:00
monty@mysql.com
f5fdf3e87a Reviewing new pushed code
- CHAR() now returns binary string as default
- CHAR(X*65536+Y*256+Z) is now equal to CHAR(X,Y,Z) independent of the character set for CHAR()
- Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
  (Some old systems returns ETIME and it's safer to test for both values
   than to try to write a wrapper for each old system)
- Fixed new introduced bug in NOT BETWEEN X and X
- Ensure we call commit_by_xid or rollback_by_xid for all engines, even if one engine has failed
- Use octet2hex() for all conversion of string to hex
- Simplify and optimize code
2005-10-12 00:58:22 +03:00
bell@sanja.is.com.ua
8aad35f9d2 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-bug6-5.0
2005-07-16 00:17:05 +03:00
bell@sanja.is.com.ua
6114bee47c stop evaluation constant functions in WHERE (BUG#4663)
correct value of CURRENT_USER() in SP with "security definer" (BUG#7291)
2005-07-16 00:01:44 +03:00
monty@mysql.com
86d7b02199 Merge with 4.1 2005-07-03 14:17:52 +03:00
bell@sanja.is.com.ua
d3905f3d0e Name resolution context added (BUG#6443) 2005-07-01 07:05:42 +03:00
igor@rurik.mysql.com
4b8f2e9bb4 func_str.test:
Added test cases for bug #11469.
item_strfunc.h:
  Fixed bug #11469: wrong implementation of the not_null_tables
  method for CONCAT_WS.
2005-06-29 02:40:25 -07:00
bell@sanja.is.com.ua
3c5286c3e2 fixed encrypt() print (BUG#7024) 2005-06-24 00:24:11 +03:00
bell@sanja.is.com.ua
a11677026f fixed printing of sum(distinct ) & avg(distinct ) & cast(... as decimal) (BUG#7015, BUG#11387) 2005-06-17 17:27:47 +03:00
bar@mysql.com
2df945d87b Bug#8610: The ucs2_turkish_ci collation fails with upper('i')
UPPER/LOWER now can return a string with different length.

mi_test1.c:
  Adding new arguments.
Many files:
  Changeing caseup/casedn to return a result with different
  length than argument.
sql_string.h:
  Removing unused method,
mysql_priv.h:
  Removing unused method
2005-06-06 16:54:15 +05:00
msvensson@neptunus.(none)
02a3295a60 Merge neptunus.(none):/home/msvensson/mysql/bug9535
into neptunus.(none):/home/msvensson/mysql/mysql-5.0
2005-05-17 20:32:00 +02:00
msvensson@neptunus.(none)
e6ba48b942 BUG#9535 Warning for "create table t as select uuid();"
- Set max_length of Item_func_uuid to max_length*system_charset_info->mbmaxlen
  Note! Item_func_uuid should be set to use 'ascii' charset when hex(), format(), md5() etc will use 'ascii'
2005-05-17 20:31:26 +02:00
msvensson@neptunus.(none)
f3890e9440 Merge neptunus.(none):/home/msvensson/mysql/mysql-4.1
into neptunus.(none):/home/msvensson/mysql/mysql-5.0
2005-05-10 10:49:50 +02:00