Commit graph

14954 commits

Author SHA1 Message Date
unknown
32fed579c5 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/dlenev/src/mysql-5.0-tzfix
2004-09-17 12:31:06 +04:00
unknown
436b8045bb Small after merge cleanup of time zone initialization code.
sql/tztime.cc:
  After merge cleanup.
  Updated comments for tz_init_table_list() and my_tz_get_table_list().
  my_tz_init(): Simplified table list creation.
2004-09-17 12:30:26 +04:00
unknown
e74b00bbc9 Removed wrong warnings in test suite (This was because select_insert / select_create results was not freed.
Added thd to openfrm() for initialization of TABLE->in_use. This fixed a bug in BDB handling where table->in_use was used early


mysql-test/r/key.result:
  Added new tests that shows a bug in warnings hat
mysql-test/t/key.test:
  Added new tests that shows a bug in warnings hat
sql/handler.cc:
  Added thd to openfrm() for initialization of TABLE->in_use
sql/item.cc:
  New function to avoid warnings when giving field a value
sql/item.h:
  New function to avoid warnings when giving field a value
sql/mysql_priv.h:
  Added thd to openfrm() for initialization of TABLE->in_use
sql/opt_range.cc:
  Don't give warnings in optimizer when internally storing a field value in a field. (Should be ok as we ar checking the feild in the WHERE clause later)
sql/sql_base.cc:
  Give memroot explicitely to open_unireg_entry() and open_table() (Makes code simpler)
  Ensure that table->in_use is set early
  New arguments for openfrm()
sql/sql_insert.cc:
  More debugging & comments
sql/sql_parse.cc:
  Delete results for select_insert and select_create. This fixed a bug that generated warnings in test suite
sql/sql_select.h:
  Don't give warnings in optimizer when internally storing a field value in a field. (Should be ok as we ar checking the feild in the WHERE clause later)
sql/sql_table.cc:
  New arguments to open_table() and openfrm()
sql/table.cc:
  Added thd to openfrm() for initialization of TABLE->in_use
  This fixes some bugs in BDB where table->in_use was used
2004-09-17 03:08:23 +03:00
unknown
6c3e66510c Merge
BitKeeper/etc/logging_ok:
  auto-union
sql/ha_berkeley.cc:
  Auto merged
sql/ha_heap.cc:
  Auto merged
sql/ha_innodb.cc:
  Auto merged
sql/ha_myisam.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_help.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_class.h:
  SCCS merged
sql/sql_parse.cc:
  SCCS merged
2004-09-15 22:36:57 +03:00
unknown
4ef01ca25c Added some missing per status variables.
sql/ha_isam.cc:
  Added per status variables.
sql/ha_isammrg.cc:
  Added per status variables.
2004-09-15 22:13:55 +03:00
unknown
ffc0d185da Added options --auto-increment-increment and --auto-increment-offset.
This allows one to setup a master <-> master replication with non conflicting auto-increment series.
Cleaned up binary log code to make it easyer to add new state variables.
Added simpler 'upper level' logic for artificial events (events that should not cause cleanups on slave).
Simplified binary log handling.
Changed how auto_increment works together with to SET INSERT_ID=# to make it more predictable: Now the inserted rows in a multi-row statement are set independent of the existing rows in the table. (Before only InnoDB did this correctly)




mysql-test/r/mix_innodb_myisam_binlog.result:
  Disable End_log_pos column from 'show binlog events' as this is now different from before
mysql-test/t/mix_innodb_myisam_binlog.test:
  Disable End_log_pos column from 'show binlog events' as this is now different from before
sql/ha_berkeley.cc:
  Changed prototype for get_auto_increment()
sql/ha_berkeley.h:
  Changed prototype for get_auto_increment()
sql/ha_heap.cc:
  Changed prototype for get_auto_increment()
sql/ha_heap.h:
  Changed prototype for get_auto_increment()
sql/ha_innodb.cc:
  Change how auto-increment is calculated.
  Now the auto-increment logic is done in 'update_auto_increment()' to ensure that all handlers has the same auto-increment usage
sql/ha_innodb.h:
  Changed prototype for get_auto_increment()
sql/ha_myisam.cc:
  Changed prototype for get_auto_increment()
sql/ha_myisam.h:
  Changed prototype for get_auto_increment()
sql/ha_ndbcluster.cc:
  Changed prototype for get_auto_increment()
sql/ha_ndbcluster.h:
  Changed prototype for get_auto_increment()
sql/handler.cc:
  Remove some usage of current_thd
  Changed how auto_increment works with SET INSERT_ID to make it more predictable
  (Now we should generate same auto-increment serie on a slave, even if the table has rows that was not on the master.
  Use auto_increment_increment and auto_increment_offset
sql/handler.h:
  Changed prototype for get_auto_increment()
sql/log.cc:
  Remove usage of 'set_log_pos()' to make code simpler. (Now log_pos is set in write_header())
  Use 'data_written' instead of 'get_event_len()' to calculate how much data was written in the log
sql/log_event.cc:
  Simple optimizations.
  Remove cached_event_len (not used variable)
  Made comments fit into 79 chars
  Removed Log_event::set_log_pos(). Now we calculate log_pos in write_header().
  Renamed write_data() to write() as the original write() function was not needed anymore.
  Call writing of event header from event::write() functions. This made it easier to calculate the length of an event.
  Simplified 'write_header' and remove 'switches' from it.
  Changed all write() functions to return 'bool'. (The previous return values where not consistent)
  Store auto_increment_increment and auto_increment_offset in binary log
  Simplified how Query_log_event's where written and read. Now it's much easier to add now status variables for a query event to the binary log.
  Removed some old MySQL 4.x code to make it easier to grep for functions used in 5.0
sql/log_event.h:
  Changed return type of write() functions to bool. (Before we returned -1 or 1 for errors)
  write_data() -> write()
  Added 'data_written' member to make it easier to get length of written event.
  Removed 'cached_event_len' and 'get_event_len()'
  Added usage of auto_increment_increment and auto_increment_offset
  Added 'artifical_event' to Start_log_event_v3, to hide logic that we in the binary log use log_pos=0 as a flag for an artifical event.
sql/mysqld.cc:
  Added options --auto-increment-increment and --auto-increment-offset
sql/set_var.cc:
  Added variables auto_increment_increment and auto_increment_offset
sql/slave.cc:
  Changed errors -> warnings & information (in error log)
sql/sql_class.cc:
  Added THD::cleanup_after_query(). This makes some code simpler and allows us to clean up 'next_insert_id' after query
sql/sql_class.h:
  Added new auto_increment_xxx variables
  Moved some functions/variables in THD class
sql/sql_help.cc:
  Removed compiler warning
sql/sql_insert.cc:
  Call 'restore_auto_increment()' if row was not inserted.
  This makes it easier for handler to reuse the last generated auto-incrment value that was not used (for example in case of duplicate key)
sql/sql_parse.cc:
  Use cleanup_after_query()
sql/sql_prepare.cc:
  Use cleanup_after_query()
sql/sql_table.cc:
  R
2004-09-15 22:10:31 +03:00
unknown
e32059a93e Fixed a couple of bugs.
sql/ha_ndbcluster.cc:
  Changed some old global variables to per thread specific in ha_ndbcluster.cc
sql/sql_help.cc:
  Added parenthesis.
BitKeeper/etc/logging_ok:
  Logging to logging@openlogging.org accepted
2004-09-14 22:02:23 +03:00
unknown
66434a6c6a Two small fixes to make -debug version usable again.
include/my_sys.h:
  Temporaly reverting Monty's optimization of clear_alloc_root() since it makes -debug server
  unusable.
sql/sql_select.cc:
  After merge fix. Now deletion is done outside of handle_select().
  (We fixed the same issue with deletion of LEX::result in 4.1 for prepared statements
   but in more general way).
2004-09-14 00:35:42 +04:00
unknown
edb9559fd0 Merge.
include/my_sys.h:
  Auto merged
sql/ha_berkeley.cc:
  Auto merged
sql/ha_heap.cc:
  Auto merged
sql/ha_innodb.cc:
  Auto merged
sql/ha_myisam.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
sql/sql_class.h:
  Merge
2004-09-13 18:12:44 +03:00
unknown
9352715111 Added per thread status variables, after review, patch v1.1. 2004-09-13 16:48:01 +03:00
unknown
ae70baf21c table lists management during VIEW processing code cleanup
sql/sql_lex.h:
  comments added
  new method of adding table to global query tables list
sql/sql_parse.cc:
  used new method to add table to query tables list
  removed spaces at end of line in new code
sql/sql_view.cc:
  layout fixed
  table lists management code cleanup
2004-09-11 23:52:55 +03:00
unknown
e4dc7e5a40 Merge abelkin@bk-internal.mysql.com:/home/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0


mysql-test/r/view.result:
  Auto merged
2004-09-11 18:50:54 +03:00
unknown
5d7848d8bf fixed privilege system upgrade script, to allow VIEW privileges for used who have CREATE privilege (BUG#5329)
scripts/mysql_fix_privilege_tables.sql:
  fixed privilege system upgrade script, to allow VIEW privileges for used who have CREATE privilege
2004-09-11 18:46:06 +03:00
unknown
8ad470e23f fixed typo (thanks to Igor)
sql/table.cc:
  fixed typo
2004-09-11 09:36:43 +03:00
unknown
f4c303b8a7 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/cps/mysql/devel/im/default_patch/mysql-5.0


BitKeeper/etc/logging_ok:
  auto-union
2004-09-11 00:48:13 +04:00
unknown
15526e4ed7 Fixed a problem causing load_defaults not to accept some command-line
options.


mysys/default.c:
  Fixed search_files function to return the number of used arguments
  properly.
BitKeeper/etc/logging_ok:
  Logging to logging@openlogging.org accepted
2004-09-11 00:44:09 +04:00
unknown
952a778d23 Fix bad output in SHOW CREATE VIEW, update affected
test result.


mysql-test/r/view.result:
  Update test result to match sql_show.cc change.
sql/sql_show.cc:
  Fix bad output in SHOW CREATE VIEW.
2004-09-10 15:04:28 -05:00
unknown
8b2ffdbfb9 view with WHERE in nested join (BUG#5511)
mysql-test/r/view.result:
  view with WHERE in nested join
mysql-test/t/view.test:
  view with WHERE in nested join
sql/table.cc:
  fixed merging of VIEW
2004-09-10 22:39:04 +03:00
unknown
9af3278fa2 sql_yacc.yy:
Make "FRAC_SECOND"/"SQL_TSI_FRAC_SECOND" non-reserved words,
  must like "SECOND"/"SQL_TSI_SECOND", "MINUTE"/"SQL_TSI_MINUTE",
  etc.
  Will wait for okay to push. (It doesn't break any tests.)


sql/sql_yacc.yy:
  Make "FRAC_SECOND"/"SQL_TSI_FRAC_SECOND" non-reserved words,
  must like "SECOND"/"SQL_TSI_SECOND", "MINUTE"/"SQL_TSI_MINUTE",
  etc.
2004-09-10 13:56:06 -05:00
unknown
d6f663188c Merge mysql.com:/usr/local/bk/mysql-5.0
into mysql.com:/home/pem/work/mysql-5.0-merge
2004-09-10 16:33:21 +02:00
unknown
749c03840a Fixed BUG#4941: Stored procedure crash fetching null value into variable.
mysql-test/r/sp.result:
  New test case for BUG#4941.
mysql-test/t/sp.test:
  New test case for BUG#4941.
sql/protocol_cursor.cc:
  Handle null values.
sql/sp_rcontext.cc:
  Handle null values.
2004-09-10 16:28:11 +02:00
unknown
b5983daa8c post merge fix 2004-09-10 15:08:30 +03:00
unknown
0650a2840e Merge
sql/sql_handler.cc:
  Auto merged
mysql-test/r/view.result:
  SCCS merged
mysql-test/t/view.test:
  SCCS merged
2004-09-10 14:01:02 +03:00
unknown
fc8da24a71 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-show-5.0


BitKeeper/etc/ignore:
  auto-union
2004-09-10 13:11:33 +03:00
unknown
76001900fd thd pointer fixed
BitKeeper/etc/ignore:
  Added libmysqld/sql_trigger.cc to the ignore list
mysql-test/r/merge.result:
  fix of test
2004-09-10 13:09:27 +03:00
unknown
1912148cec Fixed BUG#3294: Stored procedure crash if table dropped before use.
Dropping the table was not the real problem, the problem was with errors
  occuring within error handlers.


mysql-test/r/sp-error.result:
  New test case for BUG#3294.
mysql-test/t/sp-error.test:
  New test case for BUG#3294.
sql/sp_head.cc:
  Use hreturn instruction both for continue and exit handlers (a special case
  of a jump).
sql/sp_head.h:
  Use hreturn instruction both for continue and exit handlers (a special case
  of a jump).
sql/sp_rcontext.cc:
  Keep track on if we're in a handler already, for error handling.
sql/sp_rcontext.h:
  Keep track on if we're in a handler already, for error handling.
sql/sql_yacc.yy:
  Use hreturn instruction both for continue and exit handlers (a special case
  of a jump).
2004-09-10 11:11:52 +02:00
unknown
862e78568e Fixed --with-embedded builds.
Added previously missing sql_trigger.cc file to embedded library.


BitKeeper/etc/ignore:
  Added libmysqld/sql_trigger.cc to the ignore list
libmysqld/Makefile.am:
  Added previously sql_trigger.cc file to embedded library.
2004-09-10 10:29:08 +04:00
unknown
f3d4db99c3 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-show-5.0


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:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/table.h:
  Auto merged
2004-09-10 02:26:09 +03:00
unknown
b386f888da post merge fixes
mysql-test/t/merge.test:
  additional test
sql/item.h:
  parameter to detect need of saving view field names
sql/item_subselect.cc:
  arena fix
  used nearest thd pointer
sql/item_sum.cc:
  after merge fix
sql/mysql_priv.h:
  after merge fix
sql/sql_base.cc:
  fixed unique test
  fixed postmerge arena mamgement
sql/sql_class.h:
  mey method to detect conventional execution
sql/sql_handler.cc:
  new parameter
sql/sql_lex.cc:
  fixed postmerge arena mamgement
sql/sql_parse.cc:
  fixed unique test
sql/sql_select.cc:
  fixed postmerge arena mamgement
sql/sql_union.cc:
  fixed postmerge arena mamgement
sql/sql_view.cc:
  fixed postmerge arena mamgement
sql/table.cc:
  fixed postmerge arena mamgement
2004-09-10 02:22:44 +03:00
unknown
b0afd74eba Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/dlenev/src/mysql-5.0-1218-a


sql/item_func.h:
  Auto merged
2004-09-09 23:45:19 +04:00
unknown
97cbcbb0d7 After merge fixes for WL#1218 "Triggers"
mysql-test/t/trigger.test:
  After merge fix, error codes corrected.
sql/sp_head.cc:
  After mrege fix. Fixed typo.
sql/sql_trigger.cc:
  After merge fix. wait_if_gloabl_read_lock has one more argument now.
2004-09-09 23:44:27 +04:00
unknown
0994dc396e Fixed BUG#4487: Stored procedure connection aborted if uninitialized char.
mysql-test/r/sp.result:
  New test case for BUG#4487.
mysql-test/t/sp.test:
  New test case for BUG#4487.
sql/item_func.h:
  Propagate null_value properly in sp functions.
2004-09-09 19:08:54 +02:00
unknown
eb75a9fd8d Yet another manual merge with main tree for patch for WL#1218 "Triggers"
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/lex.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/share/czech/errmsg.txt:
  Auto merged
sql/share/danish/errmsg.txt:
  Auto merged
sql/share/dutch/errmsg.txt:
  Auto merged
sql/share/english/errmsg.txt:
  Auto merged
sql/share/estonian/errmsg.txt:
  Auto merged
sql/share/french/errmsg.txt:
  Auto merged
sql/share/german/errmsg.txt:
  Auto merged
sql/share/greek/errmsg.txt:
  Auto merged
sql/share/hungarian/errmsg.txt:
  Auto merged
sql/share/italian/errmsg.txt:
  Auto merged
sql/share/japanese/errmsg.txt:
  Auto merged
sql/share/korean/errmsg.txt:
  Auto merged
sql/share/norwegian-ny/errmsg.txt:
  Auto merged
sql/share/norwegian/errmsg.txt:
  Auto merged
sql/share/polish/errmsg.txt:
  Auto merged
sql/share/portuguese/errmsg.txt:
  Auto merged
sql/share/romanian/errmsg.txt:
  Auto merged
sql/share/russian/errmsg.txt:
  Auto merged
sql/share/serbian/errmsg.txt:
  Auto merged
sql/share/slovak/errmsg.txt:
  Auto merged
sql/share/spanish/errmsg.txt:
  Auto merged
sql/share/swedish/errmsg.txt:
  Auto merged
sql/share/ukrainian/errmsg.txt:
  Auto merged
include/mysqld_error.h:
  Manual merge.
sql/Makefile.am:
  Manual merge.
sql/mysql_priv.h:
  Manual merge.
sql/sp_head.cc:
  Manual merge.
sql/sql_lex.cc:
  Manual merge.
sql/sql_yacc.yy:
  Manual merge.
2004-09-09 19:52:10 +04:00
unknown
ed2c4854dd merge
mysql-test/r/view.result:
  Auto merged
mysql-test/t/view.test:
  Auto merged
sql/item.cc:
  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_show.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
2004-09-09 16:52:22 +03:00
unknown
b15004a800 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mishka.local:/home/my/mysql-5.0


BitKeeper/etc/logging_ok:
  auto-union
sql/mysql_priv.h:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
2004-09-09 15:58:55 +03:00
unknown
bc78725424 Update after merge 2004-09-09 14:55:28 +03:00
unknown
e18b7ea959 Merge on pull
BitKeeper/etc/logging_ok:
  auto-union
include/my_sys.h:
  Auto merged
mysql-test/r/func_in.result:
  Auto merged
2004-09-09 07:26:28 +03:00
unknown
33efc9677d After merge fixes of merge with 4.1 that included the new arena code.
Fixed (together with Guilhem) bugs in mysqlbinlog regarding --offset
Prefix addresses with 0x for easier comparisons of debug logs
Fixed problem where MySQL choosed index-read even if there would be a much better range on the same index
This fix changed some 'index' queries to 'range' queries in the test suite
Don't create 'dummy' WHERE clause for trivial WHERE clauses where we can remove the WHERE clause.
This fix removed of a lot of 'Using where' notes in the test suite.
Give NOTE instead of WARNING if table/function doesn't exists when using DROP IF EXISTS
Give NOTE instead of WARNING for safe field-type conversions


Makefile.am:
  Don't automaticly update files from bk
client/mysqlbinlog.cc:
  Merge with 4.1 (+ apply bug fixes for --offset and --start-position)
include/my_sys.h:
  Faster clear_alloc_root()
mysql-test/r/bdb.result:
  Updated results after merge
mysql-test/r/create.result:
  Updated results after merge
mysql-test/r/func_group.result:
  Updated results after merge
mysql-test/r/func_if.result:
  Updated results after merge
mysql-test/r/heap_btree.result:
  Updated results after merge
mysql-test/r/index_merge.result:
  Updated results after merge
mysql-test/r/index_merge_ror.result:
  Updated results after merge
mysql-test/r/innodb.result:
  Updated results after merge
mysql-test/r/join_outer.result:
  Updated results after merge
mysql-test/r/mysqlbinlog2.result:
  Updated results after merge
mysql-test/r/negation_elimination.result:
  Updated results after merge
mysql-test/r/null.result:
  Updated results after merge
  Added more tests
mysql-test/r/null_key.result:
  Updated results after merge
  Added more tests
mysql-test/r/order_by.result:
  Updated results after merge
mysql-test/r/range.result:
  Updated results after merge
  Added more tests
mysql-test/r/rpl_charset.result:
  Updated results after merge
mysql-test/r/sp-error.result:
  Updated results after merge
mysql-test/r/sp.result:
  Updated results after merge
  Added delete of some stored procedures in an attempt to be able to re-run test even if it aborts in the middle
mysql-test/r/type_blob.result:
  Updated results after merge
  (Some warnings are now notes)
mysql-test/r/user_var.result:
  Updated results after merge
  Added more tests
mysql-test/r/variables.result:
  Updated results after merge
mysql-test/r/view.result:
  Updated results after merge
mysql-test/t/mysqlbinlog2.test:
  Updated tests to use new positions
mysql-test/t/null.test:
  More tests
mysql-test/t/null_key.test:
  More tests
mysql-test/t/range.test:
  More tests
mysql-test/t/rpl_charset.test:
  Avoid big diffs in the future if tests changes
mysql-test/t/sp-error.test:
  Updated error numbers
mysql-test/t/sp-security.test:
  Updated error numbers
mysql-test/t/sp.test:
  Updated results after merge
  Added delete of some stored procedures in an attempt to be able to re-run test even if it aborts in the middle
mysql-test/t/user_var.test:
  More tests
mysql-test/t/view.test:
  Updated error numbers
mysys/my_alloc.c:
  Write into debug log the address of the allocated area
sql/ha_isam.cc:
  Prefix addresses with 0x for easier comparisons of debug logs
sql/ha_myisam.cc:
  Prefix addresses with 0x for easier comparisons of debug logs
sql/ha_ndbcluster.cc:
  Add missing enum to switch
sql/handler.cc:
  remove compiler warning
sql/item.cc:
  More debugging
  Simple cleanup
sql/item.h:
  Move Item::cleanup() to item.cc
sql/item_cmpfunc.cc:
  Fix arena code
sql/item_subselect.cc:
  After merge fixes
sql/item_subselect.h:
  After merge fixes
sql/item_sum.cc:
  Updated comment
sql/log_event.cc:
  Remove wrong test
sql/mysql_priv.h:
  Indentation fixes
sql/mysqld.cc:
  After merge fixes
  Added 0x to pointers in debug log
sql/opt_range.cc:
  Fixed problem where MySQL choosed index-read even if there would be a much better range on the same index
  This fix changed some 'index' queries to 'range' queries in the test suite
sql/set_var.cc:
  Indentation fixes
sql/sp_head.cc:
  Set state to INITIALIZED to make SP work with new arena code
sql/sql_base.cc:
  After merge fixes
sql/sql_class.cc:
  More debugging
  Use clear_alloc_root() instead of init_alloc_root() as the former is faster
sql/sql_class.h:
  New method 'only_prepare()'
sql/sql_lex.cc:
  After merge fixes
sql/sql_lex.h:
  After merge fixes
sql/sql_parse.cc:
  Fix for timezone tables. (The old way to add timezone tables to global list in 'create_total_list' doesn't work anymore)
  Give NOTE instead of WARNING if table/function doesn't exists when using DROP IF EXISTS
sql/sql_prepare.cc:
  After merge fixes
sql/sql_select.cc:
  Don't create 'dummy' WHERE clause for trivial WHERE clauses where we can remove the WHERE clause.
  This fix removed of a lot of 'Using where' notes in the test suite
sql/sql_table.cc:
  Give NOTE instead of WARNING if table/function doesn't exists when using DROP IF EXISTS
sql/sql_union.cc:
  After merge fix
sql/sql_view.cc:
  After merge fix
sql/table.cc:
  After merge fix
sql/tztime.cc:
  Update timezone table handling to use new table lists structure
sql/tztime.h:
  Update timezone table handling to use new table lists structure
sql/unireg.cc:
  Use 0x before pointers
2004-09-09 06:59:26 +03:00
unknown
12ce293a7f WL#1218 "Triggers"
After review and after merge fixes.


mysql-test/t/trigger.test:
  After merge fix. Updated error codes.
sql/sp_head.cc:
  After merge fix.
  To give some chances for functions/triggers we have to close tables during sp_instr_* 
  execution only if we have opened them before.
sql/sp_head.h:
  After merge fix. sp_instr constructor now takes one more argument.
sql/sql_trigger.cc:
  After merge and review fixes.
  Some variable renaming and optimizations.
sql/sql_yacc.yy:
  After merge fixes.
  sp_instr_* classes now require sp context as constructor parameter.
  Also we should be careful with adding table for which we are creating trigger to table 
  list. Some elements in trigger body can damage LEX::query_tables and so we should add this
  table to list only after parsing trigger body.
2004-09-09 00:46:01 +04:00
unknown
c92b534970 Fixed BUG#5000: SPs can be created with no default database.
Easy to prevent crash, but the question was how to treat this case?
  We ended up implementing the "global" SPs (i.e. with no associated
  db), which were planned but left unresolved when SPs moved into dbs.
  So now things like "call .p()" work too.


mysql-test/r/sp-error.result:
  New test case for BUG#5000, and "global" SPs in general.
mysql-test/t/sp-error.test:
  New test case for BUG#5000, and "global" SPs in general.
sql/sp.cc:
  Prevent crash when the new db is null.
sql/sp_head.cc:
  Don't set the db part of the name to thd->db, we have already set it correctly
  in the provided name struct.
  Also, don't attempt to change "no-db" when executing an SP.
sql/sql_yacc.yy:
  Added support for the "global SP" syntax, e.g ".p()".
2004-09-08 14:23:14 +02:00
unknown
1bf3ce01c4 Fixed BUG#5258: Stored procedure modified date is 0000-00-00.
Althought techically not a but (as it's functioning as designed),
  it was decided that the design should be changed. Some users have
  a problem with dates being '0000-00-00' and the SQL standard specifies
  that the modification date should be the same as the creation date
  at creation.


mysql-test/r/sp.result:
  New test case for BUG#5258.
mysql-test/t/sp.test:
  New test case for BUG#5258.
sql/sp.cc:
  Set the modification time at creation too.
2004-09-08 11:42:18 +02:00
unknown
cab6f8df6d Merge of changes from the main tree to tree for WL#1218 "Triggers".
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/lex.h:
  Auto merged
sql/parse_file.cc:
  Auto merged
sql/sp_head.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_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.h:
  Auto merged
include/mysqld_error.h:
  Manual merge.
sql/mysql_priv.h:
  Manual merge.
sql/share/czech/errmsg.txt:
  Manual merge.
sql/share/danish/errmsg.txt:
  Manual merge.
sql/share/dutch/errmsg.txt:
  Manual merge.
sql/share/english/errmsg.txt:
  Manual merge.
sql/share/estonian/errmsg.txt:
  Manual merge.
sql/share/french/errmsg.txt:
  Manual merge.
sql/share/german/errmsg.txt:
  Manual merge.
sql/share/greek/errmsg.txt:
  Manual merge.
sql/share/hungarian/errmsg.txt:
  Manual merge.
sql/share/italian/errmsg.txt:
  Manual merge.
sql/share/japanese/errmsg.txt:
  Manual merge.
sql/share/korean/errmsg.txt:
  Manual merge.
sql/share/norwegian-ny/errmsg.txt:
  Manual merge.
sql/share/norwegian/errmsg.txt:
  Manual merge.
sql/share/polish/errmsg.txt:
  Manual merge.
sql/share/portuguese/errmsg.txt:
  Manual merge.
sql/share/romanian/errmsg.txt:
  Manual merge.
sql/share/russian/errmsg.txt:
  Manual merge.
sql/share/serbian/errmsg.txt:
  Manual merge.
sql/share/slovak/errmsg.txt:
  Manual merge.
sql/share/spanish/errmsg.txt:
  Manual merge.
sql/share/swedish/errmsg.txt:
  Manual merge.
sql/share/ukrainian/errmsg.txt:
  Manual merge.
sql/sp_head.cc:
  Manual merge.
2004-09-08 13:29:21 +04:00
unknown
7de077f7df test of updating and fetching from the same table check (BUG##5157)
mysql-test/r/lowercase_view.result:
  test of updating and fetching from the same table check
mysql-test/r/view.result:
  test of updating and fetching from the same table check
mysql-test/t/lowercase_view.test:
  test of updating and fetching from the same table check
mysql-test/t/view.test:
  test of updating and fetching from the same table check
sql/mysql_priv.h:
  unique table test
sql/sql_base.cc:
  unique table test which take into account views added
sql/sql_delete.cc:
  unique table test which take into account views added
sql/sql_insert.cc:
  unique table test which take into account views added
sql/sql_parse.cc:
  unique table test which take into account views added
sql/sql_update.cc:
  unique table test which take into account views added
sql/sql_view.cc:
  unique table test which take into account views added
sql/table.h:
  save next independent (do not belong to current view) table
2004-09-08 10:18:04 +03:00
unknown
c647f600af returning test environment 2004-09-07 20:40:16 +03:00
unknown
38404d90be ixed table and db name of fields incase of lower_case_table_names (BUG#5154)
sql/item.cc:
  fixed table and db name of fields incase of lower_case_table_names
2004-09-07 19:58:02 +03:00
unknown
9243aa9ebe Fixed typo that showed up in non-debug build (in sql/sql_show.cc).
sql/sql_show.cc:
  Fixed typo that showed up in non-debug build.
2004-09-07 17:12:49 +02:00
unknown
3db980958a support of view to COM_FIELD_LIST added (BUG#5145)
sql/sql_parse.cc:
  support of view to COM_FIELD_LIST added
sql/sql_show.cc:
  support of view to COM_FIELD_LIST added
2004-09-07 15:50:56 +03:00
unknown
52ac4935e7 WL#1218 "Triggers". Some very preliminary version of patch.
Mostly needed for Monty for him getting notion what needed for triggers 
from new .FRM format. 

Things to be done:
- Right placement of trigger's invocations
- Right handling of errors in triggers (including transaction rollback)
- Support for priviliges
- Right handling of DROP/RENAME table (hope that it will be handled automatically
  with merging of .TRG into .FRM file)
- Saving/restoring some information critical for trigger creation and replication
  with their definitions (e.g. sql_mode, creator, ...)
- Replication

Already has some known bugs so probably not for general review.


include/mysqld_error.h:
  Added trigger related error codes.
sql/Makefile.am:
  Added sql_trigger.* files to list of sources from which mysqld is built.
sql/item.cc:
  Added Item_trigger_field class representing field of new/old version of row which is 
  inserted/updated/deleted and for which trigger is invoked.
sql/item.h:
  Added enums for describing trigger properties. (Here because of dependencies).
  Added Item_trigger_field class representing field of new/old version of row which is 
  inserted/updated/deleted and for which trigger is invoked.
sql/item_func.cc:
  Added Item_func_set_user_var::print_as_stmt() for printing of assignment to ser variable
  from stored procedures.
  Added comment clarifying why we don't need set no_send_ok when calling stored functions.
sql/item_func.h:
  Added Item_func_set_user_var::print_as_stmt() for printing of assignment to ser variable
  from stored procedures.
sql/lex.h:
  Symbols used in statements defining triggers were added.
sql/mysql_priv.h:
  Exported some functions needed for triggers implementation.
sql/parse_file.cc:
  Cleaned up FILE_OPTIONS_STRLIST handling (needed for triggers).
sql/parse_file.h:
  Cleaned up FILE_OPTIONS_STRLIST handling (needed for triggers).
sql/share/czech/errmsg.txt:
  Added trigger related error messages.
sql/share/danish/errmsg.txt:
  Added trigger related error messages.
sql/share/dutch/errmsg.txt:
  Added trigger related error messages.
sql/share/english/errmsg.txt:
  Added trigger related error messages.
sql/share/estonian/errmsg.txt:
  Added trigger related error messages.
sql/share/french/errmsg.txt:
  Added trigger related error messages.
sql/share/german/errmsg.txt:
  Added trigger related error messages.
sql/share/greek/errmsg.txt:
  Added trigger related error messages.
sql/share/hungarian/errmsg.txt:
  Added trigger related error messages.
sql/share/italian/errmsg.txt:
  Added trigger related error messages.
sql/share/japanese/errmsg.txt:
  Added trigger related error messages.
sql/share/korean/errmsg.txt:
  Added trigger related error messages.
sql/share/norwegian-ny/errmsg.txt:
  Added trigger related error messages.
sql/share/norwegian/errmsg.txt:
  Added trigger related error messages.
sql/share/polish/errmsg.txt:
  Added trigger related error messages.
sql/share/portuguese/errmsg.txt:
  Added trigger related error messages.
sql/share/romanian/errmsg.txt:
  Added trigger related error messages.
sql/share/russian/errmsg.txt:
  Added trigger related error messages.
sql/share/serbian/errmsg.txt:
  Added trigger related error messages.
sql/share/slovak/errmsg.txt:
  Added trigger related error messages.
sql/share/spanish/errmsg.txt:
  Added trigger related error messages.
sql/share/swedish/errmsg.txt:
  Added trigger related error messages.
sql/share/ukrainian/errmsg.txt:
  Added trigger related error messages.
sql/sp_head.cc:
  sp_head::init_strings(): added support for triggers 
    (we don't have most of strings for them)
  sp_head::execute_function(): triggers don't require RETURN
  sp_head::reset_lex(): added propagation of trigger properties to LEX used for 
   parsing of statements composing trigger body.
  Added two more SP instructions:
  - sp_instr_set_user_var for setting user variables in stored functions and triggers
    (we can't use sp_instr_stmt and "SET @a:=..." statement since it will close open 
    tables and thus break execution of calling statement.
  - sp_instr_set_trigger_field for assignment to fields of row being updated/inserted in
    triggers
sql/sp_head.h:
  Added new type of sp_head object - TYPE_ENUM_TRIGGER
  Added two more SP instructions:
  - sp_instr_set_user_var for setting user variables in stored functions and triggers
    (we can't use sp_instr_stmt and "SET @a:=..." statement since it will close open 
    tables and thus break execution of calling statement.
  - sp_instr_set_trigger_field for assignment to fields of row being updated/inserted in
    triggers
sql/sql_base.cc:
  Now freeing memory occupied by trigger related structures when closing tables.
  open_unireg_entry(): added loading of triggers for table.
  find_field_in_real_table() is now public since it required by Item_trigger_field in item.cc
sql/sql_delete.cc:
  Added triggers invocation for DELETE (should be fixed for sure :))
sql/sql_insert.cc:
  Added triggers invocation for INSERT (should be fixed for sure :))
sql/sql_lex.cc:
  Added trg_new_row_fake_var variable pointer to which is used for distinguishing between
  assignment to NEW row field (when parsing trigger definition) and structured variable.
  Added initialization of LEX->trg_table to lex_start(). (When triggers are parsed during
  opening of table it points to table object.)
sql/sql_lex.h:
  Added trigger related commands.
  Added st_trg_chistics structure describing properties of trigger being created
  (as struct and as LEX member).
  Added trg_new_row_fake_var variable pointer to which is used for
  distinguishing between assignment to NEW row field (when parsing trigger definition)
  and structured variable.
  Added LEX::trg_table which points to table being opened when we are parsing trigger
  definition while opening table.
sql/sql_parse.cc:
  Added support for CREATE/DROP TRIGGER commands.
sql/sql_table.cc:
  Cleanup. close_cached_table() always returns 0 and its result is not analyzed in most
  places so chenged its return type to void.
sql/sql_update.cc:
  Added triggers invocation for UPDATE (should be fixed for sure :))
sql/sql_yacc.yy:
  Added support for CREATE/DROP TRIGGER statements.
  Added support for OLD/NEW row identifiers in trigger.
  Made assignment to user variables not to break execution of stored function or trigger.
sql/table.h:
  Added TABLE::triggers member representing triggers for this table.
2004-09-07 16:29:46 +04:00
unknown
ac473c3813 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mishka.local:/home/my/mysql-5.0


BitKeeper/etc/logging_ok:
  auto-union
sql/mysql_priv.h:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
2004-09-07 11:33:37 +03:00
unknown
6e0b468f18 requre BASE TABLE for HANDLER (BUG#5277)
mysql-test/r/view.result:
  HANDLER with VIEW
mysql-test/t/view.test:
  HANDLER with VIEW
sql/sql_handler.cc:
  requre BASE TABLE for HANDLER
2004-09-07 10:42:23 +03:00