Commit graph

961 commits

Author SHA1 Message Date
unknown
e486fe1ff1 WL#2486 - natural/using joins according to SQL:2003
Post-review fixes that simplify the way access rights
are checked during name resolution and factor out all
entry points to check access rights into one single
function.


sql/item.cc:
  Simplfied find_field_in_table - factored out all acces right checks
  into a separate function.
sql/mysql_priv.h:
  Simplified the way we control whether to perform access right
  checks for columns.
sql/sql_acl.cc:
  - Added new functon check_column_grant_in_table_ref that serves as a single
    point of entry to check access rights during name resolution for different
    kinds of table references.
  - Moved check_grant_column_in_sctx to sql_acl.cc where it
    logically belongs.
  - Removed the parameter check_grants - it is checked before
    calling the function.
sql/sql_acl.h:
  - Added new function check_column_grant_in_table_ref.
  - Made check_grant_column_in_sctx available to other modules.
sql/sql_base.cc:
  - Factored out all code that check access rights for columns during
    name resolution into one function - check_column_grant_in_table_ref.
  - Moved check_grant_column_in_sctx to sql_acl.cc where it
    logically belongs.
  - Removed the parameter check_grants - it is checked before
    calling the function.
sql/table.cc:
  Removed code that duplicates the functionality of
  check_column_grant_in_table_ref, and called directly
  that function.
sql/table.h:
  check_grants method is replaced by more general
  check_column_grant_in_table_ref.
2005-11-30 21:27:11 +02:00
unknown
4fd41f7c0b WL#2486 - Natural/using join according to SQL:2003.
Post-review fixes according to Monty's review.


sql/item.h:
  Unite all code that stores and restores the state of a name resolution context
  into a class to represent the state, and methods to save/restore that
  state.
sql/mysql_priv.h:
  Reorder parameters so that length is after the name of a field,
  and database is before table name.
sql/sql_acl.cc:
  Reorder parameters so that length is after the name of a field,
  and database is before table name.
sql/sql_base.cc:
  * Reorder parameters so that length is after the name of a field,
    and database is before table name.
  * Added new method - Field_iterator_table_ref::get_natural_column_ref
    to avoid unnecessary code when it is knwon that no new columns will
    be created when accessing natural join columns.
sql/sql_insert.cc:
  Unite all code that stores and restores the state of a name resolution context
  into a class to represent the state, and methods to save/restore that
  state.
sql/sql_lex.cc:
  Removed obsolete comment.
sql/sql_lex.h:
  Return error from push_contex() if there is no memory.
sql/sql_list.h:
  Extended base_list_iterator, List_iterator, and List_iterator_fast with an
  empty constructor, and init() methods, so that one doesn't have to construct
  a new iterator object every time one needs to iterate over a new list.
sql/sql_parse.cc:
  Moved common functionality from the parser into one function, and renamed
  the function to better reflect what it does.
sql/sql_yacc.yy:
  Moved common functionality from the parser into one function, and renamed
  the function to better reflect what it does.
sql/table.cc:
  * Extended base_list_iterator, List_iterator, and List_iterator_fast with an
    empty constructor, and init() methods, so that one doesn't have to construct
    a new iterator object every time one needs to iterate over a new list.
  * Added new method Field_iterator_table_ref::get_natural_column_ref to be
    used in cases when it is known for sure that no new columns should be
    created.
sql/table.h:
  - column_ref_it no longer allocated for each new list of columns
  - new method get_natural_join_column for faster/simpler access
    to natural join columns.
2005-11-28 21:57:50 +02:00
unknown
d4088df5e9 Fixed BUG#14233: Crash after tampering with the mysql.proc table
Post-review version. Some minor review fixes, but also changed the way
  some errors are handled: Don't return specific parse errors; instead
  always use the more general "table corrupt" error (amended accordingly).


mysql-test/r/sp-destruct.result:
  Updated results.
mysql-test/r/sp-error.result:
  Updated for fully qualified name in "no return" error message.
mysql-test/t/sp-destruct.test:
  Adopted the more consistent error handling for a corrupted mysql.proc table.
  (No more "parse error" et al).
sql/share/errmsg.txt:
  Changed ER_SP_PROC_TABLE_CORRUPT to be more explicit.
sql/sp.cc:
  Review fixes.
  Changed the handling of parse errors, and added the routine name to the "table corrupt" error message.
sql/sql_base.cc:
  Review changes: Change error tests and added comments.
sql/sql_parse.cc:
  Mored ER_SP_NORETURN test of functions to sql_yacc.yy for more general error handling.
sql/sql_yacc.yy:
  Mored ER_SP_NORETURN test of functions from sql_parse.cc for more general error handling.
2005-11-25 17:09:26 +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
97bfd41fe1 Don't use PATH_MAX for FN_REFLEN as this uses too much stack space
Larger stack size neaded for open table on x86 64 bit
Fix failing test cases
Deleted symlink from bk


BitKeeper/etc/ignore:
  added libmysqld/ha_blackhole.cc
BitKeeper/deleted/.del-ha_blackhole.cc~727c69ef7846623a:
  Delete: libmysqld/ha_blackhole.cc
include/my_global.h:
  Don't use PATH_MAX for FN_REFLEN as this uses too much stack space.
  (With a PATH_MAX of 4096, we use 80K for opening a table as there is several objects of size FN_REFLEN on stack)
mysql-test/r/federated.result:
  Update results after error message changes
mysql-test/r/grant.result:
  Update results after error message changes
mysql-test/r/grant2.result:
  Update results after error message changes
sql/ha_federated.cc:
  Fix error messages to be more consistent
sql/mysql_priv.h:
  Stack size to have when opening a table
  (This was needed on x86 64 bit Linux)
sql/share/errmsg.txt:
  Remove quotes around error string for federated as two quotes in the output looks strange
sql/sql_base.cc:
  More correct stack size
sql/sql_parse.cc:
  Set thread_stack before store_globals()
sql/unireg.h:
  More correct MAX_DBKEY_LENGTH
