Commit graph

295 commits

Author SHA1 Message Date
knielsen@mysql.com
c8fd62f3b2 After-merge fixes; some function signatures changed from Item * to Item **. 2006-05-15 19:57:10 +02:00
konstantin@mysql.com
85c6883146 Merge mysql.com:/opt/local/work/mysql-5.0-root
into  mysql.com:/opt/local/work/mysql-5.0-runtime-merge
2006-05-15 00:51:12 +04:00
kroki@mysql.com
0963c705cd Bug#14635: Accept NEW.x as INOUT parameters to stored procedures
from within triggers

Add support for passing NEW.x as INOUT and OUT parameters to stored
procedures.  Passing NEW.x as INOUT parameter requires SELECT and
UPDATE privileges on that column, and passing it as OUT parameter
requires only UPDATE privilege.
2006-05-12 13:55:21 +04:00
monty@mysql.com
837ba4f399 Fixed memory leak in sql_parse.cc (lex_end() was not called)
This caused sp-vars.test to fail
2006-05-04 15:30:38 +03:00
kroki@mysql.com
c8e22ff70b Bug#16461: connection_id() does not work properly inside trigger
CONNECTION_ID() was implemented as a constant Item, i.e. an instance of
Item_static_int_func class holding value computed at creation time.
Since Items are created on parsing, and trigger statements are parsed
on table open, the first connection to open a particular table would
effectively set its own CONNECTION_ID() inside trigger statements for
that table.

Re-implement CONNECTION_ID() as a class derived from Item_int_func, and
compute connection_id on every call to fix_fields().
2006-04-12 19:31:00 +04:00
evgen@moonbone.local
c5493b6316 Fixed bug#13575: SP funcs in select with distinct/group and order by can
produce wrong data

By default Item_sp_func::val_str() returns string from it's result_field 
internal buffer. When grouping is present Item_copy_string is used to 
store SP function result, but it doesn't additionally buffer the result.
When the next record is read, internal buffer is overwritten, due to
this Item_copy_string::val_str() will have wrong data. Thus producing
weird query result.

The Item_func_sp::val_str() now makes a copy of returned value to prevent
occasional corruption.
2006-03-10 13:53:00 +03:00
svoj@april.(none)
328b59a5ed Merge april.(none):/home/svoj/devel/mysql/merge/mysql-4.1
into  april.(none):/home/svoj/devel/mysql/merge/mysql-5.0
2006-02-07 15:30:32 +04:00
svoj@april.(none)
91296df576 Merge april.(none):/home/svoj/devel/mysql/BUG16893/mysql-4.1
into  april.(none):/home/svoj/devel/mysql/merge/mysql-4.1
2006-02-07 13:49:55 +04:00
svoj@april.(none)
7c76ae4c13 BUG#16893: Crash in test 'fulltext_order_by'
Fixed that fulltext query + union results in unexpected behaviour.
2006-02-03 14:09:33 +04:00
svoj@april.(none)
332be5bdd9 BUG#14496: Crash or strange results with prepared statement,
MATCH and FULLTEXT
Fixed that fulltext query using PS results in unexpected behaviour
when executed 2 or more times.
2006-02-01 20:40:12 +04:00
anozdrin@mysql.com
0ff8f60b45 Patch for WL#2894: Make stored routine variables work
according to the standard.

The idea is to use Field-classes to implement stored routines
variables. Also, we should provide facade to Item-hierarchy
by Item_field class (it is necessary, since SRVs take part
in expressions).

The patch fixes the following bugs:
  - BUG#8702: Stored Procedures: No Error/Warning shown for inappropriate data 
    type matching; 
 
  - BUG#8768: Functions: For any unsigned data type, -ve values can be passed 
    and returned; 
 
  - BUG#8769: Functions: For Int datatypes, out of range values can be passed 
    and returned; 
 
  - BUG#9078: STORED PROCDURE: Decimal digits are not displayed when we use 
    DECIMAL datatype; 
 
  - BUG#9572: Stored procedures: variable type declarations ignored; 
 
  - BUG#12903: upper function does not work inside a function; 
 
  - BUG#13705: parameters to stored procedures are not verified; 
 
  - BUG#13808: ENUM type stored procedure parameter accepts non-enumerated
    data; 
 
  - BUG#13909: Varchar Stored Procedure Parameter always BINARY string (ignores 
    CHARACTER SET); 
 
  - BUG#14161: Stored procedure cannot retrieve bigint unsigned;

  - BUG#14188: BINARY variables have no 0x00 padding;

  - BUG#15148: Stored procedure variables accept non-scalar values;
