This patch reverts a change introduced by Bug 6951, which incorrectly
set thd->abort_on_warning for stored procedures.
As per internal discussions about the SQL_MODE=TRADITIONAL,
the correct behavior is to *not* abort on warnings even inside an INSERT/UPDATE
trigger.
Tests for Stored Procedures, Stored Functions, Triggers involving SQL_MODE
have been included or revised, to reflect the intended behavior.
(reposting approved patch, to work around source control issues, no review needed)
mysql-test/include/sp-vars.inc:
Tests for SQL_MODE='TRADITIONAL'
mysql-test/r/sp-vars.result:
Tests for SQL_MODE='TRADITIONAL'
mysql-test/r/sp.result:
Tests for SQL_MODE='TRADITIONAL'
mysql-test/r/trigger.result:
Tests for SQL_MODE='TRADITIONAL'
mysql-test/t/sp-vars.test:
Tests for SQL_MODE='TRADITIONAL'
mysql-test/t/sp.test:
Tests for SQL_MODE='TRADITIONAL'
mysql-test/t/trigger.test:
Tests for SQL_MODE='TRADITIONAL'
sql/sp_head.cc:
For SQL_MODE='TRADITIONAL',
thd->abort_on_warning should be set only when assigning a *column*
into neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
mysql-test/r/innodb_mysql.result:
Auto merged
mysql-test/t/innodb_mysql.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/r/create.result:
Merge
mysql-test/t/create.test:
Merge
mysql-test/t/view.test:
Remove the disable_warnings part as engine=innodb has been removed
The syntax of the CALL statement, to invoke a stored procedure, has been
changed to make the use of parenthesis optional in the argument list.
With this change, "CALL p;" is equivalent to "CALL p();".
While the SQL spec does not explicitely mandate this syntax, supporting it
is needed for practical reasons, for integration with JDBC / ODBC connectors.
Also, warnings in the sql/sql_yacc.yy file, which were not reported by Bison 2.1
but are now reported by Bison 2.2, have been fixed.
The warning found were:
bison -y -p MYSQL -d --debug --verbose sql_yacc.yy
sql_yacc.yy:653.9-18: warning: symbol UNLOCK_SYM redeclared
sql_yacc.yy:656.9-17: warning: symbol UNTIL_SYM redeclared
sql_yacc.yy:658.9-18: warning: symbol UPDATE_SYM redeclared
sql_yacc.yy:5169.11-5174.11: warning: unused value: $2
sql_yacc.yy:5208.11-5220.11: warning: unused value: $5
sql_yacc.yy:5221.11-5234.11: warning: unused value: $5
conflicts: 249 shift/reduce
"unused value: $2" correspond to the $$=$1 assignment in the 1st {} block
in table_ref -> join_table {} {},
which does not procude a result ($$) for the rule but an intermediate $2
value for the action instead.
"unused value: $5" are similar, with $$ assignments in {} actions blocks
which are not for the final reduce.
mysql-test/r/sp.result:
New test case for Bug#21462
mysql-test/t/sp.test:
New test case for Bug#21462
sql/sql_yacc.yy:
"CALL p;" syntax for calling a stored procedure
Fixed bison 2.2 warnings.
into neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
mysql-test/r/mysqltest.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
BitKeeper/deleted/.del-mtr_stress.pl:
Auto merged
mysql-test/r/ps_6bdb.result:
Auto merged
mysql-test/r/ps_7ndb.result:
Auto merged
mysql-test/r/query_cache.result:
Auto merged
mysql-test/r/subselect.result:
Auto merged
mysql-test/t/mysqltest.test:
Auto merged
mysql-test/t/ps.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/t/subselect.test:
Auto merged
BitKeeper/deleted/.del-mtr_im.pl:
Delete: mysql-test/lib/mtr_im.pl
client/mysqltest.c:
Use remote
mysql-test/mysql-test-run.pl:
Use remote
mysql-test/lib/mtr_process.pl:
Use remote
into neptunus.(none):/home/msvensson/mysql/mysql-5.1-new-maint
BitKeeper/deleted/.del-ps_6bdb.result:
Auto merged
mysql-test/include/have_multi_ndb.inc:
Auto merged
mysql-test/include/have_ndb.inc:
Auto merged
mysql-test/r/log_tables.result:
Auto merged
mysql-test/r/partition.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_7ndb.result:
Auto merged
mysql-test/r/query_cache.result:
Auto merged
mysql-test/r/subselect.result:
Auto merged
mysql-test/t/crash_commit_before.test:
Auto merged
mysql-test/t/ps.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/t/subselect.test:
Auto merged
BitKeeper/deleted/.del-mtr_im.pl:
Delete: mysql-test/lib/mtr_im.pl
client/mysqltest.c:
Use remote
mysql-test/mysql-test-run.pl:
Use remote
mysql-test/lib/mtr_process.pl:
Use remote
mysql-test/r/csv.result:
Update after add of missing semicolon
mysql-test/r/drop.result:
Update result file, no space before commands that has been "sent"
mysql-test/r/flush.result:
Update result file, no space before commands that has been "sent"
mysql-test/r/flush_block_commit.result:
Update result file, no space before commands that has been "sent"
mysql-test/r/flush_read_lock_kill.result:
Update result file, no space before commands that has been "sent"
mysql-test/r/grant2.result:
Update result file, no space before commands that has been "sent"
mysql-test/r/handler.result:
Update result file, no space before commands that has been "sent"
mysql-test/r/innodb_notembedded.result:
Update result file, no space before commands that has been "sent"
mysql-test/r/kill.result:
Update result file, no space before commands that has been "sent"
mysql-test/r/lock_multi.result:
Update result file, no space before commands that has been "sent"
mysql-test/r/multi_update.result:
Update result file, no space before commands that has been "sent"
mysql-test/r/mysqltest.result:
Update result
mysql-test/r/query_cache.result:
Update after add of missing semicolon
mysql-test/r/query_cache_notembedded.result:
Update result file, no space before commands that has been "sent"
mysql-test/r/sp-threads.result:
Update result file, no space before commands that has been "sent"
mysql-test/r/sp_notembedded.result:
Update after add of missing semicolon
mysql-test/r/type_blob.result:
Remove extra drop table
mysql-test/t/csv.test:
Add missing semicolon
mysql-test/t/query_cache.test:
Add missing semicolon
mysql-test/t/sp-error.test:
Remove "tab" from end of error declaration
mysql-test/t/sp.test:
Wrong delimiter, used ; instead of |
mysql-test/t/sp_notembedded.test:
Wrong delimiter, used ; instead of |
mysql-test/t/view_grant.test:
An incomplete error name specification was used.
mysql-test/r/sp.result:
After merge fix.
mysql-test/t/sp.test:
After merge fixes. Restored test for bug 21002 which has mysteriously
disappeared from 5.1 tree.
into shellback.(none):/home/msvensson/mysql/same_tools/my51-same_tools
client/Makefile.am:
Auto merged
mysql-test/r/csv.result:
Auto merged
mysql-test/r/query_cache.result:
Auto merged
mysql-test/r/sp_notembedded.result:
Auto merged
mysql-test/r/subselect.result:
Auto merged
mysql-test/t/csv.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/t/subselect.test:
Auto merged
client/mysqltest.c:
Manual merge
mysql-test/r/mysqltest.result:
Manual merge
mysql-test/t/mysqltest.test:
Manual merge
into mockturtle.local:/home/dlenev/src/mysql-5.0-rt-merge
BitKeeper/etc/collapsed:
auto-union
mysql-test/mysql-test-run.pl:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sp.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
mysql-test/r/sp.result:
Manual merge.
mysql-test/t/sp.test:
Manual merge.
- Disable warnings when creating the "innodb" tables if it works anyway.
- Move test that are really innodb dependent to innodb_mysql
mysql-test/r/create.result:
Move the innodb dependent test to innodb_mysql.test
mysql-test/r/innodb_mysql.result:
Move the innodb dependent test to innodb_mysql.test
mysql-test/t/create.test:
Move the innodb dependent test to innodb_mysql.test
mysql-test/t/innodb_mysql.test:
Move the innodb dependent test to innodb_mysql.test
mysql-test/t/lock_multi.test:
Disable warnings while creating the innodb table. If innodb is not available, the table will be created with default engine and thus create a warning. Regardless of this, test output should be the same.
mysql-test/t/sp.test:
Disable warnings while creating the innodb table. If innodb is not available, the table will be created with default engine and thus create a warning. Regardless of this, test output should be the same.
mysql-test/t/view.test:
Disable warnings while creating the innodb table. If innodb is not available, the table will be created with default engine and thus create a warning. Regardless of this, test output should be the same.
into mysql.com:/home/cps/mysql/trees/5.1-runtime-new
sql/handler.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sp.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/share/errmsg.txt:
Auto merged
sql/sql_table.cc:
Auto merged
mysql-test/r/sp.result:
manual merge
mysql-test/t/sp.test:
manual merge
storage/csv/ha_tina.cc:
manual merge
storage/myisam/ha_myisam.cc:
manual merge
There was possible stack overrun in an edge case which handles invalid body of
a SP in mysql.proc . That should be case when mysql.proc has been changed
manually. Though, due to bug 21513, it can be exploited without having access
to mysql.proc only being able to create a stored routine.
mysql-test/r/sp.result:
update result
mysql-test/t/sp.test:
add a test case for the bug
sql/sp.cc:
Fix stack overrun. This happen mostly when mysql.proc is damaged, though
it's possible due to another bug which creates invalid SP body in mysql.proc
(leading quote from a label being cut) to create stack overrun even without
having direct access to mysql.proc
into moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.1-bug21414
sql/mysql_priv.h:
Auto merged
sql/sp.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
mysql-test/r/sp.result:
Manual merge.
mysql-test/t/sp.test:
Manual merge.
into dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-5.1
mysql-test/r/func_gconcat.result:
Auto merged
mysql-test/r/func_group.result:
Auto merged
mysql-test/r/func_str.result:
Auto merged
mysql-test/r/func_time.result:
Auto merged
mysql-test/r/group_by.result:
Auto merged
mysql-test/r/heap_hash.result:
Auto merged
mysql-test/r/information_schema.result:
Auto merged
mysql-test/r/innodb_mysql.result:
Auto merged
mysql-test/r/join_outer.result:
Auto merged
mysql-test/r/olap.result:
Auto merged
mysql-test/r/query_cache.result:
Auto merged
mysql-test/r/range.result:
Auto merged
mysql-test/r/row.result:
Auto merged
mysql-test/r/subselect.result:
Auto merged
mysql-test/r/type_date.result:
Auto merged
mysql-test/r/union.result:
Auto merged
mysql-test/r/view_grant.result:
Auto merged
mysql-test/t/func_group.test:
Auto merged
mysql-test/t/func_str.test:
Auto merged
mysql-test/t/func_time.test:
Auto merged
mysql-test/t/view.test:
Auto merged
sql/item.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/log.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/opt_range.cc:
Auto merged
sql/opt_range.h:
Auto merged
sql/opt_sum.cc:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_list.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
mysql-test/t/sp.test:
SCCS merged
sql/item_cmpfunc.cc:
SCCS merged
sql/sql_select.cc:
SCCS merged
into dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-5.0-opt
sql/sql_insert.cc:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_select.cc:
Auto merged
containing a select statement that uses an aggregating IN subquery.
Added a parameter to the function fix_prepare_information
to restore correctly the having clause for the second execution.
Saved andor structure of the having conditions at the proper moment
before any calls of split_sum_func2 that could modify the having structure
adding new Item_ref objects. (These additions, are produced not with
the statement mem_root, but rather with the execution mem_root.)
mysql-test/r/sp.result:
Added a test case for bug #21493.
mysql-test/t/sp.test:
Added a test case for bug #21493.
sql/sql_delete.cc:
Fixed bug #21493: crash for the second execution of a function
containing a select statement that uses an aggregating IN subquery.
Added a parameter to the function fix_prepare_information
to restore correctly the having clause for the second execution.
sql/sql_insert.cc:
Fixed bug #21493: crash for the second execution of a function
containing a select statement that uses an aggregating IN subquery.
Added a parameter to the function fix_prepare_information
to restore correctly the having clause for the second execution.
sql/sql_lex.cc:
Fixed bug #21493: crash for the second execution of a function
containing a select statement that uses an aggregating IN subquery.
Added a parameter to the function fix_prepare_information
to restore correctly the having clause for the second execution.
sql/sql_lex.h:
Fixed bug #21493: crash for the second execution of a function
containing a select statement that uses an aggregating IN subquery.
Added a parameter to the function fix_prepare_information
to restore correctly the having clause for the second execution.
sql/sql_update.cc:
Fixed bug #21493: crash for the second execution of a function
containing a select statement that uses an aggregating IN subquery.
Added a parameter to the function fix_prepare_information
to restore correctly the having clause for the second execution.
The problem was that if after FLUSH TABLES WITH READ LOCK the user
issued DROP/ALTER PROCEDURE/FUNCTION the operation would fail (as
expected), but after UNLOCK TABLE any attempt to execute the same
operation would lead to the error 1305 "PROCEDURE/FUNCTION does not
exist", and an attempt to execute any stored function will also fail.
This happened because under FLUSH TABLES WITH READ LOCK we couldn't open
and lock mysql.proc table for update, and this fact was erroneously
remembered by setting mysql_proc_table_exists to false, so subsequent
statements believed that mysql.proc doesn't exist, and thus that there
are no functions and procedures in the database.
As a solution, we remove mysql_proc_table_exists flag completely. The
reason is that this optimization didn't work most of the time anyway.
Even if open of mysql.proc failed for some reason when we were trying to
call a function or a procedure, we were setting mysql_proc_table_exists
back to true to force table reopen for the sake of producing the same
error message (the open can fail for number of reasons). The solution
could have been to remember the reason why open failed, but that's a lot
of code for optimization of a rare case. Hence we simply remove this
optimization.
mysql-test/r/sp.result:
Add result for bug#21414: SP: Procedure undroppable, to some extent.
mysql-test/t/sp.test:
Remove no longer relevant comment.
Add test case for bug#21414: SP: Procedure undroppable, to some extent.
sql/mysql_priv.h:
Remove declaration of mysql_proc_table_exists.
sql/sp.cc:
Remove references to mysql_proc_table_exists.
sql/sql_acl.cc:
Remove reference to mysql_proc_table_exists.
if join is used
For procedures with selects that use complicated joins with ON expression
re-execution could erroneously ignore this ON expression, giving
incorrect result.
The problem was that optimized ON expression wasn't saved for
re-execution. The solution is to properly save it.
mysql-test/r/sp.result:
Add result for bug#20492: Subsequent calls to stored procedure yield
incorrect result if join is used.
mysql-test/t/sp.test:
Add test case for bug#20492: Subsequent calls to stored procedure yield
incorrect result if join is used.
sql/sql_select.cc:
Save modified ON expression for re-execution.
into bodhi.local:/opt/local/work/mysql-5.1-runtime-merge
BitKeeper/deleted/.del-im_check_os.inc:
Auto merged
BitKeeper/deleted/.del-im_options_set.imtest~b53d9d60e5684833:
Auto merged
BitKeeper/deleted/.del-im_options_set.result~59278f56be61d921:
Auto merged
BitKeeper/deleted/.del-im_options_unset.imtest~768eb186b51d0048:
Auto merged
configure.in:
Auto merged
BitKeeper/deleted/.del-im_options_unset.result~20a4790cd3c70a4f:
Auto merged
include/mysql_com.h:
Auto merged
mysql-test/lib/mtr_io.pl:
Auto merged
mysql-test/r/im_daemon_life_cycle.result:
Auto merged
mysql-test/r/im_life_cycle.result:
Auto merged
mysql-test/r/im_utils.result:
Auto merged
mysql-test/r/sp-error.result:
Auto merged
mysql-test/r/trigger.result:
Auto merged
mysql-test/r/type_varchar.result:
Auto merged
mysql-test/r/view.result:
Auto merged
mysql-test/t/im_daemon_life_cycle.imtest:
Auto merged
mysql-test/t/im_life_cycle.imtest:
Auto merged
mysql-test/t/im_utils.imtest:
Auto merged
mysql-test/t/sp-error.test:
Auto merged
mysql-test/t/trigger.test:
Auto merged
mysql-test/t/type_varchar.test:
Auto merged
mysql-test/t/view.test:
Auto merged
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_row.cc:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/item_strfunc.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/net_serv.cc:
Auto merged
sql/protocol.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_cache.cc:
Auto merged
sql/sql_cache.h:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_error.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_trigger.h:
Auto merged
sql/sql_yacc.yy:
Auto merged
mysql-test/mysql-test-run.pl:
Use local. Alik will merge his changes manually.
mysql-test/lib/mtr_process.pl:
Use local.
mysql-test/r/grant.result:
Use local.
mysql-test/r/sp.result:
Use local.
mysql-test/r/ps.result:
Manual merge.
mysql-test/t/grant.test:
Manual merge.
mysql-test/t/ps.test:
Manual merge.
mysql-test/t/sp.test:
Manual merge.
sql/Makefile.am:
Manual merge.
sql/field.cc:
Manual merge.
sql/mysqld.cc:
Manual merge.
sql/share/errmsg.txt:
Manual merge.
sql/sp.cc:
Manual merge.
sql/sp_head.h:
Manual merge.
sql/sql_trigger.cc:
Manual merge.
sql/sql_view.cc:
Manual merge.
The following procedure was not possible if max_sp_recursion_depth is 0
create procedure show_proc() show create procedure show_proc;
Actually there is no recursive call but the limit is checked.
Solved by temporarily increasing the thread's limit just before the fetch from cache
and decreasing after that.
mysql-test/r/sp.result:
update result
mysql-test/t/sp.test:
Test for bug #21416 SP: Recursion level higher than zero needed for non-recursive call
sql/sp.cc:
Increase the max_sp_recursion_depth temporarily for SHOW CREATE PROCEDURE call.
This call is in fact not recursive but is counted as such. Outcome, it will work
always but if max_sp_recursion_depth is reached we are going to cache one more
sp_head instance.
User name (host name) has limit on length. The server code relies on these
limits when storing the names. The problem was that sometimes these limits
were not checked properly, so that could lead to buffer overflow.
The fix is to check length of user/host name in parser and if string is too
long, throw an error.
mysql-test/r/grant.result:
Updated result file.
mysql-test/r/sp.result:
Updated result file.
mysql-test/r/trigger.result:
Updated result file.
mysql-test/r/view.result:
Updated result file.
mysql-test/t/grant.test:
Added test for BUG#16899.
mysql-test/t/sp.test:
Added test for BUG#16899.
mysql-test/t/trigger.test:
Added test for BUG#16899.
mysql-test/t/view.test:
Added test for BUG#16899.
sql/mysql_priv.h:
Added prototype for new function.
sql/share/errmsg.txt:
Added new resources.
sql/sql_acl.cc:
Remove outdated checks.
sql/sql_parse.cc:
Add a new function for checking string length.
sql/sql_yacc.yy:
Check length of user/host name.
into bodhi.local:/opt/local/work/mysql-5.1-runtime-merge
BitKeeper/etc/ignore:
auto-union
BitKeeper/deleted/.del-im_options_set.result~59278f56be61d921:
Auto merged
BitKeeper/deleted/.del-mysqld.dsp~ffdbf2d234e23e56:
Auto merged
BitKeeper/deleted/.del-mysys.dsp~32695fee91189326:
Auto merged
BitKeeper/deleted/.del-im_options_set.imtest~b53d9d60e5684833:
Auto merged
BitKeeper/deleted/.del-im_options_unset.imtest~768eb186b51d0048:
Auto merged
BitKeeper/deleted/.del-im_options_unset.result~20a4790cd3c70a4f:
Auto merged
client/mysql.cc:
Auto merged
client/mysqlbinlog.cc:
Auto merged
client/mysqlcheck.c:
Auto merged
client/mysqldump.c:
Auto merged
client/mysqltest.c:
Auto merged
dbug/dbug.c:
Auto merged
extra/perror.c:
Auto merged
extra/yassl/src/yassl_imp.cpp:
Auto merged
extra/yassl/src/yassl_int.cpp:
Auto merged
include/mysql.h:
Auto merged
include/mysql_com.h:
Auto merged
libmysql/libmysql.c:
Auto merged
mysql-test/r/cast.result:
Auto merged
mysql-test/r/date_formats.result:
Auto merged
mysql-test/r/federated.result:
Auto merged
mysql-test/r/func_compress.result:
Auto merged
mysql-test/r/func_group.result:
Auto merged
mysql-test/r/func_time.result:
Auto merged
mysql-test/r/gis-rtree.result:
Auto merged
mysql-test/r/gis.result:
Auto merged
mysql-test/r/im_daemon_life_cycle.result:
Auto merged
mysql-test/r/im_utils.result:
Auto merged
mysql-test/r/join_outer.result:
Auto merged
mysql-test/r/mysqlcheck.result:
Auto merged
mysql-test/r/rpl_sp.result:
Auto merged
mysql-test/r/rpl_trigger.result:
Auto merged
mysql-test/r/sp-code.result:
Auto merged
mysql-test/r/sp-security.result:
Auto merged
mysql-test/r/strict.result:
Auto merged
mysql-test/r/type_blob.result:
Auto merged
mysql-test/r/type_datetime.result:
Auto merged
mysql-test/r/type_ranges.result:
Auto merged
mysql-test/r/udf.result:
Auto merged
mysql-test/r/user_var.result:
Auto merged
mysql-test/t/cast.test:
Auto merged
mysql-test/t/disabled.def:
Auto merged
mysql-test/t/func_group.test:
Auto merged
mysql-test/t/func_time.test:
Auto merged
mysql-test/t/im_daemon_life_cycle.imtest:
Auto merged
mysql-test/t/im_life_cycle.imtest:
Auto merged
mysql-test/t/im_utils.imtest:
Auto merged
mysql-test/t/mysql.test:
Auto merged
mysql-test/t/mysqlbinlog.test:
Auto merged
mysql-test/t/mysqlcheck.test:
Auto merged
mysql-test/t/ps.test:
Auto merged
mysql-test/t/rpl_trigger.test:
Auto merged
mysql-test/t/sp-security.test:
Auto merged
mysql-test/t/strict.test:
Auto merged
mysql-test/t/udf.test:
Auto merged
sql/field.cc:
Auto merged
sql/item.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/item_strfunc.h:
Auto merged
sql/item_subselect.cc:
Auto merged
sql/item_sum.h:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/mysqld.cc:
Auto merged
sql/protocol.cc:
Auto merged
sql/slave.cc:
Auto merged
sql/sp.cc:
Auto merged
sql/sp_head.h:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_udf.cc:
Auto merged
sql/sql_view.cc:
Auto merged
sql/table.cc:
Auto merged
sql-common/client.c:
Auto merged
sql-common/my_time.c:
Auto merged
sql/table.h:
Auto merged
storage/ndb/src/kernel/error/ndbd_exit_codes.c:
Auto merged
storage/ndb/src/mgmsrv/ConfigInfo.cpp:
Auto merged
mysql-test/r/im_life_cycle.result:
e
use local
mysql-test/r/ps.result:
use local
client/Makefile.am:
Manual merge.
client/mysqlimport.c:
Manual merge.
configure.in:
Manual merge.
mysql-test/mysql-test-run.pl:
Manual merge.
mysql-test/r/mysqldump.result:
Manual merge.
mysql-test/r/mysqltest.result:
Manual merge.
mysql-test/r/ndb_basic.result:
Manual merge.
mysql-test/r/rpl_view.result:
Manual merge.
mysql-test/r/show_check.result:
Manual merge.
mysql-test/r/sp-error.result:
Manual merge.
mysql-test/r/sp.result:
Manual merge.
mysql-test/r/union.result:
Manual merge.
mysql-test/t/mysqldump.test:
Manual merge.
mysql-test/t/mysqltest.test:
Manual merge.
mysql-test/t/ndb_basic.test:
Manual merge.
mysql-test/t/rpl_sp.test:
Manual merge.
mysql-test/t/rpl_view.test:
Manual merge.
mysql-test/t/show_check.test:
Manual merge.
mysql-test/t/sp-error.test:
Manual merge.
mysql-test/t/sp.test:
Manual merge.
sql/item_sum.cc:
Manual merge.
sql/mysql_priv.h:
Manual merge.
sql/sp_head.cc:
Manual merge.
sql/sql_db.cc:
Manual merge.
sql/sql_delete.cc:
Manual merge.
sql/sql_lex.h:
Manual merge.
sql/sql_show.cc:
Manual merge.
sql/sql_table.cc:
Manual merge.
sql/sql_trigger.cc:
Manual merge.
sql/sql_yacc.yy:
Manual merge.
tests/mysql_client_test.c:
Manual merge.
into moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.1-runtine-merge
mysql-test/r/sp.result:
Auto merged
mysql-test/t/sp.test:
Auto merged
sql/sql_base.cc:
Auto merged
into moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.1-merge
client/mysql.cc:
Auto merged
mysql-test/Makefile.am:
Auto merged
mysql-test/r/date_formats.result:
Auto merged
mysql-test/r/func_str.result:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/t/date_formats.test:
Auto merged
mysql-test/t/func_str.test:
Auto merged
mysql-test/t/ps_1general.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/t/udf.test:
Auto merged
mysys/my_open.c:
Auto merged
BitKeeper/deleted/.del-make_win_src_distribution.sh~f80d8fca44e4e5f1:
Auto merged
sql/field.cc:
Auto merged
sql/field.h:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/time.cc:
Auto merged
client/mysqltest.c:
Manual merge.
mysql-test/r/ps_1general.result:
Manual merge.
into lmy004.:/work/mysql-5.1-runtime
sql/sp.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
mysql-test/r/sp.result:
manual merge
mysql-test/t/sp.test:
manual merge
create function func() returns char(10) binary ...
is no more possible. This will be reenabled when
bug 2676 "DECLARE can't have COLLATE clause in stored procedure"
is fixed.
Fix after 2nd review
mysql-test/r/sp-error.result:
update result
mysql-test/r/sp.result:
update result
mysql-test/t/sp-error.test:
add a test case for bug#20701 BINARY keyword should be forbidden in stored procedures
mysql-test/t/sp.test:
Fix test case which uses binary for the return value of a function.
It's no more possible after fix for bug#20701
BINARY keyword should be forbidden in SP
Fix few glitches where ; is used instead of | . The delimiter is |
sql/sql_yacc.yy:
Fix for bug#20701 BINARY keyword should be forbidden in stored routines
create function func() returns char(10) binary ...
is no more possible. This will be reenabled when
bug 2676 "DECLARE can't have COLLATE clause in stored procedure"
is fixed
into moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.1-merge
BitKeeper/deleted/.del-mysys.vcproj~40a49d09c4184822:
Auto merged
configure.in:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/r/func_time.result:
Auto merged
mysql-test/r/warnings.result:
Auto merged
mysql-test/t/func_time.test:
Auto merged
mysql-test/t/mysqlbinlog.test:
Auto merged
mysql-test/t/udf.test:
Auto merged
mysql-test/t/warnings.test:
Auto merged
BitKeeper/deleted/.del-mysqld.vcproj~6aa7b3f9c3e28fcb:
Auto merged
sql/field.cc:
Auto merged
sql/handler.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/sp.cc:
Auto merged
sql/sql_class.cc:
Auto merged
support-files/mysql.spec.sh:
Auto merged
mysql-test/r/sp.result:
Manual merge. Place 5.0 test before 5.1 test.
mysql-test/t/sp.test:
Manual merge. Place 5.0 test before 5.1 test.
mysys/my_bitmap.c:
Manual merge.
scripts/make_binary_distribution.sh:
Manual merge.
sql/Makefile.am:
Manual merge.
sql/slave.cc:
Manual merge.
sql/sql_class.h:
Manual merge.
sql/sql_parse.cc:
Manual merge.
sql/sql_select.cc:
Manual merge.
tests/mysql_client_test.c:
Manual merge.
The following procedure was not possible if max_sp_recursion_depth is 0
create procedure show_proc() show create procedure show_proc;
Actually there is no recursive call but the limit is checked.
Solved by temporarily increasing the thread's limit just before the fetch from cache
and decreasing after that.
mysql-test/r/sp.result:
update result
mysql-test/t/sp.test:
Test for bug #21416 SP: Recursion level higher than zero needed for non-recursive call
sql/sp.cc:
Increase the max_sp_recursion_depth temporarily for SHOW CREATE PROCEDURE call.
This call is in fact not recursive but is counted as such. Outcome, it will work
always but if max_sp_recursion_depth is reached we are going to cache one more
sp_head instance.
Before this fix,
- a runtime error in a statement in a stored procedure with no error handlers
was properly detected (as expected)
- a runtime error in a statement with an error handler inherited from a non
local runtime context (i.e., proc a with a handler, calling proc b) was
properly detected (as expected)
- a runtime error in a statement with a *local* error handler was executed
as follows :
a) the statement would succeed, regardless of the error condition, (bug)
b) the error handler would be called (as expected).
The root cause is that functions like my_messqge_sql would "forget" to set
the thread flag thd->net.report_error to 1, because of the check involving
sp_rcontext::found_handler_here().
Failure to set this flag would cause, later in the call stack,
in Item_func::fix_fields() at line 190, the code to return FALSE and consider
that executing the statement was successful.
With this fix :
- error handling code, that was duplicated in different places in the code,
is now implemented in sp_rcontext::handle_error(),
- handle_error() correctly sets thd->net.report_error when a handler is
present, regardless of the handler location (local, or in the call stack).
A test case, bug8153_subselect, has been written to demonstrate the change
of behavior before and after the fix.
Another test case, bug8153_function_a, as also been writen.
This test has the same behavior before and after the fix.
This test has been written to demonstrate that the previous expected
result of procedure bug18787, was incorrect, since select no_such_function()
should fail and therefore not produce a result.
The incorrect result for bug18787 has the same root cause as Bug#8153,
and the expected result has been adjusted.
sql/mysqld.cc:
Bug#8153, use sp_rcontext::handle_error() to handle errors.
sql/sql_error.cc:
Bug#8153, use sp_rcontext::handle_error() to handle errors.
sql/protocol.cc:
Bug#8153, use sp_rcontext::handle_error() to handle errors.
sql/sp_rcontext.h:
Bug#8153, created helper sp_rcontext::handle_error() to handle errors.
sql/sp_rcontext.cc:
Bug#8153, created helper sp_rcontext::handle_error() to handle errors.
mysql-test/t/sp.test:
Bug#8153, added test cases.
mysql-test/r/sp.result:
Bug#8153, added test cases, fixed expected result of bug18787.
into bodhi.local:/opt/local/work/mysql-5.0-runtime-merge
sql/item.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_view.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/table.h:
Auto merged
mysql-test/r/sp.result:
Manual merge.
mysql-test/r/udf.result:
Manual merge.
mysql-test/t/sp.test:
Manual merge.
mysql-test/t/udf.test:
Manual merge.
into moonbone.local:/work/tmp_merge-5.0-opt-mysql
client/mysql.cc:
Auto merged
mysql-test/r/date_formats.result:
Auto merged
mysql-test/r/func_str.result:
Auto merged
mysql-test/t/date_formats.test:
Auto merged
mysql-test/t/func_str.test:
Auto merged
mysql-test/t/udf.test:
Auto merged
sql/field.cc:
Auto merged
sql/field.h:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/time.cc:
Auto merged
mysql-test/r/sp.result:
Manual merge
mysql-test/t/sp.test:
Manual merge
into bodhi.local:/opt/local/work/mysql-5.0-runtime-merge
include/mysql.h:
Auto merged
include/sql_common.h:
Auto merged
libmysql/libmysql.c:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/r/mysqldump.result:
Auto merged
mysql-test/t/udf.test:
Auto merged
ndb/src/mgmsrv/ConfigInfo.cpp:
Auto merged
sql/item.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/slave.cc:
Auto merged
sql/sp.cc:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql-common/client.c:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/table.h:
Auto merged
mysql-test/r/ps.result:
Manual merge.
mysql-test/r/sp.result:
Manual merge.
mysql-test/t/ps.test:
Manual merge.
mysql-test/t/sp.test:
Manual merge.
sql/sql_prepare.cc:
Manual merge.
sql/table.cc:
Manual merge.
tests/mysql_client_test.c:
Manual merge.
into sunlight.local:/local_work/tmp_merge-5.1-opt-mysql
client/mysql.cc:
Auto merged
mysql-test/r/date_formats.result:
Auto merged
mysql-test/r/func_gconcat.result:
Auto merged
mysql-test/r/func_group.result:
Auto merged
mysql-test/r/func_str.result:
Auto merged
mysql-test/r/group_min_max.result:
Auto merged
BitKeeper/deleted/.del-make_win_src_distribution.sh~f80d8fca44e4e5f1:
Auto merged
BitKeeper/deleted/.del-mysqld.dsp~ffdbf2d234e23e56:
Auto merged
BitKeeper/deleted/.del-mysqld_ia64.dsp~7f8cf84d81ee04e2:
Auto merged
BitKeeper/deleted/.del-mysqldump.dsp~a8bd23547d3fc27e:
Auto merged
BitKeeper/deleted/.del-mysqldump_ia64.dsp~a2aabe898be35b31:
Auto merged
mysql-test/r/innodb.result:
Auto merged
mysql-test/r/innodb_mysql.result:
Auto merged
mysql-test/r/ps_7ndb.result:
Auto merged
mysql-test/r/type_ranges.result:
Auto merged
mysql-test/r/udf.result:
Auto merged
mysql-test/r/union.result:
Auto merged
mysql-test/r/view.result:
Auto merged
mysql-test/t/date_formats.test:
Auto merged
mysql-test/t/func_gconcat.test:
Auto merged
mysql-test/t/func_group.test:
Auto merged
mysql-test/t/group_min_max.test:
Auto merged
mysql-test/t/innodb.test:
Auto merged
mysql-test/t/innodb_mysql.test:
Auto merged
mysql-test/t/mysql.test:
Auto merged
mysql-test/t/select.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/t/view.test:
Auto merged
sql/field.cc:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_cmpfunc.h:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/item_subselect.cc:
Auto merged
sql/item_subselect.h:
Auto merged
sql/opt_range.h:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/time.cc:
Auto merged
storage/ndb/test/ndbapi/Makefile.am:
Auto merged
strings/decimal.c:
Auto merged
mysql-test/r/analyse.result:
Manual merge
mysql-test/r/bigint.result:
Manual merge
mysql-test/r/create.result:
Manual merge
mysql-test/r/information_schema.result:
Manual merge
mysql-test/r/ps_2myisam.result:
Manual merge
mysql-test/r/ps_3innodb.result:
Manual merge
mysql-test/r/ps_4heap.result:
Manual merge
mysql-test/r/ps_5merge.result:
Manual merge
mysql-test/r/ps_6bdb.result:
Manual merge
mysql-test/r/rpl_insert_id.result:
Manual merge
mysql-test/r/select.result:
Manual merge
mysql-test/r/sp.result:
Manual merge
mysql-test/r/subselect.result:
Manual merge
mysql-test/t/information_schema.test:
Manual merge
mysql-test/t/rpl_insert_id.test:
Manual merge
sql/field.h:
Manual merge
sql/item.cc:
Manual merge
sql/item.h:
Manual merge
sql/item_strfunc.h:
Manual merge
sql/item_sum.cc:
Manual merge
sql/mysql_priv.h:
Manual merge
sql/share/errmsg.txt:
Manual merge
sql/sql_class.h:
Manual merge
sql/sql_select.cc:
Manual merge
Fix for BUG#16676: Database CHARSET not used for stored procedures
The problem in BUG#16211 is that CHARSET-clause of the return type for
stored functions is just ignored.
The problem in BUG#16676 is that if character set is not explicitly
specified for sp-variable, the server character set is used instead
of the database one.
The fix has two parts:
- always store CHARSET-clause of the return type along with the
type definition in mysql.proc.returns column. "Always" means that
CHARSET-clause is appended even if it has not been explicitly
specified in CREATE FUNCTION statement (this affects BUG#16211 only).
Storing CHARSET-clause if it is not specified is essential to avoid
changing character set if the database character set is altered in
the future.
NOTE: this change is not backward compatible with the previous releases.
- use database default character set if CHARSET-clause is not explicitly
specified (this affects both BUG#16211 and BUG#16676).
NOTE: this also breaks backward compatibility.
mysql-test/r/mysqldump.result:
Updated result file.
mysql-test/r/sp.result:
Updated result file.
mysql-test/t/sp.test:
Provided test cases for BUG#16211, BUG#16676.
sql/mysql_priv.h:
Added two convenient functions for work with databases.
sql/sp.cc:
1. Add CHARSET-clause to CREATE-statement if it has been explicitly specified.
2. Polishing -- provided some comments.
sql/sp_head.cc:
Use database charset as default charset of sp-variable.
sql/sp_head.h:
Move init_sp_name() out of init_strings().
sql/sql_db.cc:
Two new functions created:
- load_db_opt_by_name();
- check_db_dir_existence();
sql/sql_show.cc:
Eliminate duplicated code by using
check_db_dir_existence() and load_db_opt_by_name()
sql/sql_table.cc:
Eliminate duplicated code by using
check_db_dir_existence() and load_db_opt_by_name()
sql/sql_yacc.yy:
Call sp_head::init_sp_name() to initialize stored routine name.
When there is no index defined filesort is used to sort the result of a
query. If there is a function in the select list and the result set should be
ordered by it's value then this function will be evaluated twice. First time to
get the value of the sort key and second time to send its value to a user.
This happens because filesort when sorts a table remembers only values of its
fields but not values of functions.
All functions are affected. But taking into account that SP and UDF functions
can be both expensive and non-deterministic a temporary table should be used
to store their results and then sort it to avoid twice SP evaluation and to
get a correct result.
If an expression referenced in an ORDER clause contains a SP or UDF
function, force the use of a temporary table.
A new Item_processor function called func_type_checker_processor is added
to check whether the expression contains a function of a particular type.
mysql-test/t/udf.test:
Added test case for bug#19862: Sort with filesort by function evaluates function twice
mysql-test/t/sp.test:
Added test case for bug#19862: Sort with filesort by function evaluates function twice
mysql-test/r/sp.result:
Added test case for bug#19862: Sort with filesort by function evaluates function twice
mysql-test/r/udf.result:
Added test case for bug#19862: Sort with filesort by function evaluates function twice
sql/sql_select.cc:
Fixed bug#19862: Sort with filesort by function evaluates function twice
If an expression referenced in an ORDER clause contains a SP or UDF
function, force the use of a temporary table.
sql/item_func.h:
Fixed bug#19862: Sort with filesort by function evaluates function twice
A new Item_processor function called func_type_checker_processor is added
to check whether the expression contains a function of a particular type.
sql/item.h:
Fixed bug#19862: Sort with filesort by function evaluates function twice
A new Item_processor function called func_type_checker_processor is added
to check whether the expression contains a function of a particular type.
sql/item_func.cc:
Fixed bug#19862: Sort with filesort by function evaluates function twice
A new Item_processor function called func_type_checker_processor is added
to check whether the expression contains a function of a particular type.
- Disable test case until fixed
mysql-test/r/sp.result:
Disable test case until bug#21039 is fixed
mysql-test/t/sp.test:
Disable test case until bug#21039 is fixed
"real" table fails in JOINs".
This is a regression caused by the fix for Bug 18444.
This fix removed the assignment of empty_c_string to table->db performed
in add_table_to_list, as neither me nor anyone else knew what it was
there for. Now we know it and it's covered with tests: the only case
when a table database name can be empty is when the table is a derived
table. The fix puts the assignment back but makes it a bit more explicit.
Additionally, finally drop sp.result.orig which was checked in by mistake.
BitKeeper/deleted/.del-sp.result.orig:
Delete: mysql-test/r/sp.result.orig
mysql-test/r/derived.result:
Updated result file.
mysql-test/r/sp.result:
Test results fixed (Bug#21002)
mysql-test/t/derived.test:
New error return for the case when MULTI-DELETE tries to delete from
a derived table: now derived tables belong to their own db (""), and
MUTLI-DELETE can't find the correspondent table for it in the
DELETE list, as it can't resolve tables in different dbs by alias
(See Bug#21148 for details)
mysql-test/t/sp.test:
Add a test case for Bug#21002 "Derived table not selecting from a "real"
table fails in JOINs"
sql/sp.cc:
Make empty_c_string globally accessible.
sql/sql_class.cc:
Add empty_c_string definition.
sql/sql_class.h:
Add a comment for the constructor of Table_ident which is
used for derived tables. Make sure this constructor also initializes
the database name, not only the table name.
sql/sql_parse.cc:
Don't call check_db_name for empty database.
Currently the only case when a table database name can be empty
is when the table is a derived table.
Report the right error if the database name is wrong (ER_WRONG_DB_NAME,
not ER_WRONG_TABLE_NAME).
and Stored Procedure
The essence of the bug was that for every re-execution of stored
routine or prepared statement new items for character set conversions
were created, thus increasing the number of items and the time of their
processing, and creating memory leak.
No test case is provided since current test suite can't cover such type
of bugs.
mysql-test/r/sp.result:
Add result for bug#21013: Performance Degrades when importing data
that uses Trigger and Stored Procedure.
mysql-test/t/sp.test:
Add test case for bug#21013: Performance Degrades when importing data
that uses Trigger and Stored Procedure.
sql/item.cc:
Switch arena only when in statement prepare mode. Subsequent executions
will use cached item tree.
into zippy.(none):/home/cmiller/work/mysql/merge/mysql-5.1-new-maint
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/r/create.result:
Auto merged
mysql-test/r/ps.result:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/t/create.test:
Auto merged
mysql-test/t/ndb_autodiscover3.test:
Auto merged
mysql-test/t/ps.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/t/wait_timeout.test:
Auto merged
sql/field.cc:
Auto merged
sql/field.h:
Auto merged
into zippy.(none):/home/cmiller/work/mysql/merge/mysql-5.1-new-maint
BUILD/compile-dist:
Auto merged
BitKeeper/deleted/.del-partition_innodb.result:
Auto merged
BitKeeper/deleted/.del-partition_innodb.test:
Auto merged
client/mysqltest.c:
Auto merged
mysql-test/r/create.result:
Auto merged
mysql-test/r/create_not_windows.result:
Auto merged
mysql-test/r/func_group.result:
Auto merged
mysql-test/r/innodb_mysql.result:
Auto merged
mysql-test/r/partition.result:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/t/innodb_mysql.test:
Auto merged
mysql-test/t/partition.test:
Auto merged
mysql-test/t/ps_1general.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/t/wait_timeout.test:
Auto merged
mysys/my_lib.c:
Auto merged
sql/field.cc:
Auto merged
sql/field.h:
Auto merged
sql/unireg.cc:
Auto merged
mysql-test/extra/rpl_tests/rpl_log.test:
manuakl merge
mysql-test/lib/mtr_process.pl:
manuakl merge
mysql-test/mysql-test-run.pl:
manuakl merge
mysql-test/r/type_newdecimal.result:
manuakl merge
mysql-test/t/create.test:
manuakl merge
mysql-test/t/func_group.test:
manuakl merge
mysql-test/t/type_newdecimal.test:
manuakl merge
into mysql.com:/opt/local/work/mysql-5.0-17199
mysql-test/r/create.result:
Auto merged
mysql-test/t/create.test:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/log_event.cc:
Auto merged
sql/slave.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_db.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
mysql-test/r/sp.result:
SCCS merged
mysql-test/t/sp.test:
SCCS merged
Bug#19022 "Memory bug when switching db during trigger execution"
Bug#17199 "Problem when view calls function from another database."
Bug#18444 "Fully qualified stored function names don't work correctly in
SELECT statements"
Documentation note: this patch introduces a change in behaviour of prepared
statements.
This patch adds a few new invariants with regard to how THD::db should
be used. These invariants should be preserved in future:
- one should never refer to THD::db by pointer and always make a deep copy
(strmake, strdup)
- one should never compare two databases by pointer, but use strncmp or
my_strncasecmp
- TABLE_LIST object table->db should be always initialized in the parser or
by creator of the object.
For prepared statements it means that if the current database is changed
after a statement is prepared, the database that was current at prepare
remains active. This also means that you can not prepare a statement that
implicitly refers to the current database if the latter is not set.
This is not documented, and therefore needs documentation. This is NOT a
change in behavior for almost all SQL statements except:
- ALTER TABLE t1 RENAME t2
- OPTIMIZE TABLE t1
- ANALYZE TABLE t1
- TRUNCATE TABLE t1 --
until this patch t1 or t2 could be evaluated at the first execution of
prepared statement.
CURRENT_DATABASE() still works OK and is evaluated at every execution
of prepared statement.
Note, that in stored routines this is not an issue as the default
database is the database of the stored procedure and "use" statement
is prohibited in stored routines.
This patch makes obsolete the use of check_db_used (it was never used in the
old code too) and all other places that check for table->db and assign it
from THD::db if it's NULL, except the parser.
How this patch was created: THD::{db,db_length} were replaced with a
LEX_STRING, THD::db. All the places that refer to THD::{db,db_length} were
manually checked and:
- if the place uses thd->db by pointer, it was fixed to make a deep copy
- if a place compared two db pointers, it was fixed to compare them by value
(via strcmp/my_strcasecmp, whatever was approproate)
Then this intermediate patch was used to write a smaller patch that does the
same thing but without a rename.
TODO in 5.1:
- remove check_db_used
- deploy THD::set_db in mysql_change_db
See also comments to individual files.
mysql-test/r/create.result:
Modify the result file: a database can never be NULL.
mysql-test/r/ps.result:
Update test results (Bug#17199 et al)
mysql-test/r/sp.result:
Update test results (Bug#17199 et al)
mysql-test/t/create.test:
Update the id of the returned error.
mysql-test/t/ps.test:
Add test coverage for prepared statements and current database. In scope of
work on Bug#17199 "Problem when view calls function from another database."
mysql-test/t/sp.test:
Add a test case for Bug#17199 "Problem when view calls function from another
database." and Bug#18444 "Fully qualified stored function names don't work
correctly in SELECT statements". Test a complementary problem.
sql/item_strfunc.cc:
Touch the code that reads thd->db (cleanup).
sql/log_event.cc:
While we are at it, replace direct access to thd->db with a method.
Should simplify future conversion of THD::db to LEX_STRING.
sql/slave.cc:
While we are at it, replace direct access to thd->db with a method.
Should simplify future conversion of THD::db to LEX_STRING.
sql/slave.h:
Remove a declaration for a method that is used only in one module.
sql/sp.cc:
Rewrite sp_use_new_db: this is a cleanup that I needed in order to understand
this function and ensure that it has no bugs.
sql/sp.h:
Add a new declaration for sp_use_new_db (uses LEX_STRINGs) and a comment.
sql/sp_head.cc:
- drop sp_name_current_db_new - a creator of sp_name class that was used
when sp_name was created for an identifier without an explicitly initialized
database. Now we pass thd->db to constructor of sp_name right in the
parser.
- rewrite sp_head::init_strings: name->m_db is always set now
- use the new variant of sp_use_new_db
- we don't need to update thd->db with SP MEM_ROOT pointer anymore when
parsing a stored procedure, as noone will refer to it (yes!)
sql/sp_head.h:
- remove unneded methods and members
sql/sql_class.h:
- introduce 3 THD methods to work with THD::db:
.set_db to assign the current database
.reset_db to reset the current database (temporarily) or set it to NULL
.opt_copy_db_to - to deep-copy thd->db to a pointer if it's not NULL
sql/sql_db.cc:
While we are at it, replace direct access to thd->db with a method.
Should simplify future conversion of THD::db to LEX_STRING.
sql/sql_insert.cc:
- replace checks with asserts: table_list->db must be always set in the parser.
sql/sql_lex.h:
- add a comment
sql/sql_parse.cc:
- implement the invariant described in the changeset comment.
- remove juggling with lex->sphead in SQLCOM_CREATE_PROCEDURE:
now db_load_routine uses its own LEX object and doesn't damage the main
LEX.
- add DBUG_ASSERT(0) to unused "check_db_used"
sql/sql_table.cc:
- replace a check with an assert (table_ident->db)
sql/sql_trigger.cc:
While we are at it, replace direct access to thd->db with a method.
Should simplify future conversion of THD::db to LEX_STRING.
sql/sql_udf.cc:
- use thd->set_db instead of direct modification of to thd->db
sql/sql_view.cc:
- replace a check with an assert (view->db)
sql/sql_yacc.yy:
- make sure that we always copy table->db or name->db or ident->db or
select_lex->db from thd->db if the former is not set. If thd->db
is not set but is accessed, return an error.
sql/tztime.cc:
- be nice, never copy thd->db by pointer.
into mysql.com:/opt/local/work/mysql-5.1-runtime
mysql-test/r/sp-prelocking.result:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/t/sp.test:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
Auto merged
storage/ndb/src/ndbapi/ndberror.c:
Auto merged
strings/ctype-mb.c:
Auto merged
mysql-test/t/sp-prelocking.test:
Manual merge.
with PREPARE fails with weird error".
More generally, re-executing a stored procedure with a complex SP cursor query
could lead to a crash.
The cause of the problem was that SP cursor queries were not optimized
properly at first execution: their parse tree belongs to sp_instr_cpush,
not sp_instr_copen, and thus the tree was tagged "EXECUTED" when the
cursor was declared, not when it was opened. This led to loss of optimization
transformations performed at first execution, as sp_instr_copen saw that the
query is already "EXECUTED" and therefore either not ran first-execution
related blocks or wrongly rolled back the transformations caused by
first-execution code.
The fix is to update the state of the parsed tree only when the tree is
executed, as opposed to when the instruction containing the tree is executed.
Assignment if i->state is moved to reset_lex_and_exec_core.
mysql-test/r/sp.result:
Test results fixed (Bug#15217)
mysql-test/t/sp.test:
Add a test case for Bug#15217
sql/sp_head.cc:
Move assignment of stmt_arena->state to reset_lex_and_exec_core
into mysql.com:/users/lthalmann/bk/MERGE/mysql-5.1-merge
mysql-test/r/binlog_row_mix_innodb_myisam.result:
Auto merged
mysql-test/r/federated.result:
Auto merged
mysql-test/r/innodb.result:
Auto merged
mysql-test/extra/rpl_tests/rpl_ddl.test:
Auto merged
mysql-test/r/rpl_ddl.result:
Auto merged
mysql-test/r/sp-error.result:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/r/rpl_ndb_charset.result:
Auto merged
mysql-test/r/type_ranges.result:
Auto merged
mysql-test/r/view.result:
Auto merged
mysql-test/r/trigger-grant.result:
Auto merged
mysql-test/t/archive.test:
Auto merged
mysql-test/t/create.test:
Auto merged
mysql-test/t/disabled.def:
Auto merged
mysql-test/t/federated.test:
Auto merged
mysql-test/t/innodb.test:
Auto merged
mysql-test/t/innodb_mysql.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/t/trigger-grant.test:
Auto merged
mysql-test/t/view.test:
Auto merged
sql/ha_innodb.cc:
Auto merged
sql/log.cc:
Auto merged
sql/log_event.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/set_var.h:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
mysql-test/r/create.result:
Manual merge
mysql-test/r/innodb_mysql.result:
Manual merge
sql/handler.cc:
Manual merge
sql/share/errmsg.txt:
Manual merge
sql/sql_class.h:
Manual merge
sql/sql_delete.cc:
Manual merge
sql/sql_insert.cc:
Manual merge
sql/sql_table.cc:
Manual merge
into neptunus.(none):/home/msvensson/mysql/mysql-5.1-new-maint
BUILD/compile-dist:
Auto merged
client/mysqltest.c:
Auto merged
config/ac-macros/ssl.m4:
Auto merged
include/config-win.h:
Auto merged
include/my_base.h:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/r/func_group.result:
Auto merged
mysql-test/r/group_min_max.result:
Auto merged
mysql-test/r/partition.result:
Auto merged
mysql-test/r/ps.result:
Auto merged
mysql-test/r/rpl_insert_id_pk.result:
Auto merged
mysql-test/r/rpl_ndb_multi_update3.result:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/t/create.test:
Auto merged
mysql-test/t/join_outer.test:
Auto merged
mysql-test/t/partition.test:
Auto merged
mysql-test/t/ps.test:
Auto merged
mysql-test/r/rpl_ndb_sp006.result:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysys/my_clock.c:
Auto merged
mysys/my_copy.c:
Auto merged
mysys/my_create.c:
Auto merged
mysys/my_dup.c:
Auto merged
mysys/my_lib.c:
Auto merged
mysys/my_open.c:
Auto merged
mysys/my_redel.c:
Auto merged
mysql-test/r/create.result:
Manual merge
mysql-test/r/innodb_mysql.result:
Manual merge
mysql-test/r/join_outer.result:
Manual merge
mysql-test/t/func_group.test:
Manual merge
mysql-test/t/group_min_max.test:
Manual merge
mysql-test/t/innodb_mysql.test:
Manual merge
Under row-based replication, DELETE FROM will now always be
replicated as individual row deletions, while TRUNCATE TABLE will
always be replicated as a statement.
mysql-test/extra/rpl_tests/rpl_ddl.test:
Using --echo instead of SELECT to print message.
mysql-test/r/binlog_row_mix_innodb_myisam.result:
Result change.
mysql-test/r/federated.result:
Result change.
mysql-test/r/range.result:
Result change.
mysql-test/r/rpl_sp_effects.result:
Result change.
mysql-test/r/show_check.result:
Result change.
mysql-test/r/sp-error.result:
Result change.
mysql-test/r/sp.result:
Result change.
mysql-test/r/timezone2.result:
Result change.
mysql-test/r/trigger-grant.result:
Result change.
mysql-test/r/type_datetime.result:
Result change.
mysql-test/r/type_ranges.result:
Result change.
mysql-test/r/type_timestamp.result:
Result change.
mysql-test/r/view.result:
Result change.
mysql-test/t/archive.test:
Test contain statements that only works for statement-based logging.
mysql-test/t/disabled.def:
Disabling test due to reported bug.
mysql-test/t/federated.test:
Adding ORDER BY clause to SELECT statements
mysql-test/t/range.test:
Adding ORDER BY clause to SELECT (sub-)statement
mysql-test/t/rpl_sp_effects.test:
Adding ORDER BY clause to SELECT statement.
mysql-test/t/show_check.test:
Replacing DELETE FROM without WHERE with TRUNCATE TABLE.
mysql-test/t/sp-error.test:
Replacing DELETE FROM without WHERE with TRUNCATE TABLE.
mysql-test/t/sp.test:
Adding ORDER BY clause to SELECT statement.
mysql-test/t/timezone2.test:
Replacing DELETE FROM without WHERE with TRUNCATE TABLE.
mysql-test/t/trigger-grant.test:
Replacing DELETE FROM without WHERE with TRUNCATE TABLE.
mysql-test/t/type_datetime.test:
Adding ORDER BY clause to SELECT statement.
mysql-test/t/type_ranges.test:
Replacing DELETE FROM without WHERE with TRUNCATE TABLE.
mysql-test/t/type_timestamp.test:
Replacing DELETE FROM without WHERE with TRUNCATE TABLE.
mysql-test/t/view.test:
Adding ORDER BY clause to SELECT statement.
sql/sql_class.h:
Adding member function to set replication to statement-based.
sql/sql_delete.cc:
When row-based replication is used, DELETE FROM will always delete the
contents of the table row-by-row and not use delete_all_rows().
mysql-test/extra/rpl_tests/rpl_truncate.test:
New BitKeeper file ``mysql-test/extra/rpl_tests/rpl_truncate.test''
mysql-test/extra/rpl_tests/rpl_truncate_helper.inc:
New BitKeeper file ``mysql-test/extra/rpl_tests/rpl_truncate_helper.inc''
mysql-test/r/rpl_truncate_2myisam.result:
New BitKeeper file ``mysql-test/r/rpl_truncate_2myisam.result''
mysql-test/r/rpl_truncate_3innodb.result:
New BitKeeper file ``mysql-test/r/rpl_truncate_3innodb.result''
mysql-test/r/rpl_truncate_7ndb.result:
New BitKeeper file ``mysql-test/r/rpl_truncate_7ndb.result''
mysql-test/t/rpl_truncate_2myisam.test:
New BitKeeper file ``mysql-test/t/rpl_truncate_2myisam.test''
mysql-test/t/rpl_truncate_3innodb.test:
New BitKeeper file ``mysql-test/t/rpl_truncate_3innodb.test''
mysql-test/t/rpl_truncate_7ndb.test:
New BitKeeper file ``mysql-test/t/rpl_truncate_7ndb.test''
into a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-new
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/mysql-test-run.sh:
Auto merged
mysql-test/r/grant.result:
Auto merged
mysql-test/r/heap_btree.result:
Auto merged
mysql-test/r/information_schema_db.result:
Auto merged
mysql-test/r/lock_multi.result:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/r/subselect.result:
Auto merged
mysql-test/r/view_grant.result:
Auto merged
mysql-test/t/lock_multi.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/t/view_grant.test:
Auto merged
mysys/default.c:
Auto merged
server-tools/instance-manager/guardian.cc:
Auto merged
sql/field.h:
Auto merged
sql/item.h:
Auto merged
sql/item_subselect.cc:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/lock.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_load.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql/table.cc:
Auto merged
storage/heap/hp_write.c:
Auto merged
storage/ndb/src/ndbapi/DictCache.cpp:
Auto merged
storage/ndb/src/ndbapi/DictCache.hpp:
Auto merged
client/mysqlbinlog.cc:
Manual merge from 5.0
client/mysqldump.c:
Manual merge from 5.0
configure.in:
Manual merge from 5.0
mysql-test/r/mysqldump.result:
Manual merge from 5.0
mysql-test/t/mysqldump.test:
Manual merge from 5.0
mysql-test/t/rpl_insert_id.test:
Manual merge from 5.0
server-tools/instance-manager/manager.cc:
Manual merge from 5.0
sql/field.cc:
Manual merge from 5.0
sql/ha_ndbcluster.cc:
Manual merge from 5.0
sql/mysqld.cc:
Manual merge from 5.0
sql/sql_base.cc:
Manual merge from 5.0
sql/sql_lex.cc:
Manual merge from 5.0
sql/sql_select.cc:
Manual merge from 5.0
sql/sql_table.cc:
Manual merge from 5.0
into shellback.(none):/home/msvensson/mysql/mysql-5.1-new-maint
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/t/sp.test:
Auto merged
into mysql.com:/usr/local/mysql/merge-5.1
mysql-test/lib/mtr_process.pl:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/r/sp-error.result:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/r/trigger-grant.result:
Auto merged
mysql-test/r/trigger.result:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/t/trigger-grant.test:
Auto merged
mysql-test/t/trigger.test:
Auto merged
server-tools/instance-manager/options.h:
Auto merged
sql/field_conv.cc:
Auto merged
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_func.h:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/share/errmsg.txt:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
server-tools/instance-manager/options.cc:
Manual merge
sql/item_func.cc:
Manual merge
sql/mysql_priv.h:
Manual merge
sql/sp_head.cc:
Manual merge
sql/sql_table.cc:
Manual merge
garbles data if longer than 766 chars.
The problem is that a stored routine returns BLOBs to the previous
caller, BLOBs are shallow-copied (i.e. only pointers to the data are
copied). The fix is to also copy data of BLOBs.
mysql-test/r/sp.result:
Updated result file.
mysql-test/t/sp.test:
Added a test case for BUG#18587.
sql/field_conv.cc:
Do not jump to optimization if the field type is BLOB and
the destination table requires copying of BLOBs.
sql/item_func.cc:
Request copying BLOBs for the result table.
into mysql.com:/home/dlenev/mysql-5.0-bg12472
sql/mysql_priv.h:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_table.cc:
Auto merged
mysql-test/r/sp.result:
Manual merge.
mysql-test/t/sp.test:
Manual merge.
or implicitly uses stored function gives "Table not locked" error'
CREATE TABLE ... SELECT ... statement which was explicitly or implicitly
(through view) using stored function gave "Table not locked" error.
The actual bug resides in the current locking scheme of CREATE TABLE SELECT
code, which first opens and locks tables of the SELECT statement itself,
and then, having SELECT tables locked, creates the .FRM, opens the .FRM and
acquires lock on it. This scheme opens a possibility for a deadlock, which
was present and ignored since version 3.23 or earlier. This scheme also
conflicts with the invariant of the prelocking algorithm -- no table can
be open and locked while there are tables locked in prelocked mode.
The patch makes an exception for this invariant when doing CREATE TABLE ...
SELECT, thus extending the possibility of a deadlock to the prelocked mode.
We can't supply a better fix in 5.0.
mysql-test/r/sp.result:
Added tests for bugs#12472/#15137 'CREATE TABLE ... SELECT ... which
explicitly or implicitly uses stored function gives "Table not locked" error'
mysql-test/t/sp.test:
Added tests for bugs#12472/#15137 'CREATE TABLE ... SELECT ... which
explicitly or implicitly uses stored function gives "Table not locked" error'
sql/mysql_priv.h:
Added flag which can be passed to open_table() routine in order to ignore
set of locked tables and prelocked mode.
We don't need declaration of create_table_from_items() any longer as it was
moved into sql_insert.cc and made static.
sql/sql_base.cc:
open_table():
Added flag which allows open table ignoring set of locked tables and
prelocked mode.
sql/sql_insert.cc:
Moved create_table_from_items() from sql_table.cc to sql_insert.cc as it was
not used outside of sql_insert.cc and contains code which is specific for
CREATE TABLE ... SELECT.
Also now when we are executing CREATE TABLE ... SELECT ... statement which
SELECT part requires execution in prelocked mode we ignore set of locked
tables in order to get access to the table we just have created.
We probably don't want to do this if we are under real LOCK TABLES since
it will widen window for deadlock too much.
sql/sql_table.cc:
Moved create_table_from_items() routine into sql_insert.cc, since it was not
used anywhere outside of this file and contains logic which is specific for
CREATE TABLE ... SELECT statement.
into mysql.com:/extern/mysql/5.1/generic/mysql-5.1-new
mysql-test/r/innodb.result:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/r/timezone_grant.result:
Auto merged
mysql-test/r/trigger.result:
Auto merged
mysql-test/r/view.result:
Auto merged
mysql-test/t/innodb.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/t/trigger.test:
Auto merged
mysql-test/t/view.test:
Auto merged
sql/lex.h:
Auto merged
sql/sp.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sp_head.h:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_view.cc:
Auto merged
mysql-test/r/rpl_insert_id.result:
Manual merge.
mysql-test/t/disabled.def:
Manual merge.
mysql-test/t/rpl_insert_id.test:
Manual merge.
sql/item_func.cc:
Manual merge.
sql/sql_yacc.yy:
Manual merge - not complete yet.
Do not reset value of LAST_INSERT_ID() in sub-statement.
mysql-test/r/rpl_insert_id.result:
Add result for bug#15728.
mysql-test/r/sp.result:
Add result for bug#15728.
mysql-test/t/rpl_insert_id.test:
Add test case for bug#15728.
mysql-test/t/sp.test:
Add test case for bug#15728.
sql/sql_class.cc:
Do not reset value of LAST_INSERT_ID() in sub-statement.
We must use the db key length in sp_drop_db_routines (and not the
number of characters), or long db names will be truncated in the key.
mysql-test/r/sp.result:
Updated results for new test case (BUG#18344)
mysql-test/t/sp.test:
Added new test case for BUG#18344.
sql/sp.cc:
In sp_drop_db_routines(), give the key field's ("db") key length
instead of the number of characters to index_read(), or the key
packing will truncate long db names.
into mysql.com:/extern/mysql/5.0/bug18787/mysql-5.0-runtime
mysql-test/r/sp.result:
Auto merged
mysql-test/t/sp.test:
Auto merged
sql/item_func.cc:
Auto merged
a misnamed function
... in the presence of a continue handler. The problem was that with a
handler, it continued to execute as if function existed and had set a
useful return value (which it hadn't).
The fix is to set a null return value and do an error return when a function
wasn't found.
mysql-test/r/sp.result:
Updated results for a new test case (BUG#18787).
mysql-test/t/sp.test:
New testcase for BUG#18787.
sql/item_func.cc:
Don't set "out of resources" error in Item_func_sp::execute() if no
result field is returned, it's simply wrong, it can be sometthing else,
like a function not found. Instead set null_value and return error.
Also, set "out of resources" when field creation fails in
Item_func_sp::sp_result_field() and Item_func_sp::tmp_table_field().
into april.(none):/home/svoj/devel/mysql/BUG14945/mysql-5.1-new
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/t/sp.test:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_delete.cc:
Manual merge
counter".
When TRUNCATE TABLE was called within an stored procedure the
auto_increment counter was not reset to 0 even if straight
TRUNCATE for this table did this.
This fix makes TRUNCATE in stored procedures to be handled exactly
in the same way as straight TRUNCATE. We achieve this by rolling
back the fix for bug 8850, which is no longer needed since stored
procedures don't require prelocked mode anymore (and TRUNCATE is
not allowed in stored functions or triggers).
mysql-test/r/sp.result:
Test case for BUG#14945.
mysql-test/t/sp.test:
Test case for BUG#14945.
sql/sql_delete.cc:
Handle TRUNCATE in stored procedures exactly in the same way as straight
TRUNCATE (i.e. without falling back to DELETE if possible). We achieve
this by rolling back the fix for bug 8850, which is no longer relevant
since stored procedures don't require prelocked mode anymore
(and TRUNCATE is not allowed in stored functions or triggers).
sql/sql_parse.cc:
Handle TRUNCATE in stored procedures exactly in the same way as straight
TRUNCATE (i.e. without falling back to DELETE if possible). We achieve
this by rolling back the fix for bug 8850, which is no longer relevant
since stored procedures don't require prelocked mode anymore
(and TRUNCATE is not allowed in stored functions or triggers).
into mysql.com:/opt/local/work/mysql-5.1-merge
mysql-test/r/ps.result:
Auto merged
mysql-test/r/sp-error.result:
Auto merged
mysql-test/r/sp-prelocking.result:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/r/trigger.result:
Auto merged
mysql-test/t/ps.test:
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/field.h:
Auto merged
sql/sp.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_load.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_view.cc:
Auto merged
mysql-test/t/sp-prelocking.test:
Manual merge.
into mysql.com:/extern/mysql/5.0/bug16474/mysql-5.0-runtime
mysql-test/t/sp.test:
Auto merged
sql/sql_select.cc:
Auto merged
mysql-test/r/sp.result:
Manual merge.
mysql-test/r/ps.result:
Added test coverage for "order by" in prepared statements (related to BUG#16474).
mysql-test/r/sp.result:
Added reference to test case for BUG#16474.
mysql-test/t/ps.test:
Added test coverage for "order by" in prepared statements (related to BUG#16474).
mysql-test/t/sp.test:
Added reference to test case for BUG#16474.
sql/sql_select.cc:
Fixed comment and test for basic_const_item() instead of is_splocal().
into mysql.com:/users/lthalmann/bk/mysql-5.1-new-wl3023-mats
mysql-test/t/sp.test:
Auto merged
sql/ha_ndbcluster_binlog.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
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,
into mysql.com:/home/alik/Documents/AllProgs/MySQL/devel/5.1-merged
mysql-test/r/sp.result:
Auto merged
mysql-test/r/view_grant.result:
Auto merged
mysql-test/t/skip_grants.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/t/view_grant.test:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_show.cc:
Auto merged
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.
mysql-test/t/sp.test:
Added test case for bug#13575: SP funcs in select with distinct/group and order by can
produce wrong data
mysql-test/r/sp.result:
Added test case for bug#13575: SP funcs in select with distinct/group and
order by can produce wrong data
sql/item_func.h:
Fixed bug#13575: SP funcs in select with distinct/group and order by can
produce wrong data
The Item_func_sp::val_str() now makes a copy of returned value to prevent
occasinal corruption.
into neptunus.(none):/home/msvensson/mysql/bug10656/my51-bug10656
mysql-test/r/sp.result:
Auto merged
mysql-test/r/sp_trans.result:
Auto merged
mysql-test/t/sp.test:
Auto merged
-Add test case
Move testcase that needs innodb from sp.test => sp_trans.test
mysql-test/r/sp.result:
Move test cases tyhat requires innodb to sp_trans.test
mysql-test/r/sp_trans.result:
Move test cases tyhat requires innodb to sp_trans.test
Add test case for bug#10656
mysql-test/t/sp.test:
Move test cases tyhat requires innodb to sp_trans.test
mysql-test/t/sp_trans.test:
Add test case for bug#10656
Move test cases that require innodb to sp_trans.test
into mysql.com:/home/bk/w3023-mysql-5.1-new
configure.in:
Auto merged
mysql-test/r/rpl_row_create_table.result:
Auto merged
mysql-test/t/sp.test:
Auto merged
sql/log.cc:
Auto merged
sql/log_event.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/table.h:
Auto merged
into mysql.com:/extern/mysql/5.1/generic/mysql-5.1-new
libmysql/libmysql.c:
Auto merged
mysql-test/r/binary.result:
Auto merged
mysql-test/r/federated.result:
Auto merged
mysql-test/r/func_math.result:
Auto merged
mysql-test/r/grant.result:
Auto merged
mysql-test/r/heap.result:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/r/trigger.result:
Auto merged
mysql-test/r/type_decimal.result:
Auto merged
mysql-test/t/binary.test:
Auto merged
mysql-test/t/federated.test:
Auto merged
mysql-test/t/mysql.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/t/trigger.test:
Auto merged
sql/field_conv.cc:
Auto merged
sql/ha_federated.cc:
Auto merged
sql/ha_federated.h:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_strfunc.h:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_trigger.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/table.cc:
Auto merged
sql/table.h:
Auto merged
tests/mysql_client_test.c:
Auto merged
support-files/mysql.spec.sh:
Manual merge. (use local)
into mysql.com:/extern/mysql/5.1/generic/mysql-5.1-new
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/mysql-test-run.sh:
Auto merged
mysql-test/r/grant2.result:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/t/grant2.test:
Auto merged
mysql-test/t/skip_grants.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
scripts/make_binary_distribution.sh:
Auto merged
sql/field_conv.cc:
Auto merged
sql/item.h:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/sql_udf.cc:
Auto merged
VC++Files/mysql.sln:
Manual merge (use local).
configure.in:
Manual merge.
sql/table.cc:
Manual merge.
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.
into mysql.com:/home/bk/w3023-mysql-5.1-new
configure.in:
Auto merged
BitKeeper/deleted/.del-sp_notembedded.test:
Auto merged
mysql-test/extra/binlog_tests/binlog.test:
Auto merged
mysql-test/extra/binlog_tests/blackhole.test:
Auto merged
mysql-test/r/binlog_stm_ctype_cp932.result:
Auto merged
mysql-test/t/sp.test:
Auto merged
scripts/mysql_fix_privilege_tables.sql:
Auto merged
sql/ha_ndbcluster_binlog.cc:
Auto merged
sql/handler.cc:
Auto merged
sql/handler.h:
Auto merged
sql/log.h:
Auto merged
sql/log_event.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/opt_range.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql/table.h:
Auto merged
into mysql.com:/home/my/mysql-5.1
BitKeeper/deleted/.del-innodb_notembedded.test:
Delete: mysql-test/t/innodb_notembedded.test
BitKeeper/deleted/.del-sp_notembedded.test:
Delete: mysql-test/t/sp_notembedded.test
BitKeeper/deleted/.del-subselect_notembedded.test:
Delete: mysql-test/t/subselect_notembedded.test
BitKeeper/deleted/.del-ctype_cp932_notembedded.result:
Delete: mysql-test/r/ctype_cp932_notembedded.result
BitKeeper/deleted/.del-innodb_notembedded.result:
Delete: mysql-test/r/innodb_notembedded.result
BitKeeper/deleted/.del-sp_notembedded.result:
Delete: mysql-test/r/sp_notembedded.result
BitKeeper/deleted/.del-subselect_notembedded.result:
Delete: mysql-test/r/subselect_notembedded.result
configure.in:
Auto merged
include/mysql.h:
Auto merged
libmysql/libmysql.c:
Auto merged
libmysqld/emb_qcache.cc:
Auto merged
libmysqld/embedded_priv.h:
Auto merged
libmysqld/libmysqld.c:
Auto merged
mysql-test/extra/binlog_tests/blackhole.test:
Auto merged
mysql-test/mysql-test-run.sh:
Auto merged
mysql-test/r/innodb.result:
Auto merged
mysql-test/r/mysqltest.result:
Auto merged
mysql-test/r/query_cache.result:
Auto merged
mysql-test/r/query_cache_notembedded.result:
Auto merged
mysql-test/r/sp-error.result:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/r/subselect.result:
Auto merged
mysql-test/r/view.result:
Auto merged
mysql-test/r/view_grant.result:
Auto merged
mysql-test/t/backup.test:
Auto merged
mysql-test/t/compress.test:
Auto merged
mysql-test/t/delayed.test:
Auto merged
mysql-test/t/handler.test:
Auto merged
mysql-test/t/mysql.test:
Auto merged
mysql-test/t/mysql_client_test.test:
Auto merged
mysql-test/t/mysqltest.test:
Auto merged
mysql-test/t/query_cache.test:
Auto merged
mysql-test/t/query_cache_notembedded.test:
Auto merged
mysql-test/t/read_only.test:
Auto merged
mysql-test/t/skip_grants.test:
Auto merged
mysql-test/t/sp-destruct.test:
Auto merged
mysql-test/t/sp-error.test:
Auto merged
mysql-test/t/sp-threads.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/t/temp_table.test:
Auto merged
mysql-test/t/view_grant.test:
Auto merged
mysql-test/t/wait_timeout.test:
Auto merged
mysys/mf_dirname.c:
Auto merged
sql/field.cc:
Auto merged
sql/handler.h:
Auto merged
sql/item.h:
Auto merged
sql/log_event.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/opt_range.cc:
Auto merged
sql/protocol.cc:
Auto merged
sql/protocol.h:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_cursor.cc:
Auto merged
sql/sql_db.cc:
Auto merged
sql-common/client.c:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_select.h:
Auto merged
sql/table.h:
Auto merged
sql/tztime.cc:
Auto merged
sql/tztime.h:
Auto merged
storage/ndb/include/ndbapi/NdbDictionary.hpp:
Auto merged
tests/mysql_client_test.c:
Auto merged
libmysqld/lib_sql.cc:
Manual merge
mysql-test/extra/binlog_tests/binlog.test:
Manual merge
mysql-test/extra/binlog_tests/ctype_cp932.test:
No changes
mysql-test/r/binlog_stm_binlog.result:
Manual merge
mysql-test/r/binlog_stm_ctype_cp932.result:
No changes
mysql-test/t/innodb.test:
Manual merge
mysql-test/t/view.test:
Manual merge
mysys/my_bitmap.c:
Manual merge
scripts/mysql_fix_privilege_tables.sql:
Manual merge
sql/item.cc:
Manual merge
sql/sql_cache.h:
Manual merge
sql/sql_class.h:
Manual merge
sql/sql_update.cc:
Manual merge
(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''
into mysql.com:/home/bk/w3023-mysql-5.1-new
mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
Auto merged
mysql-test/extra/rpl_tests/rpl_log.test:
Auto merged
mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test:
Auto merged
mysql-test/r/binlog_row_insert_select.result:
Auto merged
mysql-test/r/rpl_row_delayed_ins.result:
Auto merged
mysql-test/t/rpl_sp.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
sql/ha_ndbcluster_binlog.cc:
Auto merged
sql/handler.cc:
Auto merged
sql/handler.h:
Auto merged
mysql-test/t/rpl_ndb_dd_basic.test:
Auto merged
sql/log.cc:
Auto merged
sql/log_event.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/opt_range.cc:
Auto merged
sql/slave.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/table.h:
Auto merged
mysql-test/r/binlog_row_mix_innodb_myisam.result:
Merge with 5.1.7 release clone.
mysql-test/r/rpl_row_basic_11bugs.result:
Merge with 5.1.7 release clone.
mysql-test/r/rpl_row_basic_2myisam.result:
Merge with 5.1.7 release clone.
mysql-test/r/rpl_row_basic_3innodb.result:
Merge with 5.1.7 release clone.
mysql-test/r/rpl_row_create_table.result:
Merge with 5.1.7 release clone.
mysql-test/r/rpl_row_log.result:
Merge with 5.1.7 release clone.
mysql-test/r/rpl_row_log_innodb.result:
Merge with 5.1.7 release clone.
mysql-test/r/rpl_row_sp008.result:
Merge with 5.1.7 release clone.
mysql-test/t/rpl_row_basic_11bugs.test:
Merge with 5.1.7 release clone.
mysql-test/t/rpl_row_sp008.test:
Merge with 5.1.7 release clone.
Adaptions to make it work with NDB.
mysql-test/extra/binlog_tests/binlog.test:
Using replace_regex to remove table id.
mysql-test/extra/binlog_tests/blackhole.test:
Using replace_regex to remove table id.
mysql-test/extra/binlog_tests/ctype_cp932.test:
Using replace_regex to remove table id.
mysql-test/extra/binlog_tests/ctype_cp932_binlog.test:
Using replace_regex to remove table id.
mysql-test/extra/binlog_tests/ctype_ucs_binlog.test:
Using replace_regex to remove table id.
mysql-test/extra/binlog_tests/drop_temp_table.test:
Using replace_regex to remove table id.
mysql-test/extra/binlog_tests/insert_select-binlog.test:
Using replace_regex to remove table id.
mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
Using replace_regex to remove table id.
mysql-test/extra/rpl_tests/rpl_flsh_tbls.test:
Using replace_regex to remove table id.
mysql-test/extra/rpl_tests/rpl_log.test:
Using replace_regex to remove table id.
mysql-test/extra/rpl_tests/rpl_multi_query.test:
Using replace_regex to remove table id.
mysql-test/extra/rpl_tests/rpl_row_charset.test:
Using replace_regex to remove table id.
mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test:
Using replace_regex to remove table id.
mysql-test/extra/rpl_tests/rpl_stm_charset.test:
Using replace_regex to remove table id.
mysql-test/include/rpl_row_basic.inc:
Removing sync with master on cleanup since there are engines that does
not work in a "syncronized" fashion on dropping tables.
mysql-test/r/binlog_row_binlog.result:
Result change
mysql-test/r/binlog_row_blackhole.result:
Result change
mysql-test/r/binlog_row_ctype_cp932.result:
Result change
mysql-test/r/binlog_row_ctype_ucs.result:
Result change
mysql-test/r/binlog_row_insert_select.result:
Result change
mysql-test/r/binlog_row_mix_innodb_myisam.result:
Result change
mysql-test/r/ctype_cp932_binlog_row.result:
Result change
mysql-test/r/rpl_row_basic_11bugs.result:
Result change
mysql-test/r/rpl_row_basic_2myisam.result:
Result change
mysql-test/r/rpl_row_basic_3innodb.result:
Result change
mysql-test/r/rpl_row_charset.result:
Result change
mysql-test/r/rpl_row_create_table.result:
Result change
mysql-test/r/rpl_row_delayed_ins.result:
Result change
mysql-test/r/rpl_row_log.result:
Result change
mysql-test/r/rpl_row_log_innodb.result:
Result change
mysql-test/r/rpl_row_max_relay_size.result:
Result change
mysql-test/r/rpl_row_sp008.result:
Result change
mysql-test/t/binlog_stm_binlog.test:
Using replace_regex to remove table id.
mysql-test/t/ndb_binlog_ddl_multi.test:
Using replace_regex to remove table id.
mysql-test/t/ndb_binlog_ignore_db.test:
Using replace_regex to remove table id.
mysql-test/t/rpl_heap.test:
Using replace_regex to remove table id.
mysql-test/t/rpl_loaddata_s.test:
Using replace_regex to remove table id.
mysql-test/t/rpl_ndb_blob.test:
Using replace_regex to remove table id.
mysql-test/t/rpl_ndb_disk.test:
Using replace_regex to remove table id.
mysql-test/t/rpl_row_basic_11bugs.test:
Using replace_regex to remove table id.
mysql-test/t/rpl_row_create_table.test:
Using replace_regex to remove table id.
mysql-test/t/rpl_row_drop.test:
Using replace_regex to remove table id.
mysql-test/t/rpl_row_sp008.test:
Using replace_regex to remove table id.
mysql-test/t/rpl_sp.test:
Using replace_regex to remove table id.
mysql-test/t/sp.test:
Using replace_regex to remove table id.
mysql-test/t/sp_notembedded.test:
Using replace_regex to remove table id.
mysql-test/t/user_var-binlog.test:
Using replace_regex to remove table id.
sql/ha_ndbcluster_binlog.cc:
Assign_new_table_id() now takes table share.
Removed gratuitous friend declaration of ndb_add_binlog_index().
Turning of binlogging during execution of ndb_add_binlog_index().
sql/handler.h:
Removed gratuitous friend declaration of ndb_add_binlog_index().
sql/log.cc:
Adding debug printout.
sql/log_event.cc:
Closing thread tables on dummy event.
sql/rpl_injector.cc:
Added support for new locking scheme.
sql/rpl_injector.h:
Added support for new locking scheme.
into neptunus.(none):/home/msvensson/mysql/mysql-5.1
mysql-test/r/sp.result:
Auto merged
mysql-test/t/disabled.def:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/mysql-test-run.pl:
Merge locationwhere to search for client bins
into mysql.com:/home/kostja/mysql/mysql-5.1-merge
mysql-test/r/sp-error.result:
Auto merged
mysql-test/r/sp-security.result:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/t/sp-error.test:
Auto merged
mysql-test/t/sp-security.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sp.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/share/errmsg.txt:
Manual merge
sql/sql_base.cc:
Manual merge.
into neptunus.(none):/home/msvensson/mysql/mysql-5.1
mysql-test/r/mysqldump.result:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/t/system_mysql_db_fix.test:
Auto merged
client/mysqltest.c:
Merge
mysql-test/mysql-test-run.pl:
Merge
mysql-test/t/mysqldump.test:
Merge
mysql-test/t/mysqltest.test:
Merge
Fixes failing sp.test
mysql-test/r/backup.result:
A new error message for deprecated statements.
mysql-test/t/sp.test:
Disable warnings in the test for Bug#13012
sql/share/errmsg.txt:
A new error message for deprecated statements.
sql/sql_yacc.yy:
Use a better worded error message.
into neptunus.(none):/home/msvensson/mysql/mysqltest_replace/my51-mysqltest_replace
include/config-win.h:
Auto merged
mysql-test/r/mysqldump.result:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/t/mysql_client_test.test:
Auto merged
mysql-test/t/mysqldump.test:
Auto merged
mysql-test/t/mysqltest.test:
Auto merged
mysql-test/t/rpl_000015.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/t/system_mysql_db_fix.test:
Auto merged
client/mysqltest.c:
Merge
mysql-test/mysql-test-run.pl:
Merge
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:/home/kostja/mysql/mysql-5.1-merge
BitKeeper/deleted/.del-ndb_load.result:
Delete: mysql-test/r/ndb_load.result
BitKeeper/deleted/.del-ndb_load.test:
Delete: mysql-test/t/ndb_load.test
extra/perror.c:
Auto merged
mysql-test/r/fulltext.result:
Auto merged
mysql-test/r/ndb_blob.result:
Auto merged
mysql-test/r/sp-code.result:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/r/view.result:
Auto merged
mysql-test/t/fulltext.test:
Auto merged
mysql-test/t/sp-destruct.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/t/view.test:
Auto merged
sql/ha_ndbcluster.cc:
Auto merged
sql/ha_ndbcluster.h:
Auto merged
sql/item_func.cc:
Auto merged
sql/opt_range.cc:
Auto merged
sql/sp.cc:
Auto merged
sql/sp.h:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sp_head.h:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_load.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp:
Auto merged
storage/ndb/src/kernel/main.cpp:
Auto merged
storage/ndb/src/kernel/vm/Configuration.cpp:
Auto merged
storage/ndb/src/kernel/vm/Configuration.hpp:
Auto merged
storage/ndb/src/ndbapi/NdbBlob.cpp:
Auto merged
storage/ndb/test/ndbapi/testBlobs.cpp:
Auto merged
storage/ndb/tools/delete_all.cpp:
Auto merged
mysql-test/t/disabled.def:
Manual merge.
into mysql.com:/home/kostja/mysql/mysql-5.1-merge
client/mysqltest.c:
Auto merged
mysql-test/r/date_formats.result:
Auto merged
mysql-test/r/sp-error.result:
Auto merged
mysql-test/r/sp-security.result:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/r/type_float.result:
Auto merged
mysql-test/t/date_formats.test:
Auto merged
mysql-test/t/sp-error.test:
Auto merged
mysql-test/t/sp-security.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/t/type_float.test:
Auto merged
mysql-test/t/variables.test:
Auto merged
sql/item_timefunc.cc:
Auto merged
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
into mysql.com:/home/kostja/mysql/mysql-5.1-merge
BitKeeper/etc/ignore:
auto-union
configure.in:
Auto merged
libmysql/libmysql.c:
Auto merged
mysql-test/ndb/ndbcluster.sh:
Auto merged
mysql-test/r/rpl_sp.result:
Auto merged
mysql-test/r/sp-error.result:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/r/type_float.result:
Auto merged
mysql-test/t/rpl_sp.test:
Auto merged
mysql-test/t/sp-error.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
sql/field.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/mysqld.cc:
Auto merged
sql/protocol.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sp_head.h:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
sql/table.cc:
Auto merged
sql/table.h:
Auto merged
storage/myisam/ft_update.c:
Auto merged
storage/ndb/include/logger/LogHandler.hpp:
Auto merged
storage/ndb/include/logger/Logger.hpp:
Auto merged
storage/ndb/include/mgmapi/mgmapi.h:
Auto merged
storage/ndb/include/mgmcommon/ConfigRetriever.hpp:
Auto merged
storage/ndb/src/common/logger/FileLogHandler.cpp:
Auto merged
storage/ndb/src/common/logger/LogHandler.cpp:
Auto merged
storage/ndb/src/common/logger/Logger.cpp:
Auto merged
storage/ndb/src/common/logger/SysLogHandler.cpp:
Auto merged
storage/ndb/src/common/mgmcommon/ConfigRetriever.cpp:
Auto merged
storage/ndb/src/common/util/SocketServer.cpp:
Auto merged
storage/ndb/src/kernel/main.cpp:
Auto merged
storage/ndb/src/kernel/vm/Configuration.cpp:
Auto merged
storage/ndb/src/kernel/vm/Configuration.hpp:
Auto merged
storage/ndb/src/mgmapi/mgmapi.cpp:
Auto merged
storage/ndb/src/mgmclient/CommandInterpreter.cpp:
Auto merged
storage/ndb/src/mgmsrv/MgmtSrvr.cpp:
Auto merged
storage/ndb/src/mgmsrv/MgmtSrvr.hpp:
Auto merged
storage/ndb/src/mgmsrv/Services.cpp:
Auto merged
storage/ndb/src/mgmsrv/Services.hpp:
Auto merged
storage/ndb/src/mgmsrv/main.cpp:
Auto merged
storage/ndb/tools/ndb_size.pl:
Auto merged
zlib/Makefile.am:
Auto merged
mysql-test/r/information_schema.result:
SCCS merged
mysql-test/t/information_schema.test:
Manual merge.
sql/ha_archive.cc:
Manual merge.
sql/share/errmsg.txt:
SCCS merged
tests/mysql_client_test.c:
Manual merge.
into mysql.com:/home/kostja/mysql/mysql-5.1-merge
client/mysqltest.c:
Auto merged
mysql-test/r/alter_table.result:
Auto merged
mysql-test/r/create.result:
Auto merged
mysql-test/r/ctype_ucs.result:
Auto merged
mysql-test/r/mysqltest.result:
Auto merged
mysql-test/r/ps.result:
Auto merged
mysql-test/r/sp-error.result:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/r/type_decimal.result:
Auto merged
mysql-test/r/variables.result:
Auto merged
mysql-test/r/view_grant.result:
Auto merged
mysql-test/t/alter_table.test:
Auto merged
mysql-test/t/create.test:
Auto merged
mysql-test/t/ctype_ucs.test:
Auto merged
mysql-test/t/mysqltest.test:
Auto merged
mysql-test/t/ps.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
sql/ha_berkeley.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sp_head.h:
Auto merged
sql/sql_handler.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/share/errmsg.txt:
Auto merged
mysql-test/mysql-test-run.pl:
SCCS merged
sql/sql_yacc.yy:
Manual merge: resolve the conflict with moved sp_if rule
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.)
mysql-test/r/sp.result:
Auto merged
mysql-test/r/view.result:
Auto merged
mysql-test/t/handler.test:
Auto merged
mysql-test/t/mysql_client_test.test:
Auto merged
mysql-test/t/mysqltest.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/t/view.test:
Auto merged
sql/mysqld.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/t/sp.test:
Auto merged
sql/field.cc:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/mysqld.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sql_handler.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
storage/innobase/os/os0thread.c:
Auto merged
storage/myisam/myisam_ftdump.c:
Auto merged
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
Auto merged
storage/ndb/src/ndbapi/NdbImpl.hpp:
Auto merged
storage/ndb/src/ndbapi/NdbRecAttr.cpp:
Auto merged
storage/ndb/src/ndbapi/ndb_cluster_connection.cpp:
Auto merged
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.
Now it supports queries returning several results
(particularly important with the SP)
include/mysql.h:
embedded_query_result structure added
libmysql/libmysql.c:
embedded-server related fixes
libmysqld/emb_qcache.cc:
multiple-result support added
libmysqld/embedded_priv.h:
embedded_query_result struct implemented
libmysqld/lib_sql.cc:
multiple-result support added
libmysqld/libmysqld.c:
small fixes
mysql-test/t/backup.test:
test fixed
mysql-test/t/binlog_stm_binlog.test:
test fixed
mysql-test/t/binlog_stm_blackhole.test:
test fixed
mysql-test/t/binlog_stm_ctype_cp932.test:
test fixed
mysql-test/t/compress.test:
test fixed
mysql-test/t/delayed.test:
test fixed
mysql-test/t/federated.test:
test fixed
mysql-test/t/federated_archive.test:
test fixed
mysql-test/t/federated_bug_13118.test:
test fixed
mysql-test/t/federated_transactions.test:
test fixed
mysql-test/t/flush_table.test:
test fixed
mysql-test/t/handler.test:
test fixed
mysql-test/t/init_connect.test:
test fixed
mysql-test/t/innodb.test:
test fixed
mysql-test/t/mysql.test:
test fixed
mysql-test/t/mysql_client_test.test:
test fixed
mysql-test/t/mysqltest.test:
test fixed
mysql-test/t/query_cache.test:
test fixed
mysql-test/t/query_cache_notembedded.test:
test fixed
mysql-test/t/read_only.test:
test fixed
mysql-test/t/skip_grants.test:
test fixed
mysql-test/t/sp-destruct.test:
test fixed
mysql-test/t/sp-error.test:
test fixed
mysql-test/t/sp-threads.test:
test fixed
mysql-test/t/sp.test:
test fixed
mysql-test/t/view.test:
test fixed
mysql-test/t/wait_timeout.test:
test fixed
sql-common/client.c:
small fixes
sql/mysqld.cc:
embedded-server related fix
sql/protocol.cc:
embedded-server related fix
sql/protocol.h:
embedded-server related fix
sql/sql_class.cc:
embedded-server related fix
sql/sql_class.h:
embedded-server related fix
sql/sql_cursor.cc:
embedded-server related fix
sql/sql_parse.cc:
embedded-server related fix
sql/sql_prepare.cc:
embedded-server related fix
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.
Added error checking for errors when attempting to use stored procedures
after the mysql.proc table has been dropped, corrupted, or tampered with.
Test cases were put in a separate file (sp-destruct.test).
mysql-test/t/sp.test:
Added comment.
sql/share/errmsg.txt:
New error message for corrupted mysql.proc table.
sql/sp.cc:
Check and return error code when caching stored routines.
In the case when no error message has been set, set one.
sql/sp.h:
Return error code from stored routine cache function.
sql/sql_base.cc:
Check for error from sp_cache_routines_* calls.
sql/sql_trigger.h:
Updated friend declaration for sp_cache_routines*.
mysql-test/r/sp-destruct.result:
New test file for destruction of the mysql.proc table.
mysql-test/t/sp-destruct.test:
New result file for destruction of the mysql.proc table.
- allow CREATE VIEW as well as DROP VIEW to use in prepared statements;
- fix CREATE VIEW implementation to make it work in prepared statements.
mysql-test/r/sp.result:
Results file for the test case for BUG#13095.
mysql-test/t/sp.test:
Test case for BUG#13095.
sql/sql_lex.h:
Added a variable to remember start of whole CREATE VIEW statement
as well as start of its SELECT part.
sql/sql_prepare.cc:
Allow CREATE VIEW and DROP VIEW to use in prepared statements.
sql/sql_view.cc:
Use stored start of whole CREATE VIEW statement instead of thd->query,
which differs from the original when prepared statement is executing.
sql/sql_yacc.yy:
Remember start of whole CREATE VIEW statement as well as start of its
SELECT part.
procedure
For some functions returning strings (like "replace" and "ifnull" - where
val_str() is returning a pointer into one of the parameters) - we ended
up with a dangling pointer after the new operator destroyed the reuse item
in the eval function.
A working, if not very elegant, solution is to simply copy the string in
such cases.
mysql-test/r/sp.result:
New test case for BUG#13941.
mysql-test/t/sp.test:
New test case for BUG#13941.
sql/sp_head.cc:
Copy the string when evaluating some string functions (e.g. "replace" and "ifnull")
to avoid using a dangling pointer.
into mysql.com:/home/pem/work/bug7049/mysql-5.0
mysql-test/r/sp.result:
Auto merged
mysql-test/t/sp.test:
Auto merged
sql/mysqld.cc:
Auto merged
sql/sp_head.cc:
Auto merged
Test for bug#12812 moved from sp.test to sp-security.test
mysql-test/t/sp.test:
Test for bug#12812 moved from sp.test to sp-security.test
mysql-test/t/sp-security.test:
Test for bug#12812 moved from sp.test to sp-security.test
mysql-test/r/sp.result:
Test for bug#12812 moved from sp.test to sp-security.test
mysql-test/r/sp-security.result:
Test for bug#12812 moved from sp.test to sp-security.test
procedure variable
Second version, after review.
Keep the unsigned_flag in Item_decimal updated. Note that this also changed
the result of several old test results - creating tables from decimal
templates now gives unsigned columns and different sizes. (Several tests
had Length > Max_length before.)
mysql-test/r/case.result:
Updated result (after fixing BUG#12589).
mysql-test/r/metadata.result:
Updated result (after fixing BUG#12589).
mysql-test/r/ps_2myisam.result:
Updated result (after fixing BUG#12589).
mysql-test/r/ps_3innodb.result:
Updated result (after fixing BUG#12589).
mysql-test/r/ps_4heap.result:
Updated result (after fixing BUG#12589).
mysql-test/r/ps_5merge.result:
Updated result (after fixing BUG#12589).
mysql-test/r/ps_6bdb.result:
Updated result (after fixing BUG#12589).
mysql-test/r/ps_7ndb.result:
Updated result (after fixing BUG#12589).
mysql-test/r/sp.result:
New test case for BUG#12589.
mysql-test/r/type_newdecimal.result:
Updated result (after fixing BUG#12589).
mysql-test/t/sp.test:
New test case for BUG#12589.
sql/item.cc:
Keep the unsigned_flag updated in Item_splocal and Item_decimal.
Search the chain of sp_rcontexts recursively for handlers. If one is found,
it will be detected in the sp_head::execute() method at the corresponding
level.
mysql-test/r/sp.result:
New test case for BUG#7049.
Note that the spurious warnings in the BUG#12379 test now are gone (as expected).
mysql-test/t/sp.test:
New test case for BUG#7049.
sql/sp_head.cc:
Link sp_rcontexts to allow catching errors across invokation boundaries.
(Also fixed print method for the hreturn instruction.)
sql/sp_rcontext.cc:
Link sp_rcontexts to allow catching errors across invokation boundaries.
If a handler is not found in the current sp_rcontext, recurse into the previous ones (if any).
sql/sp_rcontext.h:
Link sp_rcontexts to allow catching errors across invokation boundaries.
Replaced the dumb in-handler/not-in-handler check with a proper recursion
check of handlers being executed.
(Re-commit in a different tree, to make push possible.)
mysql-test/r/sp.result:
New test case for BUG#6127.
mysql-test/t/sp.test:
New test case for BUG#6127.
sql/sp_head.cc:
Replaced the setting of ctx->in_handler with a enter/exit handler methods.
sql/sp_rcontext.cc:
Replaced the boolean in_handler flag with a stack of handlers being exectuted, for proper recursion check.
sql/sp_rcontext.h:
Replaced the boolean in_handler flag with a stack of handlers being exectuted, for proper recursion check.
(And added some comments in the sp_rcontext class.)
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.
sql/item_func.h:
Fix bug#12812 create view calling a function works without execute right on function
sql/item_func.cc:
Fix bug#12812 create view calling a function works without execute right on function
Added function Item_func_sp::check_access() which checks access rights.
Added function Item_func_sp::fix_field() which calls check_access() after fixing.
Item_func_sp::execute() now calls to check_access() to check access rights.
mysql-test/t/sp.test:
Test case for bug#12812 create view calling a function works without execute right on function
mysql-test/r/sp.result:
Test case for bug#12812 create view calling a function works without execute right on function
mysql-test/r/sp.result:
Added missing drop table.
mysql-test/t/sp.test:
Added missing drop table.
sql/sp_head.h:
Post-review fix for autocommit check in SPs and triggers.
sql/sql_yacc.yy:
Post-review fix for autocommit check in SPs and triggers.
mysql-test/r/sp.result:
fix result
mysql-test/r/type_newdecimal.result:
fix result
mysql-test/t/sp.test:
add a test for the bug
mysql-test/t/type_newdecimal.test:
add a test for the bug
sql/item_func.cc:
call correct method of the item
get strange result
according to Monty's suggestions, fixing the SELECT behaviour on errors
with SP handlers. Note that some warnings from SELECT still shows up when
the handler has caught - this is an effect of another known bug (BUG#7049).
mysql-test/r/sp.result:
New test cases for BUG#12379.
mysql-test/t/sp.test:
New test cases for BUG#12379.
sql/sql_class.cc:
Abort selects on errors more graceful with SP handlers.
sql/sql_class.h:
Abort selects on errors more graceful with SP handlers.
Have to init. all local variables in their frames, not just once at the beginning
of invocation.
mysql-test/r/sp.result:
New test case for BUG#13133.
mysql-test/t/sp.test:
New test case for BUG#13133.
sql/sp_head.cc:
Just init. local variable slots in the fram to NULL. (Real init. will be done
in each block.)
sql/sp_pcontext.cc:
Removed isset flag, since it's not used.
sql/sp_pcontext.h:
Removed isset flag, since it's not used.
sql/sql_yacc.yy:
Initialize local variables in the block to null, or the default value, given.
(Untabifed block too.)
into mysql.com:/home/psergey/mysql-5.0-bug12943
mysql-test/r/sp.result:
Auto merged
mysql-test/t/sp.test:
Auto merged
sql/item_func.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
(recommit with the right Bug#)
mysql-test/r/sp.result:
result file modified to reflect new test
mysql-test/t/sp.test:
added test for the bug
sql/item.cc:
protect Item_splocal value from modification by CONCAT() et al
sql/item.h:
added a buffer to save Item_splocal string pointer
sql/sp_head.cc:
don't employ reuse mechanism to save var into itself
* Allocate thd->user_var_events elements on appropriate mem_root
* If several SP statements are binlogged as a single statement, collect all user var
accesses they make (grep for StoredRoutinesBinlogging for details)
mysql-test/r/rpl_sp_effects.result:
Testcase for BUG#12637
mysql-test/r/sp.result:
re-enabled test case for BUG#12297
mysql-test/t/rpl_sp_effects.test:
Testcase for BUG#12637
mysql-test/t/sp.test:
re-enabled test case for BUG#12297
sql/item_func.cc:
Fix for BUG#12637: Make SPs+user variables replication work:
* Allocate thd->user_var_events elements on appropriate mem_root
* If several SP statements are binlogged as a single statement, collect all user var
accesses they make.
sql/log.cc:
Fix for BUG#12637: Make SPs+user variables replication work:
* Allocate thd->user_var_events elements on appropriate mem_root
* If several SP statements are binlogged as a single statement, collect all user var
accesses they make.
sql/sp_head.cc:
Fix for BUG#12637: Make SPs+user variables replication work:
* Allocate thd->user_var_events elements on appropriate mem_root
* If several SP statements are binlogged as a single statement, collect all user var
accesses they make.
sql/sp_head.h:
Remove compiler warning.
sql/sql_class.h:
Fix for BUG#12637: Make SPs+user variables replication work.
sql/sql_parse.cc:
Fix for BUG#12637: Make SPs+user variables replication work.
"Creating a function with char binary IN parameter fails"
Parse BINARY as part of type declaration, not as
a column attribute.
mysql-test/r/sp.result:
test for bug 9048
mysql-test/t/sp.test:
test for bug 9048
sql/sql_yacc.yy:
fix bug 9048
parse BINARY as part of type declaration and not as column modifier.
into mysql.com:/home/cps/mysql/devel/mysql-5.0-sp11333
mysql-test/r/sp.result:
Auto merged
mysql-test/t/sp.test:
Auto merged
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/sp_head.cc:
manual merge
mysql-test/r/sp.result:
update result
mysql-test/t/sp.test:
Add test for Bug #11333 "Stored Procedure: Memory blow up on repeated SELECT ... INTO query"
sql/item.cc:
we should call destructors for Items before reuse
sql/item.h:
Add new method and constructor for Item_string.
sql/sp_head.cc:
String allocation should be done on the system heap for now.
mysql-test/r/sp.result:
fix result
mysql-test/t/sp.test:
fix test for a bug: tests in sp.test should reuse tables t1 and t2 and create/drop tables t3, t4 etc.
So, tables t1 and t2 were renamed into t3 and t4
NOT FOUND ...' in conditional handled incorrectly".
Whenever we remove an instruction during optimization, we need to
adjust instruction numbers (ip - instruction pointer) stored in all
instructions. In addition to that, sp_instr_hpush_jump, which
corresponds to DECLARE CONTINUE HANDLER needs adjustment for m_handler,
which holds the number of instruction with the continue handler.
In the bug report, a wrong ip stored in m_handler was pointing at
FETCH, which resulted in an error message and abnormal SP termination.
The fix is to just remove m_handler member from sp_instr_hpush_jump,
as it's always points to the instruction next to the DECLARE
statement itself (m_ip+1).
mysql-test/r/sp.result:
Test results fixed (Bug#12168)
mysql-test/t/sp.test:
A test case for Bug#12168 "'DECLARE CONTINUE HANDLER FOR NOT
FOUND ...' in conditional handled incorrectly"
sql/sp_head.cc:
Remove m_handler (the number of continue handler instruction)
as it always equal to m_ip+1
sql/sp_head.h:
Remove m_handler (the number of continue handler instruction)
as it always equal to m_ip+1
and Bug#12297 SP crashes the server if data inserted inside a lon loop
Third commit attempt. With fixes to the issues, showed up after full rebuild and
tests on other hosts.
mysql-test/r/rpl_sp.result:
New warnings appeared in result file, as now we always create spcont in a stored routine.
This is correct behaviour. We swallowed some warnings, as we used thd->spcont to check whether
we are in the SP though we didn't set spcont in certain cases. This is fixed now.
mysql-test/r/sp.result:
fixed result file to reflect new tests
mysql-test/t/sp.test:
Added tests for bugs. Though one of them is disabled, as it fails because of the other bug.
It should be enabled, when bug 12297 is fixed.
sql/sp_head.cc:
Per-instruction arena is implemented
sql/sp_rcontext.cc:
Now we should deal with callers_arena->free_list when we employ reuse mechanism with callers_arena
switched during sp_eval_func_item
sql/sp_rcontext.h:
Add new member to sp_rcontext class, in order to handle instructions with assignment
and/or with nested SP processing properly.
into mysql.com:/home/my/mysql-5.0
mysql-test/t/sp.test:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sp_cache.cc:
manual merge
mysql-test/t/sp.test:
Use --disable_parsing instead of comments
sql/lock.cc:
Remove compiler warning
sql/mysqld.cc:
Always send valid flag argument to reload_acl_and_cache()
sql/sp_cache.cc:
Simple optimization
Don't use mutex to read 'long' variable
Indentation fixes
sql/sp_head.cc:
Fix comments to use /* */
Set proc_info to 0 after close_thread_tables()
sql/sql_base.cc:
remove not needed test
sql/sql_parse.cc:
Always send valid flag argument to reload_acl_and_cache()
Fixed indentation
Ensure we get an error if reset_master() fails.
into mysql.com:/home/dlenev/src/mysql-5.0-is
mysql-test/r/information_schema.result:
Auto merged
mysql-test/t/information_schema.test:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sp.cc:
Auto merged
sql/sp.h:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_show.cc:
Auto merged
mysql-test/r/sp.result:
Manual merge
mysql-test/t/sp.test:
Manual merge
sql/sql_class.h:
Manual merge
result set".
To enable full access to contents of I_S tables from stored functions
or statements that use them, we manipulate with thread's open tables
state and ensure that we won't cause deadlock when we open tables by
ignoring flushes and name-locks.
Building of contents of I_S.TABLES no longer requires locking of tables
since we use use handler::info() method with HA_STATUS_AUTO flag instead
of handler::update_auto_increment() for obtaining information about
auto-increment values. But this also means that handlers have to implement
support for HA_STATUS_AUTO flag (particularly InnoDB needs it).
mysql-test/r/alter_table.result:
Updated test results. This change was caused by the fact that now when
we build contents of I_S tables (and thus output of SHOW INDEX) we
don't use instances of tables which may be already opened and locked
by thread (we always use new instance).
mysql-test/r/information_schema.result:
Added test which checks how information about current auto-increment value for
table is reported in INFORMATION_SCHEMA.TABLES view.
mysql-test/r/sp.result:
Added test for bug #10055 "Using stored function with information_schema causes
empty result set".
mysql-test/t/information_schema.test:
Added test which checks how information about current auto-increment value for
table is reported in INFORMATION_SCHEMA.TABLES view.
mysql-test/t/sp.test:
Added test for bug #10055 "Using stored function with information_schema causes
empty result set".
sql/mysql_priv.h:
close_thread_tables():
Get rid of 'stopper' argument which is no longer used. Now when we need
to open and then close some table without touching tables which are already
opened we use THD::reset_n/restore_backup_open_tables_state() methods.
open_tables()/open_normal_and_derived_tables():
Added 'flags' argument to be able open tables even if some has done
a flush or hold namelock on them.
sql/sp.cc:
close_proc_table/open_proc_table_for_read/db_find_routine():
Replaced push_open_tables_state/pop_open_tables_state() methods which
were saving/restoring current open tables state in/from THD::open_state_list
with reset_n_backup_open_tables_state/restore_backup_open_tables_state()
methods which assume that backup storage for this state is allocated on
stack (or elsewhere) by their caller.
open_proc_table_for_read():
Since now we can have several open tables states stacked up we can't rely
rely on checking whether we have some tables open in previous state.
Instead we always assume that some tables are open and we need to ignore
flush while locking mysql.proc. We don't really need
MYSQL_LOCK_IGNORE_GLOBAL_READ_LOCK in this case since we open mysql.proc table
only for reading.
sql/sp.h:
Added declarations of open_proc_table_for_read()/close_proc_table() to be
able to use them in sql_show.cc.
sql/sql_base.cc:
close_thread_tables():
Get rid of 'stopper' argument which is no longer used. Now when we need
to open and then close some table without touching tables which are already
opened we use THD::reset_n/restore_backup_open_tables_state() methods.
open_tables()/open_normal_and_derived_tables():
Added 'flags' argument to be able open tables even if some has done
a flush or hold namelock on them.
sql/sql_class.cc:
Open_tables_state, THD:
Replaced push_open_tables_state/pop_open_tables_state() methods which
were saving/restoring current open tables state in/from THD::open_state_list
with reset_n_backup_open_tables_state/restore_backup_open_tables_state()
methods which assume that backup storage for this state is allocated on
stack (or elsewhere) by their caller.
sql/sql_class.h:
Open_tables_state, THD:
Replaced push_open_tables_state/pop_open_tables_state() methods which
were saving/restoring current open tables state in/from THD::open_state_list
with reset_n_backup_open_tables_state/restore_backup_open_tables_state()
methods which assume that backup storage for this state is allocated on
stack (or elsewhere) by their caller.
sql/sql_handler.cc:
open_tables()/open_normal_and_derived_tables():
Added 'flags' argument to be able open tables even if some has done
a flush or hold namelock on them.
sql/sql_prepare.cc:
open_tables()/open_normal_and_derived_tables():
Added 'flags' argument to be able open tables even if some has done
a flush or hold namelock on them.
sql/sql_show.cc:
get_all_tables():
Now we use THD::reset_n_/restore_backup_open_tables_state() for
saving/restoring open tables state instead of working with it directly
(This also allows us to have proper content of I_S system tables in
statements with stored functions and in stored functions). We also
ignore possible flushes when opening tables (we may create deadlock
otherwise). Also we do all needed manipulations with LEX in this function
and not in get_schema_tables_result() now.
get_schema_tables_record():
Let us use handler::info() method with HA_STATUS_AUTO flag for obtaining
information about table's auto-increment value. This allows to avoid locking
of tables which is needed when we use handler::update_auto_increment() method.
fill_schema_proc():
Now we use open_proc_table_for_read/close_proc_table() for access to
mysql.proc table (so we won't cause deadlock if we already have some
tables open and locked, this also allows us to have proper content in
ROUTINES system table in statements using stored functions/in stored
functions).
get_schema_tables_result():
Moved all manipulations with Open_tables_state and LEX needed for
safe opening of tables to ST_SCHEMA_TABLE::fill_table functions
(i.e. get_all_tables() and fill_schema_proc()).
sql/sql_update.cc:
open_tables()/open_normal_and_derived_tables():
Added 'flags' argument to be able open tables even if some has done
a flush or hold namelock on them.
mysql-test/r/sp.result:
Auto merged
mysql-test/r/view.result:
Auto merged
mysql-test/t/view.test:
Auto merged
sql/item_func.cc:
Auto merged
sql/sp.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sp_head.h:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_trigger.h:
Auto merged
* Don't activate prelocking mode for evaluating procedure arguments when it is not necessary.
* Code structure simplification and cleanup.
* Cleanup in .test files
mysql-test/r/sp-prelocking.result:
Prelocking-free SPs, post-review fixes:
Added comment, s/testdb/mysqltest/, fixed a wrong test (error wasnt reported because of known bug in mysqltestrun)
mysql-test/r/sp-security.result:
Don't drop the table we're not using.
mysql-test/r/sp.result:
Prelocking-free SPs, post-review fixes:
remove redundant "drop table if exists t3" statements
mysql-test/t/sp-prelocking.test:
Prelocking-free SPs, post-review fixes:
Added comment, s/testdb/mysqltest/, fixed a wrong test (error wasnt reported because of known bug in mysqltestrun)
mysql-test/t/sp-security.test:
Don't drop the table we're not using.
mysql-test/t/sp.test:
Prelocking-free SPs, post-review fixes:
remove redundant "drop table if exists t3" statements
sql/sp.cc:
New, better defined, sp_get_prelocking_info() function to get info about
statement prelocking options
sql/sp.h:
Prelocking-free SPs, post-review fixes: New, better defined, sp_get_prelocking_info()
function to get info about statement prelocking options
sql/sp_cache.h:
Prelocking-free SPs, post-review fixes: Amended the comments
sql/sp_head.cc:
Prelocking-free SPs, post-review fixes: Amend the comments, simplify the code that
attaches removes statement's prelocking tables.
sql/sql_base.cc:
Prelocking-free SPs, post-review fixes:
* Use a better defined sp_get_prelocking_info() function to get info about
statement prelocking options
* Don't activate prelocked mode for evaluation of SP arguments that use tables
but don't need prelocking.
sql/sql_class.cc:
Prelocking-free SPs, post-review fixes: Initialize THD members in the order they are declared.
Change bool in C code to my_bool
Added to mysqltest --enable_parsning and --disable_parsing to avoid to have to comment parts of tests
Added comparison of LEX_STRING's and use this to compare file types for view and trigger files.
client/client_priv.h:
Added OPT_TRIGGERS (to get rid of compiler warning)
client/mysql.cc:
Added cast to get rid of compiler warning
client/mysqldump.c:
Added OPT_TRIGGERS (to get rid of compiler warning)
Abort if we can't write to outfile (even if --ignore-errors is given)
client/mysqltest.c:
Added --enable_parsning and --disable_parsing to avoid to have to comment parts of tests
include/my_sys.h:
Make my_progname const
include/my_time.h:
Avoid using 'bool' in C programs
mysql-test/lib/init_db.sql:
Align with mysql_create_system_tables
(Ideally this file should be auto-generated from the above script)
mysql-test/r/mysqltest.result:
Test for --enable_parsing
mysql-test/r/variables.result:
Update results after fix for overflow checking of max_heap_table_size
mysql-test/t/information_schema.test:
USe --enable/disable parsing instead of comments
mysql-test/t/mysqltest.test:
Test for --enable_parsing
mysql-test/t/sp.test:
USe --enable/disable parsing instead of comments
mysql-test/t/variables.test:
Portability fix for 64 bit systems
mysql-test/t/view.test:
USe --enable/disable parsing instead of comments
mysys/my_init.c:
May my_progname const
mysys/my_static.c:
May my_progname const
mysys/thr_lock.c:
Remove not needed casts
sql-common/my_time.c:
Change bool -> my_bool as bool is not portable in C programs
sql/field.cc:
Test number_to_datetime() for -1 instead of < 0 (Safety fix)
New prototype for TIME_to_timestamp()
sql/item.h:
Don't have prototypes for both uint32 and ulong as these 'may' be the same thing
sql/item_timefunc.cc:
New prototype for TIME_to_timestamp()
sql/log.cc:
Remove compiler warnings
sql/mysql_priv.h:
New prototype for TIME_to_timestamp()
Added function for comparing LEX_STRING
sql/set_var.cc:
Added overflow checking when setting ulong variable
sql/sql_base.cc:
Added function is_equal()
Changed strncmp -> is_equal() as strncmp() to not match "V" (instead of "VIEW")
sql/sql_class.cc:
Added comment
sql/sql_select.cc:
Portability fixes
After review fixes
sql/sql_trigger.cc:
Use 'tables_alias_charset' for comparing database name
Use 'is_equal()' to compare file type. (Old code didn't do the comparison correctly)
sql/sql_view.cc:
Use 'is_equal()' to compare file type. (Old code didn't do the comparison correctly)
sql/time.cc:
New prototype for TIME_to_timestamp() to allow easyer mapping to C function
sql/tztime.cc:
bool -> my_bool (to allow calling C code from C++ code)
sql/tztime.h:
bool -> my_bool (to allow calling C code from C++ code)
its body, but lets each statement to get/release its own locks. This allows a broader set
of statements to be executed inside PROCEDUREs (but breaks replication)
This patch should fix BUG#8072, BUG#8766, BUG#9563, BUG#11126
mysql-test/r/sp-security.result:
Drop tables this test attempts to create
mysql-test/r/sp-threads.result:
Update test results
mysql-test/r/sp.result:
Disabled a test that triggers BUG#11986, cleanup used tables when tests start.
mysql-test/r/view.result:
Enabled a test case that now works with prelocking-free SPs
mysql-test/t/sp-security.test:
Drop tables this test attempts to create
mysql-test/t/sp.test:
Disabled a test that triggers BUG#11986, cleanup used tables when tests start.
mysql-test/t/view.test:
Enabled a test case that now works with prelocking-free SPs
sql/handler.cc:
Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt
sql/item_func.cc:
Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt
sql/sp.cc:
Non-prelocked SP execution: Added support for skipping prelocking of procedure body for
"CALL proc(...)" statements.
sql/sp.h:
Non-prelocked SP execution: Added support for skipping prelocking of procedure body for
"CALL proc(...)" statements.
sql/sp_cache.h:
Added comments
sql/sp_head.cc:
Non-prelocked SP execution:
* Try to unlock tables after PROCEDURE arguments have been evaluated.
* Make sp_lex_keeper be able to execute in 2 modes: A) when already in prelocked mode
B) when its statement enters/leaves prelocked mode itself.
sql/sp_head.h:
Non-prelocked SP execution: Make sp_lex_keeper to additionally keep list of tables it
needs to prelock when its statement enters/leaves prelocked mode on its own.
sql/sql_base.cc:
Non-prelocked SP execution: Make open_tables() to
* detect 'CALL proc(...)' and not to do prelocking for procedure body statements.
* Make lex->query_tables_last to point precisely to a boundary in lex->query_tables
list where 'own' tables and views' tables end and added-for-prelocking tables begin.
(it was not true before - view's tables could end up after query_tables_own_last)
sql/sql_class.cc:
Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt
sql/sql_class.h:
Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt
sql/sql_lex.cc:
Non-prelocked SP execution: More rigourous cleanup in st_lex::cleanup_after_one_table_open()
sql/sql_parse.cc:
Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt, remove outdated comments
sql/sql_trigger.h:
Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt
client/client_priv.h:
add OPT_ for --trigger parameter
client/mysqldump.c:
fixed short simbol for trigger
fixed lines break for more compiler compatibility
added sql_mode output
added comments
made protection of trigger and view restoring commands from execution by old versions of mysql
mysql-test/r/mysqldump.result:
changed test, to test sql_mode
mysql-test/r/sp.result:
now sql_mode preserved in SP
mysql-test/t/mysqldump.test:
changed test, to test sql_mode
mysql-test/t/sp.test:
now sql_mode preserved in SP
sql/set_var.cc:
fixed comment
mysql-test/r/sp.result:
added expected result for bug #8692
mysql-test/t/sp.test:
added testcase for bug #8692
sql/protocol_cursor.cc:
fixed detecting of null fields: A field contains a null value only
if length is NULL_LENGTH
different on Windows. (Bug #11570)
mysql-test/t/sp-threads.test:
Replace host column to avoid spurious error on Windows
mysql-test/t/sp.test:
Replace host column to avoid spurious error on Windows
mysql-test/r/sp.result:
Test results fixed: rewritten test for Bug#6129
mysql-test/r/view.result:
Push a change to the result file from Sanja's patch.
mysql-test/t/sp.test:
Rewrite the test for Bug#6129 (now that stored procedures don't
evaluate system variables at parse, the test produced different results).
The old test failed with 1 in the second invocation (the old
result was wrong).
sql/item_func.cc:
After-merge fix.
sql/item_func.h:
After-merge fix.
sql/mysql_priv.h:
After-merge fix.
sql/mysqld.cc:
Rollback the patch for Bug#7403 (it breaks the test suite).
using @@var_name in proc
Made sure we don't lose the tokenizer state when swapping lex in during SET
parsing.
mysql-test/r/sp.result:
New test case for BUG#9538.
mysql-test/t/sp.test:
New test case for BUG#9538.
sql/sp_head.cc:
Keep lex->next_state when swapping lex during SP parsing (for SET mainly),
otherwise the tokenizer gets confused.
sub-sequent procedure is called" which was fixed by the same patch
as bug #9597 "read lock stays when querying view from stored procedure".
mysql-test/r/sp.result:
Added test case for bug #9565 "Wrong locking in stored procedure if a
sub-sequent procedure is called".
mysql-test/t/sp.test:
Added test case for bug #9565 "Wrong locking in stored procedure if a
sub-sequent procedure is called".
into mysql.com:/home/pem/work/mysql-5.0
mysql-test/r/sp-error.result:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/t/sp-error.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
sql/sp.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
into mysql.com:/home/dlenev/src/mysql-5.0-bg8406
mysql-test/r/sp.result:
Auto merged
mysql-test/r/trigger.result:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/t/trigger.test:
Auto merged
sql/item_func.cc:
Auto merged
sql/sp.cc:
Auto merged
sql/sp_head.h:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_trigger.cc:
Auto merged
mysql-test/r/sp-error.result:
Manual merge.
mysql-test/t/sp-error.test:
Manual merge.
sql/sp_head.cc:
Manual merge.
sql/sql_yacc.yy:
Manual merge.
crash if referencing a table" and several other related bugs.
Fix for bug #11834 "Re-execution of prepared statement with dropped function
crashes server." which was spotted during work on previous bugs.
Also couple of nice cleanups:
- Replaced two separate hashes for stored routines used by statement with one.
- Now instead of doing one pass through all routines used in statement for
caching them and then doing another pass for adding their tables to table
list, we do only one pass during which do both things.
mysql-test/r/sp-error.result:
Added test for bug #11834 "Re-execution of prepared statement with dropped
function crashes server" also covering handling of prepared statements
which use stored functions but does not require prelocking.
mysql-test/r/sp.result:
Updated test for LOCK TABLES with views in table list.
(Old version of statement used in this test will work ok now, since prelocking
algorithm was tuned and will lock only one multi-set of tables for each routine
even if this routine is used in several different views).
mysql-test/r/trigger.result:
Added several tests for triggers using tables.
mysql-test/t/sp-error.test:
Added test for bug #11834 "Re-execution of prepared statement with dropped
function crashes server" also covering handling of prepared statements
which use stored functions but does not require prelocking.
mysql-test/t/sp.test:
Updated comment about recursive views to reflect current situation.
Updated test for LOCK TABLES with views in table list.
(Old version of statement used in this test will work ok now, since prelocking
algorithm was tuned and will lock only one multi-set of tables for each routine
even if this routine is used in several different views).
mysql-test/t/trigger.test:
Added several tests for triggers using tables.
sql/item_func.cc:
Item_func_sp::cleanup():
By next statement execution stored function can be dropped or altered so
we can't assume that sp_head object for it will be still valid.
sql/sp.cc:
- Added Sroutine_hash_entry structure that represents element in the set of
stored routines used by statement or routine. We can't as before use
LEX_STRING for this purprose because we want link all elements of this set
in list.
- Replaced sp_add_to_hash() with sp_add_used_routine() which takes into account
that now we use one hash for stored routines used by statement instead of two
and which mantains list linking all elelemnts in this hash.
- Renamed sp_merge_hash() to sp_update_sp_used_routines().
- Introduced sp_update_stmt_used_routines() for adding elements to the set of
routines used by statement from another similar set for statement or routine.
This function will also mantain list linking elements of destination set.
- Now instead of one sp_cache_routines() function we have family of
sp_cache_routines_and_add_tables() functions which are also responsible for
adding tables used by routines being cached to statement table list. Nice
optimization - thanks to list linking all elements in the hash of routines
used by statement we don't need to perform several iterations over this hash
(as it was before in cases when we have added new elements to it).
sql/sp.h:
Added declarations of functions used for manipulations with set (hash) of stored
routines used by statement.
sql/sp_head.cc:
sp_name::init_qname():
Now sp_name also holds key identifying routine in the set (hash) of
stored routines used by statement.
sp_head:
Instead of two separate hashes sp_funs/m_spprocs representing sets of stored
routines used by this routine we use one hash - m_sroutines.
sp_instr_set_trigger_field:
Added support for subqueries in assignments to row accessors in triggers.
Removed definition of sp_add_sp_tables_to_table_list() and auxilary functions
since now we don't have separate stage on which we add tables used by routines
used by statement to table list for prelocking. We do it on the same stage as
we load those routines in SP cache. So all this functionality moved to
sp_cache_routines_and_add_tables() family of functions.
sql/sp_head.h:
sp_name:
Now this class also holds key identifying routine in the set (hash) of stored
routines used by statement.
sp_head:
Instead of two separate hashes sp_funs/m_spprocs representing sets of stored
routines used by this routine we use one hash - m_sroutines.
sp_instr_set_trigger_field:
Added support for subqueries in assignments to row accessors in triggers.
Removed declaration of sp_add_sp_tables_to_table_list() since now we don't have
separate stage on which we add tables used by routines used by statement to
table list for prelocking. We do it on the same stage as we load those routines
in SP cache.
sql/sql_base.cc:
open_tables():
- LEX::spfuns/spprocs hashes were replaced with one LEX::sroutines hash.
- Now instead of doing one pass through all routines used in statement for
caching them and then doing another pass for adding their tables to table
list, we do only one pass during which do both things. It is easy to do
since all routines in the set of routines used by statement are linked in
the list. This also allows us to calculate table list for prelocking more
precisely.
- Now triggers properly inform prelocking algorithm about tables they use.
sql/sql_lex.cc:
lex_start():
Replaced LEX::spfuns/spprocs with with one LEX::sroutines hash.
Added LEX::sroutines_list list linking all elements in this hash.
st_lex::st_lex():
Moved definition of LEX constructor to sql_lex.cc file to be able
use sp_sroutine_key declaration from sp.h in it.
sql/sql_lex.h:
LEX:
Replaced two separate hashes for stored routines used by statement with one.
Added list linking all elements in this hash to be able to iterate through all
elements and add new elements to this hash at the same time.
Moved constructor definition to sql_lex.cc.
sql/sql_parse.cc:
mysql_execute_command():
Replaced LEX::spfuns/spprocs with one LEX::sroutines hash.
sql/sql_trigger.cc:
Added missing GNU GPL notice.
Table_triggers_list::check_n_load()
Added initialization of sroutines_key which stores key representing
triggers of this table in the set (hash) of routines used by this statement.
sql/sql_trigger.h:
Added missing GNU GPL notice.
Table_triggers_list:
Added sroutines_key member to store key representing triggers of this
table in the set (hash) of routines used by this statement.
Declared sp_cache_routines_and_add_tables_for_triggers() as friend since
it needs access to sroutines_key and trigger bodies.
sql/sql_yacc.yy:
- Now we use sp_add_used_routine() instead of sp_add_to_hash() for adding
elements to the set of stored routines used in statement.
- Enabled support of subqueries as right sides in assignments to triggers' row
accessors.
We used 'IDENT' for labels as a temporary fix for the parser conflicts
introduced if the proper rule 'ident' was used. Now a specially tailored
'label_ident' rule is used for labels instead.
mysql-test/r/sp.result:
New test cases for BUG#7088.
mysql-test/t/sp.test:
New test cases for BUG#7088.
sql/sql_yacc.yy:
Make labels in stored procedures work with other character sets than latin1.
Using a separate 'label_ident' rule (instead of 'ident') and splitting
the 'keyword' rule into two got rid of the temporary fix of using 'IDENT' for
labels (which didn't heed character sets).
into mysql.com:/home/dlenev/src/mysql-5.0-bg11394
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
mysql-test/r/sp-error.result:
Manual merge.
mysql-test/t/sp-error.test:
Manual merge.
sql/share/errmsg.txt:
Manual merge.
We want to have the defacto standard syntax for labels ("L:" instead of "label L;"),
and fix some known bugs, before we enable this again.
The code is left intact (#ifdef'ed SP_GOTO) and the test cases are kept in
sp-goto.test, for the future...
mysql-test/r/sp-error.result:
Moved all goto tests to sp-goto.test.
mysql-test/r/sp.result:
Moved all goto tests to sp-goto.test.
mysql-test/t/disabled.def:
Disabled GOTO/LABEL (until the label syntax and some bugs can be fixed).
We keep the tests in sp-goto.test for the future, but disable for now.
mysql-test/t/sp-error.test:
Moved all goto tests to sp-goto.test.
mysql-test/t/sp.test:
Moved all goto tests to sp-goto.test.
sql/lex.h:
Disabled GOTO/LABEL (until the label syntax and some bugs can be fixed).
sql/sql_yacc.yy:
Disabled GOTO/LABEL (until the label syntax and some bugs can be fixed).
"Stored procedures: crash with function calling itself".
Disallow recursive stored routines until we either make Item's and LEX
reentrant safe or will use spearate sp_head instances (and thus separate
LEX objects and Item trees) for each routine invocation.
mysql-test/r/sp-error.result:
Added tests for bug #11394 "Recursion in SP crash server" and
bug #11600 "Stored procedures: crash with function calling itself".
(We simply disallow recursion for stored routines).
mysql-test/r/sp.result:
Disabled test cases containing recursive stored routines until we will
support for them.
mysql-test/t/sp-error.test:
Added tests for bug #11394 "Recursion in SP crash server" and
bug #11600 "Stored procedures: crash with function calling itself".
(We simply disallow recursion for stored routines).
mysql-test/t/sp.test:
Disabled test cases containing recursive stored routines until we will
support for them.
sql/share/errmsg.txt:
Added error message saying that recursive stored routines are disallowed.
sql/sp_head.cc:
sp_head::execute():
Since many Item's and LEX members can't be used in reentrant fashion
we have to disable recursion for stored routines. So let us track
routine invocations using sp_head::m_is_invoked member and raise
error when one attempts to call routine recursively.
sql/sp_head.h:
sp_head:
Added m_is_invoked member for tracking of routine invocations and
preventing recursion.
Make sure to cleanup the items for a cursor query after each open, otherwise
it's done too late, after the run-time mem_root is freed.
mysql-test/r/sp.result:
New test case for BUG#11529.
mysql-test/t/sp.test:
New test case for BUG#11529.
sql/sp_head.cc:
Add a back pointer from a sp_cursor to its cpush instruction, and use it to set
the arena and cleanup the items for the cursor's query when opening it.
sql/sp_rcontext.cc:
Store pointer in sp_cursor to its cpush instruction.
sql/sp_rcontext.h:
Store pointer in sp_cursor to its cpush instruction.
mysql-test/r/sp.result:
test commented until bug#11394 fix
test for bug#10136
mysql-test/t/sp.test:
test commented until bug#11394 fix
bug10136
sql/sp_head.cc:
fixed items cleunup for SP
into mysql.com:/home/pem/work/mysql-5.0
mysql-test/r/sp.result:
Auto merged
mysql-test/t/sp.test:
Auto merged
sql/item_func.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sp_rcontext.cc:
Auto merged
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.
mysql-test/r/sp.result:
Fixed some minor mistake (spotted while debugging).
mysql-test/t/sp.test:
Fixed some minor mistake (spotted while debugging).
sql/item_func.cc:
Moved Item_func_sp::cleanup() from item_func.h to ease debugging,
and made a debug output come out right.
sql/item_func.h:
Moved Item_func_sp::cleanup() to item_func.cc to ease debugging.
sql/sp_head.cc:
Fixed valgrind problems with the previous memory leak fix (unit cleanup and
putting result field in a differen mem_root), and removed prealloc flag from
init_alloc_root() calls.
sql/sp_rcontext.cc:
New mem_root pointer used for return fields from functions.
sql/sp_rcontext.h:
New mem_root pointer used for return fields from functions.
Added a test case for bug #6866.
sql_select.cc:
Fixed bug #6866.
Bug was due to the fact that on_expr was not backed up
for the second execution of the stored procedure.
sql/sql_select.cc:
Fixed bug #6866.
Bug was due to the fact that on_expr was not backed up
for the second execution of the stored procedure.
mysql-test/r/sp.result:
Added a test case for bug #6866.
mysql-test/t/sp.test:
Added a test case for bug #6866.
Have to catch errors from SELECT when opening a cursor.
mysql-test/r/sp.result:
New test case for BUG#10961.
mysql-test/t/sp.test:
New test case for BUG#10961.
sql/protocol.h:
Init data in Protocol_cursor constructor, for error cases.
sql/sp_head.cc:
Catch "hidden" errors during SELECT when opening a cursor.
results.
Actually a problem when converting decimal to int for user variables.
mysql-test/r/sp.result:
New test case for BUG#9559.
mysql-test/t/sp.test:
New test case for BUG#9559.
sql/item_func.cc:
Don't set the unsigned flag when converting decimal user var to int.
some optimisation of IF/NOT IF ptomised to Pem
mysql-test/r/sp.result:
test for bug#5963
mysql-test/t/sp.test:
test for bug#5963
sql/item.cc:
new method which return reference on Item for SP variables support
sql/item.h:
comment fixed
method added
sql/sp_head.cc:
preparation of item made separate function
we do not need new constant Item to check IF/IF NOT
support of passing correct address of item for fix_fields method
sql/sp_rcontext.cc:
support of Item address passing to fix_fields
sql/sp_rcontext.h:
support of correct address passing to fix_fields
sql/sql_class.cc:
support of correct item address passing to fix_field
mysql-test/r/sp.result:
Correct the result file for the changed test.
mysql-test/t/sp.test:
1) Correct the "fib" stored procedure and its initial data to be mathematical correct: fib(0) = 0
2) Do a small run of "fib" first, that is not likely to hit a memory limit (see entry 9937 in the bug DB).
BitKeeper/etc/logging_ok:
Logging to logging@openlogging.org accepted
a stored procedure" (version 2).
To handle updates and inserts into view in SP properly we should set
lock types for tables of the view's main select when we are opening
view for prelocking purproses.
mysql-test/r/sp.result:
Added test case for bug #9841 "Unexpected read lock when trying to update
a view in a stored procedure"
mysql-test/t/sp.test:
Added test case for bug #9841 "Unexpected read lock when trying to update
a view in a stored procedure"
sql/sql_view.cc:
mysql_make_view():
To handle updates and inserts into view in SP properly we should set
lock types for tables of the view's main select when we are opening
view for prelocking purproses.
Also it is more correct to use LEX::select_lex::get_table_list()
instead of 'view_tables' variable for obtaining list of those
tables.
The bug appears to have already been fixed. (Bug #7293)
mysql-test/r/sp.result:
Add results for new test
mysql-test/t/sp.test:
Add regression test for bug 7293
mysql-test/r/sp.result:
New test case for BUG#9004.
Also updated some other results, since formerly "invisible" (but correct)
warnings now are visible.
mysql-test/t/sp.test:
New test case for BUG#9004.
sql/sql_error.cc:
Don't reset warnings while executing a stored routine.
sql/sql_parse.cc:
Don't reset warnings while executing a stored routine.
Bug partially fixed by 9775/9102 work on SP function return.
mysql-test/r/sp.result:
Bug#8861
Test for bug
mysql-test/t/sp.test:
Bug#8861
Test for bug
sql/protocol.cc:
Bug#8861
Requires change in assertion
Fix bug and implement return type casting.
mysql-test/r/sp.result:
Bug#9775
Test for bug + feature
Fix previous tests
mysql-test/t/sp.test:
Bug#9775
Test for bug + feature
Fix previous tests
sql/item_func.cc:
Bug#9775
new method Item_func_sp::execute(Field **)
some optimizations.
sql/item_func.h:
Bug#9775
results for Item_func_sp pass through a Field of the return type.
new method Item_func_sp::execute(Field **)
sql/sp_head.cc:
Bug#9775
missing initialiation for type_lengths in sp_head::create_typelib()
Bug in the optimizer caused an infinite loop for weird code.
mysql-test/r/sp.result:
New test case for BUG#6898.
mysql-test/t/sp.test:
New test case for BUG#6898.
sql/sp_head.cc:
Detect self referencing jumps in the optimizer.
bugfix 9102 corrected the crashing, this corrects the result.
mysql-test/r/sp.result:
Bug#7648
New test for bug
mysql-test/t/sp.test:
Bug#7648
New test for bug
sql/item_func.h:
Bug#7648
Cannot cheat in Item_func_sp::val_int()
Initialization of fields for sp return type was not complete.
mysql-test/r/sp.result:
Bug#9102
Test for bug
mysql-test/t/sp.test:
Bug#9102
Test for bug
sql/mysql_priv.h:
Bug#9102
new function: sp_prepare_create_field()
sql/sp_head.cc:
Strip spaces and do charset conversion for sp function typelibs
sql/sql_table.cc:
Bug#9102
new function - sp_prepare_create_field()
prepares create_field in similar way to mysql_prepare_table()
sql/sql_yacc.yy:
Bug#9102
... actually, it was a query cache problem. (It shouldn't cache such queries)
mysql-test/r/sp.result:
Added testcase for BUG#9902.
mysql-test/t/sp.test:
Added testcase for BUG#9902.
sql/sql_yacc.yy:
Don't cache queries which are calling stored functions.
overwrites IN variable
and added error checking of variables for [IN]OUT parameters while
rewriting the out parameter handling.
mysql-test/r/sp-error.result:
New test case for non-variable argument for [IN]OUT parameters.
(And changed to qualified names in some other error messages.)
mysql-test/r/sp.result:
New test case for BUG#9598.
mysql-test/t/sp-error.test:
New test case for non-variable argument for [IN]OUT parameters.
mysql-test/t/sp.test:
New test case for BUG#9598.
sql/item.h:
Need to distinguish between SP local variable items and other items,
for error checking and [IN]OUT parameter handling.
sql/share/errmsg.txt:
New error message for non-variable arguments for [IN]OUT parameters in stored procedures.
sql/sp_head.cc:
Rewrote the [IN]OUT parameter handling in procedure invokation, to make
it work properly when using user variables in sub-calls.
Also added error checking for non-variable arguments for such parameters
(and changed to qualified names for wrong number of arg. errors).
sql/sp_rcontext.cc:
No need to keep track on the out index for an [IN]OUT parameter any more.
sql/sp_rcontext.h:
No need to keep track on the out index for an [IN]OUT parameter any more.
causes system crash.
mysql-test/r/sp.result:
Added test case for BUG#9674.
mysql-test/t/sp.test:
Added test case for BUG#9674.
sql/item.cc:
Returning a pointer to a local variable is not a good idea.
Better to use parameter which is there for exactly this purpose.
mysql-test/r/sp.result:
Added test case for BUG#6129.
mysql-test/t/sp.test:
Added test case for BUG#6129.
sql/sp_pcontext.h:
Only need one handler counter.
sql/sql_yacc.yy:
Count handlers correctly.
mysql-test/r/sp.result:
Added testcase for BUG#6129: Check that sql_mode is really set in mysql.proc.
mysql-test/t/sp.test:
Added testcase for BUG#6129: Check that sql_mode is really set in mysql.proc.
mysql-test/r/sp.result:
Added test case for BUG#7185.
mysql-test/t/sp.test:
Added test case for BUG#7185.
sql/sql_yacc.yy:
Allow non-reserved words as stored procedure names.
and BUG#9074: STORED PROC: The scope of every handler declared is not properly applied
mysql-test/r/sp.result:
New test cases for BUG#6900 and BUG#9074 (duplicates).
mysql-test/t/sp.test:
New test cases for BUG#6900 and BUG#9074 (duplicates).
sql/sp_rcontext.cc:
Corrected logic for finding condition handlers - pick the innermost one.
state" to sp-error.test.
According to Per-Erik all SP related tests which should result in error
should go into sp-error.test and not in sp.test, because we want to be
able to run sp.test using normal client.
mysql-test/r/sp-error.result:
Moved test for bug #9566 "explicit LOCK TABLE and store procedures result in illegal
state" to sp-error.test.
mysql-test/r/sp.result:
Moved test for bug #9566 "explicit LOCK TABLE and store procedures result in illegal
state" to sp-error.test.
mysql-test/t/sp-error.test:
Moved test for bug #9566 "explicit LOCK TABLE and store procedures result in illegal
state" to sp-error.test.
mysql-test/t/sp.test:
Moved test for bug #9566 "explicit LOCK TABLE and store procedures result in illegal
state" to sp-error.test.
illegal state".
We should not assume that mysql.proc table does not exist if we are
unable to open it under LOCK TABLES or in prelocked mode (and
remember this fact by setting mysql_proc_table_exists to zero).
mysql-test/r/sp.result:
Added test for bug #9566 "explicit LOCK TABLE and store procedures result in illegal
state"
mysql-test/t/sp.test:
Added test for bug #9566 "explicit LOCK TABLE and store procedures result in illegal
state"
sql/sp.cc:
db_find_routine_aux():
We should not assume that mysql.proc table does not exist if we are
unable to open it under LOCK TABLES or in prelocked mode since this
condition may be transient.
mysql-test/r/create.result:
Auto merged
mysql-test/r/ctype_latin1_de.result:
Auto merged
mysql-test/r/grant.result:
Auto merged
mysql-test/r/grant2.result:
Auto merged
mysql-test/r/limit.result:
Auto merged
mysql-test/r/order_by.result:
Auto merged
mysql-test/r/rpl000001.result:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/r/strict.result:
Auto merged
mysql-test/r/type_blob.result:
Auto merged
mysql-test/r/type_ranges.result:
Auto merged
mysql-test/r/warnings.result:
Auto merged
mysql-test/t/ctype_latin1_de.test:
Auto merged
mysql-test/t/limit.test:
Auto merged
mysql-test/t/order_by.test:
Auto merged
mysql-test/t/show_check.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
mysql-test/t/type_blob.test:
Auto merged
mysql-test/t/type_ranges.test:
Auto merged
sql/item.cc:
Auto merged
sql/item.h:
Auto merged
sql/sql_insert.cc:
Auto merged
mysql-test/t/strict.test:
SCCS merged
Sedond attempt: Simply disallow CHECK in SPs, since it can't work.
mysql-test/r/sp-error.result:
New test cast for BUG#6600
mysql-test/r/sp.result:
Removed old test case for BUG#6600
mysql-test/t/sp-error.test:
New test cast for BUG#6600
mysql-test/t/sp.test:
Removed old test case for BUG#6600
sql/share/errmsg.txt:
Made the SP bad statement error message more general.
sql/sp_head.cc:
CHECK is not possible in stored procedures.
sql/sql_parse.cc:
Undid attempt to fix CHECK in stored procedures, it didn't work.
sql/sql_yacc.yy:
CHECK is not possible in stored procedures.
(And updated error messages for LOCK/UNLOCK.)
mysql-test/r/sp.result:
New test case for BUG#6600.
mysql-test/t/sp.test:
New test case for BUG#6600.
sql/sp_head.cc:
Added yet another multiple result set statement to the list.
sql/sql_parse.cc:
Have to invalidate SP caches in CHECK TABLE, or it will produce very
strange results when called in SPs.
and removed a have_innodb.inc inclusion which was left by mistake
in an earlier change.
mysql-test/r/sp_trans.result:
Changed procedure name and delimiter setting to follow the style of the other SP test files.
mysql-test/t/sp-error.test:
Added comment with hint for bug test case style.
mysql-test/t/sp-threads.test:
Added comments, with hint for bug test case style.
mysql-test/t/sp.test:
Removed have_innodb.inc inclusion.
Added comments about different SP test files, table usage and
hint for bug test case style.
mysql-test/t/sp_trans.test:
Changed procedure name and delimiter setting to follow the style of the other SP test files.
transactional test removed
sp_trans.test, sp_trans.result:
new file
mysql-test/r/sp.result:
transactional test removed
mysql-test/t/sp.test:
transactional test removed
into pcgem.rdg.cyberkinetica.com:/var/db/bk/work-acurtis/bug3788.4
mysql-test/r/sp.result:
Auto merged
mysql-test/t/sp.test:
Auto merged
sql/sql_parse.cc:
Auto merged
mysql-test/r/information_schema.result:
Auto merged
mysql-test/t/sp.test:
Auto merged
sql/item.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_func.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sp.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sp_head.h:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
mysql-test/r/sp.result:
Merge
BitKeeper/etc/logging_ok:
Logging to logging@openlogging.org accepted
mysql-test/r/sp.result:
fixing results for new test
mysql-test/t/sp.test:
making a new test with autocommit set to 0 and 1.
Second CALL is in autocommit mode to prove that the relevant bug
(bug #8550) is fixed.
mysql-test/r/sp.result:
New test case for BUG#8937.
mysql-test/t/sp.test:
New test case for BUG#8937.
sql/item_sum.h:
Added val_int() method for Item_sum_avg for forced int types (in SPs for instance),
otherwise Item_sum_sum::val_int() is used.
mysql-test/r/sp.result:
Reorganized tests (all bugs at the end now) and made some tests adopt to the file's style.
mysql-test/t/sp.test:
Reorganized tests (all bugs at the end now) and made some tests adopt to the file's style.
stored procedure, it is converted to DELETE.
mysql-test/r/sp.result:
A result for the test case for bug #8850
mysql-test/t/sp.test:
A test case for the bug #8850
sql/sql_delete.cc:
A fix for bug #8850, plus adding a missing call to mysql_init_select(),
which caused mem_root corruption.
sql/sql_parse.cc:
A fix for the bug #8850
BitKeeper/etc/ignore:
Added acinclude.m4 to the ignore list
Crashes with stored procedure return non-string values
Also fixes Bug#2773
mysql-test/r/information_schema.result:
Bug#3788
Fix results for bugfix
mysql-test/r/sp.result:
Bug#3788
Tests for Bug
Fix results for bugfix
mysql-test/t/sp.test:
Bug#3788
New tests for bug
sql/item.cc:
Fix unrelated crash in view test with --ps-protocol.
sql/item_func.cc:
Bug#3788
Alter how SP function result types are handled.
sql/item_func.h:
Bug#3788
Alter how SP function result types are handled.
sql/mysql_priv.h:
Bug#3788
Prototypes for new global functions
sql/sp.cc:
Bug#3788
Alter how function return type is reported
sql/sp_head.cc:
Bug#3788
Change how function return types are stored for SPs
sql/sp_head.h:
Bug#3788
Change how function return types are stored for SPs
sql/sql_parse.cc:
Bug#3788
Split out field construction into its own function
sql/sql_table.cc:
Bug#3788
Split out field preparation code into its own function
sql/sql_yacc.yy:
Bug#3788
Change how function return types are stored for SPs
sql/unireg.cc:
Bug#3788
Add assertion check
mysql-test/r/mysqldump.result:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/t/mysqldump.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
sql/item_func.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sp.cc:
Auto merged
sql/sp_rcontext.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_update.cc:
Auto merged
sql/sql_view.cc:
Auto merged
sql/table.h:
Auto merged
sql/sp_head.cc:
Manual merge.
sql/sql_class.cc:
Manual merge.
sql/sql_parse.cc:
Manual merge.
sql/sql_yacc.yy:
Manual merge.
and some SP-related cleanups.
- We don't have separate stage for calculation of list of tables
to be prelocked and doing implicit LOCK/UNLOCK any more.
Instead we calculate this list at open_tables() and do implicit
LOCK in lock_tables() (and UNLOCK in close_thread_tables()).
Also now we support cases when same table (with same alias) is
used several times in the same query in SP.
- Cleaned up execution of SP. Moved all common code which handles
LEX and does preparations before statement execution or complex
expression evaluation to auxilary sp_lex_keeper class. Now
all statements in SP (and corresponding instructions) that
evaluate expression which can contain subquery have their
own LEX.
mysql-test/r/lock.result:
Replaced wrong error code with the correct one after fixing bug in
SP-locking.
mysql-test/r/mysqldump.result:
Added dropping of view which is used in test to its beginning.
mysql-test/r/sp.result:
Added tests for improved SP-locking.
Temporarily disabled tests for SHOW PROCEDURE STATUS and alike
(Until Monty will allow to open mysql.proc under LOCK TABLES without
mentioning it in lock list).
Replaced wrong results of test for bug #5240 with correct results after
fixing bug in handling of cursors.
mysql-test/t/lock.test:
Replaced wrong error code with the correct one after fixing bug in
SP-locking.
mysql-test/t/mysqldump.test:
Added dropping of view which is used in test to its beginning.
mysql-test/t/sp.test:
Added tests for improved SP-locking.
Temporarily disabled tests for SHOW PROCEDURE STATUS and alike
(Until Monty will allow to open mysql.proc under LOCK TABLES without
mentioning it in lock list).
Removed test for bug #1654 since we already test exactly this function
in one of SP-locking tests.
Removed comment about cursor's wrong behavior in test for bug #5240
after fixing bug which was its cause.
sql/item_func.cc:
Removed comment which is no longer true.
sql/mysql_priv.h:
Changed open_tables() signature.
Now its 2nd parameter is in/out since it can add elements to table list.
sql/sp.cc:
sp_find_procedure():
Added one more parameter which enforces cache only lookup.
sp_merge_hash():
Now uses its return value to indicate that first of two hashes changed
as result of merge.
sp_cache_routines():
This function caches all stored routines used in query now.
sql/sp.h:
- sp_find_procedure() now has one more parameter which enforces cache only
lookup.
- sp_merge_hash() now uses its return value to indicate that first of two
hashes changed as result of merge.
- sp_cache_routines() caches all stored routines now. So it does not need
third argument any more.
sql/sp_head.cc:
sp_head::sp_head():
Added initialization of new m_spfuns and m_spprocs members.
sp_head::execute():
Let us save/restore part of thread context which can be damaged by
execution of instructions.
sp_head::execute_function()/execute_procedure():
Now it is responsibility of caller to close tables used in
subqueries which are passed as routine parameters.
sp_head::restore_lex():
Let us accumulate information about routines used by this one
in new m_spfuns, m_spprocs hashes.
sp_lex_keeper::reset_lex_and_exec_core()
Main method of new auxilary sp_lex_keeper class to which instructions
delegate responsibility for handling LEX and preparations before
executing statement or calculating complex expression.
Since all instructions which calculate complex expression or execute
command now use sp_lex_keeper they have to implement
sp_instr::exec_core() method. Most of instruction specific logic
has moved from sp_instr::execute() to this new method.
Removed sp_instr_set_user_var class which is no longer used, because
nowdays we allow execution of statements in stored functions and
triggers.
sp_merge_table_list() became sp_head::merge_table_list() method. It
also treats sp_head::m_sptabs as multi-set of tables now.
sp_hash_to_table_list() became sp_head::add_used_tables_to_table_list().
It takes into account that sp_head::m_sptabs is multi-set and allocates
object into persistent arena of PS.
Removed sp_merge_table_hash(), sp_open_and_lock_tables(),
sp_unlock_tables(), sp_merge_routine_tables() methods since they are not
used by new prelocking mechanism.
Added sp_add_sp_tables_to_table_list() which serves for adding tables needed
by routines used in query to the query table list for prelocking.
sql/sp_head.h:
class sp_head:
- Added m_spfuns, m_spprocs members for storing names of routines used
by this routine.
- Added add_used_tables_to_table_list() method which allows to add
tables needed by this routine to query's table list.
- Converted sp_merge_table_list() to sp_head::merge_table_list() method.
- Changed semantics of THD::m_sptabs. Now it is multi-set which contains
only tables which are used by this routine and not routines that are
called from this one.
Removed sp_merge_routine_tables(), sp_merge_table_hash(),
sp_open_and_lock_tables(), sp_unlock_tables() calls since they are not
used for our prelocking list calculation.
Added auxilary sp_lex_keeper class to which instructions delegate
responsibility for handling LEX and preparations before executing
statement or calculating complex expression. This class uses
new sp_instr::exec_core() method which is responsible for executing
instruction's core function after all preparations were made.
All instructions which hold and calculate complex expression now have
their own LEX (by aggregating sp_lex_keeper instance). sp_instr_stmt
now uses sp_lex_keeper too.
Removed sp_instr_set_user_var class which is no longer used, because
nowdays we allow execution of statements in stored functions and
triggers.
sql/sp_rcontext.cc:
Now sp_cursor holds pointer to sp_lex_keeper instead of LEX.
sql/sp_rcontext.h:
Now sp_cursor holds pointer to sp_lex_keeper instead of LEX.
sql/sql_acl.cc:
acl_init(), grant_init():
Now we use simple_open_n_lock_tables() instead of explicit
calls to open_tables() and mysql_lock_tables().
sql/sql_base.cc:
Implemented support for execution of statements in "prelocked" mode.
When we have statement which uses stored routines explicitly or
implicitly (via views or triggers) we have to open and lock all tables
for these routines at the same time as tables for the main statement.
In fact we have to do implicit LOCK TABLES at the begining of such
statement and implict UNLOCK TABLES at its end. We call such mode
"prelocked".
When open_tables() is called for the statement tables which are needed
for execution of routines used by it are added to its tables list
(this process also caches all routines used). Implicit use of routines
is discovered when we open view or table with trigger and apropriate
tables are added to the table list at this moment. Statement which has
such extra tables in its list (well actually any that uses functions)
is marked as requiring prelocked mode for its execution.
When lock_tables() sees such statement it will issue implicit LOCK TABLES
for this extended table list instead of doing usual locking, it will also
set THD::prelocked_mode to indicate that we are in prelocked mode.
When open_tables()/lock_tables() are called for statement of stored
routine (substatement), they notice that we are running in prelocked mode
and use one of prelocked tables from those that are not used by upper
levels of execution.
close_thread_tables() for substatement won't really close tables used
but will mark them as free for reuse instead.
Finally when close_thread_tables() is called for the main statement it
really unlocks and closes all tables used.
Everything will work even if one uses such statement under real LOCK
TABLES (we are simply not doing implicit LOCK/UNLOCK in this case).
sql/sql_class.cc:
Added initialization of THD::prelocked_mode member.
sql/sql_class.h:
- Added prelocked_mode_type enum and THD::prelocked_mode member
which are used for indication whenever "prelocked mode" is on
(i.e. that statement uses stored routines and is executed under
implicit LOCK TABLES).
- Removed THD::shortcut_make_view which is no longer needed.
We use TABLE_LIST::prelocking_placeholder for the same purprose
now.
sql/sql_handler.cc:
Changed open_tables() invocation.
Now its 2nd parameter is in/out since it can add elements to table list.
sql/sql_lex.cc:
lex_start():
Added initialization of LEX::query_tables_own_last.
Unused LEX::sptabs member was removed.
st_lex::unlink_first_table()/link_first_table_back():
We should update LEX::query_tables_last properly if table list
contains(ed) only one element.
sql/sql_lex.h:
LEX:
- Removed sptabs member since it is no longer used.
- Added query_tables_own_last member, which if non-0 indicates that
statement requires prelocking (implicit LOCK TABLES) for its execution
and points to last own element in query table list. If it is zero
then this query does not need prelocking.
- Added requires_prelocking(), mark_as_requiring_prelocking(),
first_not_own_table() inline methods to incapsulate and simplify
usage of this new member.
sql/sql_parse.cc:
dispatch_command():
To properly leave prelocked mode when needed we should call
close_thread_tables() even if there are no open tables.
mysql_execute_command():
- Removed part of function which were responsible for doing implicit
LOCK TABLES before statement execution if statement used stored
routines (and doing UNLOCK TABLES at the end).
Now we do all this in open_tables()/lock_tables()/close_thread_tables()
instead.
- It is also sensible to reset errors before execution of statement
which uses routines.
- SQLCOM_DO, SQLCOM_SET_OPTION, SQLCOM_CALL
We should always try to open tables because even if statement has empty
table list, it can call routines using tables, which should be preopened
before statement execution.
- SQLCOM_CALL
We should not look up routine called in mysql.proc, since it should be
already cached by this moment by open_tables() call.
- SQLCOM_LOCK_TABLES
it is better to use simple_open_n_lock_tables() since we want to avoid
materialization of derived tables for this command.
sql/sql_prepare.cc:
mysql_test_update():
Changed open_tables() invocations. Now its 2nd parameter is in/out
since it can add elements to table list.
check_prepared_statement():
Since now we cache all routines used by statement in open_tables() we
don't need to do it explicitly.
mysql_stmt_prepare():
Now we should call close_thread_tables() when THD::lex points to the
LEX of statement which opened tables.
reset_stmt_for_execute():
Commented why we are resetting all tables in table list.
sql/sql_trigger.h:
Table_triggers_list::process_triggers():
We should surpress sending of ok packet when we are calling trigger's
routine, since now we allow statements in them.
sql/sql_update.cc:
Changed open_tables() invocations.
Now its 2nd parameter is in/out since it can add elements to table list.
sql/sql_view.cc:
mysql_make_view():
- Removed handling of routines used in view. Instead we add tables which
are needed for their execution to statement's table list in
open_tables().
- Now we use TABLE_LIST::prelocking_placeholder instead of
THD::shortcut_make_view for indicating that view is opened
only to discover which tables and routines it uses (this happens
when we build extended table list for prelocking). Also now we try
to avoid to modify main LEX in this case (except of its table list).
- Corrected small error we added tables to the table list of the main
LEX without updating its query_tables_last member properly.
sql/sql_yacc.yy:
Now each expression which is used in SP statements and can contain
subquery has its own LEX. This LEX is stored in corresponding sp_instr
object and used along with Item tree for expression calculation.
We don't need sp_instr_set_user_var() anymore since now we allow
execution of statements in stored functions and triggers.
sql/table.h:
Added TABLE_LIST::prelocking_placeholder member for distinguishing
elements of table list which does not belong to the statement itself
and added there only for prelocking (as they are to be used by routines
called by this statement).
sql/tztime.cc:
my_tz_init():
Now we use more simplier simple_open_n_lock_tables() call instead of
open_tables()/lock_tables() pair.
and bug#8849 "problem with insert statement with table alias's":
make equality propagation work in stored procedures and prepared
statements.
Equality propagation can change AND/OR structure of ON expressions,
so the fix is to provide each execution of PS/SP with it's own
copy of AND/OR tree. We have been doing that already for WHERE clauses,
now ON clauses are also copied.
mysql-test/r/ps.result:
Bug#8115: test results fixed.
mysql-test/r/sp.result:
Bug#8849: test results fixed.
mysql-test/t/ps.test:
A test case for Bug#8115 "Server Crash with prepared statement".
mysql-test/t/sp.test:
A test case for Bug#8849 "problem with insert statement with table
alias's".
sql/item_cmpfunc.cc:
Comment a parse tree transformation.
sql/item_cmpfunc.h:
Comment how Item_equal works with PS/SP.
sql/mysql_priv.h:
Add declaration for init_stmt_after_parse.
sql/sp_head.cc:
Call init_stmt_after_parse in restore_lex(), which is used to
grab TABLE_LIST and SELECT_LEX list of a parsed substatement of
stored procedure. This is a necessary post-init step which
must be done for any statement which can be executed many times.
sql/sql_prepare.cc:
Implement init_stmt_after_parse() which prepares AND/OR
structure of all ON expressions and WHERE clauses of a statement
for copying.
sql/sql_select.cc:
Implementation of equality propagation inspected with regard to
prepared statements and stored procedures. We now restore
AND/OR structure of every ON expression in addition to AND/OR
structure of WHERE clauses when reexecuting a PS/SP.
sql/table.h:
Add declaration for TABLE::prep_on_expr.
of DROP PROCEDURE IF EXISTS statement.
mysql-test/r/sp.result:
New test case for BUG#8757
mysql-test/t/sp.test:
New test case for BUG#8757
sql/sp.cc:
Don't zap lex->found_semicolon. (For compound statements)
mysql-test/r/sp.result:
New test case for BUG#8757.
mysql-test/t/sp.test:
New test case for BUG#8757.
sql/sp_pcontext.cc:
Return the correct scope offset to cursors during parsing.
Have to thd->set_time() before each substatement execution, to make
current_time() et al return different times within the same procedure.
mysql-test/r/sp.result:
New test case for BUG#6857: current_time() in STORED PROCEDURES.
Note: The actual call is disable, to save time when running with slow debugging tools.
mysql-test/t/sp.test:
New test case for BUG#6857: current_time() in STORED PROCEDURES.
Note: The actual call is disable, to save time when running with slow debugging tools.
sql/sp_head.cc:
Make current_time() et all work in stored procedures.
into 51.0.168.192.in-addr.arpa:/Users/bell/mysql/bk/work-qc_item_view-5.0
mysql-test/r/sp.result:
Auto merged
mysql-test/t/sp.test:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sql_cache.cc:
Auto merged
BitKeeper/etc/logging_ok:
Logging to logging@openlogging.org accepted
BUG#6642: Stored procedure crash if expression with set function
BUG#7013: Stored procedure crash if group by ... with rollup
BUG#7743: 'Lost connection to MySQL server during query' on Stored Procedure
BUG#7992: SELECT .. INTO variable .. within Stored Procedure crashes
the server
BUG#8116: calling simple stored procedure twice in a row results
in server crash
Rolling back the item change list after each substatement in a procedure
fixed the failing assert().
mysql-test/r/sp.result:
New test cases for BUG#6642, 7013, 7743, 7992 and 8116.
mysql-test/t/sp.test:
New test cases for BUG#6642, 7013, 7743, 7992 and 8116.
sql/sp_head.cc:
Roll back the item change list after each sub statement.
mysql-test/r/sp.result:
New test case for BUG#8540.
mysql-test/t/sp.test:
New test case for BUG#8540.
sql/item.h:
Use the existing name (if any) for a SP local variable (to get the correct
field name in a select in the case of an alias).
Collect all tables and SPs refered by a statement, and open all tables
with an implicit LOCK TABLES. Do find things refered by triggers and views,
we open them first (and then repeat this until nothing new is found), before
doing the actual lock tables.
mysql-test/r/information_schema.result:
Updated result for WL#2130.
mysql-test/r/lock.result:
Updated result for WL#2130.
mysql-test/r/sp-error.result:
Updated result for WL#2130.
mysql-test/r/sp.result:
Updated result for WL#2130.
mysql-test/r/view.result:
Updated result for WL#2130.
mysql-test/t/information_schema.test:
Disabled one test case due to a bug involving LOCK TABLES,
which shows up with WL#2130.
mysql-test/t/lock.test:
New error message with WL#2130. This change is under debate and might change
in the future, but will do for now.
mysql-test/t/sp-error.test:
Updated for WL#2130. Some tests are voided when table access does work from
functions.
mysql-test/t/sp.test:
Updated for WL#2130.
mysql-test/t/view.test:
Updated for WL#2130.
sql/item_func.cc:
We now have to set net.no_send_ok for functions too, with WL#2130.
sql/share/errmsg.txt:
Reused an error code since the old use was voided by WL#2130, but a new
one was needed instead (similar, but more specific restriction).
sql/sp.cc:
Fixed error handling and collection of used tables for WL#2130.
sql/sp.h:
Fixed error handling and collection of used tables for WL#2130.
sql/sp_head.cc:
Added support functions for collecting and merging hash tables and lists
of used tables from SPs and substatements, for WL#2130.
sql/sp_head.h:
Added support functions for collecting and merging hash tables and lists
of used tables from SPs and substatements, for WL#2130.
sql/sql_base.cc:
Changed the way table->query_id is tested and set during with locked tables
in effect. This makes some SP test cases work with WL#2130, but has a side
effect on some error cases with explicit LOCK TABLES. It's still debated if
this is the correct way, so it might change.
sql/sql_class.h:
Added flags for circumventing some interference between WL#2130 and mysql_make_view().
sql/sql_derived.cc:
Added some missing initializations. (Potential bugs.)
sql/sql_lex.cc:
Clear the new hash tables for WL#2130.
sql/sql_lex.h:
Added hash tables for procedures and tables too (as for functions), for WL#2130.
sql/sql_parse.cc:
WL#2130: Make table accesses from stored functions work by adding an implicit
LOCK TABLES around (most) executed statements. To do this, we have to go through
a loop where we collect all SPs and tables in mysql_execute_statement.
sql/sql_prepare.cc:
Cache both functions and procedures for WL#2130.
sql/sql_show.cc:
Added some missing initializations. (Potential bugs.)
sql/sql_view.cc:
Shortcut mysql_make_view() if thd->shortcut_make_view is true during
the pre-open phase for collecting tables in WL#2130. Otherwise, the
similar mechanism here causes interference.
sql/sql_yacc.yy:
For WL#2130, added caching of procedures and disallowed LOCK/UNLOCK TABLES in SPs.
mysql-test/r/sp.result:
rolling back temporary Item tree changes in SP
mysql-test/t/sp.test:
rolling back temporary Item tree changes in SP
sql/sp_head.cc:
if PS instruction made some temporary changes in Item tree we have to roll it back
are not specified in an insert. Most of these changes are actually to
clean up the test suite to either specify defaults to avoid warnings,
or add the warnings to the results. Related to bug #5986.
mysql-test/t/index_merge_ror.test:
Set default on columns to avoid warnings
mysql-test/t/ctype_many.test:
Add defaults to avoid warnings
mysql-test/t/ctype_latin1_de.test:
Add defaults to avoid warnings
mysql-test/t/gis-rtree.test:
Remove field that isn't used in test
mysql-test/t/limit.test:
set default values
mysql-test/t/null.test:
Specify default values
mysql-test/t/order_by.test:
add default value
mysql-test/t/show_check.test:
Add defaults
mysql-test/t/sp.test:
Add default value
mysql-test/t/type_blob.test:
Set default value
mysql-test/t/type_ranges.test:
Set default values
mysql-test/r/create.result:
Update results
mysql-test/r/ctype_latin1_de.result:
Update results
mysql-test/r/ctype_many.result:
Update results
mysql-test/r/gis-rtree.result:
Update results
mysql-test/r/grant.result:
Update results
mysql-test/r/grant2.result:
Update results
mysql-test/r/help.result:
Update results
mysql-test/r/limit.result:
Update results
mysql-test/r/null.result:
Update results
mysql-test/r/order_by.result:
Update results
mysql-test/r/rpl000001.result:
Update results
mysql-test/r/sp.result:
Update results
mysql-test/r/strict.result:
Update results
mysql-test/r/type_blob.result:
Update results
mysql-test/r/type_ranges.result:
Update results
mysql-test/r/warnings.result:
Update results
sql/sql_insert.cc:
Change check_that_all_fields_are_given_values() to issue warnings for all
fields, and not only run when thd->abort_on_warning is set and error on
just the first field.
Add support for warnings for prepare of prepared statements
Fixed test to work with --ps-protocol
Fixed some test results
libmysql/libmysql.c:
Add support for warnings for prepare of prepared statements
mysql-test/r/func_concat.result:
After merge fixes
mysql-test/r/select.result:
Delete conflicting tables form previous tests
mysql-test/r/view.result:
New code from 4.1 fixed old error
mysql-test/t/create.test:
Ensure that --ps-protocol return same results as normal test
mysql-test/t/func_group.test:
Remove not needed --disable_ps_protocol
mysql-test/t/func_time.test:
Ensure that --ps-protocol return same results as normal test
mysql-test/t/having.test:
Ensure that --ps-protocol return same results as normal test
mysql-test/t/insert_select.test:
Remove not needed --disable_ps_protocol
mysql-test/t/select.test:
Ensure that --ps-protocol return same results as normal test
mysql-test/t/sp.test:
Fixed comment
mysql-test/t/system_mysql_db_fix.test:
Fix that results is same as from system_mysql_db.test
mysql-test/t/trigger.test:
Added comment
mysql-test/t/type_blob.test:
Remove not needed --disable_ps_protocol
mysql-test/t/union.test:
Run most of the test with --ps-protocol
mysql-test/t/user_limits.test:
Ensure that --ps-protocol return same results as normal test
mysql-test/t/view.test:
Removed --error as bug is now fixed
mysql-test/t/warnings.test:
Ensure that --ps-protocol return same results as normal test
ndb/include/Makefile.am:
Don't automaticly use SCCS files
sql/ha_ndbcluster.cc:
Removed compiler warning
sql/log_event.cc:
After merge fix
sql/sql_class.h:
After merge fix
sql/sql_insert.cc:
After merge fix
sql/sql_load.cc:
After merge fix
sql/sql_prepare.cc:
Add support for warnings for prepare of prepared statements
sql/sql_update.cc:
After merge fixes
This fixed a bug in prepared statements when used with outher joins
Fixed a bug in SUM(DISTINCT) when used with prepared statements.
Some safety fixes in test scripts to ensure that previous test failures shouldn't affect other tests
mysql-test/r/mysqldump.result:
Safety fix if a previous test would fail
mysql-test/r/show_check.result:
Safety fix if a previous test would fail
mysql-test/r/sp.result:
Fix for --ps-protocol
mysql-test/r/synchronization.result:
Safety fix if a previous test would fail
mysql-test/r/system_mysql_db.result:
Safety fix if a previous test would fail
mysql-test/t/mysqldump.test:
Safety fix if a previous test would fail
mysql-test/t/select.test:
Safety fix if a previous test would fail
mysql-test/t/show_check.test:
Safety fix if a previous test would fail
mysql-test/t/sp.test:
fix for --ps-protocol
mysql-test/t/strict.test:
Fix for --ps-protocol
mysql-test/t/synchronization.test:
Safety fix if a previous test would fail
mysql-test/t/system_mysql_db.test:
Safety fix if a previous test would fail
sql/item_sum.cc:
Fix bug in SUM(DISTINCT...) when using with prepared statements
sql/item_sum.h:
Fix bug in SUM(DISTINCT...) when using with prepared statements
sql/mysql_priv.h:
Better handling of ensuring that setup_tables() are not called twice
sql/sql_base.cc:
Better handling of ensuring that setup_tables() are not called twice
sql/sql_insert.cc:
Better handling of ensuring that setup_tables() are not called twice
sql/sql_parse.cc:
Better handling of ensuring that setup_tables() are not called twice
sql/sql_prepare.cc:
Better handling of ensuring that setup_tables() are not called twice
sql/sql_select.cc:
Better handling of ensuring that setup_tables() are not called twice
sql/sql_union.cc:
Better handling of ensuring that setup_tables() are not called twice
sql/sql_update.cc:
Better handling of ensuring that setup_tables() are not called twice
sql/table.h:
Better handling of ensuring that setup_tables() are not called twice
robustness (dropping things just in case).
mysql-test/r/sp.result:
Reverted previous name changes of all bug tests, but kept the
robustness (dropping things just in case).
mysql-test/t/sp.test:
Reverted previous name changes of all bug tests, but kept the
robustness (dropping things just in case).
include/mysqld_error.h:
Auto merged
libmysqld/lib_sql.cc:
Auto merged
mysql-test/r/rpl_charset.result:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/t/rpl_charset.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
sql/filesort.cc:
Auto merged
sql/ha_innodb.cc:
Auto merged
sql/ha_innodb.h:
Auto merged
sql/handler.cc:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_row.cc:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/item_uniq.h:
Auto merged
sql/log.cc:
Auto merged
sql/log_event.cc:
Auto merged
sql/mysqld.cc:
Auto merged
sql/parse_file.cc:
Auto merged
sql/protocol.cc:
Auto merged
sql/protocol.h:
Auto merged
sql/protocol_cursor.cc:
Auto merged
sql/repl_failsafe.cc:
Auto merged
sql/repl_failsafe.h:
Auto merged
sql/set_var.cc:
Auto merged
sql/slave.cc:
Auto merged
sql/slave.h:
Auto merged
sql/sp.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sql_analyse.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_db.cc:
Auto merged
sql/sql_delete.cc:
Auto merged
sql/sql_error.cc:
Auto merged
sql/sql_help.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_load.cc:
Auto merged
sql/sql_repl.h:
Auto merged
sql/sql_select.h:
Auto merged
sql/sql_show.cc:
Auto merged
sql/share/czech/errmsg.txt:
Auto merged
sql/share/danish/errmsg.txt:
Auto merged
sql/share/dutch/errmsg.txt:
Auto merged
sql/share/english/errmsg.txt:
Auto merged
sql/share/estonian/errmsg.txt:
Auto merged
sql/share/french/errmsg.txt:
Auto merged
sql/share/german/errmsg.txt:
Auto merged
sql/share/greek/errmsg.txt:
Auto merged
sql/share/hungarian/errmsg.txt:
Auto merged
sql/share/italian/errmsg.txt:
Auto merged
sql/share/japanese/errmsg.txt:
Auto merged
sql/share/korean/errmsg.txt:
Auto merged
sql/share/norwegian-ny/errmsg.txt:
Auto merged
sql/share/norwegian/errmsg.txt:
Auto merged
sql/share/polish/errmsg.txt:
Auto merged
sql/share/portuguese/errmsg.txt:
Auto merged
sql/sql_udf.cc:
Auto merged
sql/sql_view.cc:
Auto merged
sql/table.cc:
Auto merged
sql/unireg.cc:
Auto merged
sql/share/romanian/errmsg.txt:
Auto merged
sql/share/russian/errmsg.txt:
Auto merged
sql/share/serbian/errmsg.txt:
Auto merged
sql/share/slovak/errmsg.txt:
Auto merged
sql/share/spanish/errmsg.txt:
Auto merged
sql/share/swedish/errmsg.txt:
Auto merged
sql/share/ukrainian/errmsg.txt:
Auto merged
- No RESTICT|CASCADE in DROP SP (since it's not implemented)
- Added optional "noise" to FETCH: [[NEXT] FROM]
- At least one statement required in all block constructs except BEGIN-END
(where zero is allowed)
mysql-test/r/sp.result:
Modified test cases for optional [[NEXT] FROM] in FETCH.
mysql-test/t/sp.test:
Modified test cases for optional [[NEXT] FROM] in FETCH.
sql/sql_yacc.yy:
Various syntax fixes for stored procedures:
- No RESTICT|CASCADE in DROP SP (since it's not implemented)
- Added optional "noise" to FETCH: [[NEXT] FROM]
- At least one statement required in all block constructs except BEGIN-END
(where zero is allowed)
mysql-test/r/sp-security.result:
Auto merged
mysql-test/r/sp.result:
Auto merged
mysql-test/t/sp-security.test:
Auto merged
mysql-test/t/sp.test:
Auto merged
sql/log_event.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/sp.cc:
Auto merged
sql/sp_rcontext.cc:
Auto merged
sql/sql_base.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_load.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
mysql-test/r/sp.result:
New test case for BUG#6022.
mysql-test/t/sp.test:
New test case for BUG#6022.
sql/sp_rcontext.cc:
Find the most specific condition handler, not just the first one.
(And corrected the return type for find_handler)
sql/sp_rcontext.h:
Corrected return type for find_handler.
Fixed the pre-caching of functions. It now gives the expected stack overrun
error for functions recursing too deep.
mysql-test/r/sp.result:
New test case for BUG#6022.
mysql-test/t/sp.test:
New test case for BUG#6022.
sql/sp.cc:
Cache function first, then recurse, or the pre-caching loops infinitely
for recursive functions.
Removed the support for renaming SPs. It's non-standard, conflicted with a standard
syntax, and was a bit broken anyway.
mysql-test/r/sp-error.result:
Removed test for renaming procedures with alter.
mysql-test/r/sp.result:
Removed test for renaming procedures with alter.
mysql-test/t/sp-error.test:
Removed test for renaming procedures with alter.
mysql-test/t/sp.test:
Removed test for renaming procedures with alter.
sql/sp.cc:
Removed support for renaming SPs. It's non-standard, conflicted with a standard
syntax, and was a bit broken anyway.
sql/sp.h:
Removed support for renaming SPs. It's non-standard, conflicted with a standard
syntax, and was a bit broken anyway.
sql/sql_parse.cc:
Removed support for renaming SPs. It's non-standard, conflicted with a standard
syntax, and was a bit broken anyway.
sql/sql_yacc.yy:
Removed support for renaming SPs. It's non-standard, conflicted with a standard
syntax, and was a bit broken anyway.
into sanja.is.com.ua:/home/bell/mysql/bk/work-error-5.0
mysql-test/r/sp.result:
Auto merged
mysql-test/t/sp.test:
Auto merged
sql/item.cc:
Auto merged
sql/item_sum.cc:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/sp.cc:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sql_acl.cc:
Auto merged
sql/sql_handler.cc:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_select.h:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
net_printf/send_error calls replaced by my_error family functions
-1/1 (sent/unsent) error reporting removed
(WL#2133)
include/mysqld_error.h:
new errors added.
mysql-test/r/rpl_charset.result:
new error
mysql-test/r/rpl_timezone.result:
new error
mysql-test/r/sp-security.result:
more clean error message
mysql-test/r/sp.result:
now error state intercepted correctly
mysql-test/t/connect.test:
new error message
mysql-test/t/rpl_charset.test:
new error message
mysql-test/t/rpl_timezone.test:
new error
mysql-test/t/sp-security.test:
more correct error handling
mysql-test/t/sp.test:
now error state intercepted correctly
sql/ha_innodb.cc:
-1/1 (sent/unsent) error reporting removed
sql/ha_innodb.h:
-1/1 (sent/unsent) error reporting removed
sql/item.cc:
only boolean values should be returned by fix_fields()
sql/item_cmpfunc.cc:
only boolean values should be returned by fix_fields()
sql/item_func.cc:
only boolean values should be returned by fix_fields()
net_printf/send_error calls replaced by my_error family functions
sql/item_row.cc:
only boolean values should be returned by fix_fields()
sql/item_subselect.cc:
only boolean values should be returned by fix_fields()
-1/1 (sent/unsent) error reporting removed
sql/item_subselect.h:
-1/1 (sent/unsent) error reporting removed
sql/item_sum.cc:
only boolean values should be returned by fix_fields()
sql/item_timefunc.cc:
only boolean values should be returned by fix_fields()
sql/item_uniq.h:
only boolean values should be returned by fix_fields()
sql/mysql_priv.h:
-1/1 (sent/unsent) error reporting removed
sql/mysqld.cc:
net_printf/send_error calls replaced by my_error family functions
changes in my_message_sql to support error handling correctly
sql/protocol.cc:
net_printf/send_error calls replaced by my_error family functions
sql/protocol_cursor.cc:
net_printf/send_error calls replaced by my_error family functions
sql/repl_failsafe.cc:
net_printf/send_error calls replaced by my_error family functions
-1/1 (sent/unsent) error reporting removed
sql/repl_failsafe.h:
-1/1 (sent/unsent) error reporting removed
sql/set_var.cc:
net_printf/send_error calls replaced by my_error family functions
sql/share/czech/errmsg.txt:
new error messages
sql/share/danish/errmsg.txt:
new error messages
sql/share/dutch/errmsg.txt:
new error messages
sql/share/english/errmsg.txt:
new error messages
sql/share/estonian/errmsg.txt:
new error messages
sql/share/french/errmsg.txt:
new error messages
sql/share/german/errmsg.txt:
new error messages
sql/share/greek/errmsg.txt:
new error messages
sql/share/hungarian/errmsg.txt:
new error messages
sql/share/italian/errmsg.txt:
new error messages
sql/share/japanese/errmsg.txt:
new error messages
sql/share/korean/errmsg.txt:
new error messages
sql/share/norwegian-ny/errmsg.txt:
new error messages
sql/share/norwegian/errmsg.txt:
new error messages
sql/share/polish/errmsg.txt:
new error messages
sql/share/portuguese/errmsg.txt:
new error messages
sql/share/romanian/errmsg.txt:
new error messages
sql/share/russian/errmsg.txt:
new error messages
sql/share/serbian/errmsg.txt:
new error messages
sql/share/slovak/errmsg.txt:
new error messages
sql/share/spanish/errmsg.txt:
new error messages
sql/share/swedish/errmsg.txt:
new error messages
sql/share/ukrainian/errmsg.txt:
new error messages
sql/slave.cc:
net_printf/send_error calls replaced by my_error family functions
-1/1 (sent/unsent) error reporting removed
sql/slave.h:
-1/1 (sent/unsent) error reporting removed
sql/sp.cc:
net_printf/send_error calls replaced by my_error family functions
sql/sp_head.cc:
new eror handling support
net_printf/send_error calls replaced by my_error family functions
sql/sp_rcontext.cc:
net_printf/send_error calls replaced by my_error family functions
sql/sql_acl.cc:
net_printf/send_error calls replaced by my_error family functions
-1/1 (sent/unsent) error reporting removed
sql/sql_acl.h:
-1/1 (sent/unsent) error reporting removed
sql/sql_base.cc:
-1/1 (sent/unsent) error reporting removed
net_printf/send_error calls replaced by my_error family functions
sql/sql_class.cc:
net_printf/send_error calls replaced by my_error family functions
sql/sql_class.h:
my_messhage_sql now set/reset query_error flag
sql/sql_db.cc:
-1/1 (sent/unsent) error reporting removed
sql/sql_delete.cc:
-1/1 (sent/unsent) error reporting removed
net_printf/send_error calls replaced by my_error family functions
sql/sql_do.cc:
-1/1 (sent/unsent) error reporting removed
sql/sql_error.cc:
-1/1 (sent/unsent) error reporting removed
sql/sql_handler.cc:
-1/1 (sent/unsent) error reporting removed
net_printf/send_error calls replaced by my_error family functions
sql/sql_help.cc:
net_printf/send_error calls replaced by my_error family functions
-1/1 (sent/unsent) error reporting removed
sql/sql_insert.cc:
-1/1 (sent/unsent) error reporting removed
net_printf/send_error calls replaced by my_error family functions
sql/sql_lex.h:
-1/1 (sent/unsent) error reporting removed
sql/sql_load.cc:
-1/1 (sent/unsent) error reporting removed
sql/sql_map.cc:
errors without code removed
sql/sql_parse.cc:
net_printf/send_error calls replaced by my_error family functions
-1/1 (sent/unsent) error reporting removed from mysql_execute_command
sql/sql_prepare.cc:
net_printf/send_error calls replaced by my_error family functions
-1/1 (sent/unsent) error reporting removed
sql/sql_repl.cc:
error messages fixed
net_printf/send_error calls replaced by my_error family functions
-1/1 (sent/unsent) error reporting removed
sql/sql_repl.h:
-1/1 (sent/unsent) error reporting removed
sql/sql_select.cc:
-1/1 (sent/unsent) error reporting removed
sql/sql_select.h:
-1/1 (sent/unsent) error reporting removed
sql/sql_show.cc:
-1/1 (sent/unsent) error reporting removed
net_printf/send_error calls replaced by my_error family functions
sql/sql_table.cc:
net_printf/send_error calls replaced by my_error family functions
-1/1 (sent/unsent) error reporting removed
sql/sql_trigger.cc:
-1/1 (sent/unsent) error reporting removed
sql/sql_udf.cc:
net_printf/send_error calls replaced by my_error family functions
sql/sql_union.cc:
-1/1 (sent/unsent) error reporting removed
sql/sql_update.cc:
-1/1 (sent/unsent) error reporting removed
net_printf/send_error calls replaced by my_error family functions
sql/sql_view.cc:
-1/1 (sent/unsent) error reporting removed
sql/sql_view.h:
-1/1 (sent/unsent) error reporting removed
sql/sql_yacc.yy:
net_printf/send_error calls replaced by my_error family functions
NO SQL
CONTAINS SQL (default)
READS SQL DATA
MODIFIES SQL DATA
These are needed as hints for the replication.
(Before this, we did have the default in the mysql.proc table, but no support in the parser.)
mysql-test/r/sp.result:
Modified test cases for new data access characteristics.
mysql-test/t/sp.test:
Modified test cases for new data access characteristics.
scripts/mysql_create_system_tables.sh:
We now support all the SP data access characteristics (not just CONTAINS SQL).
scripts/mysql_fix_privilege_tables.sql:
We now support all the SP data access characteristics (not just CONTAINS SQL).
sql/lex.h:
New tokens for SP data access characteristics.
sql/sp.cc:
Store, print and support alter of data access characteristics.
sql/sp_head.cc:
Added SP_ prefix to some symbols.
sql/sql_lex.h:
Added SP_ prefix to some symbols, and added SP data access enum.
sql/sql_yacc.yy:
Parse SP data access characteristics.
(And allow "alter ... language sql", mostly as a formality, it was accidently
put in the wrong clause before.)
mysql-test/r/sp.result:
New test case for BUG#3583.
(And current query is now set correctly.)
mysql-test/t/sp.test:
New test case for BUG#3583.
sql/sp_head.cc:
Set the thd->query and try to use cached query, if any, when executing a statement.
sql/sp_head.h:
Extract the sub-query and store in sp_instr_stmt.
sql/sql_cache.cc:
Keep the net->pkt_nr up-to-date when using query cache.
This makes it work with stored procedures too.
sql/sql_cache.h:
Keep the net->pkt_nr up-to-date when using query cache.
This makes it work with stored procedures too.
sql/sql_yacc.yy:
Extract the sub-query and store in sp_instr_stmt.
(And it's never safe to cache references to local variables.)
mysql-test/r/sp.result:
New test case for BUG#4941.
mysql-test/t/sp.test:
New test case for BUG#4941.
sql/protocol_cursor.cc:
Handle null values.
sql/sp_rcontext.cc:
Handle null values.
mysql-test/r/sp.result:
New test case for BUG#4487.
mysql-test/t/sp.test:
New test case for BUG#4487.
sql/item_func.h:
Propagate null_value properly in sp functions.
Fixed (together with Guilhem) bugs in mysqlbinlog regarding --offset
Prefix addresses with 0x for easier comparisons of debug logs
Fixed problem where MySQL choosed index-read even if there would be a much better range on the same index
This fix changed some 'index' queries to 'range' queries in the test suite
Don't create 'dummy' WHERE clause for trivial WHERE clauses where we can remove the WHERE clause.
This fix removed of a lot of 'Using where' notes in the test suite.
Give NOTE instead of WARNING if table/function doesn't exists when using DROP IF EXISTS
Give NOTE instead of WARNING for safe field-type conversions
Makefile.am:
Don't automaticly update files from bk
client/mysqlbinlog.cc:
Merge with 4.1 (+ apply bug fixes for --offset and --start-position)
include/my_sys.h:
Faster clear_alloc_root()
mysql-test/r/bdb.result:
Updated results after merge
mysql-test/r/create.result:
Updated results after merge
mysql-test/r/func_group.result:
Updated results after merge
mysql-test/r/func_if.result:
Updated results after merge
mysql-test/r/heap_btree.result:
Updated results after merge
mysql-test/r/index_merge.result:
Updated results after merge
mysql-test/r/index_merge_ror.result:
Updated results after merge
mysql-test/r/innodb.result:
Updated results after merge
mysql-test/r/join_outer.result:
Updated results after merge
mysql-test/r/mysqlbinlog2.result:
Updated results after merge
mysql-test/r/negation_elimination.result:
Updated results after merge
mysql-test/r/null.result:
Updated results after merge
Added more tests
mysql-test/r/null_key.result:
Updated results after merge
Added more tests
mysql-test/r/order_by.result:
Updated results after merge
mysql-test/r/range.result:
Updated results after merge
Added more tests
mysql-test/r/rpl_charset.result:
Updated results after merge
mysql-test/r/sp-error.result:
Updated results after merge
mysql-test/r/sp.result:
Updated results after merge
Added delete of some stored procedures in an attempt to be able to re-run test even if it aborts in the middle
mysql-test/r/type_blob.result:
Updated results after merge
(Some warnings are now notes)
mysql-test/r/user_var.result:
Updated results after merge
Added more tests
mysql-test/r/variables.result:
Updated results after merge
mysql-test/r/view.result:
Updated results after merge
mysql-test/t/mysqlbinlog2.test:
Updated tests to use new positions
mysql-test/t/null.test:
More tests
mysql-test/t/null_key.test:
More tests
mysql-test/t/range.test:
More tests
mysql-test/t/rpl_charset.test:
Avoid big diffs in the future if tests changes
mysql-test/t/sp-error.test:
Updated error numbers
mysql-test/t/sp-security.test:
Updated error numbers
mysql-test/t/sp.test:
Updated results after merge
Added delete of some stored procedures in an attempt to be able to re-run test even if it aborts in the middle
mysql-test/t/user_var.test:
More tests
mysql-test/t/view.test:
Updated error numbers
mysys/my_alloc.c:
Write into debug log the address of the allocated area
sql/ha_isam.cc:
Prefix addresses with 0x for easier comparisons of debug logs
sql/ha_myisam.cc:
Prefix addresses with 0x for easier comparisons of debug logs
sql/ha_ndbcluster.cc:
Add missing enum to switch
sql/handler.cc:
remove compiler warning
sql/item.cc:
More debugging
Simple cleanup
sql/item.h:
Move Item::cleanup() to item.cc
sql/item_cmpfunc.cc:
Fix arena code
sql/item_subselect.cc:
After merge fixes
sql/item_subselect.h:
After merge fixes
sql/item_sum.cc:
Updated comment
sql/log_event.cc:
Remove wrong test
sql/mysql_priv.h:
Indentation fixes
sql/mysqld.cc:
After merge fixes
Added 0x to pointers in debug log
sql/opt_range.cc:
Fixed problem where MySQL choosed index-read even if there would be a much better range on the same index
This fix changed some 'index' queries to 'range' queries in the test suite
sql/set_var.cc:
Indentation fixes
sql/sp_head.cc:
Set state to INITIALIZED to make SP work with new arena code
sql/sql_base.cc:
After merge fixes
sql/sql_class.cc:
More debugging
Use clear_alloc_root() instead of init_alloc_root() as the former is faster
sql/sql_class.h:
New method 'only_prepare()'
sql/sql_lex.cc:
After merge fixes
sql/sql_lex.h:
After merge fixes
sql/sql_parse.cc:
Fix for timezone tables. (The old way to add timezone tables to global list in 'create_total_list' doesn't work anymore)
Give NOTE instead of WARNING if table/function doesn't exists when using DROP IF EXISTS
sql/sql_prepare.cc:
After merge fixes
sql/sql_select.cc:
Don't create 'dummy' WHERE clause for trivial WHERE clauses where we can remove the WHERE clause.
This fix removed of a lot of 'Using where' notes in the test suite
sql/sql_table.cc:
Give NOTE instead of WARNING if table/function doesn't exists when using DROP IF EXISTS
sql/sql_union.cc:
After merge fix
sql/sql_view.cc:
After merge fix
sql/table.cc:
After merge fix
sql/tztime.cc:
Update timezone table handling to use new table lists structure
sql/tztime.h:
Update timezone table handling to use new table lists structure
sql/unireg.cc:
Use 0x before pointers
Althought techically not a but (as it's functioning as designed),
it was decided that the design should be changed. Some users have
a problem with dates being '0000-00-00' and the SQL standard specifies
that the modification date should be the same as the creation date
at creation.
mysql-test/r/sp.result:
New test case for BUG#5258.
mysql-test/t/sp.test:
New test case for BUG#5258.
sql/sp.cc:
Set the modification time at creation too.
mysql-test/r/sp.result:
New test case for BUG#5307
mysql-test/t/sp.test:
New test case for BUG#5307
sql/sp_head.cc:
Use the correct end-of-query pointer when extracting the body in the case
of a create procedure compound with another statement.
Bug in diff_handlers and diff_cursors made it attempt to pop
the wrong number at jumps sometimes.
mysql-test/r/sp.result:
New testcase for BUG#5287.
mysql-test/t/sp.test:
New testcase for BUG#5287.
sql/sp_pcontext.cc:
Fixed diff_handlers and diff_cursors methods, they miscounted.
sql/sp_pcontext.h:
Made m_handlers available for diff_handlers.
into pcgem.rdg.cyberkinetica.com:/usr/home/acurtis/work/mysql-5.0
mysql-test/r/sp.result:
Auto merged
mysql-test/t/sp.test:
Auto merged
sql/sql_yacc.yy:
Auto merged
mysql-test/r/sp.result:
New testcase for BUG#5251.
mysql-test/t/sp.test:
New testcase for BUG#5251.
sql/sp_head.cc:
Added checksum to the list of statements that return result sets.
mysql-test/r/sp.result:
New test case for BUG#5251.
mysql-test/t/sp.test:
New test case for BUG#5251.
sql/sp.cc:
Don't update the created timestamp when doing alter procedure/function.
This finishes (almost) WL#2002: Implement stored procedure GOTO.
Only the syntax issue for free labels remains ("label L;" vs "L:").
include/mysqld_error.h:
New error code for GOTO in SP handler.
mysql-test/r/sp-error.result:
New error test cases for GOTO.
mysql-test/r/sp.result:
New test cases for GOTO.
Also removed some things that made it impossible to run the test in
an external (debugged) mysqld.
mysql-test/t/sp-error.test:
New error test cases for GOTO.
mysql-test/t/sp.test:
New test cases for GOTO.
Also removed some things that made it impossible to run the test in
an external (debugged) mysqld.
sql/share/czech/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/danish/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/dutch/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/english/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/estonian/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/french/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/german/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/greek/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/hungarian/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/italian/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/japanese/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/korean/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/norwegian-ny/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/norwegian/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/polish/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/portuguese/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/romanian/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/russian/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/serbian/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/slovak/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/spanish/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/swedish/errmsg.txt:
New error message for GOTO in SP handler.
sql/share/ukrainian/errmsg.txt:
New error message for GOTO in SP handler.
sql/sp_head.cc:
Code cleanup (renaming of pcontext methods), support goto, and fixed bug
in jump shortcutting in the optimizer (detect infinite loops).
sql/sp_head.h:
Code cleanup (renaming of pcontext methods), support goto, and fixed bug
in jump shortcutting in the optimizer (detect infinite loops).
sql/sp_pcontext.cc:
Major rehack and cleanup:
- We now push and pop a chain of contexts during parsing (instead of having
a single one).
- Makes error detection for GOTO easier and enables some optmizations and
debugger support.
- Makes it a little trickier to keep track on variable and cursor indexes instead.
- Renamed things to get a more consistent naming scheme too.
sql/sp_pcontext.h:
Major rehack and cleanup:
- We now push and pop a chain of contexts during parsing (instead of having
a single one).
- Makes error detection for GOTO easier and enables some optmizations and
debugger support.
- Makes it a little trickier to keep track on variable and cursor indexes instead.
- Renamed things to get a more consistent naming scheme too.
sql/sql_yacc.yy:
Changes to reflect the rework and renamings in sp_pcontext, and fixed
some GOTO error checking.
and BUG#336: Subselects with tables does not work as values for
local SP variables (which was closed before with a temp. fix, but not
actually fixed).
mysql-test/r/sp-error.result:
Moved test case for BUG#336 to sp.test, as it's not generating an error any longer.
mysql-test/r/sp.result:
Move test case for BUG#336 from sp-error.test and added new test case
for BUG#3157.
mysql-test/t/sp-error.test:
Moved test case for BUG#336 to sp.test, as it's not generating an error any longer.
mysql-test/t/sp.test:
Move test case for BUG#336 from sp-error.test and added new test case
for BUG#3157.
sql/sp_head.cc:
Open and close tables in set, jump-if[-not] and freturn instructions if
the value expression is a subselect.
sql/sp_head.h:
Store tables in set, jump-if[-not] and freturn instructions if
the value expression is a subselect.
sql/sql_yacc.yy:
Store tables in set, jump-if[-not] and freturn instructions if
the value expression is a subselect.
Mostly done, it works, but the temporary LABEL syntax still to be fixed.
mysql-test/r/sp-error.result:
New test case for WL#2002 (GOTO).
mysql-test/r/sp.result:
New test case for WL#2002 (GOTO).
(Also corrected another test)
mysql-test/t/sp-error.test:
New test case for WL#2002 (GOTO).
mysql-test/t/sp.test:
New test case for WL#2002 (GOTO).
(Also corrected another test)
sql/lex.h:
New symbol GOTO.
Also a temporary symbol LABEL, which hopefully will go away soon.
sql/sp_head.cc:
Fixed backpatching to cope with free GOTO labels an hpop and cpop instructions.
Also optimized away pointless jump instructions.
sql/sp_head.h:
Fixed backpatching to cope with free GOTO labels an hpop and cpop instructions.
We now sometimes generate hpop/cpop 0 instructions but the optimizer removes them.
sql/sp_pcontext.cc:
Added free GOTO labels, and support for coping with jumps out of blocks
with handlers or cursors.
sql/sp_pcontext.h:
Added free GOTO labels, and support for coping with jumps out of blocks
with handlers or cursors.
sql/sql_yacc.yy:
Added GOTO and LABEL, and adjusted backpatching accordingly. Also fixed LEAVE
out of blocks. The LABEL syntax will go away soon, hopefully.