fix_fields() was not called for "order by" variables if the type was a
"constant integer", and thus interpreted as a column index.
However, a local variable is an expression and should not be interpreted
as a column index. Instead it behaves just like when using a user variable
for instance (i.e. it will not affect the ordering).
mysql-test/r/sp.result:
Updated results for new test case (BUG#16474).
mysql-test/t/sp.test:
New test case for BUG#16474.
sql/sql_select.cc:
When processing order list,
time per connection
Removed const_string() method from Item_string (it was only used in one
place, in a bad way). Defer possible SP variable, and access data directly
instead, in date_format item.
mysql-test/r/sp.result:
Updated results for new test (BUG#17476).
mysql-test/t/sp.test:
New test case (BUG#17476)
sql/item.h:
Removed const_string() from Item_string.
It was only used in one place, and we can just use str_value in Item directly.
sql/item_timefunc.cc:
Must defer a (possible) local SP variable to use max_length and str_value
in Item_func_date_format::fix_length_and_dec(), and refer to str_value
directly without the const_string() method (now removed); the cast didn't
work in all cases anyway.
(Needed for "list of pushes" web page and autopush)
include/mysql.h:
Fix to embedded server to be able to run tests on it
libmysql/libmysql.c:
Fix to embedded server to be able to run tests on it
libmysqld/emb_qcache.cc:
Fix to embedded server to be able to run tests on it
libmysqld/embedded_priv.h:
Fix to embedded server to be able to run tests on it
libmysqld/lib_sql.cc:
Fix to embedded server to be able to run tests on it
libmysqld/libmysqld.c:
Fix to embedded server to be able to run tests on it
mysql-test/mysql-test-run.sh:
Fix to embedded server to be able to run tests on it
mysql-test/r/binlog.result:
Updated test for embedded server
mysql-test/r/ctype_cp932.result:
Updated test for embedded server
mysql-test/r/innodb.result:
Updated test for embedded server
mysql-test/r/mysqltest.result:
Updated test for embedded server
mysql-test/r/query_cache.result:
Updated test for embedded server
mysql-test/r/query_cache_notembedded.result:
Updated test for embedded server
mysql-test/r/sp-error.result:
Updated test for embedded server
mysql-test/r/sp.result:
Updated test for embedded server
mysql-test/r/subselect.result:
Updated test for embedded server
mysql-test/r/view.result:
Updated test for embedded server
mysql-test/r/view_grant.result:
Updated test for embedded server
mysql-test/t/backup.test:
Updated test for embedded server
mysql-test/t/binlog.test:
Updated test for embedded server
mysql-test/t/blackhole.test:
Updated test for embedded server
mysql-test/t/compress.test:
Updated test for embedded server
mysql-test/t/ctype_cp932.test:
Updated test for embedded server
mysql-test/t/delayed.test:
Updated test for embedded server
mysql-test/t/handler.test:
Updated test for embedded server
mysql-test/t/innodb.test:
Updated test for embedded server
mysql-test/t/mysql.test:
Updated test for embedded server
mysql-test/t/mysql_client_test.test:
Updated test for embedded server
mysql-test/t/mysqltest.test:
Updated test for embedded server
mysql-test/t/query_cache.test:
Updated test for embedded server
mysql-test/t/query_cache_notembedded.test:
Updated test for embedded server
mysql-test/t/read_only.test:
Updated test for embedded server
mysql-test/t/skip_grants.test:
Updated test for embedded server
mysql-test/t/sp-destruct.test:
Updated test for embedded server
mysql-test/t/sp-error.test:
Updated test for embedded server
mysql-test/t/sp-threads.test:
Updated test for embedded server
mysql-test/t/sp.test:
Updated test for embedded server
mysql-test/t/subselect.test:
Updated test for embedded server
mysql-test/t/temp_table.test:
Updated test for embedded server
mysql-test/t/view.test:
Updated test for embedded server
mysql-test/t/view_grant.test:
Updated test for embedded server
mysql-test/t/wait_timeout.test:
Updated test for embedded server
mysys/mf_dirname.c:
Review fix: Don't access data outside of array
mysys/my_bitmap.c:
Remove compiler warnings
scripts/mysql_fix_privilege_tables.sql:
Add flush privileges to .sql script so that one doesn't have to reboot mysqld when one runs the mysql_fix_privilege_script
sql-common/client.c:
Updated test for embedded server
sql/item.cc:
Remove DBUG_PRINT statement that can cause crashes when running with --debug
sql/mysqld.cc:
Fix to embedded server to be able to run tests on it
sql/protocol.cc:
Fix to embedded server to be able to run tests on it
(Trivial reconstruction of code)
sql/protocol.h:
Fix to embedded server to be able to run tests on it
sql/sql_base.cc:
Better comment
sql/sql_class.cc:
Fix to embedded server to be able to run tests on it
sql/sql_class.h:
Fix to embedded server to be able to run tests on it
sql/sql_cursor.cc:
Fix to embedded server to be able to run tests on it
sql/sql_parse.cc:
Fix to embedded server to be able to run tests on it
Don't crash for disabled commands when using embedded server
sql/sql_prepare.cc:
Fix to embedded server to be able to run tests on it
mysql-test/r/ctype_cp932_notembedded.result:
New BitKeeper file ``mysql-test/r/ctype_cp932_notembedded.result''
mysql-test/r/innodb_notembedded.result:
New BitKeeper file ``mysql-test/r/innodb_notembedded.result''
mysql-test/r/sp.result.orig:
New BitKeeper file ``mysql-test/r/sp.result.orig''
mysql-test/r/sp_notembedded.result:
New BitKeeper file ``mysql-test/r/sp_notembedded.result''
mysql-test/r/subselect_notembedded.result:
New BitKeeper file ``mysql-test/r/subselect_notembedded.result''
mysql-test/t/ctype_cp932_notembedded.test:
New BitKeeper file ``mysql-test/t/ctype_cp932_notembedded.test''
mysql-test/t/innodb_notembedded.test:
New BitKeeper file ``mysql-test/t/innodb_notembedded.test''
mysql-test/t/sp.test.orig:
New BitKeeper file ``mysql-test/t/sp.test.orig''
mysql-test/t/sp_notembedded.test:
New BitKeeper file ``mysql-test/t/sp_notembedded.test''
mysql-test/t/subselect_notembedded.test:
New BitKeeper file ``mysql-test/t/subselect_notembedded.test''
A follow-up to BUG#15011 (already fixed).
mysql-test/r/sp.result:
Updated results for new handler tests.
mysql-test/t/sp.test:
Additional tests for nested handlers.
The problem was a code generation bug: cpop instructions were not generated
when using ITERATE back to an outer block from a context with a declared
cursor; this would make it push a new cursor without popping in-between,
eventually overrunning the cursor stack with a crash as the result.
Fixed the calculation of how many cursors to pop (in sp_pcontext.cc:
diff_cursors()), and also corrected diff_cursors() and diff_handlers()
to when doing a "leave"; don't include the last context we're leaving
(we are then jumping to the appropriate pop instructions).
mysql-test/r/sp.result:
Updated result for new test case (BUG#16887)
mysql-test/t/sp.test:
New test case for BUG#16887
sql/sp_pcontext.cc:
Added new parameter to sp_pcontext::diff_handlers() and diff_cursors():
They can either include (for iterate jumps) or exclude (for leave jumps)
the outer context.
Fixed bug in diff_cursors(); it was just plain wrong and would return
zero in some situations when it shouldn't.
sql/sp_pcontext.h:
Added new parameter to sp_pcontext::diff_handlers() and diff_cursors():
They can either include (for iterate jumps) or exclude (for leave jumps)
the outer context.
sql/sql_yacc.yy:
Added parameter to diff_handlers/diff_cursors depending on if it's an
iterate or leave jump.
For "leave", we don't have to include the last context we're leaving since
we will jump to the appropriate pop instructions.
into mysql.com:/extern/mysql/work/bug16568/mysql-5.0
mysql-test/r/sp.result:
Auto merged
mysql-test/t/sp.test:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sp_head.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
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.
mysql-test/r/sp.result:
Updated results for BUG#16568 (affects results for bug14643_2 and bug14498_4)
mysql-test/t/sp.test:
Enabled test bug14498_4 for BUG#16568.
sql/sp_head.cc:
Changed type of some parameters and variables (sp_instr_opt_meta instead of sp_instr_jump*).
Added consistency check of m_ip member in instructions in sp_head::show_routine_code().
Updated print() method of, and added opt_mark() and opt_move() methods to
sp_instr_set_case_expr, to handle the new continuation destination.
sql/sp_head.h:
New abstract class between sp_instr and instructions with destinations, in particular
sp_instr_set_case_expr, for continuation destination handling.
Changed type of some parameters and variables (sp_instr_opt_meta instead of sp_instr_jump*).
Added opt_mark(), opt_move() and set_destination() methods to
sp_instr_set_case_expr.
sql/sql_parse.cc:
Fixed small bug at show_routine_code() call (tested return value the wrong way).
sql/sql_yacc.yy:
sp_instr_set_case_expr is now added to backpatch list (for the new cont. destination).
For nested sql errno handlers (unlike sqlexception and other), we didn't stop
searching when the innermost handler was found - now make sure we do.
mysql-test/r/sp.result:
Updated result for BUG#15011.
mysql-test/t/sp.test:
New testcase for BUG#15011.
sql/sp_rcontext.cc:
Make sure we stop at the innermost sql_errno handler.
Lowered the parameter to 10, and also renamed non-standard table names to t3.
mysql-test/r/sp.result:
Updated results.
mysql-test/r/sp_trans.result:
Updated results.
mysql-test/t/sp.test:
Renamed fac, primes and fib tables to t3.
Lowered fib() test parameter to 10 (20 hit the stack overrun check on some machines).
mysql-test/t/sp_trans.test:
Added drop of t3 for safety. (Might be left from sp.test after certain test failures.)
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.
mysql-test/r/sp.result:
Added test for bug #12198 "Temporary table aliasing does not work inside stored
functions" and other tests which cover handling of temporary tables in prelocked
mode.
mysql-test/t/sp.test:
Added test for bug #12198 "Temporary table aliasing does not work inside stored
functions" and other tests which cover handling of temporary tables in prelocked
mode.
sql/sp_head.cc:
sp_head::merge_table_list():
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.
Make the distinction between "exception conditions" and "completion
conditions" (warning and "no data") as defined by the standard. The latter
should not terminate a routine if no handler is found in the lexical scope.
mysql-test/r/sp.result:
New test case for BUG#15231.
Moved part of the test for BUG#7049 to the new testcase (since it was actually
an example of 15231).
mysql-test/t/sp.test:
New test case for BUG#15231.
Moved part of the test for BUG#7049 to the new testcase (since it was actually
an example of 15231).
sql/sp_rcontext.cc:
Only search for matching condition handlers in caller's contexts if it's
an exception conditition.
to Crash": the bug was that due to non-standard name
resolution precedence in stored procedures (See Bug#5967)
a stored procedure variable took precedence over a table column
when the arguments for VALUES() function were resolved.
The implementation of VALUES() function was not designed to work
with Item_splocal and crashed.
VALUES() function is non-standard. It can refer to, and
is meaningful for, table columns only. The patch disables SP
variables as possible arguments of VALUES() function.
mysql-test/r/sp.result:
Test results fixed (Bug#15441).
Also make sure that the recently added test cases follow sp.test
internal tests standard.
mysql-test/t/sp.test:
Add a test case for Bug#15441 "Running SP causes Server to Crash".
sql/item.cc:
Cleanup Item_insert_value::fix_fields().
sql/item.h:
Add a comment for Item_insert_value.
sql/sql_yacc.yy:
Actual fix for Bug#15441 "Running SP causes Server to Crash":
we should not allow VALUES() function to reference SP variables.
into mysql.com:/home/alik/Documents/AllProgs/MySQL/devel/5.0-sp-vars-merge-2
mysql-test/r/sp.result:
Auto merged
mysql-test/t/sp.test:
Auto merged
sql/field.cc:
Auto merged
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/sp_head.cc:
Merge.
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;
mysql-test/r/ctype_ujis.result:
Explicitly specify correct charset.
mysql-test/r/schema.result:
Drop our test database to not affect this test if some test
left it cause of failure.
mysql-test/r/show_check.result:
Drop our test database to not affect this test if some test
left it cause of failure.
mysql-test/r/skip_name_resolve.result:
Ignore columns with unpredictable values.
mysql-test/r/sp-big.result:
Add cleanup statement.
mysql-test/r/sp-dynamic.result:
Add cleanup statements.
mysql-test/r/sp.result:
Update result file.
mysql-test/r/sum_distinct-big.result:
Update result file.
mysql-test/r/type_newdecimal-big.result:
Update result file.
mysql-test/t/ctype_ujis.test:
Explicitly specify correct charset.
mysql-test/t/schema.test:
Drop our test database to not affect this test if some test
left it cause of failure.
mysql-test/t/show_check.test:
Drop our test database to not affect this test if some test
left it cause of failure.
mysql-test/t/skip_name_resolve.test:
Ignore columns with unpredictable values.
mysql-test/t/sp-big.test:
Add cleanup statement.
mysql-test/t/sp-dynamic.test:
Add cleanup statements.
mysql-test/t/sp.test:
Non-scalar values prohibited for assignment to SP-vars;
polishing.
mysql-test/t/type_newdecimal-big.test:
Update type specification so that the variables
can contain the large values used in the test.
sql/field.cc:
Extract create_field::init() to initialize an existing
instance of create_field from new_create_field().
sql/field.h:
Extract create_field::init() to initialize an existing
instance of create_field from new_create_field().
sql/item.cc:
- Introduce a new class: Item_sp_variable -- a base class
of stored-routine-variables classes;
- Introduce Item_case_expr -- an Item, which is used to access
to the expression of CASE statement;
sql/item.h:
- Introduce a new class: Item_sp_variable -- a base class
of stored-routine-variables classes;
- Introduce Item_case_expr -- an Item, which is used to access
to the expression of CASE statement;
sql/item_func.cc:
Pass the Field (instead of Item) for the return value of
a function to the function execution routine.
sql/item_func.h:
Pass the Field (instead of Item) for the return value of
a function to the function execution routine.
sql/mysql_priv.h:
Move create_virtual_tmp_table() out of sql_select.h.
sql/sp.cc:
Use create_result_field() instead of make_field().
sql/sp_head.cc:
- Add a function to map enum_field_types to Item::Type;
- Add sp_instr_push_case_expr instruction -- an instruction
to push CASE expression into the active running context;
- Add sp_instr_pop_case_expr instruction -- an instruction
to pop CASE expression from the active running context;
- Adapt the SP-execution code to using Fields instead of Items
for SP-vars;
- Use create_field structure for field description instead of
a set of members.
sql/sp_head.h:
- Add a function to map enum_field_types to Item::Type;
- Add sp_instr_push_case_expr instruction -- an instruction
to push CASE expression into the active running context;
- Add sp_instr_pop_case_expr instruction -- an instruction
to pop CASE expression from the active running context;
- Adapt the SP-execution code to using Fields instead of Items
for SP-vars;
- Use create_field structure for field description instead of
a set of members.
sql/sp_pcontext.cc:
- Change rules to assign an index of SP-variable: use
transparent index;
- Add an operation to retrieve a list of defined SP-vars
from the processing context recursively.
sql/sp_pcontext.h:
- Change rules to assign an index of SP-variable: use
transparent index;
- Add an operation to retrieve a list of defined SP-vars
from the processing context recursively.
sql/sp_rcontext.cc:
- Change rules to assign an index of SP-variable: use
transparent index;
- Use a tmp virtual table to store SP-vars instead of Items;
- Provide operations to work with CASE expresion.
sql/sp_rcontext.h:
- Change rules to assign an index of SP-variable: use
transparent index;
- Use a tmp virtual table to store SP-vars instead of Items;
- Provide operations to work with CASE expresion.
sql/sql_class.cc:
- Reflect Item_splocal ctor changes;
- Item_splocal::get_offset() has been renamed to get_var_idx().
sql/sql_class.h:
Polishing.
sql/sql_parse.cc:
Extract create_field::init() to initialize an existing
instance of create_field from new_create_field().
sql/sql_select.cc:
Take care of BLOB columns in create_virtual_tmp_table().
sql/sql_select.h:
Move create_virtual_tmp_table() out of sql_select.h.
sql/sql_trigger.cc:
Use boolean constants for boolean type instead of numerical ones.
sql/sql_yacc.yy:
Provide an instance of create_field for each SP-var.
mysql-test/include/sp-vars.inc:
The definitions of common-procedures, which are created
under different circumstances.
mysql-test/r/sp-vars.result:
Result file for the SP-vars test.
mysql-test/sp-vars.test:
A new test for checking SP-vars functionality.
prepared statement execute
mysql-test/r/sp.result:
Test results fixed: a fix for Bug#15392
mysql-test/t/sp.test:
A test case for Bug#15392 "Server crashes during prepared
statement execute". No test case for error in
Item_func_set_user_var::update as the only possible one is OOM.
sql/sp_head.cc:
A fix for Bug#15392 "Server crashes during prepared statement
execute": the bug was caused by mysql_change_db() call
which was overwriting the error state of 'ret'.
Later in the code, suv->fix_fields() would discover
thd->net.report_error and return it without completing
its work. As the return value of fix_fields() was ignored,
the server would afterwards crash in suv->update().
The fix makes sure that a possible internal error
is raised in reset_lex_and_exec_core and then is
handled in sp_head::execute_procedure.
mysql-test/r/sp-error.result:
Auto merged
mysql-test/t/sp.test:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/share/errmsg.txt:
SCCS merged
into mysql.com:/usr/home/pem/bug14233/mysql-5.0
mysql-test/r/sp-error.result:
Auto merged
mysql-test/t/sp.test:
Auto merged
sql/sp.cc:
Auto merged
sql/sp.h:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_trigger.h:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/share/errmsg.txt:
SCCS merged
it's about mysql_admin_commands not being reexecution-safe
(and CHECK still isn't)
mysql-test/r/sp-error.result:
optimize is now allowed in SP
mysql-test/r/sp.result:
test repair/optimize/analyze in SP
mysql-test/t/backup.test:
clean up after itself
mysql-test/t/sp-error.test:
optimize is now allowed in SP
mysql-test/t/sp.test:
test repair/optimize/analyze in SP
sql/sp_head.cc:
all mysql_admin commands return result set
sql/sql_parse.cc:
all mysql_admin commands modify table list and we should restore it for SP
sql/sql_table.cc:
optimization - don't execute views when no view is expected/allowed
sql/sql_yacc.yy:
optimize is now allowed in SP
sql/sp_head.cc:
Fix for bug #14304: auto_increment field incorrect set from within stored procedure (insert select).
- call thd->cleanup_after_query() to clean next_insert_id.
sql/sql_class.cc:
Fix for bug #14304: auto_increment field incorrect set from within stored procedure (insert select).
- save/restore clear_next_insert_id
sql/sql_class.h:
Fix for bug #14304: auto_increment field incorrect set from within stored procedure (insert select).
- clear_next_insert_id added
earlier because of various features/checks missing (these features/checks
are now implemented).
mysql-test/r/sp.result:
Enabled back bunch of tests which were previously disabled because of various
features/checks missing (since these features/checks are now implemented).
mysql-test/t/sp.test:
Enabled back bunch of tests which were previously disabled because of various
features/checks missing (since these features/checks are now implemented).
mysql-test/t/sp.test:
Tidying up after merge.
sql/mysqld.cc:
Make sure we have thd->thread_stack set before calling store_globals().
(And fixed compiler warning.)
sql/sql_class.cc:
Init THD::tread_stack in constructor.
Don't set thd->is_fatal_error in sql_update for duplicate key errors.
mysql-test/r/sp.result:
New test case for BUG#13729.
mysql-test/r/sp_trans.result:
New test case for BUG#14840.
mysql-test/t/sp.test:
New test case for BUG#13729.
mysql-test/t/sp_trans.test:
New test case for BUG#14840.
sql/sql_update.cc:
Don't set thd->is_fatal_error if it's a duplicate key error.
into sanja.is.com.ua:/home/bell/mysql/bk/work-merge-5.0
mysql-test/r/sp-error.result:
Auto merged
mysql-test/r/trigger.result:
Auto merged
mysql-test/t/sp-error.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/t/trigger.test:
Auto merged
sql/item_func.cc:
Auto merged
sql/mysqld.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sp_head.h:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_parse.cc:
Auto merged
mysql-test/r/sp.result:
merge
sql/share/errmsg.txt:
merge
client/mysqltest.c:
An expected error messages hiding from the log if disable_result_log is in force.
mysql-test/r/sp-dynamic.result:
The test expanded for case of allowed/disalowed recursion.
mysql-test/r/sp-error.result:
Error messages changed.
Test of bug11394() made with allowed recursion.
mysql-test/r/sp.result:
Tests for recursion.
mysql-test/r/trigger.result:
Check that triggers are not affected by this patch.
mysql-test/r/variables.result:
Test of max_sp_recursion_depth variable.
mysql-test/t/sp-dynamic.test:
The test expanded for case of allowed/disalowed recursion.
mysql-test/t/sp-error.test:
Error messages changed.
Test of bug11394() made with allowed recursion.
mysql-test/t/sp.test:
Tests for recursion.
mysql-test/t/trigger.test:
Check that triggers are not affected by this patch.
mysql-test/t/variables.test:
Test of max_sp_recursion_depth variable.
sql/item_func.cc:
sp_find_function() and sp_find_procedure() joined to sp_find_routine()
function as it was mentioned in TODO.
sql/mysqld.cc:
max_sp_recursion_depth variable added.
sql/set_var.cc:
max_sp_recursion_depth variable added.
sql/share/errmsg.txt:
An error message changed.
An error message added.
sql/sp.cc:
sp_find_function() and sp_find_procedure() joined to sp_find_routine()
function as it was mentioned in TODO.
Temory LEX is allocated on a stack, not on a heap.
Recursion support added for stored procedures.
sql/sp.h:
sp_find_function() and sp_find_procedure() joined to sp_find_routine()
function as it was mentioned in TODO.
sql/sp_head.cc:
Initialization of new sp_head fields to get correct list of instances
contained one instance only.
Stack requirement for SP instruction is increased.
Stack free space is checked before mem root initialisation to avoid
memory leak.
Pointer to the free instance management added before and after
SP execution.
sql/sp_head.h:
New sp_head variables added to support inst of instances of SP
for recursion and pointer on ths first free to use instance.
sql/sql_base.cc:
open_table() consume a lot of stack space so we check free stack space before it.
sql/sql_class.h:
max_sp_recursion_depth variable added.
sql/sql_parse.cc:
sp_find_function() and sp_find_procedure() joined to sp_find_routine()
function as it was mentioned in TODO.
into sanja.is.com.ua:/home/bell/mysql/bk/work-merge-5.0
sql/item.h:
Auto merged
sql/protocol.cc:
Auto merged
sql/sp.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_trigger.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
mysql-test/r/sp.result:
merge
mysql-test/r/trigger.result:
merge
mysql-test/t/sp.test:
merge
mysql-test/t/trigger.test:
merge
sql/item.cc:
merge
sql/sp_rcontext.h:
merge
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.
mysql-test/r/sp.result:
Test suite for bug#13549.
mysql-test/r/trigger.result:
Test suite for bug#13549.
mysql-test/t/sp.test:
Test suite for bug#13549.
mysql-test/t/trigger.test:
Test suite for bug#13549.
sql/item.cc:
Protection against using wrong context by SP local variable.
sql/item.h:
Protection against using wrong context by SP local variable.
sql/protocol.cc:
An incorrect macro name fixed.
sql/protocol.h:
An incorrect macro name fixed.
sql/sp.cc:
Do not allow SP which we are parsing to use other SP
context (BUG#13549).
sql/sp_head.cc:
Protection against using wrong context by SP local variable.
sql/sp_rcontext.h:
Protection against using wrong context by SP local variable.
sql/sql_cache.h:
An incorrect macro name fixed.
sql/sql_class.cc:
Protection against using wrong context by SP local variable.
sql/sql_class.h:
Protection against using wrong context by SP local variable.
sql/sql_trigger.cc:
Do not allow Trigger which we are parsing to use
other SP context (BUG#13549).
sql/sql_yacc.yy:
Protection against using wrong context by SP local variable.
when COUNT(*) is 0". The bug itself cannot be repeated.
mysql-test/r/sp.result:
Test results were fixed (Bug#14845)
mysql-test/t/sp.test:
An SQL language test case for Bug#14845
tests/mysql_client_test.c:
A test case for Bug#14845
in the function body
Changed the way the end of query was found from the lex state.
The routine body was not extracted correctly when using the
/*!version ... */ wrapper (in dump files); for some types of routines
(e.g. with a label at the first begin), the trailing "*/" was not skipped.
mysql-test/r/sp.result:
New test case for BUG#14723.
mysql-test/t/sp.test:
New test case for BUG#14723.
sql/sp_head.cc:
Changed the way the end of the definition and body is found from the lex state.
In the case of /*!version */ wrappers we must take the trailing " */" into account.
initialization crashes server.
Make sure variables are initialized to something (like null) when
the default initialization fails and a continue handler is in effect.
mysql-test/r/sp.result:
New test case for BUG#14643.
mysql-test/t/sp.test:
New test case for BUG#14643.
sql/sp_head.cc:
Make sure variables are initialized to something (like null) when
the default initialization fails and a continue handler is in effect.
If this also fails (out of memory), we have to abort without letting
the handler catch.
The problem was to continue at the right place in the code after the
test expression in a flow control statement fails with an exception
(internally, the test in sp_instr_jump_if_not), and the exception is
caught by a continue handler. Execution must then be resumed after the
the entire flow control statement (END IF, END WHILE, etc).
mysql-test/r/sp.result:
New test case for BUG#14498.
mysql-test/t/sp.test:
New test case for BUG#14498.
(Note that one call is disabled at the moment. Depends on BUG#14643.)
sql/sp_head.cc:
Added a continuation destination for sp_instr_jump_if_not, for the case when
an error in the test expression causes a continue handler to catch.
This includes new members in sp_instr_jump_if_not, adjustment of the optmizer
(mark and move methods), and separate backpatching code (since we can't use
the normal one for this).
Also removed the class sp_instr_jump, since it's never used.
...and added some comments to the optimizer.
sql/sp_head.h:
Added a continuation destination for sp_instr_jump_if_not, for the case when
an error in the test expression causes a continue handler to catch.
This includes new members in sp_instr_jump_if_not, adjustment of the optmizer
(mark and move methods), and separate backpatching code (since we can't use
the normal one for this).
Also removed the class sp_instr_jump, since it's never used.
sql/sql_yacc.yy:
Added backpatching of the continue destination for all conditional statements
(using sp_instr_jump_if_not).
large table gives server crash": make sure that when a MyISAM temporary
table is created for a cursor, it's created in its memory root,
not the memory root of the current query.
mysql-test/r/sp.result:
Test results fixed: a test case for Bug#14210
mysql-test/t/sp.test:
A test case for Bug#14210 "Simple query with > operator on large table
gives server crash"
sql/handler.cc:
- rewrite get_new_handler to accept a memory root and use it for
sql/handler.h:
- get_new_handler declaration changed
sql/opt_range.cc:
- get_new_handler declaration changed
sql/sql_base.cc:
- get_new_handler declaration changed
sql/sql_select.cc:
- the actual fix for Bug#14210. In create_myisam_from_heap we should
create the new table handler in TABLE::mem_root, not in THD::mem_root:
the latter is freed shortly after cursor is open.
- adjust create_tmp_table to explicitly supply &table->mem_root
to get_new_handler when creating a handler for a new temporary table
sql/sql_table.cc:
- get_new_handler declaration changed
sql/table.cc:
- get_new_handler declaration changed
sql/unireg.cc:
- get_new_handler declaration changed
tests/mysql_client_test.c:
A test case for Bug#14210 "Simple query with > operator on large table
gives server crash": a C API test case is worth adding because of different
memory allocation/freeing patterns in handling of C API and SP cursors
Added finer scope control for default clauses of local variable
declarations.
mysql-test/r/sp.result:
New test case for BUG#14376.
mysql-test/t/sp.test:
New test case for BUG#14376.
sql/sp_pcontext.cc:
Added boundary variable for local parameters/variables,
for better scope control of default values.
sql/sp_pcontext.h:
Added boundary variable for local parameters/variables,
for better scope control of default values.
sql/sql_yacc.yy:
Make the variables of the current DECLARE "invisible" to its DEFAULT clause.