2005-12-07 17:01:17 +03:00
ramil@mysql.com
516fd4254e Addition to fix for bug #12956: cast make differ rounding.
- use rint() in some other val_int() methods as well.
2005-11-30 11:17:25 +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
konstantin@mysql.com
2d4c54ba1b Merge mysqldev@production.mysql.com:my/mysql-5.0-release
into  mysql.com:/opt/local/work/mysql-5.0-root
2005-09-23 00:46:59 +04:00
monty@mysql.com
82fc54781b Fixed problems found by valgrind
Fixed problems in test suite where some test failed
Fixed access to not initialized memory in federated
Fixed access to not initialized memory when using BIT fields in internal temporary tables
2005-09-22 03:23:07 +03:00
bell@sanja.is.com.ua
506c6eb922 postmerge fixes 2005-09-21 08:29:47 +03:00
evgen@moonbone.local
de4e941e3f Fix bug #12812 create view calling a function works without execute right on function
Execution rigths on function was checked just before function execution,
thus it was unknown on prepare stage whether user have right to execute 
particular function.

Added access rights checking function which is called right after fixing
Item_func_sp.
This have additional effect that if user don't have rights for execution
query will fail on earlier stage and will not waste resources on optimizing
with failing on execution stage.
2005-09-20 03:05:35 +04:00
igor@rurik.mysql.com
f93e7cc77a func_str.result, null.result:
Corrected results after the fix for bug #12791.
func_test.result, func_test.test:
  Added test cases for bug #12791.
item_func.h, item_func.cc:
  Fixed bug #12791.
  Made LEAST/GREATES fully Oracle compliant.
  LEAST/GREATEST did not return NULL if only some
  arguments were NULLs. This did not comply with Oracle.