2005-11-24 02:36:28 +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
aa06123f83 Merge sanja.is.com.ua:/home/bell/mysql/bk/work-bug7-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-merge-5.0


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
2005-11-23 01:28:32 +02:00
unknown
164ce4c5cd Recursion support made for SP (BUG#10100).
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.
2005-11-23 01:11:19 +02:00
unknown
789340bc5f Merge sanja.is.com.ua:/home/bell/mysql/bk/work-bug4-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-merge-5.0


sql/sql_base.cc:
  Auto merged
2005-11-21 21:14:36 +02:00
unknown
ae4d7b0f6b Avoiding removing dummy TABLE allocated on the stack (BUG#14726).
mysql-test/r/view_grant.result:
  BUG#14726 test suite.
mysql-test/t/view_grant.test:
  BUG#14726 test suite.
2005-11-21 21:11:02 +02: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
b5182e4b92 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
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_base.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
2005-11-04 17:54:47 -08: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
4b63b4adc0 Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.0
into  ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0


sql/mysql_priv.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/sql_view.h:
  Auto merged
sql/table.cc:
  Auto merged
2005-11-03 16:43:05 +02:00
unknown
5af7ca80d9 Changes in get_table_type() and mysql_frm_type(). The main problem was
that in mysql_rm_table_part2_with_lock() previously we needed to open
same file twice. Now once is enough.


sql/mysql_priv.h:
  Merged functions get_table_type() and mysql_frm_type() into one,
  using the name from latter one.
sql/sql_base.cc:
  Changed get_table_type() to mysql_frm_type()
sql/sql_delete.cc:
  Changed get_table_type() to mysql_frm_type()
sql/sql_rename.cc:
  Changed get_table_type() to mysql_frm_type()
sql/sql_show.cc:
  Changed get_table_type() to mysql_frm_type()
sql/sql_table.cc:
  Changed get_table_type() to mysql_frm_type()
sql/sql_view.cc:
  Merged code from get_table_type() and mysql_frm_type() into the latter one.
sql/sql_view.h:
  Function prototype changes.
sql/table.cc:
  No longer needed.
2005-11-03 16:10:11 +02:00
unknown
3fa0dd23e0 A fix and a test case for Bug#14210 "Simple query with > operator on
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
2005-11-03 14:20:13 +03:00
unknown
b601d8f079 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-owner-5.0


sql/item_func.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/table.cc:
  merge
2005-11-02 12:56:19 +02:00
unknown
ee380a0777 Reverting patch for BUG #14009 (use of abs() on null value causes problems with filesort
Fix for bug #14536: SELECT @a,@a:=... fails with prepared statements


mysql-test/r/func_sapdb.result:
  Correct tests after reverting patch for BUG #14009 (use of abs() on null value causes problems with filesort)
mysql-test/r/type_newdecimal.result:
  Correct tests after reverting patch for BUG #14009 (use of abs() on null value causes problems with filesort)
mysql-test/r/user_var.result:
  More test with SELECT @a:=
mysql-test/t/disabled.def:
  Enable user_var.test for
mysql-test/t/user_var.test:
  More test with SELECT @a:=
sql/item.cc:
  Simple optimization during review of new code
sql/item_func.cc:
  Reverting patch for BUG #14009 (use of abs() on null value causes problems with filesort)
sql/item_timefunc.h:
  timediff() can return NULL for not NULL arguments
sql/sql_base.cc:
  Remove usage of current_thd() in mysql_make_view()
sql/sql_lex.h:
  Remove usage of current_thd() in mysql_make_view()
sql/sql_select.cc:
  Fix for bug #14536: SELECT @a,@a:=... fails with prepared statements
sql/sql_view.cc:
  Remove usage of current_thd() in mysql_make_view()
  Simple optimization of new code
sql/sql_view.h:
  Remove usage of current_thd() in mysql_make_view()
sql/table.cc:
  Simple optimization of new code
2005-11-01 15:54:30 +02:00
unknown
d32e0486c6 postreview fixes
sql/item_func.cc:
  some optimisation
sql/sql_acl.cc:
  some optimisation
sql/sql_base.cc:
  some optimisation
sql/sql_parse.cc:
  some optimisation
sql/table.cc:
  some optimisation
2005-10-31 22:14:27 +02:00
unknown
bef391c878 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_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-29 09:41:18 -07:00
unknown
df22630555 Merge mysql.com:/usr/local/bk/mysql-5.0
into  mysql.com:/usr/home/pem/bug14233/mysql-5.0


sql/share/errmsg.txt:
  Auto merged
sql/sql_base.cc:
  Auto merged
2005-10-28 16:58:41 +02: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
4a816ce152 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-owner7-5.0


mysql-test/r/information_schema.result:
  Auto merged
mysql-test/r/sp.result:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_cache.cc:
  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_view.cc:
  Auto merged
2005-10-28 00:24:13 +03:00
unknown
24ac4019c5 support of view underlying tables and SP functions security check added (BUG#9505) (WL#2787)
mysql-test/r/information_schema.result:
  error message changed
mysql-test/r/sp.result:
  error message changed
mysql-test/r/sql_mode.result:
  fixed test suite
mysql-test/r/view.result:
  error message changed
mysql-test/r/view_grant.result:
  test of underlying view tables check
mysql-test/t/sql_mode.test:
  fixed test suite
mysql-test/t/view_grant.test:
  test of underlying view tables check
sql/item.cc:
  check of underlying tables privilege added
sql/item.h:
  Name the resolution context points to the security  context of view (if item belong to the view)
sql/item_func.cc:
  a view error hiding for execution of prepared function belonged to a view
  fixed checking privileges if stored functions belonds to some view
sql/mysql_priv.h:
  refult of derived table processing functions changed to bool
  Security_context added as an argument to find_field_in_table()
sql/share/errmsg.txt:
  error message fixed
sql/sql_acl.cc:
  Storing requested privileges of tables added
  View underlying tables privilege check added
sql/sql_base.cc:
  View underlying tables privilege check added
sql/sql_cache.cc:
  Code cleunup: we should not register underlying tables of view second time
sql/sql_delete.cc:
  ancestor -> merge_underlying_list renaming
sql/sql_derived.cc:
  refult of derived table processing functions changed to bool
  do not give SELECT_ACL for TEMPTABLE views
sql/sql_lex.h:
  The comment added
sql/sql_parse.cc:
  registration of requested privileges added
sql/sql_prepare.cc:
  registration of requested privileges added
sql/sql_update.cc:
  manipulation of requested privileges for underlying tables made the same as for table which we are updating
sql/sql_view.cc:
  underlying tables of view security check support added
sql/table.cc:
  renaming and fixing view preparation methods, methods for checking underlyoing tables security context added
sql/table.h:
  storege for reuested privileges added
2005-10-28 00:18:23 +03:00
unknown
9349f18b44 Fixed BUG#14233: Crash after tampering with the mysql.proc table
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.
2005-10-26 15:34:57 +02: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
8a84dd7e7f 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
2005-10-17 15:02:06 -07:00
unknown
5727309da8 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/dlenev/src/mysql-5.0-bg12739


sql/mysql_priv.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
2005-10-17 22:47:46 +04:00
unknown
dd02b98d14 Fix for bug #12739 "Deadlock in multithreaded environment during creating/
droping trigger on InnoDB table".

Deadlock occured in cases when we were trying to create two triggers for
the same InnoDB table concurrently and both threads were able to reach
close_cached_table() simultaneously. Bugfix implements new approach to
table locking and table cache invalidation during creation/dropping
of trigger.

No testcase is supplied since bug was repeatable only under high concurrency.


sql/mysql_priv.h:
  reopen_name_locked_table():
    Changed function signature to make it more robust against erroneous usage.
sql/sql_base.cc:
  reopen_name_locked_table():
    Changed function signature to make it more robust against erroneous usage.
    Obtaining LOCK_open lock is now resposibility of caller.
    When searching for the table to open we should not prefer connection's current
    database over database which was explicitly specified in TABLE_LIST::db member
    (even if database is not explicitly specified for table in original query
    TABLE_LIST::db will be set properly at parsing stage).
    Fixed behavior of function in cases when error occurs during opening of table.
sql/sql_table.cc:
  prepare_for_restore()/prepare_for_repair():
    We should not prefer connection's current database over database which was
    specified in TABLE_LIST::db member (even if database is not explicitly
    specified for table in original query TABLE_LIST::db will be set properly
    at parsing stage). Fixed behavior in unlikely case when we are unable
    to open table which we are restoring/reparing at the end of preparation
    stage.
sql/sql_trigger.cc:
  mysql_create_or_drop_trigger():
    Now instead of opening and locking table, creating trigger, and then trying
    to invalidate all instances of this table in table cache, we obtain name
    lock on table first (thus ensuring that no other thread has this table
    open), open it, create trigger and then close table therefore releasing lock.
    New approach is more in line with other places where change .frm files
    (i.e. change table meta-data).
    With this change we also get rid of deadlock which occured in cases when we
    were trying to create two triggers for the same InnoDB table concurrently
    and both threads were able to reach close_cached_table() simultaneously.
    (Alternative was to forbid to InnoDB downgrade locks for CREATE/DROP
     TRIGGER statements in one way or another but I think that proposed
     solution is better long term).
2005-10-17 22:37:24 +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
0ce12f70ed Reviewing new pushed code
- CHAR() now returns binary string as default
- CHAR(X*65536+Y*256+Z) is now equal to CHAR(X,Y,Z) independent of the character set for CHAR()
- Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
  (Some old systems returns ETIME and it's safer to test for both values
   than to try to write a wrapper for each old system)
- Fixed new introduced bug in NOT BETWEEN X and X
- Ensure we call commit_by_xid or rollback_by_xid for all engines, even if one engine has failed
- Use octet2hex() for all conversion of string to hex
- Simplify and optimize code


client/mysqldump.c:
  Simple optimizations of new code
  Indentation fixes
client/mysqltest.c:
  Removed not needed variable
include/mysql_com.h:
  Made octec2hex() more usable
mysql-test/r/ctype_utf8.result:
  CHAR() now returns binary string as default
mysql-test/r/func_str.result:
  CHAR() now returns binary string as default
mysql-test/r/range.result:
  Added test to verify new introduced bug in NOT BETWEEN X and X
mysql-test/r/user_var-binlog.result:
  CHAR() now returns binary string as default
mysql-test/r/view.result:
  More tests of view rename
mysql-test/t/ctype_utf8.test:
  CHAR() now returns binary string as default
mysql-test/t/func_str.test:
  CHAR() now returns binary string as default
mysql-test/t/range.test:
  Added test to verify new introduced bug in NOT BETWEEN X and X
mysql-test/t/view.test:
  More tests of view rename
mysys/mf_keycache.c:
  Indentation changes
  Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
mysys/my_os2cond.c:
  Fix to MySQL coding style
  Optimized functions
mysys/thr_lock.c:
  Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
mysys/thr_mutex.c:
  Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
server-tools/instance-manager/instance.cc:
  Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
server-tools/instance-manager/thread_registry.cc:
  Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
sql/ha_federated.cc:
  Use octet2hex()
sql/ha_ndbcluster.cc:
  Removed not used variable
sql/handler.cc:
  Simplify code
  Use *NONE* instead of 'none' for not existing storage engine
  Ensure we call commit_by_xid or rollback_by_xid for all engines, even if one engine has failed
sql/item.h:
  Remove not needed test for *ref.  (If ref is set, it should never point at 0)
sql/item_func.cc:
  Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
  Simplify code
  More comments
  Require that last argument to find_and_check_access() is given
  (Made code shorter and faster)
sql/item_strfunc.cc:
  Changed CHAR() to return result in binary collation
  CHAR(X*65536+Y*256+Z) is now equal to CHAR(X,Y,Z) independent of the character set for CHAR()
  
  Bar will shortly add the following syntax:
  CHAR(.... USING character_set)
  and ensure that
  CONVERT(CHAR(....) USING utf8) cuts not legal utf8 strings
  Use ocet2hex()
sql/item_strfunc.h:
  CHAR() now returns a binary string
sql/log_event.cc:
  Use octet2hex()
  Simplify code
sql/parse_file.cc:
  Indentation fixes
  Use for() instead of while()
sql/password.c:
  Make octet2hex() more generally usable by returning pointer to end 0
sql/slave.cc:
  Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
sql/sql_base.cc:
  Indentation fixes
sql/sql_insert.cc:
  Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
sql/sql_manager.cc:
  Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
sql/sql_parse.cc:
  Don't check thd->db when checking for function privileges
sql/sql_prepare.cc:
  Fixed wrong merge
sql/sql_select.cc:
  Fixed new bug for NOT BETWEEN X and X
sql/sql_show.cc:
  Removed not used variable
sql/sql_table.cc:
  Indentation fixed
  Removed DBUG_PRINT that is obvious from context
sql/sql_view.cc:
  Simplify code
sql/unireg.cc:
  Use octet2hex()
2005-10-12 00:58:22 +03:00
unknown
a454c695d3 Merge kboortz@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/Users/kent/mysql/bk/mysql-5.0


sql/sql_base.cc:
  Auto merged
2005-10-04 04:03:48 +02:00
unknown
443b16861b Merge mysql.com:/home/timka/mysql/src/5.0-virgin
into  mysql.com:/home/timka/mysql/src/5.0-bug-13410


sql/item.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/table.cc:
  Auto merged
2005-10-03 22:02:22 +03:00
unknown
58263844c7 Fix for BUG#13410 - qualified reference to a view column in the HAVING clause cannot be resolved.
The problem was then when a column reference was resolved to a view column, the new Item
created for this column contained the name of the view, and not the view alias.


mysql-test/r/view.result:
  Additional test for BUG#13410.
mysql-test/t/view.test:
  Additional test for BUG#13410.
sql/item.cc:
  Correctly cast 'cur_field' to Item_ident because if the original item is
  an Item_field, the cur_field is either an Item_field or an Item_ref.
  Thus we have to cast cur_field to a common super-class of both.
sql/item.h:
  - real_item() may be called before Item_ref::ref is set
    (i.e. the Item_ref object was resolved).
  - To avoid a crash and to return some meaningful value
    in such cases we return 'this'.
sql/sql_base.cc:
  - 'item' may be an Item_ref, so we test for the type of the actual
    referenced item.
  - Correctly cast 'cur_field' to Item_ident because if the original
    item is an Item_field, the cur_field is either an Item_field or an
    Item_ref. Thus we have to cast cur_field to a common super-class
    of both.
sql/table.cc:
  - When creating a new Item for a reference to a view column, use the view alias,
    and not the real view name.
  - Removed old code
2005-10-01 09:35:30 +03:00
unknown
1d3497702a Merge mysql.com:/Users/kent/mysql/bk/mysql-5.0-release
into mysql.com:/Users/kent/mysql/bk/mysql-5.0


mysql-test/lib/mtr_report.pl:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
sql/ha_innodb.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
2005-09-30 22:37:55 +02:00
unknown
8f842e8fc9 Bug#11238
"SELECT ... FOR UPDATE executed as consistent read inside LOCK TABLES"
Do not discard lock_type information as handler::start_stmt() may require knowledge.
(fixed by Antony)
2005-09-30 20:20:10 +02:00
unknown
c8e0432dbd Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.0
into  a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-5.0-icc


client/mysqltest.c:
  Auto merged
myisam/myisamchk.c:
  Auto merged
myisam/myisamdef.h:
  Auto merged
sql/item.h:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
2005-09-30 12:36:23 +03:00
unknown
33313992bb Comment adjusted (see fix for #13545) 2005-09-30 12:37:58 +05:00
unknown
7acbea3f3f fix for bug #13545: Server crash caused by select query.
sql/sql_base.cc:
  fix for bug #13545: Server crash caused by select query.
  - compare table qualifier only with tables which are not nested joins.
  - perform recursion accordingly.
  - DBUG_ASSERT(table_list->table); added before the find_field_in_table() call.
2005-09-29 19:34:21 +05:00
unknown
f6a552b1cb sql_base.cc, item.cc:
Fixed bug #13411.
  Fixed name resolution for non-qualified reference to a view column
  in the HAVING clause.
view.result, view.test:
  Added a test case for bug #13411.


mysql-test/t/view.test:
  Added a test case for bug #13411.
mysql-test/r/view.result:
  Added a test case for bug #13411.
sql/item.cc:
  Fixed bug #13411.
  Fixed name resolution for non-qualified reference to a view column
  in the HAVING clause.
sql/sql_base.cc:
  Fixed bug #13411.
  Fixed name resolution for non-qualified reference to a view column
  in the HAVING clause.
2005-09-26 20:18:59 -07:00
unknown
ecffc1b83c Several fixes revelaled by Intel compiler.
cmd-line-utils/readline/complete.c:
  Added a cast.
dbug/my_main.c:
  Added an include to avoid implicit declaration of
  my_thread_global_init()
include/my_global.h:
  undef cannot be used on this predefined name.
  Since it is a custom fix for gcc 2.8.0, let's make it only
  effective in that case.
include/my_sys.h:
  Added a new type, TYPE_NOT_SET.
myisam/ft_boolean_search.c:
  Added casts.
myisam/mi_key.c:
  Added cast.
myisam/mi_open.c:
  Added cast.
  Changed function types.
myisam/mi_test1.c:
  Added cast.
myisam/myisamchk.c:
  Added cast.
myisam/myisamdef.h:
  Changed function type.
myisam/myisampack.c:
  Added casts.
myisam/sp_key.c:
  Added cast.
mysys/mf_iocache.c:
  Fixed invalid use of 0 to info->type. According to comment it
  should not have been set, but in earlier code by setting it
  to 0 would have been same as setting it to READ_CACHE. This
  probably was not desired, potential bug.
server-tools/instance-manager/instance_options.cc:
  Fixed a typo.
server-tools/instance-manager/protocol.cc:
  Changed enum to int.
  Changed char to uchar.
  Added casts.
sql/mysql_priv.h:
  Bit overflow.
sql/sql_base.cc:
  Removed unused label. The code below label was unused too, because
  there is a return just before.
sql/sql_parse.cc:
  Removed unneccessary extra argument.
2005-09-23 16:47:08 +03: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
7d6d4c8355 Fixed problems found by valgrind
Fixed problems in test suite where some test failed
Fixed access to not initialized memory in federated
Fixed access to not initialized memory when using BIT fields in internal temporary tables


BitKeeper/etc/ignore:
  added libmysqld/sql_cursor.h
mysql-test/r/information_schema.result:
  Change view names to 'v#' to not cause massive conflict with other tests if test dies in the middlecd
mysql-test/r/information_schema_inno.result:
  Remove used tables at start
mysql-test/r/multi_statement.result:
  Remove used tables at start
mysql-test/r/temp_table.result:
  Change view names to 'v#' to not cause massive conflict with other tests if test dies in the middle
mysql-test/r/type_bit.result:
  More tests
mysql-test/t/information_schema.test:
  Change view names to 'v#' to not cause massive conflict with other tests if test dies in the middle
mysql-test/t/information_schema_inno.test:
  Remove used tables at start
mysql-test/t/multi_statement.test:
  Remove used tables at start
mysql-test/t/temp_table.test:
  Change view names to 'v#' to not cause massive conflict with other tests if test dies in the middle
mysql-test/t/type_bit.test:
  More tests
mysql-test/valgrind.supp:
  Removed some valgrind warnings that isn't errors
sql/ha_federated.cc:
  Fixed errors discovered by valgrind:
  - Socket was not initialized
  - share->scheme was deleted while there was still pointer into it from the hash
sql/item_func.h:
  Remove access to table object from cleanup() as the table object may have been dropped earlier (In case of temporary tables or of close_thread_tables() is run before cleanup())
  This fixed a bug with access to already freed memory
sql/sql_base.cc:
  Reset variables used by fulltext
sql/sql_select.cc:
  Fixed various problems with bit fields when used in internal temporary tables.
  Calculate space needed for bit fields correctly (previously we allocated more space than needed for rows in heap/myisam tables)
2005-09-22 03:23:07 +03:00
unknown
aa95f0d447 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-owner5-5.0


sql/ha_innodb.cc:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/item_func.cc:
  merge
2005-09-20 21:27:28 +03:00
unknown
5f81fbb323 Fix for BUG#13127.
The problem was in the way table references are pre-filtered when
resolving a qualified field. When resolving qualified table references
we search recursively in the operands of the join. If there is
natural/using join with a merge view, the first call to find_field_in_table_ref
makes a recursive call to itself with the view as the new table reference
to search for the column. However the view has both nested_join and
join_columns != NULL so it skipped the test whether the view name matches
the field qualifier. As a result the field was found in the view since the
view already has a field with the same name. Thus the field was incorrectly
resolved as the view field.


mysql-test/r/select.result:
  Test for BUG#13127.
mysql-test/t/select.test:
  Test for BUG#13127.
sql/sql_base.cc:
  The patch contains two independent changes:
  
  - When searching for qualified fields, include merge views and information schema tables
  used with SHOW (both using TABLE_LIST::field_translation to represent result fields) in
  the test that compares the qualifying table with the name of the table reference being
  searched. This change fixes the bug.
  
  - Do not search the materialized list of columns of a NATURAL/USING join if 'table_list'
  is a stored table or merge view. Instead search directly in the table or view as if it
  is not under a natural join. This is a performance improvement since if 'table_list'
  is a stored table, then the search can utilize the name hash for table names.
2005-09-20 14:00:39 +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
dceb8fb271 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/dlenev/src/mysql-5.0-bg12704-2


sql/mysql_priv.h:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
2005-09-15 03:57:59 +04:00
unknown
d5303b8ab8 Fix for bug #12704 "Server crashes during trigger execution".
This bug occurs when some trigger for table used by DML statement is created
or changed while statement was waiting in lock_tables(). In this situation
prelocking set which we have calculated becames invalid which can easily lead
to errors and even in some cases to crashes.

With proposed patch we no longer silently reopen tables in lock_tables(),
instead caller of lock_tables() becomes responsible for reopening tables and
recalculation of prelocking set.


mysql-test/t/trigger.test:
  Added tests for bug #12704 "Server crashes during trigger execution".
  Unfortunately these tests rely on the order in which tables are locked
  by statement so they are non-determenistic and therefore should be disabled.
sql/lock.cc:
  mysql_lock_tables():
    Now instead of always reopening altered or dropped tables by itself
    mysql_lock_tables() can notify upper level and rely on caller doing this.
sql/mysql_priv.h:
  Now mysql_lock_tables() can either reopen deleted or altered tables by itself
  or notify caller about such situation through 'need_reopen' argument and rely
  on it in this.
  Also lock_tables() has new 'need_reopen' out parameter through which it
  notifies caller that some tables were altered or dropped so he needs to reopen
  them (and rebuild prelocking set some triggers may change or simply appear).
sql/sp.cc:
  sp_add_used_routine():
    To be able to restore LEX::sroutines_list to its state right after parsing
    we now adjust  LEX::sroutines_list_own_last/sroutines_list_own_elements when
    we add directly used routine.
  sp_remove_not_own_routines():
    Added procedure for restoring LEX::sroutines/sroutines_list to their state
    right after parsing (by throwing out non-directly used routines).
  sp_cache_routines_and_add_tables_for_view()/sp_update_stmt_used_routines():
    We should use LEX::sroutines_list instead of LEX::sroutines as source of
    routines used by view, since LEX::sroutines is not availiable for view
    on second attempt to open it (see comment in open_tables() about it).
sql/sp.h:
  sp_remove_not_own_routines():
    Added procedure for restoring LEX::sroutines/sroutines_list to their state
    right after parsing (by throwing out non-directly used routines).
sql/sp_head.cc:
  Removed assert which is no longer always true.
sql/sql_base.cc:
  reopen_table():
    When we re-open table and do shallow copy of TABLE object we should adjust
    pointers to it in associated Table_triggers_list object. Removed nil
    operation.
  open_tables():
    Now this function is able to rebuild prelocking set for statement if it is
    needed. It also correctly handles FLUSH TABLES which may occur during its
    execution.
  lock_tables():
    Instead of allowing mysql_lock_tables() to silently reopen altered or dropped
    tables let us notify caller and rely on that it will do reopen itself.
    This solves the problem when trigger suddenly appears or changed during
    mysq_lock_tables().
  close_tables_for_reopen():
    Added routine for properly preparing for reopening of tables and recalculation
    of set of prelocked tables.
sql/sql_handler.cc:
  Here we let mysql_lock_tables() to reopen dropped or altered tables by itself.
sql/sql_insert.cc:
  Here we let mysql_lock_tables() to reopen dropped or altered tables by itself.
sql/sql_lex.cc:
  LEX:
    Added 'sroutines_list_own_last' and 'sroutines_list_own_elements' members
    which are used for keeping state in which 'sroutines_list' was right after
    statement parsing (and for restoring of this list to this state).
sql/sql_lex.h:
  LEX:
    Added 'sroutines_list_own_last' and 'sroutines_list_own_elements' members
    which are used for keeping state in which 'sroutines_list' was right after
    statement parsing (and for restoring of this list to this state).
    Added chop_off_not_own_tables() method to simplify throwing away list
    of implicitly used (prelocked) tables.
sql/sql_prepare.cc:
  Now instead of silently reopening altered or dropped tables in
  lock_tables() we notify caller and rely on that the caller will
  reopen tables.
sql/sql_table.cc:
  Here we let mysql_lock_tables() to reopen dropped or altered tables by itself.
sql/sql_trigger.cc:
  Added Table_triggers_list::set_table() method to adjust Table_triggers_list
  to new pointer to TABLE instance.
sql/sql_trigger.h:
  Added Table_triggers_list::set_table() method to adjust Table_triggers_list
  to new pointer to TABLE instance.
sql/sql_update.cc:
  Now instead of silently reopening altered or dropped tables in
  lock_tables() we notify caller and rely on that the caller will
  reopen tables.
2005-09-15 03:56:09 +04:00
unknown
1d175fd9b9 Merge mysql.com:/home/mydev/mysql-4.0-4000
into  mysql.com:/home/mydev/mysql-4.1-4100


configure.in:
  Auto merged
include/my_global.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
2005-09-13 20:47:00 +02:00
unknown
849273bcfb Merge
sql/sql_base.cc:
  Auto merged
mysql-test/r/view.result:
  SCCS merged
mysql-test/t/view.test:
  SCCS merged
2005-09-13 22:22:51 +04:00
unknown
3884629d88 Bug#12845 - Stress test: Server crashes on CREATE .. SELECT statement
Solution for 4.0 and 4.1.
If the caller cannot re-open table(s), it gives a NULL
'refresh' argument to open_table(). We used to ignore
flushes then. Now we ignore drops too.
2005-09-13 20:19:59 +02:00
unknown
738ee00503 Bug#12845 - Stress test: Server crashes on CREATE .. SELECT statement
Solution for 5.0.
Changed calls to open_table(). Requested to ignore
flush at places where the command did already lock tables.
This could happen in CREATE ... SELECT and ALTER TABLE.

No test case. The bug can only be triggered by true concurrency.
The stress test suite provides a test case for this.


sql/sql_base.cc:
  Bug#12845 - Stress test: Server crashes on  CREATE .. SELECT statement
  Solution for 5.0.
  Changed open_table() so that ignoring flush requests
  is dependend on the 'flags' parameter as ignoring drop
  request was already. This aims for consistent behaviour.
sql/sql_table.cc:
  Bug#12845 - Stress test: Server crashes on  CREATE .. SELECT statement
  Solution for 5.0.
  Changed calls to open_table(). Requested to ignore
  flush at places where the command did already lock tables.
  This could happen in CREATE ... SELECT and ALTER TABLE.
2005-09-13 14:36:43 +02:00
unknown
25fb012dcf Fix for BUG#13067 "JOIN ... USING is case sensitive".
mysql-test/r/select.result:
  Test for BUG#13067
mysql-test/t/select.test:
  Test for BUG#13067
sql/sql_base.cc:
  Correctly compare field names with respect to case sensitivity.
2005-09-12 08:28:53 +03:00
unknown
b3dc4ea3e3 Fix bug #12993 View column rename broken in subselect
When view column aliased in subselect alias is set on ref which represents
field. When tmp table is created for subselect, it takes name of original field
not ref. Because of this alias on view column in subselect is lost. Which
results in reported error.

Now when alias is set on ref, it's set on ref real item too.


mysql-test/r/view.result:
  Test case for bug #12993  View column rename broken in subselect
mysql-test/t/view.test:
  Test case for bug #12993  View column rename broken in subselect
sql/sql_base.cc:
  Fix bug #12993 View column rename broken in subselect
  Now when alias is set on ref, it's set on ref real item too.
2005-09-12 02:46:35 +04:00
unknown
d3f2e6afdb Merge ahristov@bk-internal.mysql.com:/home/bk/mysql-5.0
into lmy004.:/work/mysql-5.0-bug12651


sql/sql_base.cc:
  Auto merged
2005-09-09 09:10:56 +02:00
unknown
f257163824 fix for bug #12651 (item of a prepared query allocated on non-permanent
are thus dangling later)


mysql-test/r/ps.result:
  test for bug #12651
  (data allocated on thd's arena but not on permanent arena)
mysql-test/t/ps.test:
  test for bug #12651
  (data allocated on thd's arena but not on permanent arena)
sql/sql_base.cc:
  if there is tree transformation then backup the current arena
  and use permanent one (for PS) otherwise the data will be deallocated
  after the prepare process is finished.
  this bug was introduced with the recent natural join patch
2005-09-08 21:30:05 +02:00
unknown
9adffe2926 Fix for BUG#12977.
mysql-test/r/select.result:
  Test for BUG#12977.
mysql-test/t/select.test:
  Test for BUG#12977.
sql/sql_base.cc:
  - Compare table qualifier of qualified fields only with tables that
    are not natural joins or their operands.
  - For qualified fields perform recursive search in all operands of
    natural joins that are nested joins.
  - Symmetrically detect ambiguous columns for both operands of
    NATURAL/USING joins.
2005-09-08 11:29:52 +03:00
unknown
196862dfd9 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-bug3-5.0


sql/item.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/table.cc:
  Auto merged
2005-09-02 17:06:15 +03: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
7e2024b4f4 postmerge changes
mysql-test/t/lowercase_view.test:
  error code changed after merege
mysql-test/t/view.test:
  error code changed after merege
sql/item.cc:
  inline function used instead of frequently used expression
  removed old TODO
sql/sql_base.cc:
  layoutfixed
  inline function used instead of frequently used expression
sql/sql_insert.cc:
  inline function used instead of frequently used expression
2005-09-02 09:50:17 +03:00
unknown
a8fc85cbe3 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-bug3-5.0


BitKeeper/etc/config:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/t/view.test:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/table.h:
  Auto merged
2005-09-01 22:42:37 +03:00
unknown
b11953834d Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mishka.local:/home/my/mysql-5.0


sql/sql_base.cc:
  Auto merged
2005-08-25 00:22:59 +03:00
unknown
d2aa6e78ac Cleanups during review of new code
Removed ASSERT that can obviously never be wrong
2005-08-25 00:21:47 +03:00
unknown
2f044d3d93 Post-fix for BUG#6276.
sql/sql_base.cc:
  Fixed a bug in PS (prepared statements) mode - the "always TRUE" constant
  Item created for outer joins with no common columns was not created in
  the PS memory.
  Now it is created in the right memory.
2005-08-24 10:51:28 +03:00
unknown
eb7c4ff2db Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-bug3-5.0


BitKeeper/etc/config:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/table.cc:
  Auto merged
mysql-test/r/view.result:
  merge
mysql-test/t/view.test:
  merge
sql/share/errmsg.txt:
  merge
sql/sql_insert.cc:
  merge
sql/table.h:
  merge
2005-08-23 23:17:36 +03:00
unknown
b4e830c3e3 Fix for BUG#6276.
mysql-test/r/select.result:
  Test for BUG#6276.
mysql-test/t/select.test:
  Test for BUG#6276.
sql/sql_base.cc:
  Add a true ON condition for outer joins without common columns.
2005-08-23 20:03:32 +03:00
unknown
2ef2e0630d Merge mysql.com:/home/timka/mysql/src/5.0-virgin
into  mysql.com:/home/timka/mysql/src/5.0-2486


mysql-test/r/select.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
2005-08-23 18:15:51 +03:00
unknown
fe24add743 WL#2486 - natural and using join according to SQL:2003
* Provide backwards compatibility extension to name resolution of
  coalesced columns. The patch allows such columns to be qualified
  with a table (and db) name, as it is in 4.1.
  Based on a patch from Monty.

* Adjusted tests accordingly to test both backwards compatible name
  resolution of qualified columns, and ANSI-style resolution of
  non-qualified columns.
  For this, each affected test has two versions - one with qualified
  columns, and one without. 


mysql-test/include/ps_query.inc:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/bdb.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/innodb.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/join.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/join_nested.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/join_outer.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/null_key.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/order_by.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/ps_2myisam.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/ps_3innodb.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/ps_4heap.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/ps_5merge.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/ps_6bdb.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/ps_7ndb.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/select.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/subselect.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/r/type_ranges.result:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/t/bdb.test:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/t/innodb.test:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/t/join.test:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/t/join_nested.test:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/t/join_outer.test:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/t/null_key.test:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/t/order_by.test:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/t/select.test:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/t/subselect.test:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
mysql-test/t/type_ranges.test:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
sql/sql_base.cc:
  * Applied Monty's patch for backwards compatible name resolution
    of qualified columns. The idea is:
    - When a column is qualified, search for the column in all
      tables/views underlying each natural join. In this case
      natural joins are *not* considered leaves.
    - If a column is not qualified, then consider natural joins
      as leaves, thus directly search the result columns of
      natural joins.
  * Simplified 'find_field_in_tables()' - unified two similar
    loops into one.
sql/table.cc:
  - Removed method & members not needed after Monty's patch.
sql/table.h:
  - Removed method & members not needed after Monty's patch.
tests/mysql_client_test.c:
  Put back old tests to test that coalesced columns of natural joins can be qualified.
2005-08-23 18:08:04 +03:00
unknown
6658fb34e5 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/dlenev/src/mysql-5.0-bg11896


mysql-test/t/sp-error.test:
  Auto merged
mysql-test/t/trigger.test:
  Auto merged
sql/sql_base.cc:
  Auto merged
mysql-test/r/trigger.result:
  Manual merge.
sql/share/errmsg.txt:
  Manual merge.
2005-08-23 09:15:05 +04:00
unknown
72340a481a Cleanup during review of new pushed code
include/my_global.h:
  Safer macros to avoid possible overflows
sql/item_cmpfunc.cc:
  Simple optimization
sql/sp_head.cc:
  Indentation fixes
  Remove not needed "else" levels
  Added error checking for 'new'
  Simpler reseting of thd->spcont in execute_procedure
sql/sql_base.cc:
  Faster new
sql/sql_lex.cc:
  Use 'TRUE' instead of 'true'
sql/sql_parse.cc:
  Faster new
sql/sql_view.cc:
  No need to set 'tables' as it's not used
sql/table.cc:
  Simpler DBUG_ASSERT()
2005-08-22 01:13:37 +03:00
unknown
a1820ab1ca Merge mishka.local:/tmp/skr99/mysql-5.0
into  mishka.local:/home/my/mysql-5.0


sql/item_strfunc.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
2005-08-21 13:05:15 +03:00
unknown
3eda70b270 Fixes during review of new pushed code
Fixed new bug when running a SP without a default database


mysql-test/r/information_schema.result:
  Added test to cover changes made in default handling
mysql-test/r/sp-security.result:
  Added test when executing SP without a default database
mysql-test/t/information_schema.test:
  Added test to cover changes made in default handling
mysql-test/t/sp-security.test:
  Added test when executing SP without a default database
sql/item_strfunc.cc:
  Removed wrong push
sql/mysqld.cc:
  Indentation fix
sql/sql_base.cc:
  Use share->db instead of share->table_cache_key
  Remove assert that can never fail (because of test in previous row)
sql/sql_db.cc:
  Allow empty database name when called from SP
  (To allow on run without a default database)
sql/sql_parse.cc:
  Added comment
sql/sql_show.cc:
  Indentation fixes
  Simplified code by checking for 'wrong' condition first and doing continue instead of going down one level
  Simplified precision and decimal handling
2005-08-20 11:00:00 +03:00
unknown
1cb72d7eb9 WL#2486 - natural and using join according to SQL:2003
- Corrected problem with N-way nested natural joins in PS mode.
- Code cleanup
- More asserts to check consistency of name resolution contexts
- Fixed potential memory leak of name resolution contexts


mysql-test/r/join.result:
  - Corrected problem with N-way nested natural joins in PS mode.
mysql-test/t/join.test:
  - Corrected problem with N-way nested natural joins in PS mode.
sql/item.h:
  - Fixed potential memory leak.
sql/sql_base.cc:
  - the local context of Item_fields that participate in TABLE_LIST::on_cond for
    natural joins is correctly set to the tables where the corresponding fields
    originate from.
  - removed unused variables
  - correct allocation of contexts
sql/sql_parse.cc:
  - correct allocation of contexts for JOIN ON conditions.
sql/table.cc:
  - added asserts to check the consistency of name resolution contexts
sql/table.h:
  - added asserts to check the consistency of name resolution contexts
2005-08-19 15:22:30 +03:00
unknown
b1921c85ba Fix for bug #11896 "Partial locking in case of recursive trigger definitions".
If we are in stored function or trigger we should ensure that we won't change
table that is already used by calling statement (this can damage table or
easily cause infinite loops). Particularly this means that recursive triggers
should be disallowed.


mysql-test/r/sp-error.result:
  Added tests checking that in functions we don't allow to update tables which
  are used by statements which invoke these functions.
mysql-test/r/trigger.result:
  Added test for bug #11896 "Partial locking in case of recursive trigger
  definitions".
mysql-test/t/sp-error.test:
  Added tests checking that in functions we don't allow to update tables which
  are used by statements which invoke these functions.
mysql-test/t/trigger.test:
  Added test for bug #11896 "Partial locking in case of recursive trigger
  definitions".
sql/share/errmsg.txt:
  Added error messages for complaining about situations when in function or
  trigger we try to change table which is used in statement invoking this
  function or trigger.
sql/sql_base.cc:
  open_table():
    If we are in stored function or trigger we should ensure that
    we won't change table that is already used by calling statement
    (this can damage table or easily cause infinite loops).
    So if we are opening table for writing, we should check that it
    is not already open by some calling stamement.
2005-08-18 19:07:23 +04:00
unknown
d33b968f03 WL#2486 - natural and using join according to SQL:2003
- fixed a problem with RIGHT JOIN ON and enabled corresponding tests in select.test
- fixed a memory leak


mysql-test/r/select.result:
  Fixed a problem with RIGHT JOIN ON queries, enabling the corresponding tests.
mysql-test/t/select.test:
  Fixed a problem with RIGHT JOIN ON queries, enabling the corresponding tests.
sql/sql_base.cc:
  Fixed a problem with RIGHT JOINs that have operand(s) which are NATURAL JOIN(s).
sql/table.h:
  Inherit from Sql_alloc for proper memory allocation.
  The change fixes a memory leak.
2005-08-17 17:19:31 +03:00
unknown
06ab6b8876 Fixed code formatting. 2005-08-17 14:20:01 +03:00
unknown
307d1daa35 Merge mysql.com:/home/timka/mysql/src/5.0-virgin
into  mysql.com:/home/timka/mysql/src/5.0-2486


sql/sql_base.cc:
  Auto merged
2005-08-17 13:47:16 +03:00
unknown
3eac44950b WL#2486 - Process NATURAL and USING joins according to SQL:2003
- Applied Monty's patch after his review of sql_base.cc


sql/sql_base.cc:
  Applied Monty's patch after his review of WL#2486.
2005-08-17 13:46:36 +03:00
unknown
1566ec35d6 fix for bug #12183 "SHOW OPEN TABLES behavior doesn't match grammar"
(after review commit)


mysql-test/r/show_check.result:
  test the extended functionality (so far not documented) of SHOW OPEN FILES
mysql-test/t/show_check.test:
  test the extended functionality (so far not documented) of SHOW OPEN FILES
sql/mysql_priv.h:
  pass the name of the database for checking
sql/sql_base.cc:
  first check against the db if present (SHOW OPEN FILES FROM xxx)
  then do wild compare but only against the table name
sql/sql_show.cc:
  pass the DB if specified
2005-08-16 11:18:35 +02:00
unknown
c5aac211d0 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0


sql/ha_berkeley.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_derived.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/share/errmsg.txt:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/sql_class.cc:
  Manual merge
2005-08-15 18:35:48 +03:00
unknown
03e8517cb2 merged
sql/ha_innodb.cc:
  Auto merged
sql/mysqld.cc:
  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
2005-08-12 22:58:13 +02:00
unknown
87ae5a1597 BUG#12162 - one can start two transactions with the same XID.
Now we keep all active XID's in a hash
2005-08-12 21:15:01 +02:00
unknown
2b53b711d8 Merge mysql.com:/home/timka/mysql/src/5.0-virgin
into  mysql.com:/home/timka/mysql/src/5.0-2486-merge


mysql-test/r/errors.result:
  Auto merged
mysql-test/r/fulltext.result:
  Auto merged
mysql-test/r/fulltext_order_by.result:
  Auto merged
mysql-test/r/innodb.result:
  Auto merged
mysql-test/r/join_nested.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/t/errors.test:
  Auto merged
mysql-test/t/fulltext.test:
  Auto merged
mysql-test/t/fulltext_order_by.test:
  Auto merged
mysql-test/t/innodb.test:
  Auto merged
mysql-test/t/join_nested.test:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.h:
  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_select.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.h:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
sql/sql_insert.cc:
  merge WL#2486
sql/sql_show.cc:
  merge WL#2486
2005-08-12 19:27:54 +03:00
unknown
7517d7e112 Implementation of WL#2486 -
"Process NATURAL and USING joins according to SQL:2003".

* Some of the main problems fixed by the patch:
  - in "select *" queries the * expanded correctly according to
    ANSI for arbitrary natural/using joins
  - natural/using joins are correctly transformed into JOIN ... ON
    for any number/nesting of the joins.
  - column references are correctly resolved against natural joins
    of any nesting and combined with arbitrary other joins.

* This patch also contains a fix for name resolution of items
  inside the ON condition of JOIN ... ON - in this case items must
  be resolved only against the JOIN operands. To support such
  'local' name resolution, the patch introduces a stack of
  name resolution contexts used at parse time.

NOTICE:
- This patch is not complete in the sense that
  - there are 2 test cases that still do not pass -
    one in join.test, one in select.test. Both are marked
    with a comment "TODO: WL#2486".
  - it does not include a new test specific for the task


mysql-test/include/ps_query.inc:
  Adjusted according to standard NATURAL/USING join semantics.,
mysql-test/r/bdb.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/derived.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/errors.result:
  The column as a whole cannot be resolved, so different error message.
mysql-test/r/fulltext.result:
  Adjusted according to standard JOIN ... ON semantics =>
  the ON condition can refer only to the join operands.
mysql-test/r/fulltext_order_by.result:
  More detailed error message.
mysql-test/r/innodb.result:
  Adjusted according to standard NATURAL/USING join semantics.
  This test doesn't pass completetly yet!
mysql-test/r/insert_select.result:
  More detailed error message.
mysql-test/r/join.result:
  Adjusted according to standard NATURAL/USING join semantics.
  
  NOTICE: there is one test case that still fails, and it is
  commeted out and marked with WL#2486 in the test file.
mysql-test/r/join_crash.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/join_nested.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/join_outer.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/multi_update.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/null_key.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/order_by.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/ps_2myisam.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/ps_3innodb.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/ps_4heap.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/ps_5merge.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/ps_6bdb.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/ps_7ndb.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/select.result:
  Adjusted according to standard NATURAL/USING join semantics.
  
  NOTICE: there is one failing test case which is commented with
  WL#2486 in the test file.
mysql-test/r/subselect.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/type_ranges.result:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/r/union.result:
  More detailed error message.
mysql-test/t/bdb.test:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/errors.test:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/fulltext.test:
  Adjusted according to standard JOIN ... ON semantics =>
  the ON condition can refer only to the join operands.
mysql-test/t/fulltext_order_by.test:
  More detailed error message.
mysql-test/t/innodb.test:
  Adjusted according to standard NATURAL/USING join semantics.
  This test doesn't pass completetly yet!
mysql-test/t/insert_select.test:
  More detailed error message.
mysql-test/t/join.test:
  Adjusted according to standard NATURAL/USING join semantics.
  
  NOTICE: there is one test case that still fails, and it is
  commeted out and marked with WL#2486 in the test file.
mysql-test/t/join_crash.test:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/join_nested.test:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/join_outer.test:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/null_key.test:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/order_by.test:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/select.test:
  Adjusted according to standard NATURAL/USING join semantics.
  
  NOTICE: there is one test case that still fails, and it is
  commeted out and marked with WL#2486 in the test file.
mysql-test/t/subselect.test:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/type_ranges.test:
  Adjusted according to standard NATURAL/USING join semantics.
mysql-test/t/union.test:
  More detailed error message.
sql/item.cc:
  - extra parameter to find_field_in_tables
  - find_field_in_real_table renamed to find_field_in_table
  - fixed comments/typos
sql/item.h:
  - added [first | last]_name_resolution_table to class
    Name_resolution_context
  - commented old code
  - standardized formatting
sql/mysql_priv.h:
  - refactored the find_field_in_XXX procedures,
  - added a new procedure for natural join table references,
  - renamed the find_field_in_XXX procedures to clearer names
sql/sp.cc:
  - pass the top-most list of the FROM clause to setup_tables
  - extra parameter to find_field_in_tables
sql/sql_acl.cc:
  - renamed find_field_in_table => find_field_in_table_ref
  - extra parameter to find_field_in_table_ref
  - commented old code
sql/sql_base.cc:
  This file contains the core of the implementation of the processing
  of NATURAL/USING joins (WL#2486).
  - added many comments to old code
  - refactored the group of find_field_in_XXX procedures, and added a
    new procedure for natural joins. There is one find_field_in_XXX procedure
    per each type of table reference (stored table, merge view, or natural
    join); one meta-procedure that selects the correct one depeneding on the
    table reference; and one procedure that goes over a list of table
    referenes.
  - NATURAL/USING joins are processed through the procedures:
      mark_common_columns, store_natural_using_join_columns,
      store_top_level_join_columns, setup_natural_join_row_types.
    The entry point to processing NATURAL/USING joins is the
    procedure 'setup_natural_join_row_types'.
  - Replaced the specialized Field_iterator_XXX iterators with one
    generic iterator over the fields of a table reference.
  - Simplified 'insert_fields' and 'setup_conds' due to encapsulation of
    the processing of natural joins in a separate set of procedures.
sql/sql_class.h:
  - Commented old code.
sql/sql_delete.cc:
  - Pass the FROM clause to setup_tables.
sql/sql_help.cc:
  - pass the end name resolution table to find_field_in_tables
  - adjust the list of tables for name resolution
sql/sql_insert.cc:
  - Changed the code that saves and restores the current context to
    support the list of tables for name resolution -
    context->first_name_resolution_table, and
    table_list->next_name_resolution_table.
    Needed to support an ugly trick to resolve inserted columns only in
    the first table.
  - Added Name_resolution_context::[first | last]_name_resolution_table.
  - Commented old code
sql/sql_lex.cc:
  - set select_lex.parent_lex correctly
  - set correct state of the current name resolution context
sql/sql_lex.h:
  - Added a stack of name resolution contexts to support local
    contexts for JOIN ... ON conditions.
  - Commented old code.
sql/sql_load.cc:
  - Pass the FROM clause to setup_tables.
sql/sql_olap.cc:
  - Pass the FROM clause to setup_tables.
sql/sql_parse.cc:
  - correctly set SELECT_LEX::parent_lex
  - set the first table of the current name resoltion context
  - added support for NATURAL/USING joins
  - commented old code
sql/sql_select.cc:
  - Pass the FROM clause to setup_tables.
  - Pass the end table to find_field_in_tables
  - Improved comments
sql/sql_show.cc:
  - Set SELECT_LEX::parent_lex.
sql/sql_update.cc:
  - Pass the FROM clause to setup_tables.
sql/sql_yacc.yy:
  - Added support for a stack of name resolution contexts needed to
    implement name resolution for JOIN ... ON. A context is pushed
    for each new JOIN ... ON, and popped afterwards.
  - Added support for NATURAL/USING joins.
sql/table.cc:
  - Added new class Natural_join_column to hide the heterogeneous
    representation of column references for stored tables and for
    views.
  - Added a new list TABLE_LIST::next_name_resolution_table to
    support name resolution with NATURAL/USING joins. Also added
    other members to TABLE_LIST to support NATURAL/USING joins.
  - Added a generic iterator over the fields of table references
    of various types - class Field_iterator_table_ref
sql/table.h:
  - Added new class Natural_join_column to hide the heterogeneous
    representation of column references for stored tables and for
    views.
  - Added a new list TABLE_LIST::next_name_resolution_table to
    support name resolution with NATURAL/USING joins. Also added
    other members to TABLE_LIST to support NATURAL/USING joins.
  - Added a generic iterator over the fields of table references
    of various types - class Field_iterator_table_ref
tests/mysql_client_test.c:
  Adjusted according to standard NATURAL JOIN syntax.
2005-08-12 17:57:19 +03:00
unknown
7cfb6540f7 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0


sql/ha_ndbcluster.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_union.cc:
  Manual merge (trivial)
2005-08-12 13:57:20 +03:00
unknown
8282261289 sql_base.cc:
Fixed bug #12470.
  A misplaced initialization of the cond_count counter
  resulted in a wrong calculation of it. This caused a memory
  corruption since this counter was used as a parameter of
  some memory allocation.
view.test:
  Added a test case for bug #12470.


mysql-test/t/view.test:
  Added a test case for bug #12470.
sql/sql_base.cc:
  Fixed bug #12470.
  A misplaced initialization of the cond_count counter
  resulted in a wrong calculation of it. This caused a memory
  corruption since this counter was used as a parameter of
  some memory allocation.
2005-08-12 01:27:04 -07:00
unknown
743fde2404 sql_base.cc:
Fixed bug #12382.
  INSERT statement effectively changed thd->set_query_id to 0,
  while SELECT statement changed it to 0. As a result
  the insert_fields function that expanded '*' was called
  with different values of thd->set_query_id for the query
  SELECT * FROM view depending on whether it was run after
  an INSERT or after a SELECT statement. This was corrected
  by restoring the old value of thd->set_query_id when
  returning from the function setup_fields where possible
  reset could occur.
  If the value of thd->set_query_id == 0 then the fields
  substituted instead of '*' were not registered as used
  for bitmaps used_keys. This caused selection of an invalid
  execution plan for the query SELECT * from <view>.
view.result, view.test:
  Added a test case for bug #12382.


mysql-test/t/view.test:
  Added a test case for bug #12382.
mysql-test/r/view.result:
  Added a test case for bug #12382.
sql/sql_base.cc:
  Fixed bug #12382.
  INSERT statement effectively changed thd->set_query_id to 0,
  while SELECT statement changed it to 0. As a result
  the insert_fields function that expanded '*' was called
  with different values of thd->set_query_id for the query
  SELECT * FROM view depending on whether it was run after
  an INSERT or after a SELECT statement. This was corrected
  by restoring the old value of thd->set_query_id when
  returning from the function setup_fields where possible
  reset could occur.
  If the value of thd->set_query_id == 0 then the fields
  substituted instead of '*' were not registered as used
  for bitmaps used_keys. This caused selection of an invalid
  execution plan for the query SELECT * from <view>.
2005-08-11 16:10:34 -07:00
unknown
d620954a67 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
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
2005-08-11 16:43:22 +03:00
unknown
d83f690851 Cleanups during review of new code
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.
2005-08-11 15:58:15 +03:00
unknown
8103db27bb Merge bk-internal.mysql.com:/home/bk/mysql-5.0
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
2005-08-09 11:43:55 +04:00
unknown
39fda60043 Fix for bug #10055 "Using stored function with information_schema causes empty
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.
2005-08-08 17:46:06 +04:00
unknown
e442059c0d Manual merge
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
2005-08-03 03:47:07 +00:00
unknown
b323667ffc Prelocking-free SPs, post-review fixes:
* 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.
2005-08-03 03:37:32 +00:00
unknown
705118d1f6 issue correct error message in case of view presence for duplicated table on update (BUG#10773)
frequently used command sequence replaced with inline function


BitKeeper/etc/config:
  logging switching off
mysql-test/r/lowercase_view.result:
  hided view underlying tables from error message
mysql-test/r/view.result:
  hided view underlying tables from error message
mysql-test/t/lowercase_view.test:
  hided view underlying tables from error message
mysql-test/t/view.test:
  hided view underlying tables from error message
sql/mysql_priv.h:
  subroutine which return correct error message
sql/share/errmsg.txt:
  new error message
sql/sql_base.cc:
  subroutine which issue correct error message in case of view presence for duplicated table on update
sql/sql_delete.cc:
  issue correct error message in case of view presence for duplicated table on update
sql/sql_insert.cc:
  issue correct error message in case of view presence for duplicated table on update
sql/sql_parse.cc:
  issue correct error message in case of view presence for duplicated table on update
sql/sql_update.cc:
  issue correct error message in case of view presence for duplicated table on update
sql/sql_view.cc:
  frequently used command sequence replaced with inline function
sql/table.cc:
  frequently used command sequence replaced with inline function
sql/table.h:
  frequently used command sequence replaced with inline function
2005-08-02 22:54:49 +03:00
unknown
6b3478ec12 Fixes during review of new pushed code
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)
2005-07-31 12:49:55 +03:00
unknown
11abe15eab Added Non-prelocked SP execution: Now a PROCEDURE doesn't enter/leave prelocked mode for
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
2005-07-30 08:19:57 +00:00
unknown
d2810c56cf Fixed compiler warnings
client/mysqldump.c:
  Fixed wrong argument to printf()
client/mysqltest.c:
  Fixed compiler warning
myisam/ft_boolean_search.c:
  Fixed compiler warning
myisammrg/myrg_static.c:
  Fixed compiler warning
mysql-test/r/rpl_drop_temp.result:
  Drop used database
mysql-test/t/rpl_drop_temp.test:
  Drop used database
ndb/src/common/logger/LogHandler.cpp:
  Fixed compiler warning
sql/field.cc:
  Fixed compiler warning
sql/ha_ndbcluster.cc:
  Fixed compiler warning
sql/sql_base.cc:
  Fixed compiler warning
tests/mysql_client_test.c:
  Fixed compiler warning
2005-07-28 21:25:05 +03:00
unknown
36b6bf2ef3 Merge mysql.com:/home/my/mysql-4.1
into  mysql.com:/home/my/mysql-5.0


BitKeeper/etc/ignore:
  auto-union
BitKeeper/deleted/.del-ctype_cp932.test:
  Auto merged
BitKeeper/deleted/.del-isam.test~834fb0ee8196c445:
  Auto merged
include/thr_lock.h:
  Auto merged
mysql-test/t/alias.test:
  Auto merged
mysql-test/t/alter_table.test:
  Auto merged
mysql-test/t/archive.test:
  Auto merged
mysql-test/t/backup.test:
  Auto merged
mysql-test/t/bool.test:
  Auto merged
mysql-test/t/connect.test:
  Auto merged
mysql-test/t/count_distinct2.test:
  Auto merged
mysql-test/t/create.test:
  Auto merged
mysql-test/t/ctype_many.test:
  Auto merged
mysql-test/t/ctype_ucs_binlog.test:
  Auto merged
mysql-test/t/date_formats.test:
  Auto merged
mysql-test/t/delayed.test:
  Auto merged
mysql-test/t/derived.test:
  Auto merged
mysql-test/t/distinct.test:
  Auto merged
mysql-test/t/drop.test:
  Auto merged
mysql-test/t/endspace.test:
  Auto merged
mysql-test/t/flush.test:
  Auto merged
mysql-test/t/fulltext.test:
  Auto merged
mysql-test/t/fulltext_order_by.test:
  Auto merged
mysql-test/t/func_compress.test:
  Auto merged
mysql-test/t/func_concat.test:
  Auto merged
mysql-test/t/func_date_add.test:
  Auto merged
mysql-test/t/func_equal.test:
  Auto merged
mysql-test/t/func_if.test:
  Auto merged
mysql-test/t/func_sapdb.test:
  Auto merged
mysql-test/t/func_set.test:
  Auto merged
mysql-test/t/func_str.test:
  Auto merged
mysql-test/t/gis-rtree.test:
  Auto merged
mysql-test/t/gis.test:
  Auto merged
mysql-test/t/grant.test:
  Auto merged
mysql-test/t/grant2.test:
  Auto merged
mysql-test/t/grant_cache.test:
  Auto merged
mysql-test/t/heap.test:
  Auto merged
mysql-test/t/heap_btree.test:
  Auto merged
mysql-test/t/heap_hash.test:
  Auto merged
mysql-test/t/init_connect.test:
  Auto merged
mysql-test/t/insert_select.test:
  Auto merged
mysql-test/t/insert_update.test:
  Auto merged
mysql-test/t/key.test:
  Auto merged
mysql-test/t/keywords.test:
  Auto merged
mysql-test/t/limit.test:
  Auto merged
mysql-test/t/lock.test:
  Auto merged
mysql-test/t/lowercase_table.test:
  Auto merged
mysql-test/t/lowercase_table3.test:
  Auto merged
mysql-test/t/merge.test:
  Auto merged
mysql-test/t/mix_innodb_myisam_binlog.test:
  Auto merged
mysql-test/t/myisam.test:
  Auto merged
mysql-test/t/mysqlbinlog2.test:
  Auto merged
mysql-test/t/ndb_alter_table.test:
  Auto merged
mysql-test/t/ndb_autodiscover.test:
  Auto merged
mysql-test/t/ndb_charset.test:
  Auto merged
mysql-test/t/ndb_grant.later:
  Auto merged
mysql-test/t/ndb_index_ordered.test:
  Auto merged
mysql-test/t/ndb_index_unique.test:
  Auto merged
mysql-test/t/ndb_restore.test:
  Auto merged
mysql-test/t/ndb_types.test:
  Auto merged
mysql-test/t/ndb_update.test:
  Auto merged
mysql-test/t/null.test:
  Auto merged
mysql-test/t/null_key.test:
  Auto merged
mysql-test/t/olap.test:
  Auto merged
mysql-test/t/openssl_1.test:
  Auto merged
mysql-test/t/order_by.test:
  Auto merged
mysql-test/t/ps.test:
  Auto merged
mysql-test/t/ps_1general.test:
  Auto merged
mysql-test/t/ps_4heap.test:
  Auto merged
mysql-test/t/ps_5merge.test:
  Auto merged
mysql-test/t/query_cache.test:
  Auto merged
mysql-test/t/replace.test:
  Auto merged
mysql-test/t/row.test:
  Auto merged
mysql-test/t/rpl000001.test:
  Auto merged
mysql-test/t/rpl000015.test:
  Auto merged
mysql-test/t/rpl000017.test:
  Auto merged
mysql-test/t/rpl000018.test:
  Auto merged
mysql-test/t/rpl_EE_error.test:
  Auto merged
mysql-test/t/rpl_change_master.test:
  Auto merged
mysql-test/t/rpl_charset.test:
  Auto merged
mysql-test/t/rpl_create_database.test:
  Auto merged
mysql-test/t/rpl_ddl.test:
  Auto merged
mysql-test/t/rpl_deadlock.test:
  Auto merged
mysql-test/t/rpl_empty_master_crash.test:
  Auto merged
mysql-test/t/rpl_error_ignored_table.test:
  Auto merged
mysql-test/t/rpl_flush_log_loop.test:
  Auto merged
mysql-test/t/rpl_flush_tables.test:
  Auto merged
mysql-test/t/rpl_get_lock.test:
  Auto merged
mysql-test/t/rpl_heap.test:
  Auto merged
mysql-test/t/rpl_loaddata.test:
  Auto merged
mysql-test/t/rpl_loaddata_rule_m.test:
  Auto merged
mysql-test/t/rpl_log.test:
  Auto merged
mysql-test/t/rpl_log_pos.test:
  Auto merged
mysql-test/t/rpl_max_relay_size.test:
  Auto merged
mysql-test/t/rpl_multi_query.test:
  Auto merged
mysql-test/t/rpl_openssl.test:
  Auto merged
mysql-test/t/rpl_redirect.test:
  Auto merged
mysql-test/t/rpl_relayrotate.test:
  Auto merged
mysql-test/t/rpl_replicate_do.test:
  Auto merged
mysql-test/t/rpl_reset_slave.test:
  Auto merged
mysql-test/t/rpl_server_id2.test:
  Auto merged
mysql-test/t/rpl_temporary.test:
  Auto merged
mysql-test/t/rpl_timezone.test:
  Auto merged
mysql-test/t/rpl_user_variables.test:
  Auto merged
mysql-test/t/show_check.test:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
mysql-test/t/symlink.test:
  Auto merged
mysql-test/t/synchronization.test:
  Auto merged
mysql-test/t/system_mysql_db.test:
  Auto merged
mysql-test/t/system_mysql_db_fix.test:
  Auto merged
mysql-test/t/temp_table.test:
  Auto merged
mysql-test/t/timezone2.test:
  Auto merged
mysql-test/t/timezone_grant.test:
  Auto merged
mysql-test/t/type_float.test:
  Auto merged
mysql-test/t/type_ranges.test:
  Auto merged
mysql-test/t/type_timestamp.test:
  Auto merged
mysql-test/t/union.test:
  Auto merged
mysql-test/t/update.test:
  Auto merged
mysql-test/t/user_var-binlog.test:
  Auto merged
mysql-test/t/warnings.test:
  Auto merged
mysys/thr_lock.c:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
support-files/mysql.spec.sh:
  Auto merged
BitKeeper/deleted/.del-rpl_trunc_binlog.test~961b1f6ac73d37c8:
  Simple merge
mysql-test/r/ps_grant.result:
  Simple merge
mysql-test/t/analyse.test:
  Simple merge
mysql-test/t/auto_increment.test:
  Simple merge
mysql-test/t/bdb.test:
  Simple merge
mysql-test/t/bigint.test:
  Simple merge
mysql-test/t/case.test:
  Simple merge
mysql-test/t/cast.test:
  Simple merge
mysql-test/t/check.test:
  Simple merge
mysql-test/t/count_distinct.test:
  Simple merge
mysql-test/t/ctype_latin1_de.test:
  Simple merge
mysql-test/t/ctype_uca.test:
  Simple merge
mysql-test/t/ctype_ucs.test:
  Simple merge
mysql-test/t/ctype_utf8.test:
  Simple merge
mysql-test/t/delete.test:
  Simple merge
mysql-test/t/flush_block_commit.test:
  Simple merge
mysql-test/t/func_default.test:
  Simple merge
mysql-test/t/func_gconcat.test:
  Simple merge
mysql-test/t/func_group.test:
  Aligned code with 4.1
mysql-test/t/func_in.test:
  Simple merge
mysql-test/t/func_math.test:
  Simple merge
mysql-test/t/func_misc.test:
  Simple merge
mysql-test/t/func_test.test:
  Simple merge
mysql-test/t/func_time.test:
  Simple merge
mysql-test/t/group_by.test:
  Simple merge
mysql-test/t/having.test:
  Simple merge
mysql-test/t/innodb.test:
  Simple merge
mysql-test/t/insert.test:
  Simple merge
mysql-test/t/join_outer.test:
  Simple merge
mysql-test/t/kill.test:
  Simple merge
mysql-test/t/loaddata.test:
  Simple merge
mysql-test/t/lock_multi.test:
  Simple merge
mysql-test/t/multi_update.test:
  Simple merge
mysql-test/t/mysqlbinlog.test:
  Simple merge
mysql-test/t/mysqldump.test:
  Aligned code with 4.1
mysql-test/t/mysqltest.test:
  Simple merge
mysql-test/t/ndb_basic.test:
  Simple merge
mysql-test/t/ndb_cache.test:
  Simple merge
mysql-test/t/ndb_subquery.test:
  Simple merge
mysql-test/t/ps_grant.test:
  Simple merge
mysql-test/t/range.test:
  Simple merge
mysql-test/t/rpl_drop_temp.test:
  Simple merge
mysql-test/t/rpl_loaddata_rule_s.test:
  Simple merge
mysql-test/t/rpl_loaddatalocal.test:
  Simple merge
mysql-test/t/rpl_rotate_logs.test:
  Simple merge
mysql-test/t/rpl_until.test:
  Simple merge
mysql-test/t/rpl_variables.test:
  Simple merge
mysql-test/t/select.test:
  Simple merge
mysql-test/t/sql_mode.test:
  Simple merge
mysql-test/t/type_blob.test:
  Simple merge
mysql-test/t/type_decimal.test:
  Simple merge
mysql-test/t/user_var.test:
  Simple merge
mysql-test/t/variables.test:
  Simple merge
sql/lock.cc:
  Simple optimization
sql/mysql_priv.h:
  Simple merge
sql/sql_table.cc:
  Simple merge
sql/table.cc:
  Simple merge
sql/unireg.cc:
  Simple merge
2005-07-28 17:09:54 +03:00
unknown
79f75d8fad Cleanups during review of new code
Ensure mysql_close() is called if mysql_set_character_set() fails


libmysql/libmysql.c:
  Indentation cleanup
mysql-test/r/select.result:
  Fix bad merge & align code with 4.1
mysql-test/r/type_newdecimal.result:
  Added test of extreme case
mysql-test/t/select.test:
  Fix bad merge & align code with 4.1
mysql-test/t/type_newdecimal.test:
  Added test of extreme case
mysys/charset.c:
  Removed not used variable
mysys/default.c:
  Simplify code
sql-common/client.c:
  Ensure mysql_close() is called if mysql_set_character_set() fails
sql/log.cc:
  strmov(strmov())  -> strxmov()
sql/sp.cc:
  Indentation fixes
sql/sql_acl.cc:
  Indentation fixes
sql/sql_base.cc:
  Added commments
  Moved variable to inner block
sql/sql_show.cc:
  Simple optimization (removed loop variable)
sql/sql_trigger.cc:
  strmov(strmov())  -> strxmov()
strings/decimal.c:
  Indentation fixes
2005-07-28 16:10:14 +03:00
unknown
d70aead730 Merge mysql.com:/home/my/mysql-4.0
into  mysql.com:/home/my/mysql-4.1


BitKeeper/etc/ignore:
  auto-union
include/thr_lock.h:
  Auto merged
mysys/thr_lock.c:
  Auto merged
sql/lock.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_base.cc:
  Simple merge
2005-07-27 13:24:59 +03:00
unknown
90e41facf7 Review fixes:
Fixed portability problem with bool in C programs
Moved close_thread_tables out from LOCK_thread_count mutex (safety fix)
my_sleep() -> pthread_cond_timedwait()


include/thr_lock.h:
  bool -> my_bool (bool is not portable in C programs)
mysys/thr_lock.c:
  bool -> my_bool (bool is not portable in C programs)
sql/lock.cc:
  Added comment
  Don't use | on bool variable
sql/mysql_priv.h:
  Added comment
sql/slave.cc:
  Moved close_thread_tables out from LOCK_thread_count mutex (safety fix)
sql/sql_base.cc:
  Added comments
  my_sleep() -> pthread_cond_timedwait() to get less code and potentitally faster loop
BitKeeper/etc/ignore:
  added ac_available_languages_fragment
2005-07-26 17:55:58 +03:00
unknown
2940168feb Fix merge mistake 2005-07-21 01:38:42 -04:00
unknown
0b732c4797 Merge mronstrom@bk-internal.mysql.com:/home/bk/mysql-4.1
into  c-450ae253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/mysql-5.0


include/my_sys.h:
  Auto merged
include/thr_lock.h:
  Auto merged
sql/handler.cc:
  Auto merged
sql-common/client.c:
  Auto merged
client/mysqldump.c:
  Manual merge
include/mysql.h:
  Manual merge
libmysql/libmysql.c:
  Manual merge
myisam/rt_split.c:
  Manual merge
mysys/thr_lock.c:
  Manual merge
sql/lock.cc:
  Manual merge
sql/mysql_priv.h:
  Manual merge
sql/sql_base.cc:
  Manual merge
sql/sql_table.cc:
  Manual merge
tests/mysql_client_test.c:
  Manual merge
2005-07-21 01:29:57 -04:00
unknown
a3fe765249 Merge mronstrom@bk-internal.mysql.com:/home/bk/mysql-4.0
into  c-450ae253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/mysql-4.1


include/thr_lock.h:
  Auto merged
mysys/thr_lock.c:
  Auto merged
sql/lock.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_table.cc:
  Manual merge after 4.0 fix
2005-07-20 21:58:33 -04:00
unknown
af1dfb613b Bug #10600 After review fixes
sql/lock.cc:
  Used flags immediately in call
sql/mysql_priv.h:
  Added RTFC (short for remove_table_from_cache)
  for constants and used hex syntax to clarify it is bits
  in the flags
sql/sql_base.cc:
  Use flags parameter immediately and use flags immediately in call
  Change to other variant of eternal loop variant
sql/sql_table.cc:
  Use flags immediately in call
2005-07-20 21:19:01 +02:00
unknown
a32bf7fb82 Fix for bugs #5892/6182/8751/8758/10994 (based on Antony's patch)
"Triggers have the wrong namespace"
  "Triggers: duplicate names allowed"
  "Triggers: CREATE TRIGGER does not accept fully qualified names"
  "SHOW TRIGGERS"


mysql-test/r/information_schema.result:
  Added tests for new INFORMATION_SCHEMA.TRIGGERS view and SHOW TRIGGERS command.
mysql-test/r/information_schema_db.result:
  INFORMATION_SCHEMA.TRIGGERS view was added.
mysql-test/r/rpl_sp.result:
  Now DROP TRIGGER interprets first part of trigger identifier as database
  name and not as table name. Adjusted tests properly.
mysql-test/r/trigger.result:
  Now DROP TRIGGER interprets first part of trigger identifier as database
  name and not as table name. Adjusted tests properly.
  Added test checking that triggers have database wide namespace.
  Added test for bug #8791 "Triggers: Allowed to create triggers on a subject
  table in a different DB".
mysql-test/r/view.result:
  Now DROP TRIGGER interprets first part of trigger identifier as database
  name and not as table name. Adjusted tests properly.
mysql-test/t/information_schema.test:
  Added tests for new INFORMATION_SCHEMA.TRIGGERS view and SHOW TRIGGERS command.
mysql-test/t/rpl_sp.test:
  Now DROP TRIGGER interprets first part of trigger identifier as database
  name and not as table name. Adjusted tests properly.
mysql-test/t/trigger.test:
  Now DROP TRIGGER interprets first part of trigger identifier as database
  name and not as table name. Adjusted tests properly.
  Added test checking that triggers have database wide namespace.
  Added test for bug #8791 "Triggers: Allowed to create triggers on a subject
  table in a different DB".
mysql-test/t/view.test:
  Now DROP TRIGGER interprets first part of trigger identifier as database
  name and not as table name. Adjusted tests properly.
sql/handler.cc:
  Added .TRN tho the list of known file extensions assoicated with tables.
sql/item.h:
  trg_action_time_type/trg_event_type enums:
    Added TRG_ACTION_MAX/TRG_EVENT_MAX elements which should be used instead of
    magical values in various loops where we iterate through all types of trigger
    action times or/and trigger event types.
sql/lex.h:
  Added new symbol "TRIGGERS".
sql/mysql_priv.h:
  Added declaration of constant holding extension for trigger name (.TRN) files.
sql/mysqld.cc:
  Added statistical variable for SHOW TRIGGERS command.
sql/share/errmsg.txt:
  Added error message saying that one attempts to create trigger in wrong schema.
sql/sp.cc:
  Replaced magical values with TRG_EVENT_MAX/TRG_ACTION_MAX constants.
sql/sql_base.cc:
  open_unireg_entry():
    Now Table_triggers_list::check_n_load() has one more argument which
    controls whether we should prepare Table_triggers_list with fully functional
    triggers or load only their names.
sql/sql_lex.h:
  Added element for new SHOW TRIGGERS command to enum_sql_command enum.
sql/sql_parse.cc:
  prepare_schema_table():
    Added support for SHOW TRIGGERS statement.
sql/sql_show.cc:
  Added new INFORMATION_SCHEMA.TRIGGERS view and SHOW TRIGGERS command.
sql/sql_table.cc:
  mysql_rm_table_part2():
    Replaced simple deletion of .TRG file with call to
    Table_triggers_list::drop_all_triggers which will also delete .TRN files
    for all triggers associated with table.
sql/sql_trigger.cc:
  Now triggers have database wide namespace. To support it we create special .TRN
  file with same name as trigger for each trigger. This file contains name of
  trigger's table so one does not need to specify it explicitly in DROP TRIGGER.
  Moreover DROP TRIGGER treats first part of trigger identifier as database name
  now. Updated mysql_create_or_drop_trigger() routine and
  Table_triggers_list::create_trigger()/drop_trigger()/check_n_load() methods
  accordingly. Added add_table_for_trigger() routine and
  Table_triggers_list::drop_all_triggers() method.
  
  Added Table_triggers_list::get_trigger_info() for obtaining trigger metadata.
sql/sql_trigger.h:
  Table_triggers_list:
    Use TRG_EVENT_MAX, TRG_ACTION_MAX instead of magic values.
    Added get_trigger_info() method for obtaining trigger's meta-data.
    Added drop_all_triggers() method which drops all triggers for table.
    Added declarations of trg_action_time_type_names/trg_event_type_names
    arrays which hold names of triggers action time types  and event types.
sql/sql_yacc.yy:
  Changed grammar for CREATE/DROP TRIGGER to support database wide trigger
  namespace. Added new SHOW TRIGGERS statement.
sql/table.h:
  enum enum_schema_tables:
    Added constant for new INFORMATION_SCHEMA.TRIGGERS view.
2005-07-19 20:06:49 +04:00
unknown
6d29b23b15 Bug #10600
remove_table_from_cache fails to signal other thread and gets
blocked when other thread also gets blocked


include/thr_lock.h:
  Report if any threads was signalled
mysys/thr_lock.c:
  Report if any threads was signalled
sql/lock.cc:
  Report if any threads was signalled
  Use new interface for remove_table_from_cache
sql/mysql_priv.h:
  New interface for remove_table_from_cache
  + mysql_lock_abort_for_thread
sql/sql_base.cc:
  Use new interface of remove_table_cache
  Rewrote remove_table_from_cache to fix bug
sql/sql_table.cc:
  Use new interface of remove_table_from_cache
2005-07-19 00:29:19 +02:00
unknown
7f80ca5493 take into account table lock mode when opening table:
try to find most suitable table, to avouid pickup table with too low locking mode or occupy table with write mode for select when it will be need for update later
(BUG#9597)


mysql-test/r/view.result:
  opening table in correct locking mode test
mysql-test/t/view.test:
  opening table in correct locking mode test
sql/sql_base.cc:
  take into account table lock mode when opening table:
  try to find most suitable table, to avouid pickup table with too low locking mode or occupy table with write mode for select when it will be need for update later
2005-07-15 01:22:14 +03:00
unknown
9aa1504062 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/dlenev/src/mysql-5.0-mysqlproc


mysql-test/r/sp-error.result:
  Auto merged
mysql-test/t/sp-error.test:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sp.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/share/errmsg.txt:
  Manual merge.
sql/sp.cc:
  Manual merge.
2005-07-13 15:08:13 +04:00
unknown
11f9e513d7 Implementation of Monty's idea: Now we can open mysql.proc table for lookup
of stored routines definitions even if we already have some tables open and
locked. To avoid deadlocks in this case we have to put certain restrictions
on locking of mysql.proc table.

This allows to use stored routines safely under LOCK TABLES without explicitly
mentioning mysql.proc in the list of locked tables. It also fixes bug #11554
"Server crashes on statement indirectly using non-cached function".


mysql-test/r/sp-error.result:
  Added test which checks that now we can read stored routines definitions
  under LOCK TABLES even if we have not locked mysql.proc explicitly. Also
  added check for restrictions which this ability puts on mysql.proc locking.
  Updated test for bug #9566 to correspond this new situation.
mysql-test/r/sp-threads.result:
  Added test for bug #11554 "Server crashes on statement indirectly using
  non-cached function".
mysql-test/t/sp-error.test:
  Added test which checks that now we can read stored routines definitions
  under LOCK TABLES even if we have not locked mysql.proc explicitly. Also
  added check for restrictions which this ability puts on mysql.proc locking.
  Updated test for bug #9566 to correspond this new situation.
mysql-test/t/sp-threads.test:
  Added test for bug #11554 "Server crashes on statement indirectly using
  non-cached function".
sql/lock.cc:
  get_lock_data():
   To be able to open and lock for reading system tables like 'mysql.proc',
   when we already have some tables opened and locked, and avoid deadlocks
   we have to disallow write-locking of these tables with any other tables.
sql/mysql_priv.h:
  open_table() has new parameter which allows to open table even if some-one
  has done a flush or holding namelock on it.
sql/share/errmsg.txt:
  Added error message saying that one cannot write-lock some of system tables
  with any other tables.
sql/sp.cc:
  open_proc_table_for_read()/close_proc_table():
    Added functions to be able open and close mysql.proc table when we already
    have some tables open and locked.
  open_proc_table_for_update():
    Added function to simplify opening of mysql.proc for updates.
  db_find_routine_aux()/db_find_routine()/db_update_routine()/...
    Moved responsibility for opening mysql.proc table from db_find_routine_aux()
    one level up, since this level knows better which type of table access for
    reading of for update it needs.
  sp_function_exists():
    Removed unused function.
sql/sp.h:
  sp_function_exists():
    Removed unused function.
sql/sql_base.cc:
  open_table():
    Added new parameter which allows to open table even if some-one has done a
    flush or holding namelock on it.
  open_unireg_entry():
    Mark 'mysql.proc' as a system table which has special restrictions on its
    locking, but thanks to them can be open and locked even if we already have
    some open and locked.
sql/sql_class.cc:
  Moved THD members holding information about open and locked tables to separate
  Open_tables_state class to be able to save/restore this state easier.
  Added THD::push_open_tables_state()/pop_open_tables_state() methods for
  saving/restoring this state.
sql/sql_class.h:
  Moved THD members holding information about open and locked tables to separate
  Open_tables_state class to be able to save/restore this state easier.
  Added THD::push_open_tables_state()/pop_open_tables_state() methods for
  saving/restoring this state.
sql/sql_lex.cc:
  Removed LEX::proc_table member which was not really used.
sql/sql_lex.h:
  Removed LEX::proc_table member which was not really used.
sql/sql_table.cc:
  open_table() has new parameter which allows to open table even if some-one
  has done a flush or holding namelock on it.
sql/table.h:
  Added TABLE_SHARE::system_table indicating that this table is system table
  like 'mysql.proc' and we want to be able to open and read-lock it even when
  we already have some tables open and locked (and because of this we have
  to put some restrictions on write locking it).
2005-07-13 13:48:13 +04:00
unknown
51f8821af0 Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0
into igor-inspiron.creware.com:/home/igor/mysql-5.0


sql/sql_base.cc:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/t/view.test:
  Auto merged
2005-07-12 10:44:31 -07:00
unknown
9d9ef52dbe Merge
sql/sql_base.cc:
  Auto merged
mysql-test/r/view.result:
  SCCS merged
mysql-test/t/view.test:
  SCCS merged
2005-07-12 20:49:43 +04:00
unknown
2ae3cdcf97 Fix bug #11399 Column alias was lost during view preraration.
New item created in find_field_in_table() to fix view's item, was created 
without taking into account original item's alias. This patch checks if alias 
is set to the original item and if so sets it to newly created item.


sql/sql_base.cc:
  Fix bug#11399 Alias wasn't set on view column
mysql-test/t/view.test:
  Test case for bug#11399 Use an alias in a select statement on a view
mysql-test/r/view.result:
  Test case for bug#11399 Use an alias in a select statement on a view
2005-07-12 20:45:34 +04:00
unknown
f36db3540a view.result, view.test:
Added a test case for bug #11771.
item.h:
  Fixed bug #11771.
  Added method reset_query_id_processor to be able to adjust
  query_id for fields generated from * in queries like this:
  SELECT * FROM <view> ...
sql_base.cc:
  Fixed bug #11771.
  Adjusted query_id for fields generated from * in queries
  like this: SELECT * FROM <view> ...


sql/sql_base.cc:
  Fixed bug #11771.
  Adjusted query_id for fields generated from * in queries
  like this: SELECT * FROM <view> ...
sql/item.h:
  Fixed bug #11771.
  Added method reset_query_id_processor to be able to adjust
  query_id for fields generated from * in queries like this:
  SELECT * FROM <view> ...
mysql-test/t/view.test:
  Added a test case for bug #11771.
mysql-test/r/view.result:
  Added a test case for bug #11771.
2005-07-12 05:18:05 -07:00
unknown
eef5f17bde Merge bk-internal.mysql.com:/home/bk/mysql-5.0
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.
2005-07-09 22:04:18 +04:00
unknown
14b1f91ba4 Enable support of access to tables from triggers. Thus fix bug #8406 "Triggers
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.
2005-07-09 21:51:59 +04:00
unknown
428830c500 After merge fixes
Better fix for ON DUPLICATE KEY UPDATE


mysql-test/r/group_by.result:
  After merge fixes
mysql-test/r/select.result:
  Reorder test to match 4.1 tests (will make future merges easier)
mysql-test/t/group_by.test:
  Added --disable_ps_protocol to avoid extra warning
mysql-test/t/select.test:
  Reorder test to match 4.1 tests (will make future merges easier)
sql/mysql_priv.h:
  Better fix for ON DUPLICATE KEY UPDATE
sql/sql_base.cc:
  After merge fixes
sql/sql_insert.cc:
  Better fix for ON DUPLICATE KEY UPDATE
  (old solution gave problem with item->cached_table)
sql/sql_prepare.cc:
  Better fix for ON DUPLICATE KEY UPDATE
2005-07-04 03:24:25 +03:00
unknown
eeee5fb10b Merge with 4.1
Makefile.am:
  Auto merged
myisam/mi_create.c:
  Auto merged
myisam/mi_open.c:
  Auto merged
mysql-test/r/ctype_utf8.result:
  Auto merged
mysys/thr_alarm.c:
  Auto merged
VC++Files/sql/mysqld.dsp:
  Keep old
client/mysqldump.c:
  Manual merge
client/mysqltest.c:
  Automatic merge
configure.in:
  Manual merge
mysql-test/r/ctype_ucs.result:
  Auto merge
mysql-test/r/func_str.result:
  Auto merge
mysql-test/r/group_by.result:
  Auto merge
mysql-test/r/insert_select.result:
  Auto merge
mysql-test/r/insert_update.result:
  Auto merge
mysql-test/r/lowercase_table2.result:
  Auto merge
mysql-test/r/select.result:
  Manual merge
mysql-test/r/variables.result:
  Auto merge
mysql-test/t/ctype_ucs.test:
  Auto merge
mysql-test/t/func_str.test:
  Auto merge
mysql-test/t/group_by.test:
  Auto merge
mysql-test/t/insert_select.test:
  Auto merge
mysql-test/t/insert_update.test:
  Auto merge
mysql-test/t/ndb_alter_table.test:
  Auto merge
mysql-test/t/select.test:
  Auto merge
mysql-test/t/variables.test:
  Auto merge
mysys/my_access.c:
  Auto merge
scripts/make_win_src_distribution.sh:
  Auto merge
sql/field.cc:
  Manual merge
sql/ha_ndbcluster.cc:
  Auto merge
sql/handler.cc:
  Auto merge
sql/item.cc:
  Auto merge
sql/item.h:
  Manual merge
sql/item_cmpfunc.h:
  Auto merge
sql/item_strfunc.cc:
  Auto merge
sql/item_strfunc.h:
  Auto merge
sql/mysql_priv.h:
  manual merge
sql/mysqld.cc:
  manual merge
sql/opt_range.cc:
  manual merge
sql/set_var.cc:
  Auto merge
sql/sql_base.cc:
  manual merge
  Restore processing of ON DUPLICATE KEY UPDATE
sql/sql_insert.cc:
  manual merge
  Restore processing of ON DUPLICATE KEY UPDATE
  Simplify mysql_prepare_insert by using local variable for select_lex and save old values just before they are changed
sql/sql_parse.cc:
  Restore processing of ON DUPLICATE KEY UPDATE
sql/sql_prepare.cc:
  New ON DUPLICATE KEY UPDATE handling
sql/sql_select.cc:
  manual merge
sql/sql_table.cc:
  auto merge
sql/sql_yacc.yy:
  auto merge
strings/ctype-ucs2.c:
  auto merge
strings/ctype-utf8.c:
  auto merge
2005-07-03 14:17:52 +03:00
unknown
6d9bc9c8b7 do not register changes of stack variable
sql/item.cc:
  new argument of find_field_in_tables()
sql/mysql_priv.h:
  new argument of find_field_in_tables()
sql/sp.cc:
  new argument of find_field_in_tables()
sql/sql_base.cc:
  new argument of find_field_in_tables()
sql/sql_help.cc:
  new argument of find_field_in_tables()
2005-07-03 00:51:02 +03:00
unknown
b4f595b95f Name resolution context added (BUG#6443)
include/my_bitmap.h:
  new bitmap operation
mysql-test/r/view.result:
  added warnings
  Correct inserting data check (absence of default value) for view underlying tables (BUG#6443)
mysql-test/t/view.test:
  Correct inserting data check (absence of default value) for view underlying tables (BUG#6443)
mysys/my_bitmap.c:
  new bitmap operation
sql/field.h:
  index of field in table added
sql/item.cc:
  Name resolution context added
  table list removed from fix_fields() arguments
sql/item.h:
  Name resolution context added
  table list removed from fix_fields() arguments
sql/item_cmpfunc.cc:
  table list removed from fix_fields() arguments
sql/item_cmpfunc.h:
  table list removed from fix_fields() arguments
sql/item_func.cc:
  table list removed from fix_fields() arguments
sql/item_func.h:
  table list removed from fix_fields() arguments
sql/item_row.cc:
  table list removed from fix_fields() arguments
sql/item_row.h:
  table list removed from fix_fields() arguments
sql/item_strfunc.cc:
  fixed server crash on NULL argument
sql/item_strfunc.h:
  table list removed from fix_fields() arguments
sql/item_subselect.cc:
  table list removed from fix_fields() arguments
sql/item_subselect.h:
  table list removed from fix_fields() arguments
sql/item_sum.cc:
  table list removed from fix_fields() arguments
sql/item_sum.h:
  table list removed from fix_fields() arguments
sql/item_timefunc.cc:
  table list removed from fix_fields() arguments
sql/item_timefunc.h:
  table list removed from fix_fields() arguments
sql/item_uniq.h:
  table list removed from fix_fields() arguments
sql/log_event.cc:
  Name resolution context added
sql/log_event.h:
  Name resolution context added
sql/mysql_priv.h:
  Name resolution context added
sql/set_var.cc:
  table list removed from fix_fields() arguments
sql/share/errmsg.txt:
  new error message
sql/sp.cc:
  Name resolution context added
sql/sp_head.cc:
  table list removed from fix_fields() arguments
sql/sp_head.h:
  Name resolution context added
sql/sql_base.cc:
  table list removed from fix_fields() arguments
  Name resolution context added
sql/sql_class.cc:
  renamed variable
sql/sql_delete.cc:
  Name resolution context added
sql/sql_derived.cc:
  Name resolution context added
sql/sql_do.cc:
  table list removed from fix_fields() arguments
sql/sql_handler.cc:
  Name resolution context added
sql/sql_help.cc:
  Name resolution context added
sql/sql_insert.cc:
  Name resolution context added
  table list removed from fix_fields() arguments
sql/sql_lex.cc:
  Name resolution context added
sql/sql_lex.h:
  removed resolve mode (information stored into name resolution context)
sql/sql_load.cc:
  table list removed from fix_fields() arguments
sql/sql_olap.cc:
  Name resolution context added
sql/sql_parse.cc:
  Name resolution context added
sql/sql_prepare.cc:
  table list removed from fix_fields() arguments
sql/sql_select.cc:
  table list removed from fix_fields() arguments
sql/sql_show.cc:
  Name resolution context added
sql/sql_trigger.cc:
  table list removed from fix_fields() arguments
sql/sql_udf.h:
  table list removed from fix_fields() arguments
sql/sql_union.cc:
  Name resolution context added
sql/sql_update.cc:
  Name resolution context added
sql/sql_view.cc:
  Name resolution context added
sql/sql_view.h:
  table list removed from fix_fields() arguments
sql/sql_yacc.yy:
  Name resolution context added
sql/table.cc:
  Name resolution context added
  merged view processing moved
sql/table.h:
  merged view processing moved
2005-07-01 07:05:42 +03:00
unknown
05c7edf648 Move reset of insert_values to ensure it's done also during error conditions
This fixed a failure of insert_update.test on some platforms


mysys/thr_alarm.c:
  Fixed problem noticed by valgrind
sql/opt_range.cc:
  Simple optimization for common case
sql/sql_base.cc:
  Safety assert
sql/sql_insert.cc:
  Added comment
2005-06-28 15:06:16 +03:00
unknown
6c46a993d7 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into  mishka.local:/home/my/mysql-4.1


sql/ha_ndbcluster.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
2005-06-27 16:47:44 +03:00
unknown
d10877ce8c Better bug fix for:
#9728  'Decreased functionality in "on duplicate key update
#8147  'a column proclaimed ambigous in INSERT ... SELECT .. ON DUPLICATE'

This ensures fields are uniquely qualified and also that one can't update other tables in the ON DUPLICATE KEY UPDATE part


mysql-test/r/insert_select.result:
  More tests for bug #9728 and #8147
mysql-test/r/insert_update.result:
  Updated tests after changing how INSERT ... SELECT .. ON DUPLICATE KEY works
mysql-test/t/insert_select.test:
  More tests for bug #9728 and #8147
mysql-test/t/insert_update.test:
  Updated tests after changing how INSERT ... SELECT .. ON DUPLICATE KEY works
mysys/my_access.c:
  Cleanup (shorter loop variable names)
sql/ha_ndbcluster.cc:
  Indentation fixes
sql/item.cc:
  Remove item_flags
sql/item.h:
  Remove item_flags
sql/mysql_priv.h:
  New arguments to mysql_prepare_insert
sql/sql_base.cc:
  Remove old fix for bug #8147
sql/sql_insert.cc:
  Extend mysql_prepare_insert() with new field list for tables that can be used in the values port of ON DUPLICATE KEY UPDATE
sql/sql_parse.cc:
  Revert fix for #9728
  Allow one to use other tables in ON DUPLICATE_KEY for INSERT ... SELECT if there is no GROUP BY clause
sql/sql_prepare.cc:
  New arguments to mysql_prepare_insert
sql/sql_yacc.yy:
  Revert bug fix for #9728
2005-06-27 16:46:41 +03:00
unknown
5a9475cd2a Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into neptunus.(none):/home/msvensson/mysql/mysql-5.0


sql/sql_base.cc:
  Auto merged
2005-06-23 13:10:42 +02:00
unknown
557184734f insert_update.result, insert_update.test, sql_base.cc:
Fix for bugfix #9728 merge


sql/sql_base.cc:
  Fix for bugfix #9728 merge
mysql-test/t/insert_update.test:
  Fix for bugfix #9728 merge
mysql-test/r/insert_update.result:
  Fix for bugfix #9728 merge
2005-06-23 03:51:10 +04:00
unknown
f3a3e05249 Bug #9728 fix merge
mysql-test/r/insert_select.result:
  Auto merged
mysql-test/t/insert_select.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/sql_base.cc:
  Manual merge
sql/sql_parse.cc:
  Manual merge
sql/sql_yacc.yy:
  Manual merge
2005-06-23 01:02:43 +04:00
unknown
6a8945e332 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into neptunus.(none):/home/msvensson/mysql/mysql-4.1


sql/sql_base.cc:
  Auto merged
2005-06-22 20:59:34 +02:00
unknown
4db138f91a Merged from mysql-4.1 to mysql-5.0
client/mysqltest.c:
  Auto merged
mysql-test/mysql-test-run.sh:
  Auto merged
mysql-test/t/ndb_autodiscover.test:
  Auto merged
sql/ha_ndbcluster.h:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
client/mysqldump.c:
  Merge from 4.1 to 5.0
mysql-test/r/ndb_autodiscover.result:
  Merge
ndb/test/ndbapi/create_tab.cpp:
  Merge
sql/ha_ndbcluster.cc:
  Merge
sql/handler.cc:
  Merge
sql/handler.h:
  Merge
sql/sql_base.cc:
  Merge
sql/sql_table.cc:
  Merge
2005-06-22 14:10:02 +02:00
unknown
a6c7fb455a Fix bug #9728 decreased functionality in "on duplicate key update"
Remove changes made by bug fix #8147. They strips list of insert_table_list to
only insert table, which results in error reported in bug #9728.
Added flag to Item to resolve ambigous fields reported in bug #8147.


sql/item.h:
  Fix bug#9728  decreased functionality in "on duplicate key update".
sql/item.cc:
  Fix bug#9728  decreased functionality in "on duplicate key update"
sql/sql_parse.cc:
  Fix bug#9728  decreased functionality in "on duplicate key update"
sql/sql_base.cc:
  Fix bug#9728  decreased functionality in "on duplicate key update".
sql/sql_yacc.yy:
  Fix bug#9728  decreased functionality in "on duplicate key update"
mysql-test/t/insert_select.test:
  Test case for bug#9728 Decreased functionality in "on duplicate key update".
mysql-test/r/insert_select.result:
  Test case for bug#9728 Decreased functionality in "on duplicate key update".
2005-06-22 07:18:42 +04:00
unknown
04f6f63dd8 A preparatory patch to help adding JOIN::transform() and move one-time
query transformations to the PREPARE stage (prepared statements).


sql/item.h:
  Remove an unused friend declaration.
sql/mysql_priv.h:
  Change signature of insert_fields()
sql/sp_head.cc:
  Make is_stmt_prepare_or_first_sp_execute really work: reset SP state
  to EXECUTED after execution.
sql/sql_base.cc:
  allocate_view_names flag of insert_fields is removed.
  The purpose of this variable was to amend the case when a view
  is replaced with a base table between subsequent executions of a prepared
  statement: in that case the new table theoretically can be used instead
  of the view. If allocate_view_names was set,
  all the references to the view expressions were replaced with Item_field's
  which in turn could have been resolved by their names.
  But this approach doesn't work for other reasons, so let's not try
  to help what must be solved by TDC.
sql/sql_class.h:
  Add is_first_sp_execute() helper method.
sql/sql_handler.cc:
  insert_fields signature changed.
sql/sql_lex.h:
  Add a comment for variable 'first_execution'.
2005-06-21 21:15:21 +04:00
unknown
29397de1e0 Merge neptunus.(none):/home/msvensson/mysql/mysql-4.1
into neptunus.(none):/home/msvensson/mysql/bug10365


sql/ha_ndbcluster.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
2005-06-20 13:08:45 +02:00
unknown
d18e5622eb BUG10365 Cluster handler uses non-standard error code
- Updated after review


sql/ha_ndbcluster.cc:
  Return -1 if table does not exists
sql/handler.cc:
  Return -1 if table does not exists
  Return 0 if table exists and it could be created
  Return >0 if table existed but it could not be created.
sql/sql_base.cc:
  Only need to call ha_create_table_from_engine and check if result is > 0. If that is the case, print error message
2005-06-16 15:17:47 +02:00
unknown
f1e42a0b35 renamed:
Item_buff -> Cached_item
  Item_arena -> Query_arena
  TEST_ASSERT -> YYERROR_UNLESS


sql/item.h:
  renamed:
    Item_buff -> Cached_item
sql/item_buff.cc:
  renamed:
    Item_buff -> Cached_item
sql/item_func.cc:
  renamed:
    Item_arena -> Query_arena
sql/item_subselect.cc:
  renamed:
    Item_arena -> Query_arena
sql/sp_head.cc:
  renamed:
    Item_arena -> Query_arena
sql/sp_head.h:
  renamed:
    Item_arena -> Query_arena
sql/sql_base.cc:
  renamed:
    Item_arena -> Query_arena
sql/sql_class.cc:
  renamed:
    Item_arena -> Query_arena
sql/sql_class.h:
  renamed:
    Item_arena -> Query_arena
sql/sql_lex.cc:
  renamed:
    Item_arena -> Query_arena
sql/sql_prepare.cc:
  renamed:
    Item_arena -> Query_arena
sql/sql_select.cc:
  renamed:
    Item_arena -> Query_arena
sql/sql_select.h:
  renamed:
    Item_buff -> Cached_item
    Item_arena -> Query_arena
sql/sql_union.cc:
  renamed:
    Item_arena -> Query_arena
sql/sql_view.cc:
  renamed:
    Item_arena -> Query_arena
sql/sql_yacc.yy:
  renamed:
    TEST_ASSERT -> YYERROR_UNLESS
sql/table.cc:
  renamed:
    Item_arena -> Query_arena
2005-06-15 19:58:35 +02:00
unknown
4e0bbc1b6e Fix for bug #11158 "Can't perform multi-delete in stored procedure".
In order to make multi-delete SP friendly we need to have all table 
locks for the elements of main statement table list properly set 
at the end of parsing.

Also performed small cleanup: We don't need relink_tables_for_multidelete()
any longer since the only case now when TABLE_LIST::correspondent_table
is non-zero are tables in auxilary table list of multi-delete and these
tables are handled specially in mysql_multi_delete_prepare().


mysql-test/r/sp-threads.result:
  Added test case for bug #11158 "Can't perform multi-delete in stored
  procedure".
mysql-test/t/sp-threads.test:
  Added test case for bug #11158 "Can't perform multi-delete in stored
  procedure".
sql/mysql_priv.h:
  - Removed third argument from the declaration of multi_delete_precheck()
    as nowdays we calculate number of tables in multi-delete from which
    we are going to delete rows right at the end of statement parsing.
  - Introduced definition of multi_delete_set_locks_and_link_aux_tables()
    which is responsible for propagation of proper table locks from
    multi-delete's auxilary table list to the main list and binding
    corresponding tables in these two lists.
sql/sql_base.cc:
  Removed relink_tables_for_multidelete() routine and its invocations.
  We don't need them in 5.0 since the only case now when
  TABLE_LIST::correspondent_table is non-zero are tables in auxilary table
  list of multi-delete and these tables are handled specially in
  mysql_multi_delete_prepare().
sql/sql_lex.h:
  LEX::table_count
    Added description of new role of this LEX member for multi-delete. 
    Now for this statement we store number of tables from which we should
    delete records there.
sql/sql_parse.cc:
  multi_delete_precheck():
    Moved code which is responsible for iterating through auxilary table
    list and binding its elements with corresponding elements of main
    table list, and properly updating locks in it to separate function -
    multi_delete_set_locks_and_link_aux_tables(). This is because in order
    to make multi-delete SP friendly we need to have all locks set properly
    at the end of statement parsing. So we are introducing new function
    which will be called from parser.
    We also calculate number of tables from which we are going to perform
    deletions there and store this number for later usage in
    LEX::table_count.
    Also removed some no longer needed code.
sql/sql_prepare.cc:
  mysql_test_multidelete():
    Now multi_delete_precheck() takes only two arguments, so we don't
    need to pass fake third parameter.
sql/sql_yacc.yy:
  delete:
    In order to make multi-delete SP friendly we need to have all table 
    locks for the elements of main statement table list properly set 
    at the end of parsing.
2005-06-09 01:07:52 +04:00
unknown
09944efd71 BUG#10365 Cluster handler uses non-standard error codes
- Added better error messages when trying to open a table that can't be discovered or unpacked. The most likely cause of this is that it does not have any frm data, probably since it has been created from NdbApi or is a NDB system table.
 - Separated functionality that was in ha_create_table_from_engine into two functions. One that checks if the table exists and another one that tries to create the table from the engine.


mysql-test/r/ndb_autodiscover.result:
  Add tests for reading from a table that can't be discovered(SYSTAB_0)
  Discovery is not performed during create table anymore.
mysql-test/t/ndb_autodiscover.test:
  Add tests for reading from a table that can't be discovered(SYSTAB_0)
  Discovery is not performed during create table anymore.
ndb/test/ndbapi/create_tab.cpp:
  Set connectstring before creating Ndb object.
sql/ha_ndbcluster.cc:
  Rename and use the function ndbcluster_table_exists_in_engine.
  Correct return valu from ndbcluster_discover
  Remove old code "ndb_discover_tables"
sql/ha_ndbcluster.h:
  Rename function ndbcluster_table_exists to ndb ndbcluster_table_exists_in_engine
sql/handler.cc:
  Update comment of ha_create_table_from_engine
  Remove parameter create_if_found from ha_create_table_from_engine, the function ha_table_exists_in_engine is now used toi check if table is found in engine.
  Cleanup return codes from ha_create_table_from_engine.
  Change name of ha_table_exists to ha_table_exists_in_engine, update comment and returne codes.
sql/handler.h:
  Remove paramter create_if_cound from  ha_create_table_from_engine
  Rename ha_table_exists to ha_table_exists_in_engine
sql/sql_base.cc:
  Use the function ha_table_exists_in_engine to detect if table exists in enegine. 
  If it exists, call function ha_create_table_from_engine to try and create it.
  If create of table fails, set correct error message.
sql/sql_table.cc:
  Add comments, remove parameter create_if_found to ha_create_table_from_engine.
  When dropping a table, try to discover it from engine. If discover fails, use same error message as if the table didn't exists. 
  Maybe another message should be displayed here, ex: "Table could not be dropped, unpack failed"
  
  When creating a new table, use ha_table_exists_in_engine to check if a table with the given name already exists.
2005-06-08 13:31:59 +02:00
unknown
06a948c36b Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/dlenev/src/mysql-5.0-bg10015


sql/handler.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2005-06-07 14:54:48 +04:00
unknown
49357ae8f0 Fix for bug #10015 "Crash in InnoDB if stored routines are used".
We should not allow explicit or implicit transaction commits inside
of stored functions or triggers (so in autocommit mode we should not
do commits after execution of sub-statement).
Also since we don't support nested statement transactions in 5.0,
we shouldn't commit or rollback stmt transactions while we are inside
stored functions or triggers. This should be fixed in later (>=5.1)
releases.


mysql-test/r/sp_trans.result:
  Added test for bug #10015 "Crash in InnoDB if stored routines are used"
  and for general transaction handling inside of functions.
mysql-test/t/sp_trans.test:
  Added test for bug #10015 "Crash in InnoDB if stored routines are used"
  and for general transaction handling inside of functions.
sql/handler.cc:
  ha_trans_commit()/ha_trans_rollback():
    Since we don't support nested statement transactions in 5.0,
    we can't commit or rollback stmt transactions while we are inside
    stored functions or triggers. So we simply do nothing now.
    This should be fixed in later ( >= 5.1) releases.
sql/item_func.cc:
  Item_func_sp::execute():
    Set THD::transaction.in_sub_stmt flag to TRUE during stored function
    execution to prevent commits and rollbacks for statement level
    transactions, since doing them will ruin such transaction for
    stateemtn which calls this function.
sql/share/errmsg.txt:
  Added error message which says that statements doing explicit or implicit
  commits are disallowed in triggers and stored functions.
sql/sql_base.cc:
  close_thread_tables():
    Clarified comment about committing of statement transactions in
    prelocked mode.
sql/sql_class.h:
  THD::transaction:
    Added in_sub_stmt method which indicates that we are executing
    statements from trigger or stored function now, and thus
    statement transaction belongs to statement which invoked this
    routine and we should not commit or rollback it while executing
    these sub-statements.
sql/sql_parse.cc:
  end_active_trans()/begin_trans()/end_trans():
    We should not commit or rollback global (non-stmt) transaction
    if we are executing stored function or trigger. These checks will
    catch situation when we are trying to do commit or rollback in stored
    procedure which is called from function or trigger.
sql/sql_trigger.h:
  Table_triggers_list::process_triggers():
    Set THD::transaction.in_sub_stmt flag to TRUE during trigger
    execution to prevent commits and rollbacks for statement level
    transactions, since doing them will ruin such transaction for
    stateemtn which invokes this trigger.
sql/sql_yacc.yy:
  Prohibited usage of statements which do explicit or implicit commit or
  rollback inside of stored functions and triggers.
2005-06-07 14:53:08 +04:00
unknown
bd47a7df59 Merge with 4.1
BitKeeper/etc/logging_ok:
  auto-union
client/sql_string.cc:
  Auto merged
configure.in:
  Auto merged
include/my_global.h:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/create.result:
  Auto merged
mysql-test/r/olap.result:
  Auto merged
mysql-test/r/warnings.result:
  Auto merged
mysql-test/t/create.test:
  Auto merged
mysql-test/t/warnings.test:
  Auto merged
mysys/raid.cc:
  Auto merged
scripts/make_binary_distribution.sh:
  Auto merged
sql/field.cc:
  Auto merged
BitKeeper/deleted/.del-ha_isam.cc~4dce65904db2675e:
  Auto merged
BitKeeper/deleted/.del-ha_isammrg.cc~dc682e4755d77a2e:
  Auto merged
sql/ha_berkeley.cc:
  Auto merged
sql/ha_blackhole.cc:
  Auto merged
sql/ha_heap.cc:
  Auto merged
sql/ha_innodb.cc:
  Auto merged
sql/ha_myisam.cc:
  Auto merged
sql/ha_myisammrg.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_geofunc.cc:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/item_uniq.cc:
  Auto merged
sql/lock.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/opt_range.h:
  Auto merged
sql/procedure.cc:
  Auto merged
sql/protocol.cc:
  Auto merged
sql/protocol_cursor.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_analyse.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_error.cc:
  Auto merged
sql/sql_handler.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_map.cc:
  Auto merged
sql/sql_olap.cc:
  Auto merged
sql/sql_repl.cc:
  Auto merged
sql/sql_string.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_udf.cc:
  Auto merged
sql/examples/ha_archive.cc:
  Auto merged
sql/examples/ha_example.cc:
  Auto merged
sql/examples/ha_tina.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/tztime.cc:
  Auto merged
strings/ctype-win1250ch.c:
  Auto merged
mysql-test/r/func_gconcat.result:
  merge & ensure that 4.1 and 5.0 source have tests in same order
mysql-test/r/innodb.result:
  merge & ensure that 4.1 and 5.0 source have tests in same order
mysql-test/t/func_gconcat.test:
  merge & ensure that 4.1 and 5.0 source have tests in same order
mysql-test/t/innodb.test:
  merge & ensure that 4.1 and 5.0 source have tests in same order
sql/item_func.cc:
  merge
sql/mysqld.cc:
  merge
sql/opt_range.cc:
  merge
sql/sql_parse.cc:
  merge
  Give better name to goto labels
sql/sql_select.cc:
  merge
2005-06-07 00:31:53 +03:00
unknown
4eb26350cb merge
client/mysql.cc:
  Auto merged
libmysql/libmysql.c:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_bitmap.h:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
2005-06-05 17:19:50 +03:00
unknown
1b99948246 Removed duplicated and wrong merged code
sql/sql_base.cc:
  Fixed wrong comment
2005-06-03 01:15:56 +03:00
unknown
1dd50e466d misc. fixes for windoze builds
VC++Files/client/mysql.dsp:
  added missing mysys.lib
VC++Files/client/mysqladmin.dsp:
  added missing mysys.lib
VC++Files/client/mysqlimport.dsp:
  added missing mysys.lib
VC++Files/client/mysqlshow.dsp:
  added missing mysys.lib
VC++Files/libmysql/libmysql.dsp:
  added missing mysys.lib
VC++Files/mysql.dsw:
  added dependencies on mysys
include/config-win.h:
  added missing constant
sql/sql_base.cc:
  pulled declaration of table_list out of for-scope
2005-06-02 15:32:02 +02:00
unknown
906b210a4a Code cleanups during code reviews
Ensure we get error if INSERT IGNORE ... SELECT fails
Fixed wrong key_part->key_length usage in index_merge


client/mysql.cc:
  Code cleanups & simply optimizations
mysql-test/r/information_schema.result:
  Safety
mysql-test/t/information_schema.test:
  Safety
sql/ha_ndbcluster.cc:
  Code cleanups
sql/item.cc:
  Code cleanups
sql/item_subselect.cc:
  Code cleanups
sql/item_sum.cc:
  Code cleanups
sql/opt_range.cc:
  Made get_index_only_read_time() static (instad of inline) to increase portability (function was not declared before use)
  Simple optimization
  Fixed wrong key_part->key_length usage in index_merge
  Removed not used variable n_used_covered
  Indentation fixes & comment cleanups
sql/parse_file.cc:
  Code cleanups
sql/sql_base.cc:
  Code cleanups
sql/sql_bitmap.h:
  Added missing return
sql/sql_insert.cc:
  Ensure we get error if INSERT IGNORE ... SELECT fails
sql/sql_select.cc:
  Code cleanups
sql/sql_show.cc:
  Safety fix if a LOT of errors are ignored
sql/sql_update.cc:
  Code cleanups
sql/table.cc:
  Code cleanups
sql/table.h:
  Code cleanups
sql/uniques.cc:
  Code cleanups
strings/decimal.c:
  Simple optimization
  Code cleanups
2005-06-01 16:35:09 +03:00
unknown
388d9df13e Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
After merge fixes.
2005-06-01 13:22:17 +02:00
unknown
046ced266a Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
Manual merge from 4.1.


mysql-test/r/create.result:
  Auto merged
mysql-test/t/create.test:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_handler.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2005-06-01 11:15:21 +02:00
unknown
57d4adf60c Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
Hand merged from 4.0.


sql/lock.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_handler.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
2005-05-31 19:37:24 +02:00
unknown
cf2188ca39 Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
1.) Added a new option to mysql_lock_tables() for ignoring FLUSH TABLES.
Used the new option in create_table_from_items().
It is necessary to prevent the SELECT table from being reopend.
It would get new storage assigned for its fields, while the
SELECT part of the command would still use the old (freed) storage.
2.) Protected the CREATE TABLE and CREATE TABLE ... SELECT commands
against a global read lock. This prevents a deadlock in
CREATE TABLE ... SELECT in conjunction with FLUSH TABLES WITH READ LOCK
and avoids the creation of new tables during a global read lock.
3.) Replaced set_protect_against_global_read_lock() and
unset_protect_against_global_read_lock() by
wait_if_global_read_lock() and start_waiting_global_read_lock()
in the INSERT DELAYED handling.


mysql-test/r/create.result:
  Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
  Added test results.
mysql-test/t/create.test:
  Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
  Added tests which do not require concurrency.
sql/lock.cc:
  Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
  Added a new option to mysql_lock_tables() for ignoring FLUSH TABLES.
  Changed the parameter list.
  Removed two unnecessary functions. Their functionality is included in
  wait_if_global_read_lock() and start_waiting_global_read_lock().
sql/mysql_priv.h:
  Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
  Changed the declaration of mysql_lock_tables().
  Added definitions for the new options.
sql/sql_acl.cc:
  Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
  Adjusted mysql_lock_tables() calls to the new argument list.
sql/sql_base.cc:
  Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
  Adjusted mysql_lock_tables() calls to the new argument list.
sql/sql_handler.cc:
  Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
  Adjusted mysql_lock_tables() calls to the new argument list.
sql/sql_insert.cc:
  Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
  Replaced set_protect_against_global_read_lock() and
  unset_protect_against_global_read_lock() by
  wait_if_global_read_lock() and start_waiting_global_read_lock()
  in the INSERT DELAYED handling.
  Adjusted mysql_lock_tables() calls to the new argument list.
sql/sql_parse.cc:
  Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
  Protected the CREATE TABLE and CREATE TABLE ... SELECT commands
  against a global read lock. This prevents a deadlock in
  CREATE TABLE ... SELECT in conjunction with FLUSH TABLES WITH READ LOCK
  and avoids the creation of new tables during a global read lock.
sql/sql_table.cc:
  Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
  Adjusted mysql_lock_tables() calls to the new argument list.
  Used the new option in create_table_from_items().
2005-05-31 11:08:14 +02:00
unknown
5cdac99069 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/opt/local/work/mysql-5.0-7306-new


sql/item_subselect.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_olap.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
2005-05-30 20:56:11 +04:00
unknown
78422442df Preparatory (and the most problematic) patch for Bug#7306
"the server side preparedStatement error for LIMIT placeholder",
which moves all uses of LIMIT clause from PREPARE to OPTIMIZE
and later steps.
After-review fixes.


mysql-test/r/group_min_max.result:
  Test results fixed for EXPLAINs when using GROUP_MIN_MAX access plan.
sql/item_subselect.cc:
  Move setting of the internal LIMIT used for IN/ALL/ANY/EXISTS 
  subqueries to one place: Item_exists_subselect::fix_length_and_dec().
  This implies that unit->select_limit_cnt is not set until the item is 
  fixed. This is OK, as now LIMIT values are not used until JOIN::optimize.
sql/mysql_priv.h:
  setup_tables no longer needs a special flag for the case when
  it's called from JOIN::reinit() (we don't need to call setup_tables
  between two executions of a correlated subquery).
sql/opt_range.cc:
  Fix a glitch in GROUP_MIN_MAX access plan: we should use table metadata,
  not field data, to evaluate max_used_key_length, which is then
  used for explain.
sql/sp.cc:
  - setup_tables signature changed.
sql/sql_base.cc:
  - setup_tables no longer needs a special mode for subqueries.
    Unused checks were removed.
sql/sql_delete.cc:
  - setup_tables signature changed
sql/sql_help.cc:
  - setup_tables signature changed
sql/sql_insert.cc:
  - setup_tables signature changed
sql/sql_lex.cc:
  Consolidate setting of internal LIMIT for IN/ALL/ANY/EXISTS subqeries
  in one place, and hence remove it from st_select_lex::test_limit().
sql/sql_lex.h:
  Cleanup signature of st_select_lex_unit::init_prepare_fake_select_lex().
sql/sql_load.cc:
  - setup_tables signature changed
sql/sql_olap.cc:
  - setup_tables signature changed
sql/sql_parse.cc:
  - st_select_lex_unit::set_limit() signature changed
sql/sql_select.cc:
  Move setting of JOIN::select_limit from JOIN::prepare
  to JOIN::optimize. At prepare, limit is unknown yet.
  Remove excessive cleanups from JOIN::reinit which were overwriting
  join->join_tab[i]->table->used_keys. This fixes the bug which was triggered
  by the change in item_subselect.cc.
sql/sql_union.cc:
  Class st_select_lex_unit was changed to avoid calls to 
   st_select_lex_unit::set_limit from places where it may be unknown.
  Now unit->select_limit_cnt is set at ::exec(). 
  st_select_lex_unit::init_prepare_fake_select_lex(): 
   - move out set_limit functionality
   - remove a few lines of dead code.
  st_select_lex_unit::prepare():
    - now we don't call set_limit at the time of prepare, so the value  
      of unit->select_limit_cnt may be unknown here. Use sl->select_limit
      instead.
  st_select_lex_unit::exec():
    - cleanup
    - call set_limit explicitly as it has been moved out of 
     init_prepare_fake_select_lex.
sql/sql_update.cc:
  - setup_tables signature changed
2005-05-30 20:54:37 +04:00
unknown
e38f06f7ff Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/my/mysql-5.0


sql/sql_base.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
2005-05-25 18:38:29 +03:00
unknown
c6283dbba9 Cleanup's during review
Added ASSERT() to detect wrongly packed fields


sql/field.h:
  Fixed comments to right format
sql/opt_range.cc:
  Merged code
sql/sql_base.cc:
  Fixed indentation
sql/sql_insert.cc:
  Fixed comments to right format
sql/sql_select.cc:
  Simplify code
sql/unireg.cc:
  Simply code for calculating key_buff_length
  Added ASSERT() to detect wrongly packed fields
2005-05-25 18:33:32 +03:00
unknown
896786eadd Manual merge of patch fixing several trigger related bugs with main tree.
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Manual merge
sql/sql_update.cc:
  Manual merge
2005-05-24 22:35:41 +04:00
unknown
1fa7c69d31 Fix for bugs:
#5860 "Multi-table UPDATE does not activate update triggers"
 #6812 "Triggers are not activated for INSERT ... SELECT"
 #8755 "Trigger is not activated by LOAD DATA".
This patch also implements proper handling of triggers for special forms
of insert like REPLACE or INSERT ... ON DUPLICATE KEY UPDATE. 
Also now we don't call after trigger in case when we have failed to
inserted/update or delete row. Trigger failure should stop statement
execution.

I have not properly tested handling of errors which happen inside of
triggers in this patch, since it is simplier to do this once we will be
able to access tables from triggers.


mysql-test/r/trigger.result:
  Added tests for triggers behavior for various non-standard forms of
  INSERT such as REPLACE and INSERT ... ON DUPLICATE KEY UPDATE.
  Also added tests for bugs #5860 "Multi-table UPDATE does not activate
  update triggers", #6812 "Triggers are not activated for INSERT ... SELECT"
  and #8755 "Trigger is not activated by LOAD DATA".
mysql-test/t/trigger.test:
  Added tests for triggers behavior for various non-standard forms of
  INSERT such as REPLACE and INSERT ... ON DUPLICATE KEY UPDATE.
  Also added tests for bugs #5860 "Multi-table UPDATE does not activate
  update triggers", #6812 "Triggers are not activated for INSERT ... SELECT"
  and #8755 "Trigger is not activated by LOAD DATA".
sql/item.cc:
  Since it turned out that at trigger loading time we can't say in which
  buffer TABLE::record[0] or record[1] old version of row will be stored
  we have to change our approach to binding of Item_trigger_field to
  Field instances.
  Now after trigger parsing (in Item_trigger_field::setup_table()) we only
  find index of proper Field in the TABLE::field array. Then before trigger
  is invoked we set Table_triggers_list::old_field/new_field so they point
  to arrays holding Field instances bound to buffers with proper row
  versions. And as last step in Item_trigger_field::fix_fields() we get
  pointer to Field from those arrays using saved field index.
  
  Item_trigger_field::setup_field()/fix_fields() were changed to implement
  this approach.
sql/item.h:
  Since it turned out that at trigger loading time we can't say in which
  buffer TABLE::record[0] or record[1] old version of row will be stored
  we have to change our approach to binding of Item_trigger_field to
  Field instances.
  Now after trigger parsing (in Item_trigger_field::setup_table()) we only
  find index of proper Field in the TABLE::field array. Then before trigger
  is invoked we set Table_triggers_list::old_field/new_field so they point
  to arrays holding Field instances bound to buffers with proper row
  versions. And as last step in Item_trigger_field::fix_fields() we get
  pointer to Field from those arrays using saved field index.
  
  Item_trigger_field:
  - Added field_idx member to store index of Field object corresponding to
    this Item in TABLE::field array.
  - Added triggers member to be able to access to parent Table_trigger_list
    object from fix_fields() method.
  - setup_field() no longer needs to know for which type of event this
    trigger is, since it does not make decision Field for which buffer
    (record[0] or record[1] is appropriate for this Item_trigger_field)
sql/mysql_priv.h:
  Added fill_record_n_invoke_before_triggers() methods. They are simple
  wrappers around fill_record() which invoke proper before trigger right
  after filling record with values.
sql/sql_base.cc:
  Added fill_record_n_invoke_before_triggers() methods. They are simple
  wrappers around fill_record() which invoke proper before trigger right
  after filling record with values.
sql/sql_delete.cc:
  mysql_delete():
    Now we stop statement execution if one of triggers failed, we also
    don't execute after delete trigger if we failed to delete row from
    the table (We also pass information about which buffer contains old
    version of row to process_triggers()).
  multi_delete::send_data()/do_deletes():
    Now we also invoke triggers in case of multi-delete.
sql/sql_insert.cc:
  mysql_insert():
    Moved invocation of before triggers to fill_record_n_invoke_before_triggers()
    method. After triggers are now executed as part of write_record().
    (as nice side effect now we also stop statement execution if one of
    triggers fail).
  write_record():
    Invoke after insert trigger after performing insert. Also invoke proper
    triggers if insert is converted to update or conflicting row is deleted.
    Cleaned up error handling a bit - no sense to report error via
    handler::print_error if it was not generated by handler method and
    was reported before.
    Also now we will execute after trigger only if we really have written
    row to the table. 
  select_insert::send_data()/store_values():
    We should also execute INSERT triggers for INSERT ... SELECT statement.
sql/sql_load.cc:
  read_fixed_length()/read_sep_field():
    We should execute INSERT triggers when processing LOAD DATA statement.
    Small cleanup in auto-increment related code. Also moved check for
    thd->killed which is used to abort LOAD DATA in case of problems
    in 'traditional' mode to better place..
sql/sql_trigger.cc:
  Since it turned out that at trigger loading time we can't say in which
  buffer TABLE::record[0] or record[1] old version of row will be stored
  we have to change our approach to binding of Item_trigger_field to
  Field instances.
  Now after trigger parsing (in Item_trigger_field::setup_table()) we only
  find index of proper Field in the TABLE::field array. Then before trigger
  is invoked we set Table_triggers_list::old_field/new_field so they point
  to arrays holding Field instances bound to buffers with proper row
  versions. And as last step in Item_trigger_field::fix_fields() we get
  pointer to Field from those arrays using saved field index.
  
  Table_triggers_list methods were changed to implement this approach
  (see also comments for sql_trigger.h).
sql/sql_trigger.h:
  Since it turned out that at trigger loading time we can't say in which
  buffer TABLE::record[0] or record[1] old version of row will be stored
  we have to change our approach to binding of Item_trigger_field to
  Field instances.
  Now after trigger parsing (in Item_trigger_field::setup_table()) we only
  find index of proper Field in the TABLE::field array. Then before trigger
  is invoked we set Table_triggers_list::old_field/new_field so they point
  to arrays holding Field instances bound to buffers with proper row
  versions. And as last step in Item_trigger_field::fix_fields() we get
  pointer to Field from those arrays using saved field index.
  
  Changed Table_triggers_list to implement this new approach:
  - Added record1_field member to store array of Field objects bound
    to TABLE::record[1] buffer (instead of existing old_field member)
  - Added new_field member and changed meaning of old_field member.
    During trigger execution they should point to arrays of Field objects
    bound to buffers holding new and old versions of row respectively.
  - Added 'table' member to be able to get access to TABLE instance
    (for which this trigger list object was created) from process_triggers()
    method.
  - Now process_triggers() method sets old_field and new_field members
    properly before executing triggers body (basing on new 
    old_row_is_record1 parameter value).
  - Renamed prepare_old_row_accessors_method() to prepare_record1_accessors()
  
  Also added has_before_update_triggers() method which allows to check
  whenever any before update triggers exist for table.
sql/sql_update.cc:
  mysql_update():
    Now we invoke before triggers in fill_record_n_invoke_before_triggers()
    method. Also now we abort statement execution when one of triggers fail.
  safe_update_on_fly():
    When we are trying to understand if we can update first table in multi
    update on the fly we should take into account that BEFORE UPDATE
    trigger can change field values.
  multi_update::send_data()/do_updates()
    We should execute proper triggers when doing multi-update
    (in both cases when we do it on the fly and using temporary tables).
2005-05-24 22:19:33 +04:00
unknown
afaa3c8923 sql_yacc.yy:
missing semicolon added
sql_base.cc:
  bad merge fixed
sp_head.cc, view.test, view.result:
  Correct restoring view name in SP table locking BUG#9758
configure.in:
  restore -fno-implicit-templates -fno-exceptions -fno-rtti in configure


configure.in:
  restore -fno-implicit-templates -fno-exceptions -fno-rtti in configure
mysql-test/r/view.result:
  Correct restoring view name in SP table locking BUG#9758
mysql-test/t/view.test:
  Correct restoring view name in SP table locking BUG#9758
sql/sp_head.cc:
  Correct restoring view name in SP table locking BUG#9758
sql/sql_base.cc:
  bad merge fixed
sql/sql_yacc.yy:
  missing semicolon added
2005-05-17 17:08:43 +02:00
unknown
9c71571f83 Merge with 4.1 to get fix for memory leak
client/mysql.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/sql_base.cc:
  merge
2005-05-16 20:21:38 +03:00
unknown
f80fa96d1c Fix memory leak
client/mysql.cc:
  Remove usage of c_ptr_safe() as this causes a linkage problem when compiling MySQL without inline functions
sql/sql_base.cc:
  Don't use c_ptr_safe() on this string as this causes a realloc and the String object (allocated by sql_yacc.yy) is never freed
2005-05-16 20:16:46 +03:00
unknown
7f5bf3dcdb Manual merge (again)
configure.in:
  Auto merged
include/mysql.h:
  Auto merged
innobase/row/row0mysql.c:
  Auto merged
BitKeeper/deleted/.del-ctype-cp932.c:
  Auto merged
BitKeeper/deleted/.del-errmsg.txt~4617575065d612b9:
  Auto merged
BitKeeper/deleted/.del-errmsg.txt~ffe4a0c9e3206150:
  Auto merged
libmysql/libmysql.c:
  Auto merged
libmysqld/Makefile.am:
  Auto merged
mysql-test/r/ctype_ucs.result:
  Auto merged
mysql-test/t/ctype_ucs.test:
  Auto merged
mysql-test/t/ps_grant.test:
  Auto merged
sql/ha_blackhole.cc:
  Auto merged
strings/ctype-big5.c:
  Auto merged
strings/ctype-ucs2.c:
  Auto merged
2005-05-14 12:38:12 +04:00
unknown
c3f73a4281 sql/ha_blackhole.cc
bug#10175 - blackhole.test hangs with "Warning: prev link 1 didn't point at previous lock at read: read lock with no write locks"
sql/sql_base.cc
    libmysqld/examples/mysql.cc linking problem


sql/ha_blackhole.cc:
  bug#10175 - blackhole.test hangs with "Warning: prev link 1 didn't point at previous lock at read: read lock with no write locks"
sql/sql_base.cc:
  libmysqld/examples/mysql.cc linking problem
2005-05-13 21:43:26 +02:00
unknown
623444963e Manual merge
sql/sql_base.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  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
sql/table.h:
  Auto merged
2005-05-10 16:41:47 -07:00
unknown
e02416c53c Many files:
Fixed bug #8528.
  Representation for single-table views was made similar to
  representation for multi-table views.
view.test:
  Added test case for bug #8528.
view.result:
  Added test case for bug #8528. Fixed other test cases.


mysql-test/r/view.result:
  Added test case for bug #8528. Fixed other test cases.
mysql-test/t/view.test:
  Added test case for bug #8528.
sql/sql_base.cc:
  Fixed bug #8528.
  Representation for single-table views was made similar to
  representation for multi-table views.
sql/sql_delete.cc:
  Fixed bug #8528.
  Representation for single-table views was made similar to
  representation for multi-table views.
sql/sql_insert.cc:
  Fixed bug #8528.
  Representation for single-table views was made similar to
  representation for multi-table views.
sql/sql_parse.cc:
  Fixed bug #8528.
  Representation for single-table views was made similar to
  representation for multi-table views.
sql/sql_prepare.cc:
  Fixed bug #8528.
  Representation for single-table views was made similar to
  representation for multi-table views.
sql/sql_select.cc:
  Fixed bug #8528.
  Representation for single-table views was made similar to
  representation for multi-table views.
sql/sql_update.cc:
  Fixed bug #8528.
  Representation for single-table views was made similar to
  representation for multi-table views.
sql/sql_view.cc:
  Fixed bug #8528.
  Representation for single-table views was made similar to
  representation for multi-table views.
sql/table.cc:
  Fixed bug #8528.
  Representation for single-table views was made similar to
  representation for multi-table views.
sql/table.h:
  Fixed bug #8528.
  Representation for single-table views was made similar to
  representation for multi-table views.
2005-05-10 16:31:13 -07:00
unknown
902aa10d23 Merge ltantony.mysql.com:/usr/home/antony/work2/p2-bug6616-4.1
into ltantony.mysql.com:/usr/home/antony/work2/p2-bug6616-5.0


BitKeeper/etc/logging_ok:
  auto-union
sql/sql_base.cc:
  Auto merged
2005-05-07 08:46:42 +01:00
unknown
b0bc3da102 Merge ltantony.mysql.com:/usr/home/antony/work2/p2-bug6616
into ltantony.mysql.com:/usr/home/antony/work2/p2-bug6616-4.1


BitKeeper/etc/logging_ok:
  auto-union
sql/sql_base.cc:
  Auto merged
2005-05-06 16:16:05 +01:00
unknown
079910b6f1 Bug#6616
MySQL server 100% CPU if FLUSH TABLES WITH READ LOCK + INSERT
  Infinite loop caused by missing update to thd version.


sql/sql_base.cc:
  Bug#6616
    thd version needs to be updated before reopening tables
    to prevent an infinite loop.
BitKeeper/etc/logging_ok:
  Logging to logging@openlogging.org accepted
2005-05-06 14:42:28 +01:00
unknown
d45f95f04a postreview changes
sql/item.cc:
  changed parameters order
sql/item.h:
  changed parameters order
sql/sql_base.cc:
  fixed comment
  changed parameters order
2005-04-30 19:27:22 +03:00
unknown
79f5ad3d78 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-test-5.0


sql/item.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
2005-04-30 01:43:35 +03:00
unknown
1df25ccdac Fix for #6553 and #8776 (no errors on bad spatial data)
mysql-test/r/gis-rtree.result:
  test result fixed
mysql-test/r/gis.result:
  test result fixed
mysql-test/t/gis-rtree.test:
  test case fixed
mysql-test/t/gis.test:
  test case added
sql/field.cc:
  error messages launched now when we try to put bad spatial
  data in the GEOMETRY field
sql/field.h:
  interface fixed
sql/item_geofunc.cc:
  bad_data sign now instead of NULL now returned from
  Item_geometry_from_text::val_str
sql/share/errmsg.txt:
  error message added
sql/spatial.cc:
  bad_geometry data instance
sql/spatial.h:
  bad_geometry_data declaration
sql/sql_base.cc:
  messages now created in store_* function
2005-04-29 20:23:02 +05:00
unknown
ca119d390e if outer refernce (identifier) was resolved with help of cache all subqueries and resolved item itseld have to be correctly marked as dependent
(BUG#10041)


sql/item.cc:
  depended_from shoudl be cleaned
  layout fixed
  function to mark range of SELECTs as dependent (used if item was resolved with PS cache of resolving identifiers)
sql/item.h:
  function to mark range of SELECTs as dependent (used if item was resolved with PS cache of resolving identifiers)
sql/item_subselect.h:
  function to mark range of SELECTs as dependent (used if item was resolved with PS cache of resolving identifiers)
sql/sql_base.cc:
  if outer refernce (identifier) was resolved with help of cache all subqueries and resolved item itseld have to be correctly marked as dependent
2005-04-29 02:43:56 +03:00
unknown
cfefd88d37 information_schema.result, information_schema.test:
Added a test in connection with the fix for
  bug #6106.
view.result, view.test:
  Added test cases for bugs #6106/6107.
sql_show.cc:
  The addition of the case for items of the type REF_ITEM in the
  function uses_only_table_name_fields became necessary after
  the fix for bug #6106.
sql_base.cc:
  The problem was due to the fact that two different column
  references were glued together though one of them belonged to
  a subquery while another to an outer query. This caused
  eventually a wrong calculation of values for the used_tables
  attribute.


sql/sql_base.cc:
  The problem was due to the fact that two different column
  references were glued together though one of them belonged to
  a subquery while another to an outer query. This caused
  eventually a wrong calculation of values for the used_tables
  attribute.
sql/sql_show.cc:
  The addition of the case for items of the type REF_ITEM in the
  function uses_only_table_name_fields became necessary after
  the fix for bug #6106.
mysql-test/t/view.test:
  Added test cases for bugs #6106/6107.
mysql-test/r/view.result:
  Added test cases for bugs #6106/6107.
mysql-test/t/information_schema.test:
  Added a test in connection with the fix for
  bug #6106.
mysql-test/r/information_schema.result:
  Added a test in connection with the fix for
  bug #6106.
2005-04-13 23:06:37 -07:00
unknown
46aad9633e Merge
sql/field.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.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_parse.cc:
  Auto merged
sql/handler.cc:
  SCCS merged
2005-04-05 13:23:11 +02:00
unknown
cd0a50bf34 remove the rest of isam/merge references
fix a race condition in TC_LOG_BINLOG::unlog


include/Makefile.am:
  remove the rest of isam/merge references
include/config-win.h:
  unused and abused macro removed
include/my_pthread.h:
  unused and abused macro removed
include/my_sys.h:
  MY_IGNORE_BADFD flag
include/mysql_embed.h:
  remove the rest of isam/merge references
mysql-test/r/replace.result:
  remove the rest of isam/merge references
mysql-test/t/replace.test:
  remove the rest of isam/merge references
mysql-test/t/xa.test:
  comment
mysys/my_sync.c:
  MY_IGNORE_BADFD flag
sql/handler.cc:
  remove the rest of isam/merge references
sql/log.cc:
  fix a race condition in TC_LOG_BINLOG::unlog
  preparation for binlog group commit
sql/mysql_priv.h:
  remove duplicates
sql/mysqld.cc:
  remove the rest of isam/merge references
sql/opt_range.cc:
  remove the rest of isam/merge references
sql/set_var.cc:
  hide unused variables. simplify sync_binlog code
sql/sql_base.cc:
  remove the rest of isam/merge references
sql/sql_class.h:
  cleanup
2005-04-05 13:17:49 +02:00
unknown
ae25f8df6e Now one gets an error if one tries to insert an invalid value via a stored procedure in STRICT mode. (Bug #5907)
client/mysqldump.c:
  Changed some function and variable names to MySQL syntax
  Fixed indentation for last few pushes
  (No logic changes)
mysql-test/r/strict.result:
  Test for bug #5907 (Traditional mode: invalid value can be inserted via a stored procedure)
mysql-test/t/strict.test:
  Test for bug #5907 (Traditional mode: invalid value can be inserted via a stored procedure)
sql/sql_base.cc:
  More comments
sql/sql_error.cc:
  Ensure that PS gives error for invalid values in 'strict' mode
2005-04-05 00:32:48 +03:00
unknown
a50bf2f06b - stackoverflow check added for view of view processing
- fixed bug in join view processing
- postreview fixes (BUG#9398 & BUG#8703)


sql/sql_base.cc:
  used original TABLE object to get correct name of table and db
sql/sql_view.cc:
  fixed bug of assigning select_lex for join view
sql/table.cc:
  comment fixed
  stack overflow check added
  new method for underlying base table finding
sql/table.h:
  comment fixed
  new method for underlying base table finding
2005-04-03 01:23:45 +03:00
unknown
daddf263e5 fixed mechanism of detection selection from table wich we update
(BUG##9398, BUG#8703)
fixed wrong join view detection in multi-delete which lead to server crash


mysql-test/r/lowercase_view.result:
  added new tests of updation and selection from the same table
mysql-test/r/view.result:
  added new tests of updation and selection from the same table
  added test of multidelete command over join view which lead to server crash
  test suite from bugs #9398 and #8703
mysql-test/t/lowercase_view.test:
  added new tests of updation and selection from the same table
mysql-test/t/view.test:
  added new tests of updation and selection from the same table
  added test of multidelete command over join view which lead to server crash
  test suite from bugs #9398 and #8703
sql/sql_base.cc:
  changed procedure of finding tables
sql/sql_class.cc:
  added derived table procession detection
sql/sql_class.h:
  added derived table procession detection
sql/sql_delete.cc:
  fixed detection of selection from table which update for multidelete
sql/sql_derived.cc:
  added derived table procession detection
sql/sql_lex.cc:
  added detection os SELECTs processed inside derived tables
  removed old mechanism of multidelete/multiupdate table duplication detection (which can't work with views)
sql/sql_lex.h:
  added detection os SELECTs processed inside derived tables
  removed old mechanism of multidelete/multiupdate table duplication detection (which can't work with views)
sql/sql_parse.cc:
  removed wrong test of join view (for multidelete in can be not only first table)
sql/sql_prepare.cc:
  added detection os SELECTs processed inside derived tables (reset it for reusing in PS/SP)
sql/sql_select.cc:
  added detection os SELECTs processed inside derived tables
sql/sql_update.cc:
  fixed detection of selection from table which update for multiupdate
2005-03-28 15:13:31 +03:00
unknown
284b8b8b63 Cleanup during reviews
Removed some optional arguments
Fixed portability problem in federated tests


client/sql_string.cc:
  update from sql/sql_string.cc
client/sql_string.h:
  update from sql/sql_string.h
mysql-test/r/federated.result:
  Fixed error message
sql/field.cc:
  Cleanup during review
  Remove const in 'const unsigned int'
sql/field.h:
  Remove const in 'const unsigned int'
sql/ha_federated.cc:
  Better error string.  Add missing argument to error (before 'errno' was picked up from stack)
sql/handler.cc:
  Removed compiler warning
sql/item_func.cc:
  Cleanup during review
sql/item_sum.cc:
  Cleanup during review
sql/lock.cc:
  Remove optional arguments
sql/log_event.cc:
  Remove optional arguments
sql/mysql_priv.h:
  Remove optional arguments
  cahnge preapre_create_fields to use pointers instead of references
sql/opt_range.cc:
  Fix arguments so that return value is last
sql/sql_base.cc:
  Remove optional arguments
sql/sql_delete.cc:
  Remove optional arguments
sql/sql_error.cc:
  Remove optional arguments
sql/sql_help.cc:
  Remove optional arguments
sql/sql_parse.cc:
  Remove optional arguments
sql/sql_prepare.cc:
  Remove optional arguments
sql/sql_rename.cc:
  Remove optional arguments
sql/sql_select.cc:
  Remove optional arguments
sql/sql_show.cc:
  Cleanup during review
sql/sql_string.cc:
  Simple optimization
sql/sql_table.cc:
  Remove optional arguments
  Fixed indentation
sql/sql_update.cc:
  Remove optional arguments
sql/sql_yacc.yy:
  Change references to pointers
2005-03-16 16:11:01 +02:00
unknown
380b5819a2 Fix for Bug #8897 Test ndb_autodiscover: Spurious warning in --ps-protocol on NDB 2005-03-09 14:29:22 +01:00
unknown
b1095fb0cd Manual merge SP-locking improvements patch with current tree.
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.
2005-03-04 17:46:45 +03:00
unknown
ac9f68b9fa Better approach for prelocking of tables for stored routines execution
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.
2005-03-04 16:35:28 +03:00
unknown
77d149a476 missing DBUG_RETURN added 2005-02-26 23:46:40 +01:00
unknown
248e449451 Remove compiler warnings and remove not used variables
(Found during build process)


extra/comp_err.c:
  Remove compiler warnings
extra/perror.c:
  Remove compiler warnings
innobase/dict/dict0dict.c:
  Remove compiler warnings
innobase/dict/dict0load.c:
  Remove compiler warnings
innobase/pars/pars0sym.c:
  Remove compiler warnings
innobase/row/row0row.c:
  Remove compiler warnings
innobase/row/row0sel.c:
  Remove compiler warnings
libmysqld/lib_sql.cc:
  Remove not used variables
myisam/mi_key.c:
  Remove compiler warnings
regex/engine.c:
  Added comment
sql/derror.cc:
  Remove not used variables
sql/examples/ha_archive.cc:
  Fixed bug in blob handling
  Removed not used variable
sql/field.cc:
  Remove compiler warnings
  Remove not used variables
sql/filesort.cc:
  Remove compiler warnings
sql/ha_heap.cc:
  Remove not used variable
sql/ha_innodb.cc:
  Remove not used variables
  Remove compiler warnings
sql/handler.cc:
  Remove compiler warnings and remove not used variables
sql/item.cc:
  Remove compiler warnings and remove not used variables
sql/item_subselect.cc:
  Remove compiler warnings
sql/item_sum.cc:
  Remove compiler warnings
sql/item_sum.h:
  Remove compiler warnings and remove not used variables
sql/log.cc:
  Remove compiler warnings and remove not used variables
sql/log_event.cc:
  Remove compiler warnings
sql/mysqld.cc:
  Remove compiler warnings and remove not used variables
sql/opt_range.cc:
  Remove compiler warnings and remove not used variables
sql/slave.cc:
  Remove compiler warnings and remove not used variables
sql/sp_pcontext.cc:
  Remove compiler warnings and remove not used variables
sql/sql_acl.cc:
  Remove compiler warnings and remove not used variables
sql/sql_analyse.cc:
  Remove compiler warnings and remove not used variables
sql/sql_base.cc:
  Remove compiler warnings and remove not used variables
sql/sql_db.cc:
  Remove compiler warnings and remove not used variables
sql/sql_help.cc:
  Remove compiler warnings and remove not used variables
sql/sql_insert.cc:
  Remove compiler warnings and remove not used variables
sql/sql_load.cc:
  Remove compiler warnings and remove not used variables
sql/sql_parse.cc:
  Remove compiler warnings and remove not used variables
sql/sql_prepare.cc:
  Remove compiler warnings and remove not used variables
sql/sql_select.cc:
  Remove compiler warnings and remove not used variables
sql/sql_show.cc:
  Remove compiler warnings and remove not used variables
sql/sql_table.cc:
  Remove compiler warnings
sql/sql_union.cc:
  Remove compiler warnings
sql/sql_update.cc:
  Remove compiler warnings and remove not used variables
sql/sql_yacc.yy:
  Remove compiler warnings and remove not used variables
sql/strfunc.cc:
  Remove compiler warnings and remove not used variables
strings/ctype-ucs2.c:
  Remove compiler warnings
tests/mysql_client_test.c:
  Remove compiler warnings and remove not used variables
tools/mysqlmanager.c:
  Remove compiler warnings and remove not used variables
2005-02-25 16:53:22 +02:00
unknown
d50af8aece Review of new pushed code (XA & other)
Portability fixes and cleanups
Fixed setting of 'res' in mysql_execute_command()


sql/handler.cc:
  delete_table() will not return error for not found files if one handler file was found and deleted
sql/handler.h:
  Incremented MAX_HA so that ndb works again
  Don't convert char pointer to (my_xid*) as we don't know if the address is aligned on 8
sql/log.cc:
  Indentation fixes
  Simplified loop to find next log
  Fixed race condition in reset_logs that caused mix_innodb_myisam_binlog to fail
sql/log_event.cc:
  Don't convert char pointer to (my_xid*) as we don't know if the address is aligned on 8
sql/sql_acl.cc:
  Convert db name directly to avoid extra strmov
sql/sql_base.cc:
  Added comment
  Removed not needed code
sql/sql_db.cc:
  Added comment
  Remove not needed code
sql/sql_parse.cc:
  Always call mysql_rm_db() with lower case db name
  Ensure that 'res' is set correctly in mysql_execute_command()
  (One don't have to set res if one calls my_error() and res should be = 0 for correct commands)
sql/sql_repl.cc:
  Indentation fixes
  use packet->ptr() instead of packet->c_ptr()
sql/sql_table.cc:
  Join similar code when table didn't exist in engine
2005-02-21 14:47:57 +02:00
unknown
6c8ae9d65e Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/my/mysql-5.0


BUILD/SETUP.sh:
  Auto merged
mysql-test/r/ps_6bdb.result:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/my_decimal.cc:
  Auto merged
sql/my_decimal.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
2005-02-19 19:00:41 +02:00
unknown
64cc538bda Fixed BUILD script to use --with-berkeley-db instead of --with-bdb
Lots of small fixes to multi-precision-math path
Give Note for '123.4e'
Added helper functions type 'val_string_from_real()
Don't give warnings for end space for string2decimal()
Changed storage of values for SP so that we can detect length of argument without strlen()
Changed interface for str2dec() so that we must supple the pointer to the last character in the buffer



BUILD/SETUP.sh:
  with-bdb ->with-berkeley-db
include/decimal.h:
  Make string2decimal and string2decimal_fixed inline
mysql-test/r/func_group.result:
  More tests (to find bugs in precision math fixes)
mysql-test/r/func_set.result:
  Test to cover more Item_func_field::val_xxx() code
mysql-test/r/ps_6bdb.result:
  update results
mysql-test/r/type_decimal.result:
  New tests
  Give note for '123.4e'
mysql-test/r/type_newdecimal.result:
  Number of decimal changes (probably right, but hard to verify)
mysql-test/t/func_group.test:
  More tests (to find bugs in precision math fixes)
mysql-test/t/func_set.test:
  Test to cover more Item_func_field::val_xxx() code
mysql-test/t/type_decimal.test:
  New tests to cover more cases in decimal.c
sql/item.cc:
  Added helper functions type 'val_string_from_real()'
  Use new interfase to str2my_decimal()
  Moved nr_of_decimals() here (and made it static)
sql/item.h:
  Added helper functions type 'val_string_from_real()'
sql/item_func.cc:
  Style fixes
  Trivial optimizations
  Ensure null_value is set if my_decimal_add/sub/mul/div returns error
  Remove not needed Item_func_int_div::val_str()
  Join Item_func_signproc and Item_func_neg
  Fix that FIELD() works when first argument is NULL or one if it's arguments are NULL
  new str2my_decimal interface
sql/item_func.h:
  Make Item_func_int_div inherit from Item_int_func (allows us to remove some virtual functions)
  Join Item_func_signproc & Item_func_neg
sql/item_strfunc.cc:
  Move nr_of_decmails() to Item.cc (as it was only used here)
sql/item_sum.cc:
  Style fixes
  Change a lot of code to use new helper converter functions in item.cc
  Moved Item_sum::val_decimal() to Item_sum_int::val_decimal()
  Fixed calls to wrong functions (Item_sum_num::val_int())
  Ensure that all hybrid functions checks hybrid_type in val_xxx() (As there is no gurantee that they are called in the right context)
  Simplify key_length allocation in Item_sum_sum_distinct()
  Simplified create_tmp_field() and reset_field()
  Fixed potential error in Item_sum_hybrid::reset_field()
  Optimize Item_sum_avg::update_field()
  Item_std_field() functions musted be fully coded becasue Item_variance_field::val_xxx functions called helper functions
  Coded missing Item_sum_ufd_xxx::val_decimal() functions
sql/item_sum.h:
  Moved Item_sum::val_decimal() to Item_sum_int::val_decimal()
  Added missing Item_sum_ufd_xxx::val_decimal() functions
  Removed not used scale() function.
  Fixed that Item_std_field() works with decimal arguments
  Fixed that CREATE ... STD() will create a REAL field
sql/log_event.cc:
  Ensure that we use same format for all types
sql/my_decimal.cc:
  Don't give warnings for end space for string2decimal()
  Added dbug_print_decimal()
sql/my_decimal.h:
  Style fixes
  Prototypes for new functions
  New interface for str2my_decimal()
sql/mysql_priv.h:
  Made nr_of_decimals() static
sql/protocol.cc:
  Simplify code (by assume that decimal can't be bigger than DECIMAL_MAX_STR_LENGTH]
sql/protocol_cursor.cc:
  Changed storage of values for SP so that we can detect length of argument without strlen()
sql/sp_head.cc:
  Simplify code for decimal handling by letting item handling conversion to decimal
sql/sp_rcontext.cc:
  Use new method to get length of arguments
sql/sql_analyse.cc:
  if -> switch
  Increase 'empty' if decimal value=0
  Remove usage of strcat()
sql/sql_base.cc:
  Remove unnecessary checks
sql/sql_class.cc:
  Remove not needed 'else'
  Removed not used variables
sql/sql_select.cc:
  remove test for impossible condtion
strings/decimal.c:
  Made two trivial functions macros
  Changed interface for str2dec() so that we must supple the pointer to the last character in the buffer
  This safer than before as we don't require an end \0 anymore (old code gave wrong answers in MySQL for some internals strings that where not \0 terminated)
  Detect error numbers of type '12.55e'
  str2dec() will now set 'to' to zero in case of errors
2005-02-19 18:58:27 +02:00
unknown
61a88ff0a1 Merge serg.mylan:/usr/home/serg/Abk/mysql-5.0
into serg.mylan:/usr/home/serg/Abk/mysql-5.0-xa


configure.in:
  Auto merged
mysql-test/r/drop_temp_table.result:
  Auto merged
mysql-test/r/innodb.result:
  Auto merged
mysql-test/t/innodb.test:
  Auto merged
sql/ha_innodb.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
2005-02-18 12:02:46 +01:00
unknown
90cc9c6bb6 Merge
BitKeeper/triggers/post-commit:
  Auto merged
mysql-test/r/lowercase_table2.result:
  Auto merged
mysql-test/r/variables.result:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
mysql-test/r/system_mysql_db.result:
  Update results
scripts/mysql_create_system_tables.sh:
  Merge fix for Bug #7617, making enum fields in grant tables
  case-insensitive.
scripts/mysql_fix_privilege_tables.sql:
  Merge fix for Bug #7617, and fix additional enum/set columns.
sql/sql_acl.cc:
  Hand-merge due to whitespace change
sql/sql_lex.cc:
  Hand-merge bug fix.
2005-02-17 16:16:58 -08:00
unknown
cb8b1cf3e7 Merge mysql.com:/home/jimw/my/mysql-4.1-8355
into mysql.com:/home/jimw/my/mysql-4.1-clean


sql/sql_base.cc:
  Auto merged
2005-02-17 13:48:34 -08:00
unknown
2071fe55c4 Fixes after 4.1->5.0 merge.
mysql-test/r/rpl_multi_query.result:
  result update
mysql-test/t/rpl_multi_query.test:
  binlog position changes from 4.1 to 5.0
sql/sql_base.cc:
  Manually putting back the old code (like I did in 4.1 already, as the 2nd fix for BUG#8055 does not need to change sql_base.cc anymore)
2005-02-16 23:23:20 +01:00
unknown
4cead8c8a5 1) undoing my fix for BUG#8055 "Trouble with replication from temporary tables and ignores"
and fixing it another way (per Monty; a simpler solution which does not increase the number
of binlog events is to always execute DROP TEMPORARY TABLE IF EXISTS on slave). A new test rpl_drop_temp.
2) fixing BUG#8436 "Multiple "stacked" SQL statements cause replication to stop" by setting
thd->query_length to the length of the query being executed, not counting the next queries
if this is a multi-query. Should also improve display of SHOW PROCESSLIST. A new test rpl_multi_query.



mysql-test/r/drop_temp_table.result:
  back to one single DROP
sql/sql_base.cc:
  undoing the fix I had made some days ago: we are back to one single DROP TEMPORARY TABLE for all temp tables.
sql/sql_parse.cc:
  1) set thd->query_length to the length of the query being executed, excluding the other next queries
  if this is a multi-query. The setting happens ASAP, ie. just after we know it's a multi-query, ie. just after yyparse().
  Don't include the ';' in thd->query_length, because this is not good for storage in binlog.
  2) always execute a DROP TEMPORARY TABLE IF EXISTS on slave, don't skip it even if --replicate-ignore-table
2005-02-14 23:47:17 +01:00
unknown
2d8b51991c manually merged
client/mysqlbinlog.cc:
  Auto merged
configure.in:
  Auto merged
include/my_global.h:
  Auto merged
include/my_pthread.h:
  Auto merged
innobase/trx/trx0trx.c:
  Auto merged
mysql-test/include/varchar.inc:
  Auto merged
mysql-test/r/bdb.result:
  Auto merged
mysql-test/r/myisam.result:
  Auto merged
mysql-test/r/mysqlbinlog2.result:
  Auto merged
mysql-test/t/ctype_ucs.test:
  Auto merged
mysql-test/t/user_var.test:
  Auto merged
mysys/hash.c:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/log_event.h:
  Auto merged
sql/set_var.h:
  Auto merged
sql/slave.cc:
  Auto merged
sql/slave.h:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_repl.cc:
  Auto merged
sql/sql_repl.h:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_trigger.cc:
  Auto merged
mysql-test/r/ctype_ucs.result:
  ul
mysql-test/r/drop_temp_table.result:
  ul
mysql-test/r/innodb.result:
  ul
mysql-test/r/insert_select.result:
  ul
mysql-test/r/mix_innodb_myisam_binlog.result:
  ul
mysql-test/r/rpl_change_master.result:
  ul
mysql-test/r/rpl_charset.result:
  ul
mysql-test/r/rpl_error_ignored_table.result:
  ul
mysql-test/r/rpl_flush_log_loop.result:
  ul
mysql-test/r/rpl_flush_tables.result:
  ul
mysql-test/r/rpl_loaddata.result:
  ul
mysql-test/r/rpl_loaddata_rule_m.result:
  ul
mysql-test/r/rpl_log.result:
  ul
mysql-test/r/rpl_max_relay_size.result:
  ul
mysql-test/r/rpl_relayrotate.result:
  ul
mysql-test/r/rpl_replicate_do.result:
  ul
mysql-test/r/rpl_rotate_logs.result:
  ul
mysql-test/r/rpl_temporary.result:
  ul
mysql-test/r/rpl_timezone.result:
  ul
mysql-test/r/rpl_until.result:
  ul
mysql-test/r/rpl_user_variables.result:
  ul
mysql-test/r/user_var.result:
  ul
2005-02-14 21:50:09 +01:00
unknown
930da62bea Merge serg.mylan:/usr/home/serg/Abk/m50-broken
into serg.mylan:/usr/home/serg/Abk/mysql-5.0


sql/sql_base.cc:
  Auto merged
2005-02-09 13:48:31 +01:00
unknown
1de817e9c4 Fix removal of tables from cache when the database they are contained
within is dropped and lower_case_table_names is set. (Bug #8355)


mysql-test/t/lowercase_table2.test:
  Add new regression test
mysql-test/r/lowercase_table2.result:
  Add results for regression test
sql/mysql_priv.h:
  Change remove_db_from_cache() to use char* instead of my_string
sql/sql_base.cc:
  Lowercase database name in remove_db_from_cache so
  that all of the correct entries are removed.
2005-02-08 15:14:14 -08:00
unknown
f4eef98e6e Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-5.0
into deer.(none):/home/hf/work/mysql-5.0.clean


mysql-test/r/view.result:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/sp_head.cc:
  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_show.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2005-02-09 02:54:08 +04:00
unknown
91db48e35a Precision Math implementation
BitKeeper/etc/ignore:
  Added client/decimal.c client/my_decimal.cc client/my_decimal.h to the ignore list
2005-02-09 02:50:45 +04:00
unknown
3f24932124 WL#2130: Table locking for stored FUNCTIONs
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.
2005-02-08 20:52:50 +01:00
unknown
2359f1fa3e Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-5.0
into gluh.mysql.r18.ru:/home/gluh/MySQL/mysql-5.0


sql/sql_base.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.h:
  Auto merged
2005-02-07 11:57:14 +03:00
unknown
57902c74ec Merge
BitKeeper/deleted/.del-acinclude.m4~f4ab416bac5003:
  Auto merged
configure.in:
  Auto merged
include/mysql.h:
  Auto merged
scripts/Makefile.am:
  Auto merged
mysql-test/r/drop_temp_table.result:
  SCCS merged
sql/sql_base.cc:
  SCCS merged
2005-02-05 18:07:50 +01:00
unknown
d52afba56a Outer joins cleanup: Remove TABLE::outer_join and use TABLE::maybe_null only (2nd patch after Monty's comments).
sql/mysql_priv.h:
  Outer joins cleanup: Remove TABLE::outer_join and use TABLE::maybe_null only.
sql/opt_range.cc:
  Outer joins cleanup: Remove TABLE::outer_join and use TABLE::maybe_null only.
sql/sql_base.cc:
  Outer joins cleanup: Remove TABLE::outer_join and use TABLE::maybe_null only.
sql/sql_select.cc:
  Outer joins cleanup: Remove TABLE::outer_join and use TABLE::maybe_null only.
sql/table.h:
  Outer joins cleanup: 
   * Remove TABLE::outer_join and use TABLE::maybe_null only.
   * Added comments.
2005-02-05 18:16:29 +03:00
unknown
ededf83143 Fix for BUG#8055 "Trouble with replication from temporary tables and ignores":
when we close the session's temp tables at session end, we automatically write to binlog *one* DROP TEMPORARY TABLE *per tmp table*.


mysql-test/r/drop_temp_table.result:
  result update (note: one DROP TEMPORARY TABLE per tmp table)
mysql-test/t/drop_temp_table.test:
  checking that we have one DROP TEMPORARY TABLE per tmp table now, not one multi-table DROP.
  Hiding columns Log_pos/End_log_pos per Monty's request.
sql/sql_base.cc:
  When we close the session's temp tables at session end, we automatically write to binlog one DROP TEMPORARY TABLE per tmp table, 
  not one single multi-table DROP TEMPORARY TABLE (because it causes problems if slave has --replicate*table rules).
2005-02-04 22:43:54 +01:00
unknown
95772f4505 Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-5.0
into gluh.mysql.r18.ru:/home/gluh/MySQL/mysql-5.0


sql/sql_base.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
2005-02-03 20:46:53 +03:00
unknown
4f1cbb6031 4.1 -> 5.0 merge
BitKeeper/etc/logging_ok:
  auto-union
Build-tools/Do-compile:
  Auto merged
client/mysqladmin.cc:
  Auto merged
client/mysqldump.c:
  Auto merged
configure.in:
  Auto merged
extra/perror.c:
  Auto merged
innobase/buf/buf0rea.c:
  Auto merged
innobase/fil/fil0fil.c:
  Auto merged
innobase/include/rem0rec.ic:
  Auto merged
innobase/include/univ.i:
  Auto merged
innobase/os/os0file.c:
  Auto merged
innobase/ut/ut0ut.c:
  Auto merged
mysql-test/r/derived.result:
  Auto merged
mysql-test/r/func_str.result:
  Simple merge
mysql-test/r/subselect.result:
  Automatic merge
mysql-test/t/derived.test:
  Automatic merge
mysql-test/t/func_str.test:
  Simple merge
mysql-test/t/subselect.test:
  Automatic merge
mysys/my_handler.c:
  Automatic merge
ndb/src/kernel/blocks/backup/Backup.cpp:
  Automatic merge
scripts/make_binary_distribution.sh:
  Automatic merge
scripts/mysql_install_db.sh:
  Automatic merge
sql/examples/ha_archive.cc:
  Simple merge
sql/ha_innodb.cc:
  Automatic merge
sql/item.cc:
  Merge
sql/item_cmpfunc.h:
  Automatic merge
sql/item_func.cc:
  Simple merge
sql/item_func.h:
  Automatic merge
sql/item_strfunc.cc:
  Automatic merge
sql/item_strfunc.h:
  Automatic merge
sql/item_subselect.cc:
  Automatic merge
sql/mysqld.cc:
  Automatic merge
sql/set_var.cc:
  Automatic merge
sql/sql_base.cc:
  Automatic merge
sql/sql_class.cc:
  Automatic merge
sql/sql_class.h:
  Automatic merge
sql/sql_lex.cc:
  Automatic merge
sql/sql_lex.h:
  Automatic merge
sql/sql_parse.cc:
  Automatic merge
sql/sql_select.cc:
  Automatic merge
sql/sql_table.cc:
  Automatic merge
sql/sql_update.cc:
  Simple merge
strings/ctype-big5.c:
  Automatic merge
strings/ctype-bin.c:
  Automatic merge
strings/ctype-gbk.c:
  Automatic merge
strings/ctype-latin1.c:
  Automatic merge
strings/ctype-mb.c:
  Automatic merge
strings/ctype-simple.c:
  Automatic merge
strings/ctype-sjis.c:
  Automatic merge
strings/ctype-tis620.c:
  Automatic merge
strings/ctype-ucs2.c:
  Automatic merge
strings/ctype-utf8.c:
  Automatic merge
vio/viosocket.c:
  Automatic merge
vio/viossl.c:
  Automatic merge
2005-02-03 13:18:30 +02:00
unknown
9fe76ad98b Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1
into sanja.is.com.ua:/home/bell/mysql/bk/work-4.1


sql/item.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
2005-02-01 11:05:29 +02:00
unknown
5ee855c850 unused variable removed 2005-01-30 10:46:09 +01:00
unknown
7f39357efe Fix after review for
ChangeSet
  1.1803 05/01/24
  Additional fix for WL#1629: SHOW with WHERE(discussed with PeterG)
2005-01-27 11:06:44 +03:00
unknown
37c4eadb46 Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-5.0
into gluh.mysql.r18.ru:/home/gluh/MySQL/mysql-5.0


sql/sql_base.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
2005-01-25 11:42:50 +03:00
unknown
a82fd1eaec merged
BitKeeper/deleted/.del-sort.c~e2e56b5a37ce86f4:
  Auto merged
client/mysql.cc:
  Auto merged
client/mysqlbinlog.cc:
  Auto merged
client/mysqldump.c:
  Auto merged
client/mysqltest.c:
  Auto merged
myisam/ft_boolean_search.c:
  Auto merged
myisam/mi_packrec.c:
  Auto merged
myisam/sort.c:
  Auto merged
mysql-test/r/fulltext.result:
  Auto merged
sql/item_create.cc:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_acl.h:
  Auto merged
sql/sql_analyse.cc:
  Auto merged
sql/sql_cache.cc:
  Auto merged
sql/sql_db.cc:
  Auto merged
sql/tztime.cc:
  Auto merged
tests/client_test.c:
  Auto merged
2005-01-24 19:41:42 +01:00
unknown
e9db02074f Additional fix for WL#1629: SHOW with WHERE(discussed with PeterG)
- Do not allow a column list as part of SHOW WITH WHERE task.
 - The WHERE clause must accept field names which are
   valid in SHOW, not INFORMATION_SCHEMA names.


mysql-test/r/information_schema.result:
  The test correction
mysql-test/t/information_schema.test:
  The test correction
sql/sql_base.cc:
  Process field translation table for 'show' commands
sql/sql_parse.cc:
  schema_table_seformed is always true for 'show' commands
sql/sql_show.cc:
  - Do not allow a column list as part of SHOW WITH WHERE task.
  - The WHERE clause must accept field names which are
    valid in SHOW, not INFORMATION_SCHEMA names.
sql/sql_yacc.yy:
  Do not allow a column list as part of SHOW WITH WHERE task
sql/table.h:
  A new 'schema_table_reformed' variable in table_list
  If schema_table_reformed is true select items should be 
  translated using field translation table
2005-01-24 18:44:54 +03:00
unknown
38e664cf64 fixed way of forward reference detection to support literal constant (BUG#8025)
mysql-test/r/subselect.result:
  Forward reference detection
mysql-test/t/subselect.test:
  Forward reference detection
sql/item.cc:
  now forward reference is detected via ref_pointer_array, because some literal constants are 'fixed' just after creation
sql/sql_base.cc:
  fill ref_pointer_array with zerows for forward reference detection.
2005-01-24 17:17:19 +02:00
unknown
8bdb500105 fixes/cleanups according to Coverity report 2005-01-24 15:48:25 +01:00
unknown
6130a3ad7c View field names should be case insensitive 2005-01-19 16:19:10 +03:00
unknown
88bd301d36 XA (not completely polished out yet)
include/my_pthread.h:
  cleanup. don't use gcc extensions
innobase/include/trx0sys.ic:
  Jan's fix for innobase_xa_prepare
innobase/read/read0read.c:
  Jan's fix for innobase_xa_prepare
innobase/trx/trx0trx.c:
  Jan's fix for innobase_xa_prepare
mysql-test/include/varchar.inc:
  test fix
mysql-test/r/ctype_ucs.result:
  new log event - all binlog positions are changed :(
mysql-test/r/drop_temp_table.result:
  new log event - all binlog positions are changed :(
mysql-test/r/insert_select.result:
  new log event - all binlog positions are changed :(
mysql-test/r/mix_innodb_myisam_binlog.result:
  new log event - all binlog positions are changed :(
mysql-test/r/myisam.result:
  test fix
mysql-test/r/rpl000015.result:
  new log event - all binlog positions are changed :(
mysql-test/r/rpl_change_master.result:
  new log event - all binlog positions are changed :(
mysql-test/r/rpl_charset.result:
  new log event - all binlog positions are changed :(
mysql-test/r/rpl_error_ignored_table.result:
  new log event - all binlog positions are changed :(
mysql-test/r/rpl_flush_log_loop.result:
  new log event - all binlog positions are changed :(
mysql-test/r/rpl_flush_tables.result:
  new log event - all binlog positions are changed :(
mysql-test/r/rpl_loaddata.result:
  new log event - all binlog positions are changed :(
mysql-test/r/rpl_loaddata_rule_m.result:
  new log event - all binlog positions are changed :(
mysql-test/r/rpl_loaddata_rule_s.result:
  new log event - all binlog positions are changed :(
mysql-test/r/rpl_log.result:
  new log event - all binlog positions are changed :(
mysql-test/r/rpl_log_pos.result:
  new log event - all binlog positions are changed :(
mysql-test/r/rpl_max_relay_size.result:
  new log event - all binlog positions are changed :(
mysql-test/r/rpl_relayrotate.result:
  new log event - all binlog positions are changed :(
mysql-test/r/rpl_replicate_do.result:
  new log event - all binlog positions are changed :(
mysql-test/r/rpl_reset_slave.result:
  new log event - all binlog positions are changed :(
mysql-test/r/rpl_rotate_logs.result:
  new log event - all binlog positions are changed :(
mysql-test/r/rpl_server_id1.result:
  new log event - all binlog positions are changed :(
mysql-test/r/rpl_server_id2.result:
  new log event - all binlog positions are changed :(
mysql-test/r/rpl_temporary.result:
  new log event - all binlog positions are changed :(
mysql-test/r/rpl_timezone.result:
  new log event - all binlog positions are changed :(
mysql-test/r/rpl_until.result:
  new log event - all binlog positions are changed :(
mysql-test/r/rpl_user_variables.result:
  new log event - all binlog positions are changed :(
mysql-test/r/user_var.result:
  new log event - all binlog positions are changed :(
mysql-test/t/ctype_ucs.test:
  new log event - all binlog positions are changed :(
mysql-test/t/mix_innodb_myisam_binlog.test:
  new log event - all binlog positions are changed :(
mysql-test/t/mysqlbinlog.test:
  new log event - all binlog positions are changed :(
mysql-test/t/mysqlbinlog2.test:
  new log event - all binlog positions are changed :(
mysql-test/t/rpl_charset.test:
  new log event - all binlog positions are changed :(
mysql-test/t/rpl_error_ignored_table.test:
  new log event - all binlog positions are changed :(
mysql-test/t/rpl_loaddata_rule_m.test:
  new log event - all binlog positions are changed :(
mysql-test/t/rpl_loaddata_rule_s.test:
  new log event - all binlog positions are changed :(
mysql-test/t/rpl_log.test:
  new log event - all binlog positions are changed :(
mysql-test/t/rpl_log_pos.test:
  new log event - all binlog positions are changed :(
mysql-test/t/rpl_user_variables.test:
  new log event - all binlog positions are changed :(
mysql-test/t/user_var.test:
  new log event - all binlog positions are changed :(
mysys/hash.c:
  typo fixed
sql/ha_berkeley.cc:
  handlerton framework
sql/ha_berkeley.h:
  handlerton framework
sql/ha_innodb.cc:
  handlerton framework
sql/ha_innodb.h:
  handlerton framework
sql/handler.cc:
  new transaction handling, handlerton framework, two-phase commit, XA support
sql/handler.h:
  new transaction handling, handlerton framework, two-phase commit, XA support
sql/lex.h:
  XA commands
sql/log.cc:
  new transaction handling, handlerton framework, two-phase commit,
  XA support, tc-logging, TC_LOG_MMAP class
sql/log_event.cc:
  Xid_log_event
sql/log_event.h:
  Xid_log_event, LOG_EVENT_BINLOG_CLOSED_F flag
sql/mysql_priv.h:
  wrapper for query_id++
sql/mysqld.cc:
  new command-line options --log-tc, --log-tc-size, --tc-heuristic-recover,
  new status variables Tc_log_page_size, Tc_log_max_pages_used, Tc_log_page_waits.
  init/stop tc logging
sql/set_var.h:
  warning fixed
sql/share/errmsg.txt:
  XA error messages
sql/sp_head.cc:
  s/query_id++/next_query_id()/
sql/sql_base.cc:
  typo fixed. new transaction handling.
sql/sql_class.cc:
  cleanup of THD.transaction
sql/sql_class.h:
  TC_LOG classes, new status variables, new savepoint handling, XA support
sql/sql_insert.cc:
  comments
sql/sql_lex.cc:
  s/found_colon/found_semicolon/
sql/sql_lex.h:
  SQLCOM_XA_xxx, XA related changes in Lex
sql/sql_parse.cc:
  cleanup, XA commands, new savepoint handling
sql/sql_repl.cc:
  two functions moved to log.cc
sql/sql_repl.h:
  two functions moved to log.cc
sql/sql_trigger.cc:
  s/lex.name_and_length/lex.ident/
sql/sql_yacc.yy:
  XA commands, cleanup
2005-01-16 13:16:23 +01:00
unknown
6ead860060 After merge fixes
Fix for BIT(X) field as string


mysql-test/r/func_gconcat.result:
  Fix wrong merge
mysql-test/r/func_sapdb.result:
  Use results so that dimitry can fix them properly
mysql-test/r/innodb.result:
  Update test after fast TRUNCATE in InnoDB
mysql-test/r/ps_1general.result:
  After megre fixes
mysql-test/r/type_bit.result:
  New test to verify patch for Bit fields
mysql-test/t/ps_1general.test:
  After merge fixes
mysql-test/t/type_bit.test:
  New test to verify patch for Bit fields
sql/field.cc:
  Fix for new my_strntod()
  Fix for BIT(X) field as string
sql/item.h:
  Fix for new my_strntod()
sql/item_func.h:
  Fix for new my_strntod()
sql/item_sum.h:
  Fix for new my_strntod()
sql/procedure.h:
  Fix for new my_strntod()
sql/sql_base.cc:
  Port fix for INSERT DELAYED with prepared statements to 5.0
2005-01-15 17:38:43 +02:00
unknown
0cbd58c52b Merge with 4.1
BitKeeper/etc/ignore:
  auto-union
Build-tools/Do-compile:
  Auto merged
client/mysqladmin.cc:
  Auto merged
heap/hp_create.c:
  Auto merged
heap/hp_write.c:
  Auto merged
include/my_sys.h:
  Auto merged
innobase/data/data0type.c:
  Auto merged
innobase/include/row0mysql.h:
  Auto merged
innobase/os/os0file.c:
  Auto merged
innobase/rem/rem0cmp.c:
  Auto merged
innobase/row/row0sel.c:
  Auto merged
innobase/srv/srv0start.c:
  Auto merged
mysql-test/r/ctype_latin1_de.result:
  Auto merged
mysql-test/r/ctype_tis620.result:
  Auto merged
mysql-test/r/ctype_ucs.result:
  Auto merged
mysql-test/r/ctype_ujis.result:
  Auto merged
mysql-test/r/ctype_utf8.result:
  Auto merged
mysql-test/r/func_gconcat.result:
  Auto merged
mysql-test/r/func_sapdb.result:
  Auto merged
mysql-test/r/show_check.result:
  Auto merged
mysql-test/r/type_float.result.es:
  Auto merged
mysql-test/r/type_float.result:
  Auto merged
mysql-test/r/type_timestamp.result:
  Auto merged
mysql-test/t/ctype_ucs.test:
  Auto merged
mysql-test/t/func_sapdb.test:
  Auto merged
mysql-test/t/show_check.test:
  Auto merged
mysql-test/t/type_float.test:
  Auto merged
mysql-test/t/type_timestamp.test:
  Auto merged
mysys/mf_iocache.c:
  Auto merged
ndb/src/kernel/vm/Configuration.cpp:
  Auto merged
scripts/mysql_install_db.sh:
  Auto merged
sql/field.cc:
  Auto merged
sql/ha_berkeley.cc:
  Auto merged
sql/ha_innodb.cc:
  Auto merged
sql/item_sum.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
strings/ctype-big5.c:
  Auto merged
strings/ctype-bin.c:
  Auto merged
strings/ctype-czech.c:
  Auto merged
strings/ctype-gbk.c:
  Auto merged
strings/ctype-latin1.c:
  Auto merged
strings/ctype-mb.c:
  Auto merged
strings/ctype-simple.c:
  Auto merged
strings/ctype-sjis.c:
  Auto merged
strings/ctype-tis620.c:
  Auto merged
strings/ctype-uca.c:
  Auto merged
strings/ctype-ucs2.c:
  Auto merged
strings/ctype-utf8.c:
  Auto merged
strings/ctype-win1250ch.c:
  Auto merged
configure.in:
  Use local values
mysql-test/r/ps_1general.result:
  Update results
mysql-test/t/func_gconcat.test:
  no changes
mysql-test/t/ps_1general.test:
  Use local code
ndb/src/common/util/version.c:
  Use local code
sql/filesort.cc:
  Empty line changes
sql/ha_heap.cc:
  Merge
sql/item_timefunc.cc:
  Keep local code
sql/mysql_priv.h:
  Update to 5.0
sql/sql_show.cc:
  Hand merge
support-files/mysql.spec.sh:
  No changes
2005-01-15 14:09:45 +02:00
unknown
177e99f327 Fix bug in INSERT DELAYED with prepared statements
The bug was that if you have two TL_WRITE_DELAYED at the same time,
mi_lock_databases() could be done in the wrong order and we could write the wrong header to the MyISAM index file.


sql/mysql_priv.h:
  Fix bug in insert delayed with prepared statements
sql/sql_base.cc:
  Fix bug in insert delayed with prepared statements
sql/sql_prepare.cc:
  Fix bug in insert delayed with prepared statements
  The bug was that if you have two TL_WRITE_DELAYED at the same time,
  mi_lock_databases() could be done in the wrong order and we could write the wrong header to the MyISAM index file.
2005-01-14 00:09:15 +02:00
unknown
c7fbf424c7 Merging fixed 2005-01-11 23:28:56 +04:00
unknown
4f113ac4f3 Merging conflicts resolved
VC++Files/libmysqld/libmysqld.dsp:
  Auto merged
client/mysql.cc:
  Auto merged
include/my_sys.h:
  Auto merged
libmysqld/lib_sql.cc:
  Auto merged
mysql-test/r/ctype_utf8.result:
  Auto merged
ndb/src/kernel/blocks/backup/Backup.cpp:
  Auto merged
ndb/src/kernel/blocks/suma/Suma.cpp:
  Auto merged
ndb/src/mgmsrv/InitConfigFileParser.cpp:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/strfunc.cc:
  Auto merged
VC++Files/sql/mysqld.dsp:
  Libraries changed
mysys/default.c:
  get_defaults_files implementation added
sql/sql_base.cc:
  merging
sql/sql_show.cc:
  merging
2005-01-11 21:00:53 +04:00
unknown
c9079c1340 - Housekeeping: removed a few unreferenced variables, noticed while doing
Windows builds


sql/sql_base.cc:
  - removed an unreferenced variable
sql/strfunc.cc:
  - removed an unreferenced variable
2005-01-11 15:38:03 +01:00
unknown
4290679b75 don't cast lvalue 2005-01-07 14:25:48 +02:00
unknown
615cd4ff75 Fixed a bug in prepared statements error handling
After merge fixes


libmysql/libmysql.c:
  Fixed a bug in prepared statements error handling introduced by me on a recent patch
mysql-test/r/delayed.result:
  Updated results
mysql-test/t/delayed.test:
  Bigger timeout needed when using --ps-protocol (don't understand why yet)
  Added output of not_flushed_dealyed_rows for easier debugging
sql/sql_base.cc:
  USE tables_share fix for prepared statements
sql/sql_prepare.cc:
  After merge fix
2005-01-06 16:59:29 +02:00
unknown
8ff8867251 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/my/mysql-5.0


sql/item_func.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
2005-01-06 13:31:31 +02:00
unknown
acf76e3b88 First stage of table definition cache
Split TABLE to TABLE and TABLE_SHARE (TABLE_SHARE is still allocated as part of table, will be fixed soon)
Created Field::make_field() and made Field_num::make_field() to call this
Added 'TABLE_SHARE->db' that points to database name; Changed all usage of table_cache_key as database name to use this instead
Changed field->table_name to point to pointer to alias. This allows us to change alias for a table by just updating one pointer.
Renamed TABLE_SHARE->real_name to table_name
Renamed TABLE->table_name to alias
Renamed TABLE_LIST->real_name to table_name


include/myisam.h:
  Added const before names
mysql-test/r/group_min_max.result:
  Make results repeatable
mysql-test/t/group_min_max.test:
  Make results repeatable
sql/field.cc:
  Created Field::make_field() and made Field_num::make_field() to call this
  Use TABLE_SHARE
  Use sql_strmake() instead of sql_memdup() to simplify code
sql/field.h:
  Changed table_name to be pointer to table_name. This allows us to change alias for all fields by just changing one pointer.
  Use TABLE_SHARE
sql/field_conv.cc:
  Use TABLE_SHARE
sql/filesort.cc:
  Use TABLE_SHARE
sql/ha_berkeley.cc:
  Use TABLE_SHARE
sql/ha_heap.cc:
  Use TABLE_SHARE
sql/ha_innodb.cc:
  Use TABLE_SHARE
sql/ha_myisam.cc:
  Use TABLE_SHARE
sql/ha_myisammrg.cc:
  Use TABLE_SHARE
  Change some pointer handling to use const char*
sql/ha_ndbcluster.cc:
  Use TABLE_SHARE
sql/handler.cc:
  Use TABLE_SHARE
sql/item.cc:
  Use TABLE_SHARE
sql/item_func.cc:
  Use TABLE_SHARE
sql/item_subselect.cc:
  Use TABLE_SHARE
sql/item_sum.cc:
  Use TABLE_SHARE
sql/key.cc:
  Use TABLE_SHARE
sql/lock.cc:
  Use TABLE_SHARE
sql/log_event.cc:
  real_name -> table_name
sql/mysql_priv.h:
  Use TABLE_SHARE
sql/opt_range.cc:
  Use TABLE_SHARE
sql/opt_sum.cc:
  Use TABLE_SHARE
sql/records.cc:
  Use TABLE_SHARE
sql/repl_failsafe.cc:
  real_name -> table_name
sql/slave.cc:
  Use TABLE_SHARE
sql/sp.cc:
  Use TABLE_SHARE
sql/sp_head.cc:
  real_name -> table_name
sql/sql_acl.cc:
  Use TABLE_SHARE
  removed unnecessary assert
  fixed indentation
  changed some char * -> const char*
sql/sql_acl.h:
  changed some char* -> const char*
sql/sql_base.cc:
  Use TABLE_SHARE
sql/sql_cache.cc:
  Use TABLE_SHARE
sql/sql_class.cc:
  Use TABLE_SHARE
sql/sql_db.cc:
  real_name -> table_name
sql/sql_delete.cc:
  Use TABLE_SHARE
sql/sql_derived.cc:
  Use TABLE_SHARE
sql/sql_handler.cc:
  Use TABLE_SHARE
sql/sql_help.cc:
  Use TABLE_SHARE
sql/sql_insert.cc:
  Use TABLE_SHARE
sql/sql_load.cc:
  Use TABLE_SHARE
sql/sql_parse.cc:
  Use TABLE_SHARE
sql/sql_rename.cc:
  real_name -> table_name
sql/sql_select.cc:
  Use TABLE_SHARE
  table->blob_fields now points to field offsets, not fields
  tmp_table->table_name now points to alias name
sql/sql_show.cc:
  Use TABLE_SHARE
sql/sql_table.cc:
  Use TABLE_SHARE
sql/sql_test.cc:
  Use TABLE_SHARE
sql/sql_trigger.cc:
  Use TABLE_SHARE
sql/sql_udf.cc:
  Use TABLE_SHARE
sql/sql_union.cc:
  real_name -> table_name
sql/sql_update.cc:
  Use TABLE_SHARE
sql/sql_view.cc:
  Use TABLE_SHARE
sql/table.cc:
  Split TABLE to TABLE and TABLE_SHARE
  Changed blob_field to be field offsets instead of pointer to fields
  Only initialize table->s->default_values with default record (not all table->record[#])
  Some indentation changes
sql/table.h:
  Split TABLE to TABLE and TABLE_SHARE
sql/tztime.cc:
  real_name -> table_name
sql/unireg.cc:
  Use TABLE_SHARE
sql/unireg.h:
  Use TABLE_SHARE
2005-01-06 13:00:13 +02:00
unknown
47dc78e6a3 fixed views with PS protocol
mysql-test/r/view.result:
  query cache part moved to separate test
mysql-test/t/view.test:
  query cache part moved to separate test
sql/item_func.cc:
  fixed for safety
sql/sql_base.cc:
  do not use real table call with view
  fixed wrapping * substitured items
  fixed fix_fields call parameter (refference)
sql/sql_yacc.yy:
  added initialisation of SELECT in commands which can use subqueries
sql/table.cc:
  fised fix_fields call parameter
sql/table.h:
  new view specific method
2005-01-05 16:48:23 +02:00
unknown
4fd1524c0a reverting the change that results in infinite recursion 2005-01-05 02:19:04 +02:00
unknown
34f313eeaf fixed bugs in view code with prepared statemnts
sql/sql_acl.cc:
  block checking view underlying tables
sql/sql_base.cc:
  item registration fixed
  fixed non registred item resolving
  fixed result of outo-merge
  fixed creation reference if alias used
sql/sql_insert.cc:
  layout fixed
  removed unused variable
sql/sql_parse.cc:
  block checking view underlying tables
sql/sql_prepare.cc:
  make preparation check same as usual check
sql/sql_update.cc:
  made want_privilege assignment simplier
  block checking view underlying tables
sql/sql_view.cc:
  belong_to_view assignmebt moved after privileges check
sql/table.cc:
  check option fix field added
  arena management added
2005-01-04 18:04:16 +02:00
unknown
11f9b67134 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into sergbook.mysql.com:/usr/home/serg/Abk/mysql-5.0


sql/sql_base.cc:
  Auto merged
2005-01-04 01:59:24 +02:00
unknown
00c36b694a mysql-test/r/multi_update.result, mysql-test/t/multi_update.test
don't fail w/o bdb (or innodb)
sql/sql_base.cc
    typo fixed.
    "mysql-test-run --ps-protocol select" fixed (item->cached_item was set to the last table if many matches)


mysql-test/r/multi_update.result:
  don't fail w/o bdb (or innodb)
mysql-test/t/multi_update.test:
  don't fail w/o bdb (or innodb)
sql/sql_base.cc:
  typo fixed.
  "mysql-test-run --ps-protocol select" fixed (item->cached_item was set to the last table if many matches)
2005-01-04 00:22:22 +02:00
unknown
2bcaed348d Better handling of ensuring that setup_tables() are not called twice
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
2005-01-03 21:04:33 +02:00
unknown
e055be6658 Remove clear_insert_values() because it was far from trivial to handle the cleanup in all cases
(Old code failed for INSERT ... ON DUPLICATE with prepared statements) 
Instead, always reset table->insert_values on open.


mysql-test/t/trigger.test:
  Fix test for --ps-protocol
sql/sql_base.cc:
  Clear insert_values on open_table
sql/sql_insert.cc:
  Remove clear_insert_values()
sql/sql_parse.cc:
  Remove clear_insert_values()
sql/sql_prepare.cc:
  Remove clear_insert_values()
sql/table.cc:
  Remove clear_insert_values()
sql/table.h:
  Remove clear_insert_values()
2005-01-03 13:56:23 +02:00
unknown
12a215b083 Merge with global tree
BitKeeper/etc/logging_ok:
  auto-union
client/mysqltest.c:
  Auto merged
innobase/dict/dict0dict.c:
  Auto merged
innobase/include/dict0dict.h:
  Auto merged
libmysql/errmsg.c:
  Auto merged
myisam/mi_open.c:
  Auto merged
myisam/mi_write.c:
  Auto merged
mysql-test/r/grant.result:
  Auto merged
mysql-test/r/merge.result:
  Auto merged
mysql-test/r/show_check.result:
  Auto merged
mysql-test/t/derived.test:
  Auto merged
mysql-test/t/merge.test:
  Auto merged
mysql-test/t/show_check.test:
  Auto merged
mysql-test/t/system_mysql_db_fix.test:
  Auto merged
scripts/mysql_install_db.sh:
  Auto merged
sql/ha_innodb.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_func.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_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_parse.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
sql/tztime.h:
  Auto merged
2004-12-31 00:50:30 +02:00
unknown
2e8d13c73e After merge fixes
config/ac-macros/character_sets.m4:
  Added latin1_spanish_ci
dbug/dbug_analyze.c:
  Remove compiler warnings
include/my_handler.h:
  Reorder structure arguments to be more optimal
innobase/dict/dict0load.c:
  Fixed wrong define tag (for MySQL 5.0)
innobase/fil/fil0fil.c:
  Fixed compiler warning
innobase/os/os0file.c:
  Fixed compiler warning
myisam/ft_boolean_search.c:
  Fixed compiler warning
myisam/ft_static.c:
  Update to use new HA_KEYSEG structure
myisam/mi_open.c:
  Simple optimization
myisammrg/myrg_static.c:
  Removed compiler warning
mysql-test/r/grant.result:
  Update results after merge
mysql-test/r/index_merge.result:
  Update results after merge
mysql-test/r/information_schema_inno.result:
  Add missing drop table
mysql-test/r/lowercase_table.result:
  safety fix
mysql-test/r/multi_update.result:
  safety fix
mysql-test/r/ps_1general.result:
  safety fix
mysql-test/r/ps_2myisam.result:
  Update results after merge
  (set is not anymore of binary type)
mysql-test/r/ps_3innodb.result:
  Update results after merge
mysql-test/r/ps_4heap.result:
  Update results after merge
mysql-test/r/ps_5merge.result:
  Update results after merge
mysql-test/r/ps_6bdb.result:
  Update results after merge
mysql-test/r/show_check.result:
  Update results after merge
mysql-test/r/subselect.result:
  Update results after merge
  (added missing quotes)
mysql-test/r/timezone2.result:
  Update results after merge
mysql-test/r/view.result:
  Update results after merge
  (note that INSERT IGNORE will work again after next merge from 4.1)
mysql-test/t/derived.test:
  Removed empty line
mysql-test/t/grant.test:
  Update results after merge
mysql-test/t/information_schema_inno.test:
  added missing drop table
mysql-test/t/lowercase_table.test:
  safety fix
mysql-test/t/multi_update.test:
  safety fix
mysql-test/t/ps_1general.test:
  safety fix
mysql-test/t/view.test:
  update error codes after merge
ndb/src/mgmsrv/main.cpp:
  after merge fix
ndb/tools/ndb_test_platform.cpp:
  removed compiler warnings
regex/main.c:
  remove compiler warnings
sql/field.cc:
  Remove compiler warning
sql/gen_lex_hash.cc:
  Added DBUG support
sql/ha_myisam.cc:
  Removed warning from valgrind
sql/ha_ndbcluster.cc:
  Remove compiler warning
sql/item_cmpfunc.cc:
  Better to use val_int() instead of val_real() as we don't want Item_func_nop_all to return different value than the original ref element
sql/mysqld.cc:
  Remove compiler warning
sql/sql_acl.cc:
  More debugging
sql/sql_lex.cc:
  Remove unnecessary 'else'
sql/sql_parse.cc:
  After merge fixes
  Simplify reset of thd->server_status for SQLCOM_CALL
sql/sql_prepare.cc:
  After merge fixes
  Removed possible core dump in mysql_stmt_fetch()
sql/sql_update.cc:
  After merge fixes (together with Sanja)
strings/ctype-czech.c:
  Remove compiler warning
strings/ctype-ucs2.c:
  Remove compiler warning
strings/ctype-win1250ch.c:
  Remove compiler warning
strings/xml.c:
  Remove compiler warning
tests/client_test.c:
  Fix test to work with 5.0
vio/test-sslserver.c:
  Portability fix
2004-12-31 00:44:00 +02:00
unknown
bb2d3eaa30 Merge with 4.1
BitKeeper/etc/ignore:
  auto-union
BitKeeper/etc/logging_ok:
  auto-union
Build-tools/Do-compile:
  Auto merged
VC++Files/sql/mysqld.dsp:
  Auto merged
client/Makefile.am:
  Auto merged
client/mysql.cc:
  Auto merged
BitKeeper/deleted/.del-acinclude.m4~f4ab416bac5003:
  Auto merged
client/mysqltest.c:
  Auto merged
include/my_base.h:
  Auto merged
innobase/dict/dict0dict.c:
  Auto merged
innobase/dict/dict0load.c:
  Auto merged
innobase/include/dict0dict.h:
  Auto merged
innobase/include/row0mysql.h:
  Auto merged
innobase/os/os0file.c:
  Auto merged
innobase/srv/srv0srv.c:
  Auto merged
libmysql/libmysql.c:
  Auto merged
myisam/mi_check.c:
  Auto merged
myisam/mi_rnext_same.c:
  Auto merged
myisam/mi_write.c:
  Auto merged
myisam/sort.c:
  Auto merged
mysql-test/mysql-test-run.sh:
  Auto merged
mysql-test/r/ctype_ucs.result:
  Auto merged
mysql-test/r/ctype_ujis.result:
  Auto merged
mysql-test/r/gis-rtree.result:
  Auto merged
mysql-test/r/group_by.result:
  Auto merged
mysql-test/r/merge.result:
  Auto merged
mysql-test/r/metadata.result:
  Auto merged
mysql-test/r/ndb_alter_table.result:
  Auto merged
mysql-test/r/ps_1general.result:
  Auto merged
mysql-test/r/insert_update.result:
  Auto merged
mysql-test/r/timezone2.result:
  Auto merged
mysql-test/r/type_enum.result:
  Auto merged
mysql-test/r/variables.result:
  Auto merged
mysql-test/t/ctype_ucs.test:
  Auto merged
mysql-test/t/merge.test:
  Auto merged
mysql-test/t/ps_1general.test:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
mysql-test/t/system_mysql_db_fix.test:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
ndb/include/ndbapi/NdbConnection.hpp:
  Auto merged
ndb/include/ndbapi/NdbDictionary.hpp:
  Auto merged
ndb/src/common/util/version.c:
  Auto merged
ndb/src/kernel/blocks/dbacc/DbaccInit.cpp:
  Auto merged
ndb/src/kernel/blocks/dbacc/Makefile.am:
  Auto merged
ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
  Auto merged
ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
  Auto merged
ndb/src/kernel/blocks/dblqh/DblqhInit.cpp:
  Auto merged
ndb/src/kernel/blocks/dbtc/DbtcMain.cpp:
  Auto merged
ndb/src/kernel/blocks/dbtux/Dbtux.hpp:
  Auto merged
ndb/src/ndbapi/NdbBlob.cpp:
  Auto merged
ndb/src/ndbapi/NdbConnection.cpp:
  Auto merged
ndb/src/ndbapi/NdbDictionary.cpp:
  Auto merged
ndb/src/ndbapi/NdbDictionaryImpl.cpp:
  Auto merged
ndb/src/ndbapi/NdbDictionaryImpl.hpp:
  Auto merged
ndb/src/ndbapi/NdbOperationExec.cpp:
  Auto merged
ndb/src/ndbapi/NdbScanOperation.cpp:
  Auto merged
ndb/test/ndbapi/Makefile.am:
  Auto merged
scripts/make_win_src_distribution.sh:
  Auto merged
scripts/mysql_install_db.sh:
  Auto merged
sql/field.cc:
  Auto merged
sql/ha_innodb.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/ha_ndbcluster.h:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_create.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_geofunc.cc:
  Auto merged
sql/item_row.cc:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_strfunc.h:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/item_sum.h:
  Auto merged
sql/log.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/net_serv.cc:
  Auto merged
sql/password.c:
  Auto merged
sql/protocol.cc:
  Auto merged
sql/repl_failsafe.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_cache.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_derived.cc:
  Auto merged
sql/sql_do.cc:
  Auto merged
sql/sql_handler.cc:
  Auto merged
sql/sql_help.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_repl.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_union.cc:
  Auto merged
sql/examples/ha_archive.cc:
  Auto merged
sql/strfunc.cc:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
sql/tztime.h:
  Auto merged
sql/udf_example.cc:
  Auto merged
sql/unireg.cc:
  Auto merged
Makefile.am:
  Simple merge
client/mysqldump.c:
  Simple merge
configure.in:
  Simple merge
libmysqld/lib_sql.cc:
  Automatic merge
mysql-test/r/func_str.result:
  Automatic merge
mysql-test/r/grant.result:
  simple merge
mysql-test/r/multi_update.result:
  automatc merge
mysql-test/r/ps.result:
  automatic merge
mysql-test/r/ps_2myisam.result:
  Automatic merge
mysql-test/r/ps_3innodb.result:
  Automatic merge
mysql-test/r/ps_4heap.result:
  Automatic merge
mysql-test/r/ps_5merge.result:
  Automatic merge
mysql-test/r/ps_6bdb.result:
  Automatic merge
mysql-test/r/ps_7ndb.result:
  Automatic merge
mysql-test/r/show_check.result:
  Automatic merge
mysql-test/r/subselect.result:
  Automatic merge
mysql-test/t/grant.test:
  Automatic merge
mysql-test/t/multi_update.test:
  Automatic merge
mysql-test/t/ps.test:
  Automatic merge
mysql-test/t/show_check.test:
  Automatic merge
ndb/docs/wl2077.txt:
  merge
ndb/src/mgmsrv/main.cpp:
  merge
scripts/mysql_fix_privilege_tables.sh:
  merge
sql/item.cc:
  Merge (difficult)
sql/item.h:
  simple merge
sql/item_cmpfunc.h:
  Automatic merge
sql/item_subselect.cc:
  Simple merge
sql/item_subselect.h:
  Automatic merge
sql/mysql_priv.h:
  Simple merge
sql/slave.h:
  Automatic merge
sql/sql_base.cc:
  Removed code that was backported to 4.1
sql/sql_class.h:
  Merge (some code moved to sql_insert.cc)
sql/sql_db.cc:
  simple merge
sql/sql_insert.cc:
  Merge (difficult as logic had changed both in 4.1 and 5.0)
  Some coded moved here from sql_class.h
sql/sql_parse.cc:
  Merge (difficult)
sql/sql_prepare.cc:
  Simple merge
sql/sql_select.cc:
  Automatic merge
sql/sql_table.cc:
  Simple merge
sql/sql_update.cc:
  Difficult merge because of different logic for multi-updates
sql/sql_yacc.yy:
  Simple merge
tests/client_test.c:
  Simple merge
2004-12-22 13:54:39 +02:00
unknown
97f4b97909 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/dlenev/src/mysql-5.0-tzbug


sql/sql_base.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2004-12-21 15:42:19 +03:00
unknown
8eaef91fff Add 0x before pointers (to help with debugging)
Add support for VARCHAR with 1 or 2 length bytes
Enable VARCHAR packing in MyISAM files (previous patch didn't pack data properly)
Give error if we got problems in temporary tables during a SELECT
Don't use new table generated by ALTER TABLE if index generation fails
Fixed wrong call by range_end() (Could cause an ASSERT in debug mode)


BUILD/SETUP.sh:
  Add flags for Intel 64
dbug/dbug.c:
  Add 0x before pointers (to help with debugging)
heap/_check.c:
  Add 0x before pointers (to help with debugging)
heap/hp_create.c:
  Add support for VARCHAR with 1 or 2 length bytes
heap/hp_delete.c:
  Add 0x before pointers
heap/hp_hash.c:
  Add support for VARCHAR with 1 or 2 length bytes
  Added more debugging
heap/hp_open.c:
  Add 0x before pointers
heap/hp_rkey.c:
  Add 0x before pointers
heap/hp_rrnd.c:
  Add 0x before pointers
heap/hp_write.c:
  Add 0x before pointers
include/my_base.h:
  Add support for VARCHAR with 1 or 2 length bytes
myisam/ft_static.c:
  Add support for VARCHAR with 1 or 2 length bytes
myisam/ft_test1.c:
  Add support for VARCHAR with 1 or 2 length bytes
  Fixed indentation
  (This file should probably be deleted as it doesn't compile)
myisam/ft_update.c:
  Add support for VARCHAR with 1 or 2 length bytes
  Fixed indentation
  Removed some not needed 'else'
myisam/mi_check.c:
  Don't give an error for tables packed with myisampack
myisam/mi_checksum.c:
  Add support for VARCHAR with 1 or 2 length bytes
myisam/mi_create.c:
  Add support for VARCHAR with 1 or 2 length bytes
  Store in number of pack-length-bytes in keyseg->bit_start
myisam/mi_dbug.c:
  Add support for VARCHAR with 1 or 2 length bytes
myisam/mi_dynrec.c:
  Add support for VARCHAR with 1 or 2 length bytes
  (old code in _mi_rec_unpack() didn't really work with VARCHAR's)
myisam/mi_key.c:
  Add support for VARCHAR with 1 or 2 length bytes
myisam/mi_open.c:
  Add support for VARCHAR with 1 or 2 length bytes
myisam/mi_packrec.c:
  Add support for VARCHAR with 1 or 2 length bytes
myisam/mi_search.c:
  Add support for VARCHAR with 1 or 2 length bytes
myisam/mi_test1.c:
  Add support for VARCHAR with 1 or 2 length bytes
myisam/mi_test3.c:
  Add support for VARCHAR with 1 or 2 length bytes
myisam/mi_test_all.res:
  Update results
myisam/mi_unique.c:
  Add support for VARCHAR with 1 or 2 length bytes
myisam/myisampack.c:
  Add support for VARCHAR with 1 or 2 length bytes
mysql-test/include/varchar.inc:
  Added more tests
mysql-test/r/bdb.result:
  Update results after new tests
mysql-test/r/information_schema.result:
  Update results
mysql-test/r/innodb.result:
  Update results
mysql-test/r/myisam.result:
  Update results after new tests
mysql-test/r/ps_1general.result:
  Update results
mysql-test/t/bdb.test:
  Shorter comments
mysys/list.c:
  Add 0x before pointers
mysys/my_handler.c:
  Add support for VARCHAR with 1 or 2 length bytes
mysys/raid.cc:
  Add 0x before pointers
sql/field.cc:
  Add support for VARCHAR with 1 or 2 length bytes
sql/field.h:
  Add support for VARCHAR with 1 or 2 length bytes
sql/field_conv.cc:
  Add support for VARCHAR with 1 or 2 length bytes
sql/ha_berkeley.cc:
  Add support for VARCHAR with 1 or 2 length bytes
sql/ha_heap.cc:
  Add support for VARCHAR with 1 or 2 length bytes
sql/ha_myisam.cc:
  Ensure that enable_indexes() will report an error if it fails
  Enable VARCHAR packing for MyISAM files
sql/item_sum.cc:
  Change key_cmp -> cmp() as we are comparing fields, not key segements
sql/opt_range.cc:
  Add support for VARCHAR with 1 or 2 length bytes
  Change range_end to call ha_index_or_rnd_end() as in some error cases we may be in rnd mode when we abort
sql/sql_base.cc:
  Remove compiler warning
sql/sql_parse.cc:
  Move length checking code to sql_table.cc (as we don't have character set for fields at this stage)
sql/sql_select.cc:
  Add support for VARCHAR with 1 or 2 length bytes
  Ensure that we report an error if we get an error while writing to internal temporary tables
sql/sql_select.h:
  Add support for VARCHAR with 1 or 2 length bytes
sql/sql_show.cc:
  Fix typo in comment
sql/sql_table.cc:
  Don't use new table generated by ALTER TABLE if index generation fails
vio/vio.c:
  Fixed DBUG info
vio/viosocket.c:
  Fixed DBUG info
vio/viossl.c:
  Fixed DBUG info
vio/viosslfactories.c:
  Fixed DBUG info
2004-12-18 05:19:21 +02:00
unknown
bc152db579 Fix for bug #6849 "Crash while preparing query containing const expr with
IN and CONVERT_TZ()" (with after review changes).

Now we add implicitly used time zone tables to global table list right
at the parsing stage instead of doing it later in mysql_execute_command()
or in check_prepared_statement().

No special test-case needed since this bug also manifests itself as
timezone2.test failure if one runs it with --ps-protocol option.


sql/sql_base.cc:
  relink_tables_for_multidelete(): 
   presence of implicitly used time zone tables is no longer condition for
   propagation of TABLE pointers from global table list to local table
   lists (since now global list is always created...)
sql/sql_lex.cc:
  - Added LEX::add_time_zone_tables_to_query_tables() function which adds
    implicitly used time zone tables to global table list.
  - Definition of fake_time_zone_tables_list moved to tztime.cc, since
    it is no longer used in parser.
sql/sql_lex.h:
  - Since now we add implicitly used time zone tables right at parsing
    stage, LEX::time_zone_tables_used is either zero or points to valid
    time zone tables list. Updated its description to reflect that.
  - Added LEX::add_time_zone_tables_to_query_tables() function which adds
    implicitly used time zone tables to global table list.
  - Declaration of fake_time_zone_tables_list moved to tztime.h,
    since it is no longer used in parser.
sql/sql_parse.cc:
  mysql_execute_command():
    Removed adding list of implicitly used time zone tables to global table
    list, since now we do this right at the parsing stage.
sql/sql_yacc.yy:
  Let us add implicitly used time zone tables to global table list
  right at the parsing stage instead of doing it later in
  mysql_execute_command() or in check_prepared_statement().
sql/tztime.cc:
  Moved fake_time_zone_tables_list definition from sql_lex.cc to
  tztime.cc since now it is used only for error reporting from
  my_tz_get_table_list() function.
sql/tztime.h:
  Moved fake_time_zone_tables_list declaration from sql_lex.h to
  tztime.h since now it is used only for error reporting from
  my_tz_get_table_list() function.
2004-12-17 15:34:48 +03:00
unknown
8322eb0aaa * Added comments and one assert
* Backport of safety measures from 5.0: make numeorous replaces:
    s/item->fix_fields()/if (!item->fixed) item->fix_fields()


sql/item.cc:
   * More comments
   * Backport of safety measures from 5.0: make numeorous replaces:
      s/item->fix_fields()/if (!item->fixed) item->fix_fields()
sql/item.h:
  Assert added
sql/item_cmpfunc.cc:
  Backport of safety measures from 5.0: make numeorous replaces:
    s/item->fix_fields()/if (!item->fixed) item->fix_fields()
sql/item_func.cc:
  Backport of safety measures from 5.0: make numeorous replaces:
    s/item->fix_fields()/if (!item->fixed) item->fix_fields()
sql/item_strfunc.h:
  Backport of safety measures from 5.0: make numeorous replaces:
    s/item->fix_fields()/if (!item->fixed) item->fix_fields()
sql/item_subselect.cc:
  Backport of safety measures from 5.0: make numeorous replaces:
    s/item->fix_fields()/if (!item->fixed) item->fix_fields()
sql/item_sum.cc:
  Backport of safety measures from 5.0: make numeorous replaces:
    s/item->fix_fields()/if (!item->fixed) item->fix_fields()
sql/set_var.cc:
  Backport of safety measures from 5.0: make numeorous replaces:
    s/item->fix_fields()/if (!item->fixed) item->fix_fields()
sql/sql_base.cc:
  Backport of safety measures from 5.0: make numeorous replaces:
    s/item->fix_fields()/if (!item->fixed) item->fix_fields()
sql/sql_handler.cc:
  Backport of safety measures from 5.0: make numeorous replaces:
    s/item->fix_fields()/if (!item->fixed) item->fix_fields()
sql/sql_help.cc:
  Backport of safety measures from 5.0: make numeorous replaces:
    s/item->fix_fields()/if (!item->fixed) item->fix_fields()
sql/sql_select.cc:
  Backport of safety measures from 5.0: make numeorous replaces:
    s/item->fix_fields()/if (!item->fixed) item->fix_fields()
2004-12-14 03:36:19 +03:00
unknown
af07ef79d4 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/dlenev/src/mysql-4.1-bg6765


sql/item_strfunc.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_db.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2004-12-09 13:33:12 +03:00
unknown
9ad51c631c Fix for bug #6765 "Implicit access to time zone description
tables requires privileges for them if some table or column level grants
present" (with after-review fixes).

We should set SELECT_ACL for implicitly opened tables in 
my_tz_check_n_skip_implicit_tables() to be able to bypass privilege
checking in check_grant(). Also we should exclude those tables from
privilege checking in multi-update.


mysql-test/r/timezone2.result:
  Extended test for bug #6116 "SET time_zone := ... requires access to
  mysql.time_zone tables"
  Added test for bug #6765 "Implicit access to time zone description 
  tables requires privileges for them if some table or column level grants
  present"
mysql-test/t/timezone2.test:
  Extended test for bug #6116 "SET time_zone := ... requires access to
  mysql.time_zone tables"
  Added test for bug #6765 "Implicit access to time zone description 
  tables requires privileges for them if some table or column level grants
  present"
sql/item_geofunc.cc:
  sql_acl.h is now included via mysql_priv.h
sql/item_strfunc.cc:
  sql_acl.h is now included via mysql_priv.h
sql/log.cc:
  sql_acl.h is now included via mysql_priv.h
sql/mysql_priv.h:
  Now we have to include sql_acl.h before tztime.h, since 
  my_tz_check_n_skip_implicit_tables() defined there requires
  SELECT_ACL constant defined in sql_acl.h.
sql/mysqld.cc:
  sql_acl.h is now included via mysql_priv.h
sql/repl_failsafe.cc:
  sql_acl.h is now included via mysql_priv.h
sql/set_var.cc:
  sql_acl.h is now included via mysql_priv.h
sql/sql_acl.cc:
  sql_acl.h is now included via mysql_priv.h
sql/sql_base.cc:
  sql_acl.h is now included via mysql_priv.h
sql/sql_cache.cc:
  sql_acl.h is now included via mysql_priv.h
sql/sql_class.cc:
  sql_acl.h is now included via mysql_priv.h
sql/sql_db.cc:
  sql_acl.h is now included via mysql_priv.h
sql/sql_derived.cc:
  sql_acl.h is now included via mysql_priv.h
sql/sql_do.cc:
  sql_acl.h is now included via mysql_priv.h
sql/sql_insert.cc:
  sql_acl.h is now included via mysql_priv.h
sql/sql_parse.cc:
  check_one_table_access(): Tweaked comments.
  multi_update_precheck(): Added skipping of implicitly opened tables
    during privilege checking.
sql/sql_prepare.cc:
  sql_acl.h is now included via mysql_priv.h
sql/sql_repl.cc:
  sql_acl.h is now included via mysql_priv.h
sql/sql_show.cc:
  sql_acl.h is now included via mysql_priv.h
sql/sql_update.cc:
  sql_acl.h is now included via mysql_priv.h
sql/sql_yacc.yy:
  sql_acl.h is now included via mysql_priv.h
sql/tztime.h:
  my_tz_check_n_skip_implicit_tables():
    We should set SELECT_ACL for implictly opened tables to be able to
    bypass privilege checking in check_grant().
2004-12-09 13:31:46 +03:00
unknown
8379b61efb Merge with new VARCHAR code
configure.in:
  Auto merged
BitKeeper/deleted/.del-acinclude.m4~f4ab416bac5003:
  Auto merged
BitKeeper/deleted/.del-ha_isam.cc~4dce65904db2675e:
  Auto merged
BitKeeper/deleted/.del-ha_isammrg.cc~dc682e4755d77a2e:
  Auto merged
client/mysqldump.c:
  Auto merged
client/mysqltest.c:
  Auto merged
heap/hp_create.c:
  Auto merged
heap/hp_delete.c:
  Auto merged
heap/hp_hash.c:
  Auto merged
heap/hp_write.c:
  Auto merged
include/decimal.h:
  Auto merged
include/m_ctype.h:
  Auto merged
libmysql/libmysql.c:
  Auto merged
libmysqld/Makefile.am:
  Auto merged
myisam/mi_check.c:
  Auto merged
myisam/mi_create.c:
  Auto merged
myisam/mi_write.c:
  Auto merged
mysql-test/r/ctype_tis620.result:
  Auto merged
mysql-test/r/ctype_ucs.result:
  Auto merged
mysql-test/r/myisam.result:
  Auto merged
mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/r/order_by.result:
  Auto merged
mysql-test/r/ps.result:
  Auto merged
mysql-test/r/ps_1general.result:
  Auto merged
mysql-test/r/ps_2myisam.result:
  Auto merged
mysql-test/r/ps_3innodb.result:
  Auto merged
mysql-test/r/ps_4heap.result:
  Auto merged
mysql-test/r/ps_5merge.result:
  Auto merged
mysql-test/r/ps_6bdb.result:
  Auto merged
mysql-test/r/select.result:
  Auto merged
mysql-test/r/strict.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/r/type_blob.result:
  Auto merged
mysql-test/t/ctype_ucs.test:
  Auto merged
mysql-test/t/endspace.test:
  Auto merged
mysql-test/t/myisam.test:
  Auto merged
mysql-test/t/ps_1general.test:
  Auto merged
mysql-test/t/strict.test:
  Auto merged
mysql-test/t/type_blob.test:
  Auto merged
ndb/src/common/util/NdbSqlUtil.cpp:
  Auto merged
scripts/mysql_fix_privilege_tables.sh:
  Auto merged
sql/field.h:
  Auto merged
sql/field_conv.cc:
  Auto merged
sql/ha_heap.cc:
  Auto merged
sql/ha_innodb.cc:
  Auto merged
sql/ha_innodb.h:
  Auto merged
sql/ha_myisam.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/handler.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/opt_sum.cc:
  Auto merged
sql/protocol.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_help.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/structs.h:
  Auto merged
sql/table.cc:
  Auto merged
strings/ctype-czech.c:
  Auto merged
strings/ctype-uca.c:
  Auto merged
strings/ctype-utf8.c:
  Auto merged
strings/ctype-win1250ch.c:
  Auto merged
strings/decimal.c:
  Auto merged
tests/client_test.c:
  Auto merged
mysql-test/r/bdb.result:
  Merge with VARCHAR code
mysql-test/r/heap.result:
  Merge with VARCHAR code
mysql-test/r/innodb.result:
  Merge with VARCHAR code
mysql-test/r/select.result.es:
  Merge with VARCHAR code
mysql-test/t/bdb.test:
  Merge with VARCHAR code
mysql-test/t/heap.test:
  Merge with VARCHAR code
mysql-test/t/innodb.test:
  Merge with VARCHAR code
sql/field.cc:
  Merge with VARCHAR code
sql/item.cc:
  Merge with VARCHAR code
sql/sql_acl.cc:
  Merge with VARCHAR code
sql/sql_parse.cc:
  Merge with VARCHAR code
sql/sql_table.cc:
  Merge with VARCHAR code
sql/sql_update.cc:
  Merge with VARCHAR code
sql/table.h:
  Merge with VARCHAR code
strings/ctype-mb.c:
  Don't pad my_like_range with max_str for simple LIKE expression
strings/ctype-tis620.c:
  Merge with VARCHAR code
strings/ctype-ucs2.c:
  Added new argument to my_strnncollsp_ucs2()
  Simply code
2004-12-06 19:18:35 +02:00
unknown
796bd7de96 Merge with 4.1
BitKeeper/etc/ignore:
  auto-union
BitKeeper/etc/logging_ok:
  auto-union
BUILD/SETUP.sh:
  Auto merged
Build-tools/Do-compile:
  Auto merged
client/mysqladmin.cc:
  Auto merged
configure.in:
  Auto merged
innobase/include/lock0lock.h:
  Auto merged
innobase/os/os0file.c:
  Auto merged
libmysqld/Makefile.am:
  Auto merged
mysql-test/mysql-test-run.sh:
  Auto merged
mysql-test/r/ctype_ucs.result:
  Auto merged
mysql-test/r/heap.result:
  Auto merged
mysql-test/r/insert_select.result:
  Auto merged
mysql-test/r/lowercase_table3.result:
  Auto merged
mysql-test/r/rpl_start_stop_slave.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/t/ctype_ucs.test:
  Auto merged
mysql-test/t/rpl_until.test:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
  Auto merged
sql/field.cc:
  Auto merged
sql/field.h:
  Auto merged
sql/ha_myisam.h:
  Auto merged
sql/handler.cc:
  Auto merged
sql/handler.h:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/lock.cc:
  Auto merged
sql/log_event.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/slave.h:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_db.cc:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_rename.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/log_event.cc:
  Merge with 4.1
  Trivial cleanup
2004-12-06 11:38:56 +02:00
unknown
a8ea31fae6 Add support for up to VARCHAR (size up to 65535)
Renamed HA_VAR_LENGTH to HA_VAR_LENGTH_PART
Renamed in all files FIELD_TYPE_STRING and FIELD_TYPE_VAR_STRING to MYSQL_TYPE_STRING and MYSQL_TYPE_VAR_STRING to make it easy to catch all possible errors
Added support for VARCHAR KEYS to heap
Removed support for ISAM
Now only long VARCHAR columns are changed to TEXT on demand (not CHAR)
Internal temporary files can now use fixed length tables if the used VARCHAR columns are short


BitKeeper/deleted/.del-ha_isam.cc~4dce65904db2675e:
  Delete: sql/ha_isam.cc
BitKeeper/deleted/.del-_cache.c~b5d80b5c3ae233b1:
  Delete: isam/_cache.c
BitKeeper/deleted/.del-_dbug.c~88d7964ae5e3c9bd:
  Delete: isam/_dbug.c
BitKeeper/deleted/.del-_dynrec.c~48dd758f5a5450df:
  Delete: isam/_dynrec.c
BitKeeper/deleted/.del-_key.c~ce62d47a6c681084:
  Delete: isam/_key.c
BitKeeper/deleted/.del-_locking.c~dea4cdc6ea425c67:
  Delete: isam/_locking.c
BitKeeper/deleted/.del-_packrec.c~47ae1b16c007e9be:
  Delete: isam/_packrec.c
BitKeeper/deleted/.del-_page.c~148b1a613d052ee8:
  Delete: isam/_page.c
BitKeeper/deleted/.del-_search.c~f509292aa1ff18ff:
  Delete: isam/_search.c
BitKeeper/deleted/.del-_statrec.c~58d9263b3475d58b:
  Delete: isam/_statrec.c
BitKeeper/deleted/.del-changed.c~d075de80a314b02d:
  Delete: isam/changed.c
BitKeeper/deleted/.del-close.c~fd62629496ee5bcc:
  Delete: isam/close.c
BitKeeper/deleted/.del-create.c~96cecc433c0c2242:
  Delete: isam/create.c
BitKeeper/deleted/.del-delete.c~65ee8daaa75a14b6:
  Delete: isam/delete.c
BitKeeper/deleted/.del-extra.c~706f29d72beb2565:
  Delete: isam/extra.c
BitKeeper/deleted/.del-info.c~96cfb747af8da0d:
  Delete: isam/info.c
BitKeeper/deleted/.del-isamchk.c~c0f59c2687d2248f:
  Delete: isam/isamchk.c
BitKeeper/deleted/.del-isamlog.c~85b6b31c6e2b8519:
  Delete: isam/isamlog.c
BitKeeper/deleted/.del-log.c~55a973013d55cade:
  Delete: isam/log.c
BitKeeper/deleted/.del-open.c~95b3b75042fae00a:
  Delete: isam/open.c
BitKeeper/deleted/.del-pack_isam.c~43801f0df7504834:
  Delete: isam/pack_isam.c
BitKeeper/deleted/.del-panic.c~f7fd71605324f8f3:
  Delete: isam/panic.c
BitKeeper/deleted/.del-range.c~142f1f8ac4948082:
  Delete: isam/range.c
BitKeeper/deleted/.del-rfirst.c~66f494291dc005d3:
  Delete: isam/rfirst.c
BitKeeper/deleted/.del-rkey.c~cc54c6498352f999:
  Delete: isam/rkey.c
BitKeeper/deleted/.del-rlast.c~d1fe1866139e9866:
  Delete: isam/rlast.c
BitKeeper/deleted/.del-rnext.c~b308eaa1e11ea7de:
  Delete: isam/rnext.c
BitKeeper/deleted/.del-rprev.c~b359f71fdea4bbce:
  Delete: isam/rprev.c
BitKeeper/deleted/.del-rrnd.c~7fcfcce88d4a5200:
  Delete: isam/rrnd.c
BitKeeper/deleted/.del-rsame.c~75a62d5548103a15:
  Delete: isam/rsame.c
BitKeeper/deleted/.del-rsamepos.c~5b5652dd2cda6d5d:
  Delete: isam/rsamepos.c
BitKeeper/deleted/.del-sort.c~e2e56b5a37ce86f4:
  Delete: isam/sort.c
BitKeeper/deleted/.del-static.c~3a1354b84f4a9cc7:
  Delete: isam/static.c
BitKeeper/deleted/.del-test1.c~64d52e9412d457ed:
  Delete: isam/test1.c
BitKeeper/deleted/.del-test2.c~2f9a632cab572958:
  Delete: isam/test2.c
BitKeeper/deleted/.del-test3.c~e8a7a4afe8a087:
  Delete: isam/test3.c
BitKeeper/deleted/.del-isamdef.h~ac8d49e7e2201c66:
  Delete: isam/isamdef.h
BitKeeper/deleted/.del-update.c~670264f51dc44934:
  Delete: isam/update.c
BitKeeper/deleted/.del-write.c~8f1918b1f6770e54:
  Delete: isam/write.c
BitKeeper/deleted/.del-Makefile.am~6cfa0db5e7778d09:
  Delete: isam/Makefile.am
BitKeeper/deleted/.del-make-ccc~3ee55391eda0b0ab:
  Delete: isam/make-ccc
BitKeeper/deleted/.del-ChangeLog~208984fb7a51e568:
  Delete: isam/ChangeLog
BitKeeper/deleted/.del-test_all.res~c2aafb49a3a77db7:
  Delete: isam/test_all.res
BitKeeper/deleted/.del-test_all~93c701e44a9c5b65:
  Delete: isam/test_all
BitKeeper/deleted/.del-.cvsignore~54f6f0f2d5012561:
  Delete: isam/.cvsignore
BitKeeper/deleted/.del-ha_isammrg.cc~dc682e4755d77a2e:
  Delete: sql/ha_isammrg.cc
BitKeeper/deleted/.del-ha_isam.h~bf53d533be3d3927:
  Delete: sql/ha_isam.h
BitKeeper/deleted/.del-ha_isammrg.h~66fd2e5bfe7207dc:
  Delete: sql/ha_isammrg.h
acinclude.m4:
  Remove ISAM
client/mysqldump.c:
  FIELD_TYPE -> MYSQL_TYPE
client/mysqltest.c:
  Add missing DBUG_RETURN
configure.in:
  Remove ISAM
heap/heapdef.h:
  Add support for VARCHAR
heap/hp_create.c:
  Add support for VARCHAR
heap/hp_delete.c:
  Add support for VARCHAR
heap/hp_hash.c:
  Add support for VARCHAR
  (VARCHAR keys was not supported before)
heap/hp_rkey.c:
  Add support for VARCHAR
heap/hp_update.c:
  Add support for VARCHAR
heap/hp_write.c:
  Add support for VARCHAR
  (Added flag SEARCH_UPDATE to mark that this is an update)
include/decimal.h:
  Remove not needed my_global.h
include/m_ctype.h:
  Add support for VARCHAR
include/my_base.h:
  Add support for VARCHAR
include/my_handler.h:
  Moved general purpose macro from MyISAM code
include/mysql_com.h:
  Add support for VARCHAR
libmysql/libmysql.c:
  Add support for VARCHAR
libmysqld/Makefile.am:
  Removed ISAM
myisam/ft_static.c:
  Add support for VARCHAR
myisam/ft_test1.c:
  Add support for VARCHAR
myisam/ft_update.c:
  Add support for VARCHAR
myisam/mi_check.c:
  Add support for VARCHAR
myisam/mi_create.c:
  Add support for VARCHAR
  - VARCHAR key segments are marked with HA_VAR_LENGTH_PART
myisam/mi_key.c:
  Add support for VARCHAR
  Fixed bug in old VARCHAR code when reading index-only
myisam/mi_range.c:
  Fixed comment style
myisam/mi_rnext_same.c:
  Handle case where equal keys can be of different length
myisam/mi_search.c:
  Add support for VARCHAR
myisam/mi_test1.c:
  Add support for VARCHAR
myisam/mi_unique.c:
  Add support for VARCHAR
  (Some new code to handle keys that are equal but have different lengths)
myisam/mi_write.c:
  Fixed comment
myisam/myisamchk.c:
  Better infotext if wrong type
mysql-test/r/bdb.result:
  Updated old result and new results for VARCHAR
mysql-test/r/create.result:
  Updated old result and new results for VARCHAR
mysql-test/r/ctype_tis620.result:
  Updated old result and new results for VARCHAR
  (Old code sorted tis620 wrong)
mysql-test/r/ctype_ucs.result:
  Updated old result and new results for VARCHAR
mysql-test/r/endspace.result:
  Updated old result and new results for VARCHAR
mysql-test/r/func_like.result:
  Updated old result and new results for VARCHAR
mysql-test/r/heap.result:
  Updated old result and new results for VARCHAR
mysql-test/r/innodb.result:
  Updated old result. This will change a bit when also InnoDB supports VARCHAR
mysql-test/r/merge.result:
  Updated old result and new results for VARCHAR
mysql-test/r/myisam.result:
  Updated old result and new results for VARCHAR
mysql-test/r/mysqldump.result:
  Updated old result and new results for VARCHAR
mysql-test/r/order_by.result:
  Updated old result and new results for VARCHAR
  (Key length is different for VARCHAR)
mysql-test/r/ps.result:
  Updated old result and new results for VARCHAR
mysql-test/r/ps_1general.result:
  Updated results for new .frm version
  Don't print seconds in show full process list as this may change
mysql-test/r/ps_2myisam.result:
  Updated old result and new results for VARCHAR
mysql-test/r/ps_3innodb.result:
  Updated old result and new results for VARCHAR
mysql-test/r/ps_4heap.result:
  Updated old result and new results for VARCHAR
mysql-test/r/ps_5merge.result:
  Updated old result and new results for VARCHAR
mysql-test/r/ps_6bdb.result:
  Updated old result and new results for VARCHAR
mysql-test/r/select.result.es:
  Updated results by hand
mysql-test/r/select.result:
  Updated old result and new results for VARCHAR
mysql-test/r/select_found.result:
  Updated old result and new results for VARCHAR
mysql-test/r/show_check.result:
  Updated old result and new results for VARCHAR
mysql-test/r/strict.result:
  Updated old result and new results for VARCHAR
mysql-test/r/subselect.result:
  Updated old result and new results for VARCHAR
mysql-test/r/system_mysql_db.result:
  Updated old result and new results for VARCHAR
mysql-test/r/type_blob.result:
  Updated old result and new results for VARCHAR
mysql-test/r/type_ranges.result:
  Updated old result and new results for VARCHAR
mysql-test/r/type_ranges.result.es:
  Updated some results by hand
mysql-test/t/bdb.test:
  Test VARCHAR
mysql-test/t/ctype_ucs.test:
  Some fixes related to VARCHAR
mysql-test/t/endspace.test:
  Fixes to make it easier to compare columns with end space
mysql-test/t/heap.test:
  Test VARCHAR
mysql-test/t/innodb.test:
  Prepare for testing VARCHAR
mysql-test/t/myisam.test:
  Test VARCHAR
mysql-test/t/ps_1general.test:
  Don't show seconds for show processlist
mysql-test/t/ps_4heap.test:
  Update for VARCHAR
mysql-test/t/strict.test:
  Fix test for VARCHAR
mysql-test/t/type_blob.test:
  Update test for VARCHAR
  Note that now you can't store 'a' and 'a ' in an unique varchar/text index if the column is not binary
mysys/my_handler.c:
  Add support for VARCHAR
ndb/src/common/util/NdbSqlUtil.cpp:
  Fix for usage of strnncollsp
scripts/mysql_fix_privilege_tables.sh:
  Simple fix so that my_print_defaults works
sql/Makefile.am:
  Remove ISAM
sql/field.cc:
  Add support for VARCHAR
  Fixed the keys for blob's are compared with strnncollsp
  Ensure that old tables from MySQL 4.0 works as they did before.
  (Old VARCHAR will be converted to new VARCHAR on ALTER TABLE)
sql/field.h:
  Add support for VARCHAR
sql/field_conv.cc:
  Change FIELD_TYPE_VAR_STRING -> MYSQL_TYPE_VARCHAR
  Added usage of HA_KEY_BLOB_LENGTH
sql/ha_berkeley.cc:
  Add support for VARCHAR
  Added usage of table->insert_or_update if we would ever want to know in key_cmp if we are changing keys
sql/ha_heap.cc:
  Add support for VARCHAR
sql/ha_innodb.cc:
  Changed MYSQL_TYPE_VAR_STRING to MYSQL_TYPE_VARCHAR.
  Waiting for Heikki to add full VARCHAR support
sql/ha_innodb.h:
  InnoDB doesn't support full VARCHAR yet
sql/ha_myisam.cc:
  Add support for VARCHAR
sql/ha_ndbcluster.cc:
  Add support for VARCHAR
sql/handler.h:
  Added HA_NO_VARCHAR for table handler that doesn't support VARCHAR. In this case MySQL will create a normal CHAR instead
sql/item.cc:
  Fixed access of already freed memory
  Added support of VARCHAR
  - varchar length is now checked in mysql_prepare
sql/item_cmpfunc.cc:
  Added new parameter to strncollsp
sql/item_sum.cc:
  Added new parameter to strncollsp
  FIELD_TYPE -> MYSQL_TYPE
sql/key.cc:
  Add support for VARCHAR
sql/opt_range.cc:
  Remove character set parameter from set_key_image()
sql/opt_sum.cc:
  Remove character set parameter from set_key_image()
sql/protocol.cc:
  Return MYSQL_TYPE_VAR_STRING instead of MYSQL_TYPE_VARCHAR to clients (to not cause compatiblity problems)
sql/sql_acl.cc:
  Change key handling code so that we can use CHAR or VARCHAR for the user table columns
sql/sql_base.cc:
  Remove old, not used code
sql/sql_help.cc:
  Remove charset from get_key_image
sql/sql_parse.cc:
  Ensure that OPTION_TABLE_LOCK is cleared ASAP; This fixed a problem in BDB transaction code when one used LOCK TABLES on a BDB table
  Added support for VARCHAR
  Moved field length checking and VARCHAR -> TEXT convert to mysql_prepare (as we need the know the character set for the column)
sql/sql_select.cc:
  Added support of VARCHAR
  Added heuristic to use fixed size rows for tmp tables if we are using only a few short VARCHAR's
sql/sql_string.cc:
  Added extra argument to strnncollsp
sql/sql_table.cc:
  Add support for VARCHAR
  Automaticly convert (with warning) big VARCHAR (but not CHAR) to TEXT
  If handler doesn't support VARCHAR convert VARCHAR to CHAR
sql/sql_update.cc:
  Fixed compiler warning
sql/sql_yacc.yy:
  Add support for VARCHAR
sql/strfunc.cc:
  Fixed valgrind warning
sql/structs.h:
  Added 'table' to KEY structure to make life easier for some handler functions
sql/table.cc:
  Add support for VARCHAR
  - New .frm version
  - FIELD_TYPE -> MYSQL_TYPE
sql/table.h:
  Added insert_or_update; A bool flag a handler can set/reset if needed (for handler internal usage)
sql/unireg.h:
  Add support for VARCHAR
strings/ctype-big5.c:
  Added new argument to strnncollsp() to allow one to define if end space are significant or not
  Changed my_like_range... to correctly calculate min_length & max_length
strings/ctype-bin.c:
  Added new argument to strnncollsp() to allow one to define if end space are significant or not
strings/ctype-czech.c:
  Changed my_like_range... to correctly calculate min_length & max_length
strings/ctype-gbk.c:
  Added new argument to strnncollsp() to allow one to define if end space are significant or not
  Changed my_like_range... to correctly calculate min_length & max_length
strings/ctype-latin1.c:
  Added new argument to strnncollsp() to allow one to define if end space are significant or not
strings/ctype-mb.c:
  Added new argument to strnncollsp() to allow one to define if end space are significant or not
  Changed my_like_range... to correctly calculate min_length & max_length
strings/ctype-simple.c:
  Added new argument to strnncollsp() to allow one to define if end space are significant or not
  Changed my_like_range... to correctly calculate min_length & max_length
strings/ctype-sjis.c:
  Added new argument to strnncollsp() to allow one to define if end space are significant or not
  Changed my_like_range... to correctly calculate min_length & max_length
strings/ctype-tis620.c:
  Added new argument to strnncollsp() to allow one to define if end space are significant or not
  Changed my_like_range... to correctly calculate min_length & max_length
strings/ctype-uca.c:
  Added new argument to strnncollsp() to allow one to define if end space are significant or not
strings/ctype-ucs2.c:
  Changed my_like_range... to correctly calculate min_length & max_length
strings/ctype-utf8.c:
  Added new argument to strnncollsp() to allow one to define if end space are significant or not
strings/ctype-win1250ch.c:
  Changed my_like_range... to correctly calculate min_length & max_length
strings/decimal.c:
  Fixed include files usage
  Fixed some compiler warnings
tests/client_test.c:
  Ensure tests works with VARCHAR
2004-12-06 02:00:37 +02:00
unknown
220acb328e Bug#6391 (binlog-do-db rules ignored)
CREATE DATABASE statement used the current database instead of the
  database created when checking conditions for replication.
  CREATE/DROP/ALTER DATABASE statements are now replicated based on
  the manipulated database.


mysql-test/t/rpl_until.test:
  Longer sleep to allow slave to stop.
mysql-test/t/rpl_charset.test:
  Position change in binary file.
mysql-test/r/drop_temp_table.result:
  Position change in binlog.
mysql-test/r/rpl_loaddata_rule_m.result:
  Position change in binlog.
mysql-test/r/rpl_charset.result:
  Position change in binlog.
sql/log_event.h:
  Added new flag and parameter to suppress generation of
  USE statements.
sql/log_event.cc:
  Added parameter and code to suppress generation of
  USE statements.
sql/sql_db.cc:
  Suppress generation of USE before CREATE/ALTER/DROP DATABASE
  statements.
sql/log.cc:
  Query_log_event have new extra parameter.
sql/sql_table.cc:
  Query_log_event have new extra parameter.
sql/sql_base.cc:
  Query_log_event have new extra parameter.
sql/sql_update.cc:
  Query_log_event have new extra parameter.
sql/sql_insert.cc:
  Query_log_event have new extra parameter.
sql/sql_rename.cc:
  Query_log_event have new extra parameter.
sql/sql_delete.cc:
  Query_log_event have new extra parameter.
sql/sql_acl.cc:
  Query_log_event have new extra parameter.
sql/handler.cc:
  Query_log_event have new extra parameter.
sql/item_func.cc:
  Query_log_event have new extra parameter.
sql/sql_parse.cc:
  Query_log_event have new extra parameter.
2004-12-03 12:13:51 +01:00
unknown
7108deee6e spelling fixed/comments added (postreview fixes)
sql/mysqld.cc:
  spelling fixed
sql/sql_base.cc:
  spelling fixed
sql/sql_delete.cc:
  spelling fixed
sql/sql_parse.cc:
  comments added
sql/sql_prepare.cc:
  comments added
sql/sql_update.cc:
  spelling fixed
sql/sql_view.cc:
  spelling fixed
sql/table.cc:
  spelling fixed
2004-11-25 09:28:32 +02:00
unknown
a352372170 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-join-5.0


sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sp.cc:
  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_select.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.h:
  Auto merged
2004-11-25 02:27:02 +02:00
unknown
f88d01932f post-merge fix
mysql-test/r/view.result:
  changes in error number, and key in view processing
mysql-test/t/view.test:
  changes in error number, and key in view processing
sql/mysql_priv.h:
  changes functions
sql/sp.cc:
  now we report to setup_tables(), are we setuping SELECT...INSERT
sql/sql_base.cc:
  fixed finding table, taking in account join view, which can have not TABLE pointer
  now we report to setup_tables(), are we setuping SELECT...INSERT and ennumerete insert table separately
sql/sql_delete.cc:
  now we report to setup_tables(), are we setuping SELECT...INSERT
sql/sql_help.cc:
  now we report to setup_tables(), are we setuping SELECT...INSERT
sql/sql_insert.cc:
  fixed returning value of functions
sql/sql_load.cc:
  now we report to setup_tables(), are we setuping SELECT...INSERT
  removed second setup_tables call (merge)
sql/sql_olap.cc:
  now we report to setup_tables(), are we setuping SELECT...INSERT
sql/sql_parse.cc:
  UPDATE->MULTIUPDATE switching fixed
sql/sql_prepare.cc:
  UPDATE->MULTIUPDATE switching fixed
sql/sql_select.cc:
  now we report to setup_tables(), are we setuping SELECT...INSERT
sql/sql_update.cc:
  UPDATE->MULTIUPDATE switching fixed
sql/sql_view.cc:
  returning value fixed
sql/sql_view.h:
  returning value fixed
2004-11-25 02:23:13 +02:00
unknown
c774eb0e6d fixed problem in MacOS
correct printing of aliases


mysql-test/r/lowercase_view.result:
  aliases in VIEWs
mysql-test/t/lowercase_view.test:
  aliases in VIEWs
sql/item.cc:
  tracking using aliases in indentifiers
sql/item.h:
  tracking using aliases in indentifiers
sql/sql_base.cc:
  tracking using aliases in indentifiers
sql/sql_lex.cc:
  tracking using aliases in indentifiers
sql/sql_lex.h:
  tracking using aliases in indentifiers
sql/table.h:
  tracking using aliases in indentifiers
2004-11-24 19:48:30 +02:00
unknown
5a00a868b7 merge
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/opt_sum.cc:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_help.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_load.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_view.h:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2004-11-21 20:08:12 +02:00
unknown
c9497e2365 post merge 2004-11-21 19:33:49 +02:00
unknown
6eb81bbb22 fixing compiler warnings
sql/item_func.cc:
  fixed type
sql/sql_base.cc:
  keep kompiller happy about unused lable in libmysqld
sql/sql_view.cc:
  keep kompiller happy about unused variable in libmysqld
sql/table.h:
  correct type casting
2004-11-17 14:17:09 +02:00
unknown
ac9e3a9633 valgrind error fix 2004-11-16 00:29:49 +03:00
unknown
ac0cd2d3ac marge
sql/ha_innodb.cc:
  Auto merged
sql/ha_innodb.h:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/share/french/errmsg.txt:
  Auto merged
sql/share/greek/errmsg.txt:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
sql/share/portuguese/errmsg.txt:
  Auto merged
sql/share/romanian/errmsg.txt:
  Auto merged
sql/share/serbian/errmsg.txt:
  Auto merged
sql/share/spanish/errmsg.txt:
  Auto merged
sql/share/swedish/errmsg.txt:
  Auto merged
sql/mysql_priv.h:
  merge
sql/sql_parse.cc:
  merge
sql/sql_show.cc:
  merge
2004-11-13 19:45:36 +02:00
unknown
8d71bcec21 now my_printf_error is not better then my_error, but my_error call is shorter
used only one implementation of format parser of (printf)
fixed multistatement


include/mysqld_error.h:
  newerror messages
mysql-test/t/key.test:
  unknown error replaced with real error
mysys/my_error.c:
  my_error & my_printf_error use my_vsprintf
sql/field_conv.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/ha_innodb.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/handler.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/item.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_cmpfunc.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_func.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/item_strfunc.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/lock.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/log.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/parse_file.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/procedure.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/protocol.cc:
  no need reset thd->lex->found_colon to break multiline sequance now, send_error called too late
sql/repl_failsafe.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/set_var.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/share/czech/errmsg.txt:
  new errors converted from unknown error
sql/share/danish/errmsg.txt:
  new errors converted from unknown error
sql/share/dutch/errmsg.txt:
  new errors converted from unknown error
sql/share/english/errmsg.txt:
  new errors converted from unknown error
sql/share/estonian/errmsg.txt:
  new errors converted from unknown error
sql/share/french/errmsg.txt:
  new errors converted from unknown error
sql/share/german/errmsg.txt:
  new errors converted from unknown error
sql/share/greek/errmsg.txt:
  new errors converted from unknown error
sql/share/hungarian/errmsg.txt:
  new errors converted from unknown error
sql/share/italian/errmsg.txt:
  new errors converted from unknown error
sql/share/japanese/errmsg.txt:
  new errors converted from unknown error
sql/share/korean/errmsg.txt:
  new errors converted from unknown error
sql/share/norwegian-ny/errmsg.txt:
  new errors converted from unknown error
sql/share/norwegian/errmsg.txt:
  new errors converted from unknown error
sql/share/polish/errmsg.txt:
  new errors converted from unknown error
sql/share/portuguese/errmsg.txt:
  new errors converted from unknown error
sql/share/romanian/errmsg.txt:
  new errors converted from unknown error
sql/share/russian/errmsg.txt:
  new errors converted from unknown error
sql/share/serbian/errmsg.txt:
  new errors converted from unknown error
sql/share/slovak/errmsg.txt:
  new errors converted from unknown error
sql/share/spanish/errmsg.txt:
  new errors converted from unknown error
sql/share/swedish/errmsg.txt:
  new errors converted from unknown error
sql/share/ukrainian/errmsg.txt:
  new errors converted from unknown error
sql/slave.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/sp_head.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_acl.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_analyse.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_base.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_class.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_db.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_delete.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_handler.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_insert.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_load.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_map.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_parse.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
  multi-row command fixed
sql/sql_prepare.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
  remover send_error ingected from 4.1
sql/sql_rename.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_repl.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_select.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_show.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_table.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_trigger.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_udf.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_update.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_view.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/sql_yacc.yy:
  now my_printf_error is not better then my_error, but my_error call is shorter
sql/table.cc:
  now my_printf_error is not better then my_error, but my_error call is shorter
strings/my_vsnprintf.c:
  * format support added to my_vsprint
2004-11-13 19:35:51 +02:00