Commit graph

316 commits

Author SHA1 Message Date
anozdrin@mysql.com
c4cbe46bc7 Fix for BUG#13198: SP executes if definer does not exist.
Basically, this fix contains a test case and removing of a workaround
for replication. This fix became possible after pushing WL#2897
(Complete definer support in stored routines).
2006-03-02 16:23:42 +03:00
anozdrin@mysql.com
fbb5920399 Implementation of WL#2897: Complete definer support in the stored routines.
The idea is to add DEFINER-clause in CREATE PROCEDURE and CREATE FUNCTION
statements. Almost all support of definer in stored routines had been already
done before this patch.

NOTE: this patch changes behaviour of dumping stored routines in mysqldump.
Before this patch, mysqldump did not dump DEFINER-clause for stored routines
and this was documented behaviour. In order to get full information about stored
routines, one should have dumped mysql.proc table. This patch changes this
behaviour, so that DEFINER-clause is dumped.

Since DEFINER-clause is not supported in CREATE PROCEDURE | FUNCTION statements
before this patch, the clause is covered by additional version-specific comments.
2006-03-02 15:18:49 +03:00
msvensson@neptunus.(none)
334b9c7a27 Merge neptunus.(none):/home/msvensson/mysql/bug16878/my50-bug16878
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0
2006-02-21 17:19:46 +01:00
guilhem@mysql.com
56bed24c92 Fix for BUG#14769 "Function fails to replicate if fails half-way (slave stops)":
if the function, invoked in a non-binlogged caller (e.g. SELECT, DO), failed half-way on the master,
slave would stop and complain that error code between him and master mismatch. 
To solve this, when a stored function is invoked in a non-binlogged caller (e.g. SELECT, DO), we binlog the function
call as SELECT instead of as DO (see revision comment of sp_head.cc for more).
And: minor wording change in the help text.
This cset will cause conflicts in 5.1, I'll merge.
2006-02-18 17:26:30 +01:00
msvensson@neptunus.(none)
32c2712083 Bug#16878 dump of trigger
- Pass "in_comment" variable on to new lex in sp_head::reset_lex
 - Add testcases for dumping and reloading trigger without BEGIN/END
2006-02-09 11:05:28 +01:00
pem@mysql.com
2d340a875c Merge mysql.com:/extern/mysql/bk/mysql-5.0
into  mysql.com:/extern/mysql/work/bug16568/mysql-5.0
2006-02-06 14:09:14 +01:00
pem@mysql.com
ff4e2892b7 Fixed on BUG#16568: Continue handler with simple CASE not working correctly
After trying multiple inheritance (to messy and hard make it work) and
  sublassing jump_if_not (worked, but ugly), decided to on this solution
  instead:
  Inserting an abstract sp_instr_opt_meta class as parent for all instructions
  with destinations makes it possible to handle a continuation pointer for
  sp_instr_set_case_expr too.
  Note: No special test case; the fix is captured by the changed behaviour of
  bug14643_2, and bug14498_4 (formerly disabled), in sp.test.
2006-01-26 17:26:25 +01:00
pem@mysql.com
f60a763208 Fixed BUG#15737: Stored procedure optimizer bug with LEAVE
Second version.
  The problem was that the optimizer didn't work correctly with forwards jumps
  to "no-op" hpop and cpop instructions.
  Don't generate "no-op" instructions (hpop 0 and cpop 0), it isn't actually
  necessary.
