Commit graph

521 commits

Author SHA1 Message Date
unknown
95a3509a66 Merge mysql.com:/opt/local/work/mysql-4.1-root
into  mysql.com:/opt/local/work/mysql-5.0-root


BitKeeper/deleted/.del-rpl_ignore_table.result:
  Delete: mysql-test/r/rpl_ignore_table.result
BitKeeper/deleted/.del-rpl_multi_update4.result:
  Delete: mysql-test/r/rpl_multi_update4.result
BitKeeper/deleted/.del-rpl_ignore_table-slave.opt:
  Delete: mysql-test/t/rpl_ignore_table-slave.opt
BitKeeper/deleted/.del-rpl_ignore_table.test:
  Delete: mysql-test/t/rpl_ignore_table.test
BitKeeper/deleted/.del-rpl_multi_update4-slave.opt:
  Delete: mysql-test/t/rpl_multi_update4-slave.opt
BitKeeper/deleted/.del-disabled.def:
  Auto merged
BitKeeper/deleted/.del-rpl_multi_update4.test:
  Delete: mysql-test/t/rpl_multi_update4.test
heap/hp_create.c:
  Auto merged
mysql-test/r/date_formats.result:
  Auto merged
mysql-test/r/myisam.result:
  Auto merged
mysql-test/r/update.result:
  Auto merged
mysql-test/t/date_formats.test:
  Auto merged
mysql-test/t/heap.test:
  Auto merged
mysql-test/t/kill.test:
  Auto merged
mysql-test/t/update.test:
  Auto merged
ndb/include/mgmapi/mgmapi_config_parameters.h:
  Auto merged
ndb/test/ndbapi/testBlobs.cpp:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_select.h:
  Auto merged
configure.in:
  Manual merge.
libmysql/libmysql.c:
  Manual merge.
mysql-test/r/heap.result:
  Manual merge.
mysql-test/r/heap_hash.result:
  Manual merge.
mysql-test/r/kill.result:
  Manual merge.
sql/ha_heap.cc:
  Manual merge.
sql/ha_heap.h:
  Manual merge.
sql/item_timefunc.cc:
  Manual merge.
sql/sql_class.cc:
  Manual merge.
sql/sql_parse.cc:
  Manual merge.
sql/sql_update.cc:
  Manual merge.
tests/mysql_client_test.c:
  Manual merge.
2006-02-02 18:17:18 +03:00
unknown
029eb59455 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1
into  sanja.is.com.ua:/home/bell/mysql/bk/work-bug8-4.1


