Added a simple optimizer that shortcuts jumps and skip unused instructions.
sql/sp.cc:
Optimize the code after parsing.
sql/sp_head.cc:
Added a simple optimizer that shortcuts jumps and skip unused instructions.
sql/sp_head.h:
Added a simple optimizer that shortcuts jumps and skip unused instructions.
Simply disallow it, just as we disallow creation of routines from within
other SPs.
include/mysqld_error.h:
New error code for when attempting to drop a stored routine from within
another stored routine.
mysql-test/r/sp-error.result:
New test case for BUG#4344.
mysql-test/t/sp-error.test:
New test case for BUG#4344.
sql/share/czech/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/danish/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/dutch/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/english/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/estonian/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/french/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/german/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/greek/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/hungarian/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/italian/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/japanese/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/korean/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/norwegian-ny/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/norwegian/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/polish/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/portuguese/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/romanian/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/russian/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/serbian/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/slovak/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/spanish/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/swedish/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/share/ukrainian/errmsg.txt:
New error message for when attempting to drop a stored routine from within
another stored routine.
sql/sql_yacc.yy:
Don't allow drop function/procedure from within another function/procedure.
at least partially. It doesn't crash or give packets out of order
any more, but it's unclear why it doesn't actually return anything
from within an SP. This should be investigated at some point, but
for the moment this will have to do. (It is a rather obscure feature... :)
mysql-test/r/sp.result:
Test case for BUG#4318.
mysql-test/t/sp.test:
Test case for BUG#4318.
sql/sql_yacc.yy:
Recognize HANDLER READ as another statement that might result in multiple results.
(including one which may explain autobuild's failure of yesterday)
client/mysqlbinlog.cc:
- In mysqlbinlog, we should not reset the Format event when we see Rotate. If a binlog started with a Format event, it is not going to switch later to 4.0 format.
I had already did the same fix in Rotate_log_event::exec_event() in replication.
- Fix for a merge bug.
sql/log_event.cc:
An event with an uninited catalog (read from a 4.x server) is not the same as an event with a NULL catalog
(5.0 server which did not specify catalog), the difference is that they are not in the same format;
so I introduce a way to know if the catalog has been inited or not. This fixes a rpl_trunc_binlog failure
I had.
When we leave Load_log_event::exec_event(), we must reset thd->catalog to 0, like we already do
in Query_log_event::exec_event(). This fixes a Valgrind error which popped in rpl_charset (which may
be what caused autobuild to crash yesterday).
And a fix for event's parsing (the position was always computed right because start_dup==end is always true
and will until we add new string members to Query_log_event.
sql/log_event.h:
catalog_len changed from uint to int to allow -1, which means "not inited"
(I preferred to do it like this rather than create a new bool var Query_log_event::catalog_inited
like we have in Query_log_event::sql_mode_inited; that's because catalog will not use the whole range of int,
so it's allowed to pick -1 as a special value and have only one var.
sql/slave.cc:
comments
mysqld crashes on CREATE TABLE in a database with corrupted db.opt file.
Bug#4646
sql/sql_db.cc:
mysqld crashes on CREATE TABLE in a database with corrupted db.opt file.
Bug#4646
mysql-test/r/view.result:
using VIEW fields several times in query resolved via temporary tables
mysql-test/t/view.test:
using VIEW fields several times in query resolved via temporary tables
sql/item.h:
fixed using of result_field by Item_ref
sql/sql_base.cc:
Create Item_ref as reference on VIEW fields expression reference
sql/sql_insert.cc:
privent creating Item_ref in insert list (where Item_fields should be)
sql/sql_lex.cc:
Item_ref creation control
sql/sql_lex.h:
Item_ref creation control
sql/sql_update.cc:
privent creating Item_ref in insert list (where Item_fields should be) and creation Item_fields for UPDATE list
sql/table.cc:
Do not create Item_ref for internal view of view processing
mysql-test/r/view.result:
fixed ps variavles test
test of view built over updatable view
mysql-test/t/view.test:
fixed ps variavles test
test of view built over updatable view
sql/sql_acl.cc:
mpre optimal locking (found by Monty)
sql/sql_view.cc:
made different fields for view updatebility in principle and updatability during this execution
sql/table.h:
made different fields for view updatebility in principle and updatability during this execution
Sub-CALLs of procedures zapped thd->current_arena for good.
mysql-test/r/sp.result:
New test case for BUG#4579.
mysql-test/t/sp.test:
New test case for BUG#4579.
sql/sp_head.cc:
Keep and restore old thd->current_arena before/after executing an SP,
instead of just setting it to 0 afterwards.
mysql-test/r/view.result:
check 'use index' on view with temporary table
mysql-test/t/view.test:
check 'use index' on view with temporary table
sql/sql_base.cc:
privent crash on temporary table
mysql-test/r/ps_1general.result:
Auto merged
mysql-test/r/ps_2myisam.result:
Auto merged
mysql-test/r/ps_3innodb.result:
Auto merged
mysql-test/r/ps_4heap.result:
Auto merged
mysql-test/r/ps_5merge.result:
Auto merged
mysql-test/r/ps_6bdb.result:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_select.cc:
Auto merged
new tests to ensure that prepared statement *really* work
(and that MySQL not picks up some number from arbitrary location
that happens to match the parameter's value)
mysql-test/include/ps_query.inc:
new tests to ensure that prepared statement *really* work
(and that MySQL not picks up some number from arbitrary location
that happens to match the parameter's value)
mysql-test/r/ps_2myisam.result:
results updated
mysql-test/r/ps_3innodb.result:
results updated
mysql-test/r/ps_4heap.result:
results updated
mysql-test/r/ps_5merge.result:
results updated
mysql-test/r/ps_6bdb.result:
results updated
sql/sql_select.cc:
don't shortcut - it backfires!
(in particular - when itemptr is Item_param :)
We now get an run-time error instead of a crash (although a slightly misleading
error message, but it's an improvement).
mysql-test/r/sp-error.result:
New test case for BUG#2653.
mysql-test/t/sp-error.test:
New test case for BUG#2653.
sql/sp_head.cc:
Detect failed evals (fix item really), which are due to unresolved variables/fields.
Typically this would be a reference to an undeclared variable.
(Also got rid of some compiler warnings.)
sql/sp_rcontext.cc:
Detect failed evals (fix item really), which are due to unresolved variables/fields.
Typically this would be a reference to an undeclared variable.
sql/sp_rcontext.h:
Changed return type to int, so be able to detect failed evals (fix item).
sql/sql_class.cc:
Changed return type to int, so be able to detect failed evals (fix item).
mysql-test/r/view.result:
test of duplicate field names
mysql-test/t/view.test:
test of duplicate field names
sql/sql_view.cc:
test of duplicate field names
error handling of view initialization fixed (Bug#4599)
include/mysqld_error.h:
new error message
mysql-test/r/view.result:
changing of underlaying table test
mysql-test/t/view.test:
changing of underlaying table test
sql/share/czech/errmsg.txt:
new error message
sql/share/danish/errmsg.txt:
new error message
sql/share/dutch/errmsg.txt:
new error message
sql/share/english/errmsg.txt:
new error message
sql/share/estonian/errmsg.txt:
new error message
sql/share/french/errmsg.txt:
new error message
sql/share/german/errmsg.txt:
new error message
sql/share/greek/errmsg.txt:
new error message
sql/share/hungarian/errmsg.txt:
new error message
sql/share/italian/errmsg.txt:
new error message
sql/share/japanese/errmsg.txt:
new error message
sql/share/korean/errmsg.txt:
new error message
sql/share/norwegian-ny/errmsg.txt:
new error message
sql/share/norwegian/errmsg.txt:
new error message
sql/share/polish/errmsg.txt:
new error message
sql/share/portuguese/errmsg.txt:
new error message
sql/share/romanian/errmsg.txt:
new error message
sql/share/russian/errmsg.txt:
new error message
sql/share/serbian/errmsg.txt:
new error message
sql/share/slovak/errmsg.txt:
new error message
sql/share/spanish/errmsg.txt:
new error message
sql/share/swedish/errmsg.txt:
new error message
sql/share/ukrainian/errmsg.txt:
new error message
sql/sql_base.cc:
error message interception
error handling fixed
sql/sql_view.cc:
comment fixed
error message interception
sql/table.cc:
error message interception
sql/table.h:
error message interception
client code and replication slave code, as far as LOAD DATA INFILE and
other queries' execution is concerned. Duplication of code leads to
replication bugs, because the replication duplicate lags much behind.
Fix for 2 Valgrind errors on slave replicating LOAD DATA INFILE
- one serious (causing a random test failure in rpl_loaddata in 5.0)
- one not serious (theoretically a bug but not dangerous): uninited thd->row_count
sql/log_event.cc:
Fix for 2 Valgrind errors:
- one serious (causing a random test failure in rpl_loaddata in 5.0): uninited lex in replic of LOAD DATA INFILE on slave
- one not serious (theoretically a bug but not dangerous): uninited thd->row_count in replication of LOAD DATA INFILE on slave.
Sanja is likely to rework the fix to the 1st problem tomorrow.
sql/item_sum.cc:
"unused variable" warning
sql/item_timefunc.cc:
"unused variable" warning
sql/log_event.h:
const bool is_valid() -> bool is_valid() const
sql/opt_range.cc:
cast log's argument to double (otherwise an error on some compilers)
sql/opt_range.h:
get_quick_select_for_ref should be declared in the global scope to be visible.