2005-08-26 22:25:45 -07:00
jimw@mysql.com
a3c893e0b8 Fix cases where SLEEP() calls would get optimized away or cached. (Bug #12689) 2005-08-19 15:51:40 -07:00
jimw@mysql.com
898aae5e0f Add SLEEP(seconds) function, which always returns 0 after the given
number of seconds (which can include microseconds). (Bug #6760)
2005-08-11 18:58:22 -07:00
sergefp@mysql.com
e5ba8ba521 Remove Item_func::NOTLIKE_FUNC and all [dead] code that uses it 2005-07-29 03:37:06 +02:00
bar@mysql.com
0255803b4e Merge mysql.com:/usr/home/bar/mysql-4.1.b10201
into  mysql.com:/usr/home/bar/mysql-5.0
2005-07-26 13:25:18 +05:00
bar@mysql.com
0c2035b7bd func_gconcat.result, func_gconcat.test:
Adding test
item_sum.cc:
  Adding a call for collation/charset aggregation,
      to collect attributes from the arguments. The actual bug fix.
item_func.h, item_func.cc, item.h, item.cc:
  - Removing collation aggrgation functions from Item_func class
      in item.cc, and adding it as non-class functions in item.cc
      to be able to reuse this code for group_concat.
      - Adding replacement for these functions into Item_func class
      as wrappers for moved functions, to minizize patch size,
2005-07-26 12:52:02 +05:00
konstantin@mysql.com
8b0adacbc6 After-merge fixes (4.1 -> 5.0). 2005-07-16 16:10:42 +04:00
konstantin@mysql.com
8e72214d74 Merge mysql.com:/opt/local/work/mysql-4.1-root
into  mysql.com:/media/sda1/mysql/mysql-5.0-merge
2005-07-16 13:45:32 +04:00
konstantin@mysql.com
e08caeeee2 A fix and a test case for Bug#9359 "Prepared statements take snapshot
of system vars at PREPARE time": implement a special Item
to handle system variables. This item substitutes itself with 
a basic constant containing variable value at fix_fields.
2005-07-16 03:29:13 +04:00
hf@deer.(none)
3ddd2771d6 Fix for bug #11708 (real function returns wrongly rounded decimal) 2005-07-07 20:28:47 +05:00
bell@sanja.is.com.ua
d3905f3d0e Name resolution context added (BUG#6443) 2005-07-01 07:05:42 +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
pem@mysql.comhem.se
46619fa0e3 Post review and additional fix for BUG#10968: Stored procedures: crash if long loop.
Fixed valgrind complaints. This fixes the memory leak problems for
  procedured, and partially for functions. There's still a leak involving
  results from functions that turned out to be too involved, so it will be
  fixed separately.
2005-06-10 16:14:01 +02:00
igor@igor-inspiron.creware.com
83fae64323 item_func.h:
Identation correction for the fix of bug #9939.
2005-06-02 10:00:32 -07:00
igor@igor-inspiron.creware.com
186e8c5891 item_func.h:
Fixed bug #9939: a wrong conversion of arguments
  for functions COALESCE and IFNULL.
  The str_op virtual method was added into Item_func_numhybrid.
item_func.cc:
  Fixed bug #9939: a wrong conversion of arguments
  for functions COALESCE and IFNULL.
  The str_op virtual method was added into Item_func_numhybrid.
item_cmpfunc.h, item_cmpfunc.cc:
  Fixed bug #9939: a wrong conversion of arguments
  for functions COALESCE and IFNULL.
  Item_func_coalesce and Item_func_ifnull now
  inherit from a modified Item_func_numhybrid.
case.test, case.result:
  Added test cases for bug #9939.
2005-06-02 07:27:02 -07:00
dlenev@mysql.com
e7f29e1904 Manual merge of fix for bug #9913 into 5.0 tree. 2005-05-09 16:21:57 +04:00
msvensson@neptunus.(none)
891b64fd84 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into neptunus.(none):/home/msvensson/mysql/mysql-4.1
2005-05-09 12:16:59 +02:00
msvensson@neptunus.(none)
34cec09efb Merge neptunus.(none):/home/msvensson/mysql/bug10241
into neptunus.(none):/home/msvensson/mysql/mysql-5.0
2005-05-09 11:26:48 +02:00
dlenev@mysql.com
12621f349b Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/dlenev/src/mysql-4.1-bg9913
2005-05-09 12:18:19 +04:00
holyfoot@hf-ibm.(none)
2c8e9df232 A lot of fixes to Precision math
Mostly about precision/decimals of the results of the operations
2005-05-05 20:06:49 +05:00
msvensson@neptunus.(none)
5b5565c30a BUG#10241 cygwin port: invalid pragma interface directives
- Introduce ifdefs so we can control when to use #pragma interface on cygwin
2005-05-04 15:05:56 +02:00
dlenev@brandersnatch.localdomain
8ee6d33bdd Fix for Bug #9913 "udf_deinit is not called after execution of PS"
(aka "deinit is not called when calling udf from trigger").

We should call udf_deinit() function during cleanup phase after prepared
(or ordinary) statement execution instead of calling it from Item's
desctructor.

No test case is provided since it is hard to test UDF's from our test
suite.
2005-04-30 20:23:40 +04:00
monty@mysql.com
28a5491d3d Merge with 4.1 2005-04-30 09:46:08 +03:00
monty@mysql.com
c0e8a8d625 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/my/mysql-5.0
2005-04-30 03:46:38 +03:00
monty@mysql.com
129c604032 Setting a variable to CAST(NULL as X) set the result type of the variable to X. (Bug #6598) 2005-04-30 03:14:42 +03:00
monty@mysql.com
fbf31c4a8c CAST(string_argument AS UNSIGNED) didn't work for big integers above the signed range. (Bug #7036)
Produce warnings of wrong cast of strings to signed/unsigned.
Don't block not resolved IP's if DNS server is down (Bug #8467)
Fix compiler problems with MinGW (Bug #8872)
2005-04-29 17:03:34 +03:00
pem@mysql.com
79cf164767 Merge mysql.com:/usr/local/bk/mysql-5.0
into mysql.com:/home/pem/work/mysql-5.0
2005-04-27 14:10:33 +02:00
georg@lmy002.wdf.sap.corp
7d6c12313e fix for compile error (Windows) 2005-04-27 13:54:42 +02:00
pem@mysql.comhem.se
406ea35128 Fixed memory leak in Item_func_sp::cleanup(). 2005-04-26 18:18:41 +02:00
acurtis@xiphis.org
8689083aca Bug#9775 - Stored procedures: crash if create function that returns enum or set
Fix bug and implement return type casting.
2005-04-20 18:08:42 +01:00
acurtis@xiphis.org
77a9429c13 Bug#7648 - Stored procedure crash when invoking a function that returns a bit
bugfix 9102 corrected the crashing, this corrects the result.
2005-04-19 10:51:11 +01:00
bell@sanja.is.com.ua
dcdda90a11 Merge 2005-03-30 10:27:36 +03:00