sql/sql_class.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
2006-01-18 13:49:37 +02:00
unknown
e7c25ed4a1 Excluded posibility of tmp_table_param.copy_field double deletion (BUG#14851).
mysql-test/r/kill.result:
  BUG#14851 test
mysql-test/t/kill.test:
  BUG#14851 test
sql/sql_class.cc:
  Debug prints are added.
sql/sql_select.cc:
  Allocation of tmp_join fixed to involve constructor (it is not related to the bug directly but might cause other problems).
  Excluded posibility of tmp_table_param.copy_field double deletion (BUG#14851).
sql/sql_select.h:
  JOINs constructor added, initialization of them fixed (it is not related to the bug directly but might cause other problems).
2006-01-18 13:48:57 +02:00
unknown
55499cad0d Fixed refresh_status function.
sql/sql_class.cc:
  Improved documentation on add_to_status().
sql/sql_parse.cc:
  Changed refresh status to take thd as argument to avoid current_thd.
  Removed add_to_status away from loop, as it is not necessary for each
  variable, only required for each thread. In this case only the current
  thread.
2006-01-10 18:56:23 +02:00
unknown
2de5c14162 Merge
mysql-test/r/ndb_basic.result:
  Auto merged
mysql-test/r/ndb_multi.result:
  Auto merged
mysql-test/t/ndb_basic.test:
  Auto merged
mysql-test/t/ndb_multi.test:
  Auto merged
sql/sql_class.cc:
  Auto merged
2005-12-18 15:26:37 +01:00
unknown
348efa5220 Fix for bug #15623: Test case rpl000001 and rpl_error_ignored_table failure on MacOSX
and bug #15668: Test 'sp-error' crashes server on Mac OS X.


mysql-test/r/rpl000001.result:
  Fix for bug #15623: Test case rpl000001 and rpl_error_ignored_table failure on MacOSX 
  and bug #15668: Test 'sp-error' crashes server on Mac OS X.
  - accept 2013 error as well.
mysql-test/t/flush_read_lock_kill.test:
  Fix for bug #15623: Test case rpl000001 and rpl_error_ignored_table failure on MacOSX 
  and bug #15668: Test 'sp-error' crashes server on Mac OS X.
  - accept 2013 error as well.
mysql-test/t/rpl000001.test:
  Fix for bug #15623: Test case rpl000001 and rpl_error_ignored_table failure on MacOSX 
  and bug #15668: Test 'sp-error' crashes server on Mac OS X.
  - accept 2013 error as well.
mysql-test/t/rpl_error_ignored_table.test:
  Fix for bug #15623: Test case rpl000001 and rpl_error_ignored_table failure on MacOSX 
  and bug #15668: Test 'sp-error' crashes server on Mac OS X.
  - accept 2013 error as well.
sql/sql_class.cc:
  Fix for bug #15623: Test case rpl000001 and rpl_error_ignored_table failure on MacOSX 
  and bug #15668: Test 'sp-error' crashes server on Mac OS X.
  - don't call the close_active_vio() in case of KILL_QUERY.
2005-12-14 21:42:08 +04:00
unknown
53f8fed437 Merge rurik.mysql.com:/home/igor/mysql-5.0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-2


sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysql_priv.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_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2005-12-10 23:31:03 -08:00
unknown
6b2f13098a Patch for WL#2894: Make stored routine variables work
according to the standard.

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

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

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

  - BUG#15148: Stored procedure variables accept non-scalar values;


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.
2005-12-07 17:01:17 +03:00
unknown
e324da302f Merge rurik.mysql.com:/home/igor/mysql-5.0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-2


sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/item_sum.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2005-12-02 20:42:36 -08:00
unknown
babaa74e8a Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/usr/home/ram/work/mysql-5.0


sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
2005-12-01 14:31:28 +04:00
unknown
f853fbc9f4 Fix for bug #14304: auto_increment field incorrect set from within stored procedure (insert select).
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
2005-12-01 14:26:46 +04:00
unknown
c9ef409150 Merge mysql.com:/home/timka/mysql/src/5.0-virgin
into  mysql.com:/home/timka/mysql/src/5.0-bug-14920


sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
mysql-test/r/group_min_max.result:
  Manually merged test cases.
mysql-test/t/group_min_max.test:
  Manually merged test cases.
2005-12-01 09:26:17 +02:00
unknown
e3f5755228 Fix for BUG#14920 Ordering aggregated result sets corrupts resultset.
The cause of the bug was the use of end_write_group instead of end_write
in the case when ORDER BY required a temporary table, which didn't take
into account the fact that loose index scan already computes the result
of MIN/MAX aggregate functions (and performs grouping).

The solution is to call end_write instead of end_write_group and to add
the MIN/MAX functions to the list of regular functions so that their
values are inserted into the temporary table.


mysql-test/r/group_min_max.result:
  Test for BUG#14920
mysql-test/t/group_min_max.test:
  Test for BUG#14920
sql/sql_class.cc:
  Added new member to TMP_TABLE_PARAM.
sql/sql_class.h:
  Added new member to TMP_TABLE_PARAM.
sql/sql_select.cc:
  Enable result rows generated by loose index scan being written into
  a temporary table. The change is necessary because loose index
  scan already computes the result of GROUP BY and the MIN/MAX aggregate
  functions. This is realized by three changes:
  - create_tmp_table allocates space for aggregate functions in the
    list of regular functions,
  - use end_write instead of end_write group,
  - copy the pointers to the MIN/MAX aggregate functions to the list
    of regular functions TMP_TABLE_PARAM::items_to_copy.
sql/sql_select.h:
  New parameter to create_tmp_table.
2005-11-30 12:52:12 +02:00
unknown
0b262a6213 Some post-merge cleaning, and made assert THD::store_globals() work at all times.
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.
2005-11-24 19:13:13 +01:00
unknown
448327afb4 Merge rurik.mysql.com:/home/igor/mysql-5.0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-2


sql/mysql_priv.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2005-11-23 21:44:21 -08:00
unknown
1c313f0368 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/opt/local/work/mysql-5.0-root


sql/sql_class.cc:
  Auto merged
2005-11-23 21:20:31 +03:00
unknown
0633a41c15 Always initialize THD::thread_stack: it's used in
check_stack_overrun().


sql/slave.cc:
  Move initialization of THD::thread_stack before THD::store_globals()
sql/sql_acl.cc:
  Initialize THD::thread_stack in artificial THDs used
  to load gratns subsystem.
sql/sql_class.cc:
  Add an assert that THD::thread_stack is assigned.
sql/sql_insert.cc:
  Add initialization of THD::thread_stack (delayed insert
  thread).
sql/sql_parse.cc:
  Move initialization of THD::thread_stack before
  THD::store_globals().
sql/sql_udf.cc:
  Add initialization for THD::thread_stack (an artificial
  THD used to initialize UDF subsystem).
sql/tztime.cc:
  Add initialization for THD::thread_stack (an artificial
  THD used to initialize timezones).
2005-11-23 21:18:10 +03:00
unknown
056d7266c7 A name of macro is fixed. 2005-11-23 12:26:07 +02:00
unknown
c3c232a88c Merge rurik.mysql.com:/home/igor/mysql-5.0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-2


mysql-test/r/func_gconcat.result:
  Auto merged
mysql-test/t/func_gconcat.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_strfunc.cc:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_sum.cc:
  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_lex.h:
  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
2005-11-22 23:00:57 -08:00
unknown
a2c26aa710 Merge sanja.is.com.ua:/home/bell/mysql/bk/work-bug2-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-merge-5.0


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
2005-11-23 00:58:13 +02:00
unknown
6574612df8 Fix for BUG#13549 "Server crash with nested stored procedures
if inner routine has more local variables than outer one, and
one of its last variables was used as argument to NOT operator".

THD::spcont was non-0 when we were parsing stored routine/trigger
definition during execution of another stored routine. This confused
methods of Item_splocal and forced them use wrong runtime context.
Fix ensures that we always have THD::spcont equal to zero during
routine/trigger body parsing. This also allows to avoid problems
with errors which occur during parsing and SQL exception handlers.


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.
2005-11-23 00:50:37 +02:00
unknown
e2de3a8fc4 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/dlenev/src/mysql-5.0-bg13825


sql/ha_innodb.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
2005-11-19 15:11:57 +03:00
unknown
11d4d7e6ff Fix for bug #13825 "Triggers: crash if release savepoint" and for general
handling of savepoints in stored routines.

Fixed ha_rollback_to_savepoint()/ha_savepoint()/ha_release_savepoint()
functions to properly handle savepoints inside of stored functions and
triggers.
Also now when we invoke stored function or trigger we create new savepoint
level. We destroy it at the end of function/trigger execution and return back
to old savepoint level.


mysql-test/r/sp_trans.result:
  Added test for bug #13825 "Triggers: crash if release savepoint" and for
  general handling of savepoints in stored routines.
mysql-test/t/sp_trans.test:
  Added test for bug #13825 "Triggers: crash if release savepoint" and for
  general handling of savepoints in stored routines.
sql/ha_innodb.cc:
  innobase_savepoint():
    Replaced check which always failed due to similar check in caller
    with assertion.
sql/handler.cc:
  ha_rollback_to_savepoint()/ha_savepoint()/ha_release_savepoint():
    Changed functions to properly support handling of savepoints
    inside of stored functions and triggers.
sql/sql_class.cc:
  THD::reset_sub_statement_state()/restore_sub_statement_state():
    When we invoke stored function or trigger we should create new savepoint
    level. We should destroy it at the end of function/trigger execution and
    return back to old savepoint level. To support this behavior we should
    save and reset list of current savepoints on entering function and restore
    old list when we leave it.
sql/sql_class.h:
  Sub_statement_state:
    When we invoke stored function or trigger we should create new savepoint
    level. We should destroy it at the end of function/trigger execution and
    return back to old savepoint level. To support this behavior added "savepoint"
    member which is used to save/restore list of current savepoints on
    entering/leaving function.
sql/sql_parse.cc:
  mysql_execute_command():
    Changed processing of SQLCOM_SAVEPOINT so now it is not ignored when
    we are in autocommit mode and savepoint is set inside of stored
    function or trigger.
2005-11-19 15:09:23 +03:00
unknown
2e4045e45d Merge rurik.mysql.com:/home/igor/mysql-5.0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-2


sql/mysql_priv.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2005-11-16 20:09:35 -08:00
unknown
013b3d8ab3 Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
Version for 5.0.
It fixes three problems:
1. The cause of the bug was that we did not check the table version for
 the HANDLER ... READ commands. We did not notice when a table was
 replaced by a new one. This can happen during ALTER TABLE, REPAIR
 TABLE, and OPTIMIZE TABLE (there might be more cases). I call the fix
 for this problem "the primary bug fix".
2. mysql_ha_flush() was not always called with a locked LOCK_open.
 Though the function comment clearly said it must.
 I changed the code so that the locking is done when required. I call
 the fix for this problem "the secondary fix".
3. In 5.0 (not in 4.1 or 4.0) DROP TABLE had a possible deadlock flaw in
 concur with FLUSH TABLES WITH READ LOCK. I call the fix for this
 problem "the 5.0 addendum fix".


include/my_pthread.h:
  Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  Added a new macro for the 5.0 addendum fix.
mysql-test/r/handler.result:
  Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  The test result.
mysql-test/t/handler.test:
  Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  The test case.
sql/lock.cc:
  Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  Changed a comment which did confuse me and which is not fully
  correct anymore after the 5.0 addendum fix.
  Added an assertion which would fire without the 5.0 addendum fix.
sql/mysql_priv.h:
  Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  Changed a definition for the secondary fix.
sql/sql_base.cc:
  Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  Changed function calls for the secondary fix.
sql/sql_class.cc:
  Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  Changed a function call for the secondary fix.
sql/sql_handler.cc:
  Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  The first two diffs make the primary bug fix.
  The rest is for the secondary fix.
sql/sql_table.cc:
  Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  The first diff (four changed places) make the 5.0 addendum fix.
  The other three are changed function calls for the secondary fix.
2005-11-15 21:57:02 +01:00
unknown
faaf53d966 Merge mysql.com:/home/mydev/mysql-4.0-4000
into  mysql.com:/home/mydev/mysql-4.1-4100


mysql-test/r/handler.result:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
mysql-test/t/handler.test:
  Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  Manual merge.
sql/sql_handler.cc:
  Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  Manual merge.
sql/sql_table.cc:
  Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  Manual merge.
2005-11-15 18:09:40 +01:00
unknown
7d183320b0 Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
Version for 4.0.
It fixes two problems:
1. The cause of the bug was that we did not check the table version for
   the HANDLER ... READ commands. We did not notice when a table was
   replaced by a new one. This can happen during ALTER TABLE, REPAIR
   TABLE, and OPTIMIZE TABLE (there might be more cases). I call the fix
   for this problem "the primary bug fix".
2. mysql_ha_flush() was not always called with a locked LOCK_open.
   Though the function comment clearly said it must.
   I changed the code so that the locking is done when required. I call
   the fix for this problem "the secondary fix".


mysql-test/r/handler.result:
  Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  The test result.
mysql-test/t/handler.test:
  Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  The test case.
sql/mysql_priv.h:
  Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  Changed a definition for the secondary fix.
sql/sql_base.cc:
  Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  Changed function calls for the secondary fix.
sql/sql_class.cc:
  Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  Changed a function call for the secondary fix.
sql/sql_handler.cc:
  Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  The first two diffs make the primary bug fix.
  The rest is for the secondary fix.
sql/sql_table.cc:
  Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  Changed function calls for the secondary fix.
2005-11-03 18:24:12 +01:00
unknown
cc57d4ef4e Merge rurik.mysql.com:/home/igor/mysql-5.0
into rurik.mysql.com:/home/igor/dev/mysql-5.0-2


sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2005-10-27 21:37:52 -07:00
unknown
5ed3b0b3d7 Fix for BUG#13037: undefined variable in IF cause erroneous error-message.
mysql-test/r/sp-error.result:
  Results for the test case for BUG#13037.
mysql-test/t/sp-error.test:
  Test case for BUG#13037.
sql/sql_base.cc:
  Polishing: use constant.
sql/sql_class.cc:
  Reset THD::where in THD::cleanup_after_query();
  Polishing: use the constant (THD::DEFAULT_WHERE).
sql/sql_class.h:
  Introduce a constant for the default value of THD::where.
2005-10-25 13:02:48 +04:00
unknown
cd49e32407 Merge rurik.mysql.com:/home/igor/mysql-5.0
into rurik.mysql.com:/home/igor/dev/mysql-5.0-2


sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2005-10-22 19:35:37 -07:00
unknown
8698ffc968 BUG#121915: Merge 4.1->5.0
mysql-test/r/update.result:
  Auto merged
mysql-test/t/update.test:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/records.cc:
  Auto merged
sql/repl_failsafe.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/structs.h:
  Auto merged
2005-10-19 01:52:06 +04:00
unknown
6a0695fe93 Fixed bug #12762:
allowed set functions aggregated in outer subqueries, allowed nested set functions.


mysql-test/r/func_gconcat.result:
  Changed a query when fixing bug #12762.
mysql-test/r/subselect.result:
  Added test cases for bug #12762.
  Allowed set functions aggregated in outer subqueries. Allowed nested set functions.
mysql-test/t/func_gconcat.test:
  Changed a query when fixing bug #12762.
mysql-test/t/subselect.test:
  Added test cases for bug #12762.
  Allowed set functions aggregated in outer subqueries. Allowed nested set functions.
sql/item.cc:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Added a parameter to Item::split_sum_func2 aliowing to defer splitting for set functions
  aggregated in outer subquries.
  Changed Item_field::fix_fields to calculate attributes used when checking context conditions
  for set functions.
  Allowed alliases for set functions defined in outer subqueries.
sql/item.h:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Added a parameter to Item::split_sum_func2 aliowing to defer splitting for set functions
  aggregated in outer subquries.
sql/item_cmpfunc.cc:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Added a parameter to Item::split_sum_func2 aliowing to defer splitting for set functions
  aggregated in outer subquries.
sql/item_func.cc:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Added a parameter to Item::split_sum_func2 aliowing to defer splitting for set functions
  aggregated in outer subquries.
sql/item_row.cc:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Added a parameter to Item::split_sum_func2 aliowing to defer splitting for set functions
  aggregated in outer subquries.
sql/item_strfunc.cc:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Added a parameter to Item::split_sum_func2 aliowing to defer splitting for set functions
  aggregated in outer subquries.
sql/item_subselect.cc:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Introduced next levels for subqueries and a bitmap of nesting levels showing
  in what subqueries a set function can be aggregated.
sql/item_sum.cc:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Added Item_sum methods to check context conditions imposed on set functions.
sql/item_sum.h:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Added Item_sum methods to check context conditions imposed on set functions.
sql/mysql_priv.h:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Introduced a type of bitmaps to be used for nesting constructs.
sql/sql_base.cc:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Introduced next levels for subqueries and a bitmap of nesting levels showing
  in what subqueries a set function can be aggregated.
sql/sql_class.cc:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Introduced a bitmap of nesting levels showing in what subqueries a set function can be aggregated.
sql/sql_class.h:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Introduced a bitmap of nesting levels showing in what subqueries a set function can be aggregated.
sql/sql_delete.cc:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Introduced a bitmap of nesting levels showing in what subqueries a set function can be aggregated.
sql/sql_lex.cc:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Introduced next levels for subqueries and a bitmap of nesting levels showing
  in what subqueries a set function can be aggregated.
sql/sql_lex.h:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Introduced next levels for subqueries and a bitmap of nesting levels showing
  in what subqueries a set function can be aggregated.
sql/sql_parse.cc:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Introduced next levels for subqueries.
sql/sql_prepare.cc:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Introduced a bitmap of nesting levels showingin what subqueries a set function can be aggregated.
sql/sql_select.cc:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Introduced next levels for subqueries and a bitmap of nesting levels showing
  in what subqueries a set function can be aggregated.
sql/sql_update.cc:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Introduced a bitmap of nesting levels showing in what subqueries a set function can be aggregated.
sql/sql_yacc.yy:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Introduced next levels for subqueries.
2005-10-15 14:32:37 -07:00
unknown
5dfd72a038 fix for Valgrind errors: query_id needs to be inited early (already fixed in 5.0 by Konstantin) and so does client_capabilities (not fixed in 5.0);
because they are used by net_printf() and push_warning(), which can be called if check_connection() fails.


sql/mysqld.cc:
  not needed anymore
sql/repl_failsafe.cc:
  not needed anymore
sql/slave.cc:
  not needed anymore
sql/sql_class.cc:
  query_id needs to be inited early (already fixed in 5.0 by Konstantin) and so does client_capabilities (not fixed in 5.0);
  because they are used by net_printf() and push_warning(), which may be called if check_connection() fails.
2005-10-14 15:34:52 +02:00
unknown
c2621f3dcb Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0


BUILD/SETUP.sh:
  Auto merged
client/mysql.cc:
  Auto merged
client/mysqldump.c:
  Auto merged
client/mysqltest.c:
  Auto merged
include/my_sys.h:
  Auto merged
mysql-test/r/func_str.result:
  Auto merged
mysql-test/r/information_schema.result:
  Auto merged
mysql-test/r/information_schema_inno.result:
  Auto merged
mysql-test/r/multi_statement.result:
  Auto merged
mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/r/temp_table.result:
  Auto merged
mysql-test/t/func_str.test:
  Auto merged
mysql-test/t/information_schema.test:
  Auto merged
mysql-test/t/information_schema_inno.test:
  Auto merged
mysql-test/t/multi_statement.test:
  Auto merged
mysql-test/t/mysql.test:
  Auto merged
mysql-test/t/temp_table.test:
  Auto merged
sql/ha_federated.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/structs.h:
  Auto merged
sql/table.h:
  Auto merged
strings/decimal.c:
  Auto merged
sql/sql_parse.cc:
  manual merge
sql/sql_prepare.cc:
  manual merge
sql/table.cc:
  manual merge
2005-10-08 03:37:23 +03:00
unknown
c807724f36 Review of code pushed since last 5.0 pull:
Ensure that ccache is also used for C programs
mysql: Ensure that 'delimiter' works the same way in batch mode as in normal mode
mysqldump: Change to use ;; (instead of //) as a stored procedure/trigger delimiter
Fixed test cases by adding missing DROP's and rename views to be of type 'v#'
Removed MY_UNIX_PATH from fn_format()
Removed current_db_used from TABLE_LIST
Removed usage of 'current_thd' in Item_splocal
Removed some compiler warnings
A bit faster longlong2str code



BUILD/FINISH.sh:
  Ensure that ccache is also used for C programs
BUILD/SETUP.sh:
  Ensure that ccache is also used for C programs
client/mysql.cc:
  More debugging
  Ensure that 'delimiter' works the same way in batch mode as in normal mode.
  Compare 'delimiter' command case-insensitive.
  The above fixes the delimiter bugs so that we can now use ;; as a trigger/SP function delimiter in mysqldump.
client/mysqldump.c:
  Indentation fixes
  Use ;; as a delmimiter for stored procedures and triggers instead of //
client/mysqltest.c:
  Indentation fixes
include/my_sys.h:
  Remove not needed MY_UNIX_PATH parameter
mysql-test/r/alter_table.result:
  Better to reuse mysqltest database (test didn't properly delete mysqltest1 at start)
mysql-test/r/func_str.result:
  More testing of CONV() (to ensure that longlong2str() works correctly)
mysql-test/r/information_schema.result:
  Drop all used tables and views
  Rename view tables to 'v#' to ensure that if this test fails, not a lot of other test fails
mysql-test/r/information_schema_inno.result:
  Drop all used tables
mysql-test/r/multi_statement.result:
  Drop used tables
mysql-test/r/mysql.result:
  Add error messages to result
mysql-test/r/mysqldump.result:
  ;; is now used as SP/trigger delimiter
mysql-test/r/mysqlshow.result:
  Drop used tables
mysql-test/r/temp_table.result:
  Drop used views
  Rename views to v#
mysql-test/t/alter_table.test:
  Better to reuse mysqltest database (test didn't properly delete mysqltest1 at start)
mysql-test/t/func_str.test:
  More testing of CONV() (to ensure that longlong2str() works correctly)
mysql-test/t/information_schema.test:
  Drop all used tables and views
  Rename view tables to 'v#' to ensure that if this test fails, not a lot of other test fails
mysql-test/t/information_schema_inno.test:
  Drop all used tables
mysql-test/t/multi_statement.test:
  Drop used tables
mysql-test/t/mysql.test:
  Add error messages to result
mysql-test/t/mysqlshow.test:
  Drop used tables
mysql-test/t/temp_table.test:
  Drop used views
  Rename views to v#
mysys/mf_format.c:
  Remove not needed MY_UNIX_PATH parameter
  (This goes against how fn_format() is supposed to work and also conflicts with other options like MY_RETURN_REAL_PATH)
sql/ha_federated.cc:
  Removed extra empty line
sql/item.cc:
  Use 'str_value' instead of 'str_value_ptr' to hold result for Item_splocal
  Remove some calls to 'thd' in Item_splocal by making 'thd' a class variable
  One doesn't have to set 'null_value' when calling 'is_null()'
sql/item.h:
  Add THD as a class variable to Item_splocal
  Use 'str_value' instead of 'str_value_ptr' to hold temp result
  Fixed bug in Item_hex when used in CAST()
sql/item_func.cc:
  Optimize new code
sql/log_event.cc:
  Move 'to_unix_path()' out of fn_format()
sql/opt_range.cc:
  Simplify code
sql/sp_head.cc:
  Ensure that Item_splocal has thd set before we call '->this_item()'
sql/sql_class.cc:
  Return error if Statement::insert() fails in either hash_insert()
sql/sql_parse.cc:
  Remove 'current_db_used' as we can trivially check if db table qualifier was used without this.
  Simplify code
sql/sql_prepare.cc:
  Use enum instead of const int, to avoid ugly code for VC++
sql/structs.h:
  Remove compiler warnings when using STRING_WITH_LEN() with constant strings.
sql/table.cc:
  Fixed indentation
sql/table.h:
  Remove not needed current_db_used
strings/decimal.c:
  Simplify code
strings/longlong2str-x86.s:
  A bit faster longlong2str.
  (Took some ideas from Peter Gulutzan's code)
strings/my_strtoll10.c:
  Simplify code for MetroWerks compiler
2005-10-06 17:54:43 +03:00
unknown
07172cabdf Bug#13143 - formatID should not affect XID's uniqueness 2005-10-05 16:38:53 +02:00
unknown
38ebb6c638 Merge mysqldev@production.mysql.com:my/mysql-5.0-release
into  mysql.com:/opt/local/work/mysql-5.0-root


BitKeeper/etc/ignore:
  auto-union
include/my_sys.h:
  Auto merged
mysql-test/r/information_schema.result:
  Auto merged
mysql-test/t/ctype_ujis.test:
  Auto merged
sql/ha_federated.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/log.cc:
  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_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/table.cc:
  Auto merged
2005-09-23 00:46:59 +04:00
unknown
813fc4104e A fix and a test case for Bug#6513 "Test Suite: Values inserted by using
cursor is interpreted latin1 character and Bug#9819 "Cursors: Mysql Server
Crash while fetching from table with 5 million records."
A fix for a possible memory leak when fetching into an SP cursor
in a long loop.
The patch uses a common implementation of cursors in the binary protocol and 
in stored procedures and implements materialized cursors.
For implementation details, see comments in sql_cursor.cc


include/my_sys.h:
  - declaration for multi_alloc_root
libmysqld/Makefile.am:
  - drop protocol_cursor.cc, add sql_cursor.cc (replaces the old
  implementation of cursors with a new one)
mysql-test/r/ctype_ujis.result:
  - test results fixed (a test case for Bug#6513)
mysql-test/r/sp-big.result:
  - test results fixed (a test case for Bug#9819)
mysql-test/t/ctype_ujis.test:
  Add a test case for Bug#6513 "Test Suite: Values inserted by using cursor is
   interpreted latin1 character"
mysql-test/t/sp-big.test:
  Add a restricted test case for Bug#9819 "Cursors: Mysql Server Crash
  while fetching from table with 5 million records."
mysys/my_alloc.c:
  - an implementation of multi_alloc_root; this is largely a copy-paste
    from mulalloc.c, but the function is small and there is no easy way
    to reuse the existing C function.
sql/Makefile.am:
  - add sql_cursor.h, sql_cursor.cc (a new implementation of stored procedure
  cursors) and drop protocol_cursor.cc (the old one)
sql/handler.cc:
  - now TABLE object has its mem_root always initialized.
    Adjust the implementation handler::ha_open
sql/item_subselect.cc:
  - adjust to the changed declaration of st_select_lex_unit::prepare
sql/protocol.h:
  - drop Protocol_cursor
sql/sp_head.cc:
  - move juggling with Query_arena::free_list and Item::next to
    sp_eval_func_item, as this is needed in 3 places already.
sql/sp_head.h:
  - declare a no-op implementation for cleanup_stmt in sp_instr_cpush.
    This method is needed for non-materializing cursors, which are yet not 
    used in stored procedures.
  - declaration for sp_eval_func_item
sql/sp_rcontext.cc:
  - reimplement sp_cursor using the new implementation of server side cursors.
  - use sp_eval_func_item to assign values of SP variables from the
    row fetched from a cursor. This should fix a possible memory leak in 
    the old implementation of sp_cursor::fetch
sql/sp_rcontext.h:
  - reimplement sp_cursor using the new implementation of server side cursors.
sql/sql_class.cc:
  - disable the functionality that closes transient cursors at commit/rollback;
    transient cursors are not used in 5.0, instead we use materialized ones.
    To be enabled in a later version.
sql/sql_class.h:
  - adjust to the rename Cursor -> Server_side_cursor
  - additional declarations of select_union used in materialized cursors
sql/sql_derived.cc:
  - reuse bits of tmp table code in UNION, derived tables, and materialized
    cursors
  - cleanup comments
sql/sql_lex.h:
  - declarations of auxiliary methods used by materialized cursors
  - a cleanup in st_select_lex_unit interface
sql/sql_list.h:
  - add an array operator new[] to class Sql_alloc
sql/sql_prepare.cc:
  - split the tight coupling of cursors and prepared statements to reuse 
    the same implementation in stored procedures
  - cleanups of error processing in Prepared_statement::{prepare,execute}
sql/sql_select.cc:
  - move the implementation of sensitive (non-materializing) cursors to 
    sql_cursor.cc
  - make temporary tables self-contained: the table, its record and fields
    are allocated in TABLE::mem_root. This implementation is not clean
    and resets thd->mem_root several times because of the way create_tmp_table 
    works (many additional things are done inside it).
  - adjust to the changed declaration of st_select_lex_unit::prepare
sql/sql_select.h:
  - move the declaration of sensitive (non-materializing) cursors to 
    sql_cursor.cc
sql/sql_union.cc:
  - move pieces of st_select_unit::prepare to select_union and st_table
    methods to be able to reuse code in the implementation of materialized
    cursors
sql/sql_view.cc:
  - adjust to the changed signature of st_select_lex_unit::prepare
sql/table.cc:
  - implement auxiliary st_table methods for use with temporary tables
sql/table.h:
  - add declarations for auxiliary methods of st_table used to work with 
   temporary tables
tests/mysql_client_test.c:
  - if cursors are materialized, a parallel update of the table used
    in the cursor may go through: update the test.
sql/sql_cursor.cc:
  New BitKeeper file ``sql/sql_cursor.cc'' -- implementation of server side
  cursors
sql/sql_cursor.h:
  New BitKeeper file ``sql/sql_cursor.h'' - declarations for
  server side cursors.
2005-09-22 02:11:21 +04:00
unknown
3fe752f527 WL#2787 (Add view definer/owner to the view definition (.frm) to check privileges on used tables and stored routines when using a VIEW.)
Part 2 postreview fixes.


sql/ha_innodb.cc:
  Renamed structure st_security_context to class Security_context
sql/item_func.cc:
  Renamed structure st_security_context to class Security_context
sql/item_strfunc.cc:
  fixed USER() function
sql/log.cc:
  variable used to optimize access to security context
sql/mysql_priv.h:
  Renamed structure st_security_context to class Security_context
sql/mysqld.cc:
  main security context used direcly
sql/sp_head.cc:
  Renamed structure st_security_context to class Security_context
  removed unneed variable
sql/sp_head.h:
  Comment inmroved
  Renamed structure st_security_context to class Security_context
sql/sql_acl.cc:
  Renamed structure st_security_context to class Security_context
  fixed function comment and return value
  variable used to optimize access to security context
  Renamed method of Security_ontext
sql/sql_acl.h:
  fixed return value type
sql/sql_class.cc:
  Renamed structure st_security_context to class Security_context
sql/sql_class.h:
  Renamed structure st_security_context to class Security_context
  Method renamed
sql/sql_db.cc:
  Renamed structure st_security_context to class Security_context
  fixed layout
sql/sql_parse.cc:
  registration of wanted access for underlying tables
sql/sql_show.cc:
  Renamed structure st_security_context to class Security_context
  fixed layout
sql/sql_yacc.yy:
  Renamed structure st_security_context to class Security_context
2005-09-20 21:20:38 +03:00
unknown
84f029a448 WL#2787 (part 2, ver 3 (merged)) changed securety context switching
libmysqld/lib_sql.cc:
  changed securety context switching
mysql-test/r/rpl_sp.result:
  now it show real information from changed security context of SP (checked)
sql/ha_innodb.cc:
  changed securety context switching
sql/item.cc:
  changed securety context switching
sql/item_func.cc:
  changed securety context switching
sql/item_strfunc.cc:
  changed securety context switching
sql/log.cc:
  changed securety context switching
sql/mysql_priv.h:
  changed securety context switching
sql/mysqld.cc:
  changed securety context switching
sql/repl_failsafe.cc:
  changed securety context switching
sql/set_var.cc:
  changed securety context switching
sql/slave.cc:
  changed securety context switching
sql/sp.cc:
  changed securety context switching
sql/sp_head.cc:
  changed securety context switching
  in case of inability to switch context  we return error now
sql/sp_head.h:
  changed securety context switching
sql/sql_acl.cc:
  changed securety context switching
sql/sql_acl.h:
  changed securety context switching
sql/sql_base.cc:
  changed securety context switching
sql/sql_class.cc:
  changed securety context switching
sql/sql_class.h:
  changed securety context switching
sql/sql_db.cc:
  changed securety context switching
sql/sql_insert.cc:
  changed securety context switching
sql/sql_parse.cc:
  changed securety context switching
sql/sql_show.cc:
  changed securety context switching
sql/sql_trigger.cc:
  changed securety context switching
sql/sql_view.cc:
  changed securety context switching
sql/sql_yacc.yy:
  changed securety context switching
2005-09-15 22:29:07 +03:00
unknown
b6aba9db70 Fixed BUG#12379: PROCEDURE with HANDLER calling FUNCTION with error
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.
2005-09-13 15:32:42 +02:00
unknown
f32088a941 Post-merge fixes. Call sp_cache_clear in THD::cleanup. 2005-09-09 11:43:26 +04:00
unknown
20994fec52 Merge 4.1->5.0
client/mysqlimport.c:
  Auto merged
configure.in:
  Auto merged
include/my_global.h:
  Auto merged
mysql-test/r/connect.result:
  Auto merged
mysql-test/r/func_gconcat.result:
  Auto merged
mysql-test/t/connect.test:
  Auto merged
mysql-test/t/func_gconcat.test:
  Auto merged
ndb/src/kernel/blocks/backup/Backup.cpp:
  Auto merged
ndb/src/kernel/blocks/backup/Backup.hpp:
  Auto merged
ndb/src/kernel/main.cpp:
  Auto merged
ndb/src/mgmsrv/MgmtSrvr.cpp:
  Auto merged
ndb/src/mgmsrv/MgmtSrvr.hpp:
  Auto merged
ndb/src/ndbapi/Makefile.am:
  Auto merged
ndb/test/src/NdbBackup.cpp:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
2005-09-09 10:54:59 +04:00
unknown
c910050a76 Implement WL#2661 "Prepared Statements: Dynamic SQL in Stored Procedures".
The idea of the patch is to separate statement processing logic,
such as parsing, validation of the parsed tree, execution and cleanup, 
from global query processing logic, such as logging, resetting
priorities of a thread, resetting stored procedure cache, resetting
thread count of errors and warnings.
This makes PREPARE and EXECUTE behave similarly to the rest of SQL
statements and allows their use in stored procedures.
This patch contains a change in behaviour:
until recently for each SQL prepared statement command, 2 queries
were written to the general log, e.g.
[Query]   prepare stmt from @stmt_text;
[Prepare] select * from t1 <-- contents of @stmt_text
The chagne was necessary to prevent [Prepare] commands from being written
to the general log when executing a stored procedure with Dynamic SQL.
We should consider whether the old behavior is preferrable and probably
restore it.
This patch refixes Bug#7115, Bug#10975 (partially), Bug#10605 (various bugs
in Dynamic SQL reported before it was disabled).


mysql-test/r/not_embedded_server.result:
  Since we don't want to log Dynamic SQL in stored procedures,
  now the general log gets only one log entry per SQL statement.
mysql-test/r/sp-error.result:
  - remove obsolete tests
  - a better error message for the case when a stored procedure that
  returns a result set is called from a function
mysql-test/r/trigger.result:
  - a better error message for the case when a stored procedure that
  returns a result set is called from a trigger
mysql-test/t/sp-error.test:
  - a better error message for the case when a stored procedure that
    returns a result set is called from a function.
  - move the comment to its place (end of file).
mysql-test/t/trigger.test:
  - a better error message for the case when a stored procedure that
  returns a result set is called from a trigger
sql/item_func.cc:
  - we need to pass sql_command explicitly to get_var_with_binlog, because
  when creating a query for SQL prepared statement thd->lex->sql_command
  points at SQLCOM_EXECUTE, which is not listed in the list of update
  queries.
sql/log_event.h:
  - remove an extra copy of the previous sentence
sql/mysql_priv.h:
  - fix declarations of sql_prepare.cc API
sql/share/errmsg.txt:
  - a new error message, when one attempts to execute a prepared statement
  which is currently being executed (this can happen only in Dynamic SQL
  at the moment).
sql/sp_head.cc:
  - extend sp_multi_results_command to return different flags for a
  command (and rename it)
  - add support for SQLCOM_PREPARE,SQLCOM_EXECUTE, SQLCOM_DEALLOCATE
    to sp_get_flags_for_command
  - replace multiple boolean sp_head members with uint m_flags
  - a fix for a crash when user variables are used in a stored procedure
    and binlog is on. A temporary fix for Bug#12637 "SP crashes the server 
   if it has update query with user var & binlog is enabled", which actually
   stands for stored functions: now instead of a crash we break
   replication if a user variable is used in a stored function which 
   is executed in prelocked mode.
sql/sp_head.h:
  - replace multiple boolean flags of sp_head with uint m_flags;
  - add flag CONTAINS_DYNAMIC_SQL
  - use this flag to error if a stored procedure with Dynamic SQL is
    called from a function or trigger.
sql/sql_class.cc:
  - Statement_map::insert should not delete a statement if it exists,
    now it's done externally to be able to handle the case when the
    statement being deleted is in use.
  - remove extra code (free_list is already reset in free_items)
sql/sql_lex.cc:
  - add lex->stmt_prepare_mode; we can't rely on thd->command any more,
    because we don't reset it any more (Dynamic SQL requirement is that
    PS are as little intrusive as possible).
sql/sql_lex.h:
  - declare bool LEX::stmt_prepare_mode
sql/sql_parse.cc:
  - move prepared statement code to sql_prepare.cc
  - change declarations (refactored code)
  - better error message when one attempts to use Dynamic SQL or a 
    stored procedure that returns a result set in a function or trigger.
sql/sql_prepare.cc:
  - major refactoring to ensure PREPARE/EXECUTE commands do not reset global THD
    state and allow their use in stored procedures.
  - add Prepared_statement::flags and use it to ensure no recursive execution
    of a prepared statement is possible
  - better comments
sql/sql_yacc.yy:
  - enable PREPARE/EXECUTE/DEALLOCATE in stored procedures
  - produce an error message on attempt to use PREPARE/EXECUTE/DEALLOCATE
    in a stored function or trigger
mysql-test/r/sp-dynamic.result:
  - sp-dynamic.test results
mysql-test/t/sp-dynamic.test:
  - a new test for PREPARE/EXECUTE/DEALLOCATE in stored procedures.
2005-09-03 03:13:18 +04:00
unknown
dc92221300 Rename:
- current_arena to stmt_arena: the thread may have more than one
'current' arenas: one for runtime data, and one for the parsed 
tree of a statement. Only one of them is active at any moment.
- set_item_arena -> set_query_arena, because Item_arena was renamed to 
Query_arena a while ago
- set_n_backup_item_arena -> set_n_backup_active_arena;
the active arena is the arena thd->mem_root and thd->free_list
are currently pointing at.
- restore_backup_item_arena -> restore_active_arena (with the same
rationale)
- change_arena_if_needed -> activate_stmt_arena_if_needed; this
method sets thd->stmt_arena active if it's not done yet.


sql/item.cc:
  Rename.
sql/item_cmpfunc.cc:
  Rename.
sql/item_func.cc:
  Rename.
sql/item_subselect.cc:
  Rename.
sql/item_subselect.h:
  Remove an unused forward declaration.
sql/item_sum.h:
  Remove an unused forward declaration.
sql/mysql_priv.h:
  Remove an unused forward declaration.
sql/sp.cc:
  Rename.
sql/sp_head.cc:
  Rename.
sql/sql_base.cc:
  Rename.
sql/sql_class.cc:
  Rename.
sql/sql_class.h:
  Rename.
sql/sql_lex.cc:
  Rename.
sql/sql_parse.cc:
  Rename.
sql/sql_prepare.cc:
  Rename.
sql/sql_select.cc:
  Rename.
sql/sql_show.cc:
  Rename.
sql/sql_union.cc:
  Rename.
sql/sql_view.cc:
  Rename.
sql/table.cc:
  Rename.
2005-09-02 17:21:19 +04:00
unknown
1a170dc092 Fixes bug #12517. Clear user variables and replication events before
closing temp tables in thread cleanup.


mysql-test/r/connect.result:
  added results for test of bug #12517
mysql-test/t/connect.test:
  added test of bug #12517
sql/sql_class.cc:
  Clear user variables and replication events before
  closing temp tables in thread cleanup.
2005-08-30 17:22:19 +04:00
unknown
16238242fc Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/psergey/mysql-5.0-rpl-bug


sql/sp_head.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
2005-08-27 02:34:05 +04:00
unknown
9bc3976c79 Slightly amended Monty's SP replication code cleanup patch
sql/item.cc:
  Code cleanup
sql/item.h:
  Code cleanup
sql/log.cc:
  Added comments
sql/sp_head.cc:
  Code cleanup patch from Monty: 
  in subst_spvars()
  - Move local variables first in block
  - Use res|= instead of res |=
  - Use strmake() instead of alloc + memcpy
  Added:
  - Fail the query if we don't have enough memory to produce a binlog-suitable query string: 
    if we're so low on memory we're likely to fail the query anyway, and failing now removes
    the need for hack with THD::query_str_binlog_suitable.
sql/sql_class.cc:
  Remove THD::query_str_binlog_unsuitable
sql/sql_class.h:
  Remove THD::query_str_binlog_unsuitable
sql/sql_delete.cc:
  Remove THD::query_str_binlog_unsuitable
sql/sql_insert.cc:
  Remove THD::query_str_binlog_unsuitable
sql/sql_parse.cc:
  Code cleanup
sql/sql_update.cc:
  Remove THD::query_str_binlog_unsuitable
2005-08-27 02:33:06 +04:00
unknown
4a226f6ac0 libmysqld.vcproj:
Changed spelling "Commerical" to "Commercial"
mysqld.vcproj:
  Aligned engines with Unix version
sql_class.cc:
  VC7 needs my_free() cast of first arg to be (gptr)
my_global.h:
  Can't assume macro set_timespec_nsec exists if set_timespec does


include/my_global.h:
  Can't assume macro set_timespec_nsec exists if set_timespec does
sql/sql_class.cc:
  VC7 needs my_free() cast of first arg to be (gptr)
VC++Files/sql/mysqld.vcproj:
  Aligned engines with Unix version
VC++Files/libmysqld/libmysqld.vcproj:
  Changed spelling "Commerical" to "Commercial"
2005-08-25 23:24:43 +02:00
unknown
8a5e527453 Fix for BUG#12335 (SP replication) : New binlogging strategy for stored PROCEDUREs/FUNCTIONs.
"Interleaved SPs execution is now binlogged properly, "SELECT spfunc()" is binlogged too.
The known remaining issue is binlogging/replication of "a routine is deleted while it is executed" scenario.


mysql-test/r/rpl_sp.result:
  Fix for BUG#12335: updated test cases/results
mysql-test/t/rpl_sp.test:
  Fix for BUG#12335: updated test cases/results
sql/item.cc:
  Fix for BUG#12335 (SP replication): 
   - Added Item_name_const 'function'
   - Addede 'delete reuse' to call dtor on item reuse
sql/item.h:
  Fix for BUG#12335 (SP replication) : Added Item_name_const 'function' + code cleanup
sql/item_create.cc:
   Fix for BUG#12335 (SP replication) : Added Item_name_const 'function'
sql/item_create.h:
   Fix for BUG#12335 (SP replication) : Added Item_name_const 'function'
sql/item_func.cc:
  Fix for BUG#12335 (SP replication) : binary log is now constrolled from within execute_function.
sql/lex.h:
  Fix for BUG#12335 (SP replication) : Added Item_name_const 'function'
sql/log.cc:
  Fix for BUG#12335 (SP replication) : Added MYSQL_LOG::{start|stop}_union_events to allow
  one to temporary disable binlogging but collect a 'union' information about binlog write
  calls.
sql/mysql_priv.h:
  Fix for BUG#12335 (SP replication)
sql/sp_head.cc:
  Fix for BUG#12335 (SP replication) : Now we use different SP binlogging strategy, grep for 
  StoredRoutinesBinlogging for details
sql/sp_head.h:
  Comments added
sql/sp_pcontext.h:
  Comments added
sql/sp_rcontext.h:
  Comments added
sql/sql_class.cc:
  Fix for BUG#12335 (SP replication) : Now we use different SP binlogging strategy, grep for 
  StoredRoutinesBinlogging for details
sql/sql_class.h:
  Fix for BUG#12335 (SP replication) : Added MYSQL_LOG::{start|stop}_union_events to allow
  one to temporary disable binlogging but collect a 'union' information about binlog write
  calls.
sql/sql_delete.cc:
  Fix for BUG#12335: check THD::query_str_binlog_unsuitable when writing to binlog.
sql/sql_insert.cc:
  Fix for BUG#12335: check THD::query_str_binlog_unsuitable when writing to binlog.
sql/sql_lex.cc:
  Fix for BUG#12335 (SP replication): Add ability to extract previous returned token from
  the tokenizer.
sql/sql_lex.h:
  Fix for BUG#12335 (SP replication): Add ability to extract previous returned token from
  the tokenizer.
sql/sql_parse.cc:
  Fix for BUG#12335 (SP replication) : Now we use different SP binlogging strategy, grep for 
  StoredRoutinesBinlogging for details
sql/sql_update.cc:
  Fix for BUG#12335: check THD::query_str_binlog_unsuitable when writing to binlog.
sql/sql_yacc.yy:
  Fix for BUG#12335 (SP replication) : When creating Item_splocal, remember where it is located
  in the query.
2005-08-25 17:34:34 +04:00