2006-01-25 15:11:49 +01:00
anozdrin@mysql.com
145fd62bc1 Fix for BUG#15588: String overrun during sp-vars.test
The bug appears after implementation of WL#2984
(Make stored routine variables work according to the standard).
2006-01-20 15:59:22 +03:00
pem@mysql.com
a07bbd78da Post-review fixes (BUG#15658). 2006-01-19 16:13:04 +01:00
pem@mysql.com
3a753667dd Merge mysql.com:/extern/mysql/bk/mysql-5.0
into  mysql.com:/extern/mysql/work/bug15658/mysql-5.0
2006-01-19 11:48:07 +01:00
pem@mysql.com
559a243686 Merge mysql.com:/extern/mysql/bk/mysql-5.0
into  mysql.com:/extern/mysql/work/bug14498/mysql-5.0
2006-01-16 15:37:25 +01:00
dlenev@mysql.com
f9ea947bdc Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/dlenev/src/mysql-5.0-bg12198-2
2006-01-13 01:56:57 +03:00
dlenev@mysql.com
d14e701446 Fix for bug #12198 "Temporary table aliasing does not work inside stored
functions".

We should ignore alias when we check if table was already marked as temporary
when we calculate set of tables to be prelocked. Otherwise we will erroneously
treat tables which are used in same routine and have same name but different
alias as non-temporary.
2006-01-13 01:51:56 +03:00
pem@mysql.com
0cc1acd51c Fixing BUG#15658: Server crashes after creating function as empty string
Empty strings (and names with trailing spaces) should not be allowed.
2006-01-11 15:11:05 +01:00
anozdrin@mysql.com
b04b851ef9 Fix for BUG#15110: mysqldump --triggers: does not include DEFINER clause
There are two main idea of this fix:
  - introduce a common function for server and client to split user value
    (<user name>@<host name>) into user name and host name parts;
  - dump DEFINER clause in correct format in mysqldump.
2006-01-11 02:07:40 +03:00
knielsen@mysql.com
be8f21e8f1 Fix compile failure on QNX. 2006-01-06 14:30:25 +01:00
monty@mysql.com
b0a5ea01ef Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0
2006-01-06 01:08:48 +02:00
monty@mysql.com
6e22e29de6 Review fixes of new pushed code
- Fixed tests
- Optimized new code
- Fixed some unlikely core dumps
- Better bug fixes for:
  - #14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  - #14850 (ERROR 1062 when a quering a view using a Group By on a column that can be null
2006-01-06 00:47:49 +02:00
kent@mysql.com
c11b35d9bf Merge mysql.com:/Users/kent/mysql/bk/mysql-5.0-release
into mysql.com:/Users/kent/mysql/bk/mysql-5.0
2005-12-14 13:18:24 +01:00
ramil@mysql.com
51184adde3 Fix for bug #15630: Test case failure in sp-dynamic, sp-error, and sp. 2005-12-12 15:57:35 +04:00
dlenev@mysql.com
246c12edc4 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/dlenev/src/mysql-5.0-merges
2005-12-07 21:21:54 +03:00
konstantin@mysql.com
4821559e47 Fix a compilation failure. 2005-12-07 21:16:04 +03:00
dlenev@mysql.com
8d1292185c Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/dlenev/src/mysql-5.0-merges
2005-12-07 20:31:10 +03:00
anozdrin@mysql.com
5b981a4844 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/alik/Documents/AllProgs/MySQL/devel/5.0-sp-vars-merge-2
2005-12-07 17:17:42 +03: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
dlenev@mysql.com
b5e21b60d9 Merge mysqldev@production.mysql.com:my/mysql-5.0-release
into  mysql.com:/home/dlenev/src/mysql-5.0-bg11555-2
2005-12-07 14:38:20 +03:00
dlenev@mysql.com
40614adf66 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/dlenev/src/mysql-5.0-bg11555-2
2005-12-07 12:47:25 +03:00
dlenev@mysql.com
06b895c096 Fix for bug #11555 "Stored procedures: current SP tables locking make
impossible view security".

We should not expose names of tables which are explicitly or implicitly (via
routine or trigger) used by view even if we find that they are missing.
So during building of list of prelocked tables for statement we track which
routines (and therefore tables for these routines) are used from views. We
mark elements of LEX::routines set which correspond to routines used in views
by setting Sroutine_hash_entry::belong_to_view member to point to TABLE_LIST
object for topmost view which uses routine. We propagate this mark to all
routines which are used by this routine and which we add to this set. We also
mark tables used by such routine which we add to the list of tables for
prelocking as belonging to this view.
2005-12-07 12:27:17 +03:00
serg@serg.mylan
e4821e3e9d merged 2005-12-07 08:50:14 +01:00
konstantin@mysql.com
712385568f A fix and a test case for Bug#15392 "Server crashes during
prepared statement execute
2005-12-07 00:57:15 +03:00
serg@serg.mylan
6b5320d617 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into serg.mylan:/usr/home/serg/Abk/mysql-5.0
2005-12-05 18:18:56 +01:00
serg@serg.mylan
9c0a8bbd17 this has nothing to do with the bug#13012.
it's about mysql_admin_commands not being reexecution-safe
(and CHECK still isn't)
2005-12-03 15:02:09 +01:00
serg@serg.mylan
b3b72c6329 Bug#13012: REPAIR/BACKUP/RESTORE TABLE cause "packet out of order" in SP.
Mark them properly as result-returning statements
2005-12-02 22:59:45 +01:00
bell@sanja.is.com.ua
b1f0e78146 Merge sanja.is.com.ua:/home/bell/mysql/bk/work-bug1-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-merge1-5.0
2005-12-02 21:20:25 +02:00
bell@sanja.is.com.ua
45e59f3d76 Now we shall store only position (index of first character)
of SELECT from query begining, to be independet of query buffer
allocation.
Correct procedure used to find beginning of the current statement
during parsing (BUG#14885).
2005-12-02 21:18:12 +02:00
ramil@mysql.com
37cfade0b4 Fix for bug #14304: auto_increment field incorrect set from within stored procedure (insert select). 2005-12-01 14:26:46 +04:00
pem@mysql.com
df553710df Merge mysql.com:/usr/local/bk/mysql-5.0
into  mysql.com:/usr/home/pem/bug14643/mysql-5.0
2005-11-28 13:20:15 +01:00
bell@sanja.is.com.ua
db8f03ebe8 Merge sanja.is.com.ua:/home/bell/mysql/bk/work-bug7-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-merge-5.0
2005-11-23 01:28:32 +02:00
bell@sanja.is.com.ua
7bd691f11e Recursion support made for SP (BUG#10100). 2005-11-23 01:11:19 +02:00
bell@sanja.is.com.ua
7d2442a160 Merge sanja.is.com.ua:/home/bell/mysql/bk/work-bug2-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-merge-5.0
2005-11-23 00:58:13 +02:00
bell@sanja.is.com.ua
2bcd68973b Fix for BUG#13549 "Server crash with nested stored procedures
if inner routine has more local variables than outer one, and
one of its last variables was used as argument to NOT operator".

THD::spcont was non-0 when we were parsing stored routine/trigger
definition during execution of another stored routine. This confused
methods of Item_splocal and forced them use wrong runtime context.
Fix ensures that we always have THD::spcont equal to zero during
routine/trigger body parsing. This also allows to avoid problems
with errors which occur during parsing and SQL exception handlers.
2005-11-23 00:50:37 +02:00
pem@mysql.com
6c2f6e29b9 Post-merge fixes in sp_head.cc (print methods). 2005-11-22 14:25:44 +01:00
pem@mysql.com
d71d1242ff Merge mysql.com:/usr/local/bk/mysql-5.0
into  mysql.com:/usr/home/pem/show-sp-code/mysql-5.0
2005-11-22 13:24:53 +01:00
pem@mysql.com
962d2df6b0 Some final cleanup of the sp_instr print methods. 2005-11-22 13:06:52 +01:00
bell@sanja.is.com.ua
7f162c7899 Merge sanja.is.com.ua:/home/bell/mysql/bk/work-bug1-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-merge-5.0
2005-11-21 21:15:48 +02:00
bell@sanja.is.com.ua
806f9e24ff Inefficient usage of String::append() fixed.
Bad examples of usage of a string with its length fixed.
The incorrect length in the trigger file configuration descriptor
  fixed (BUG#14090).
A hook for unknown keys added to the parser to support old .TRG files.
2005-11-20 20:47:07 +02:00
pem@mysql.com
3a832faafe Post-review fixes, mainly fixing all print() methods for sp_instr* classes.
Also added mysql-test files:
 include/is_debug_build.inc
 r/is_debug_build.require
 r/sp-code.result
 t/sp-code.test
2005-11-18 16:30:27 +01:00
pem@mysql.com
c518a2405f Background:
Since long, the compiled code of stored routines has been printed in the trace file
when starting mysqld with the "--debug" flag. (At creation time only, and only in
debug builds of course.) This has been helpful when debugging stored procedure
execution, but it's a bit awkward to use. Also, the printing of some of the
instructions is a bit terse, in particular for sp_instr_stmt where only the command
code was printed.

This improves the printout of several of the instructions, and adds the debugging-
only commands "show procedure code <name>" and "show function code <name>".
(In non-debug builds they are not available.)
2005-11-17 11:11:48 +01:00
dlenev@mysql.com
63fcccb193 Fix for bug #13399 Crash when executing PS/SP which should activate trigger
which is now dropped" and bug #12329 "Bogus error msg when executing PS with
stored procedure after SP was re-created".
2005-11-17 03:51:14 +03:00