Commit graph

596 commits

Author SHA1 Message Date
unknown
2e1bfbd2b4 Cleanup patch for handling of subselects in commands which cannot
handle them.

Problem:
CREATE|ALTER EVENT, HANDLER READ, KILL, Partitioning uses `expr` from the
parser. This rule comes with all the rings and bells including subqueries.
However, these commands are not subquery safe. For this reason there are two
fuse checks in the parser. They were checking by command id. CREATE EVENT
should forbid subquery is the fix for
bug#16394 Events: Crash if schedule contains SELECT
The fix has been incorporated as part of the patch for WL#3337 (Event scheduler
new architecture).

Solution:
A new flag was added to LEX command_forbids_subselect. The fuse checks were
changed. The commands are responsible to set the value to true whenever
they can't handle subselects.


sql/sql_lex.cc:
  initialize the variable
sql/sql_lex.h:
  Add a new flag whether the parser should allow a subselect when
  parsing. This is temporarily turned off by commands like CREATE|ALTER EVENT,
  HA_READ, KILL. Could be used by other parts which reuse `expr` rule of the
  grammar and should not allow subqueries as part of it.
sql/sql_yacc.yy:
  Forbid subselects in some commands in a better way.
  CREATE|ALTER EVENT, HANDLER READ, KILL, are not subselect
  safe for parameters and therefore they should be forbidden already in
  the parser.
  This patch makes it easier for the developer to add new commands in that
  sense similar to the mentioned above.
2006-08-23 16:53:04 +02:00
unknown
e10aed5272 Merge bk-internal.mysql.com:/data0/bk/mysql-5.1-runtime
into  bk-internal.mysql.com:/data0/bk/mysql-5.1-wl3337


sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
2006-08-18 10:11:32 +02:00
unknown
96aef62c73 Merge ahristov@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  example.com:/work/mysql-5.1-runtime


sql/item.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_partition.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_trigger.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
2006-08-17 19:09:55 +02:00
unknown
728a924c66 Cleanup patch.
There is an existing macros for initializing LEX_STRINGs
with constant strings -> C_STRING_WITH_LEN. Change existing code to use it.
(char *) STRING_WITH_LEN -> C_STRING_WITH_LEN


sql/handler.cc:
  There is an existing macros for initializing LEX_STRINGs
  with constant strings -> C_STRING_WITH_LEN. Change existing code to use it.
  (char *) STRING_WITH_LEN -> C_STRING_WITH_LEN
sql/item.cc:
  There is an existing macros for initializing LEX_STRINGs
  with constant strings -> C_STRING_WITH_LEN. Change existing code to use it.
  (char *) STRING_WITH_LEN -> C_STRING_WITH_LEN
sql/mysql_priv.h:
  There is an existing macros for initializing LEX_STRINGs
  with constant strings -> C_STRING_WITH_LEN. Change existing code to use it.
  (char *) STRING_WITH_LEN -> C_STRING_WITH_LEN
sql/sql_acl.cc:
  There is an existing macros for initializing LEX_STRINGs
  with constant strings -> C_STRING_WITH_LEN. Change existing code to use it.
  (char *) STRING_WITH_LEN -> C_STRING_WITH_LEN
sql/sql_error.cc:
  There is an existing macros for initializing LEX_STRINGs
  with constant strings -> C_STRING_WITH_LEN. Change existing code to use it.
  (char *) STRING_WITH_LEN -> C_STRING_WITH_LEN
sql/sql_error.h:
  There is an existing macros for initializing LEX_STRINGs
  with constant strings -> C_STRING_WITH_LEN. Change existing code to use it.
  (char *) STRING_WITH_LEN -> C_STRING_WITH_LEN
sql/sql_lex.h:
  There is an existing macros for initializing LEX_STRINGs
  with constant strings -> C_STRING_WITH_LEN. Change existing code to use it.
  (char *) STRING_WITH_LEN -> C_STRING_WITH_LEN
sql/sql_parse.cc:
  There is an existing macros for initializing LEX_STRINGs
  with constant strings -> C_STRING_WITH_LEN. Change existing code to use it.
  (char *) STRING_WITH_LEN -> C_STRING_WITH_LEN
sql/sql_partition.cc:
  There is an existing macros for initializing LEX_STRINGs
  with constant strings -> C_STRING_WITH_LEN. Change existing code to use it.
  (char *) STRING_WITH_LEN -> C_STRING_WITH_LEN
sql/sql_plugin.cc:
  There is an existing macros for initializing LEX_STRINGs
  with constant strings -> C_STRING_WITH_LEN. Change existing code to use it.
  (char *) STRING_WITH_LEN -> C_STRING_WITH_LEN
sql/sql_show.cc:
  There is an existing macros for initializing LEX_STRINGs
  with constant strings -> C_STRING_WITH_LEN. Change existing code to use it.
  (char *) STRING_WITH_LEN -> C_STRING_WITH_LEN
sql/sql_trigger.cc:
  There is an existing macros for initializing LEX_STRINGs
  with constant strings -> C_STRING_WITH_LEN. Change existing code to use it.
  (char *) STRING_WITH_LEN -> C_STRING_WITH_LEN
sql/sql_view.cc:
  There is an existing macros for initializing LEX_STRINGs
  with constant strings -> C_STRING_WITH_LEN. Change existing code to use it.
  (char *) STRING_WITH_LEN -> C_STRING_WITH_LEN
sql/tztime.cc:
  There is an existing macros for initializing LEX_STRINGs
  with constant strings -> C_STRING_WITH_LEN. Change existing code to use it.
  (char *) STRING_WITH_LEN -> C_STRING_WITH_LEN
2006-08-17 18:13:45 +02:00
unknown
66fb56f115 Merge ahristov@bk-internal.mysql.com:/home/bk/mysql-5.1-wl3337
into  example.com:/work/mysql-5.1-runtime-wl3337


BitKeeper/etc/ignore:
  auto-union
client/mysqltest.c:
  Auto merged
libmysqld/Makefile.am:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/sp_notembedded.result:
  Auto merged
sql/CMakeLists.txt:
  Auto merged
sql/Makefile.am:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_db.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/share/errmsg.txt:
  C
mysql-test/r/events_bugs.result:
  update result
  manual merge
mysql-test/r/ps_1general.result:
  update result
  manual merge
sql/sql_yacc.yy:
  manual merge
2006-08-14 15:26:59 +02:00
unknown
21e75cb081 Manual merge 5.0->5.1. Post-merge fixes.
client/mysqldump.c:
  A post-merge fix - 'sock' was renamed to 'mysql'
mysql-test/r/events_bugs.result:
  A post merge fix: now we strip rear comments from the query before
  it gets into the log.
mysql-test/r/func_group.result:
  A post merge fix: default clause is now printed uppercase.
mysql-test/r/im_life_cycle.result:
  Fix my mistake in manual resolve.
mysql-test/r/mysqlcheck.result:
  use test; - after we drop client_test_db there is no current database.
  This cleanup is present in 5.1 only, but the test that was added in 
  5.0 assumes there is a current database, test.
mysql-test/r/mysqldump.result:
  Ignore results of execution of mysqldump: we can't rely on 
  MASTER_LOG_POS in test results, it's different for statement
  and row level logging.
mysql-test/r/mysqlshow.result:
  A post-merge fix: information schema contains a few more tables
  in 5.1
mysql-test/r/mysqltest.result:
  A post merge fix: add 5.1 test end separator.
mysql-test/r/ndb_basic.result:
  A post-merge fix: add test end separators.
mysql-test/r/rpl_switch_stm_row_mixed.result:
  A post merge fix: length of varbinary column is now 3 times less.
  Assuming a side effect of some other change. Length of any
  field is not relevant in this test.
mysql-test/r/rpl_view.result:
  Add an end of test marker.
mysql-test/r/show_check.result:
  Remove duplicate results. Add results from a merged test case.
mysql-test/r/sp-error.result:
  Add test end separators.
mysql-test/r/sp-security.result:
  Post-merge fix: use test after the current database is dropped.
mysql-test/r/sp.result:
  Remove a duplicate result (bad merge that left a copy of
  the test case for Bug#19862 in the test suite).
mysql-test/r/strict.result:
  An after-merge fix for a new test case: in 5.1 we issue a more accurate
  error message: "Incorrect value" instead of "Truncated value". I reason
  it so that in case of an error nothing is truncated, really.
  Also found similar changes in other test cases.
mysql-test/r/type_datetime.result:
  Fix the text of an error.
mysql-test/r/union.result:
  A post-merge fix: CHARACTER SET is now uppercase.
mysql-test/t/mysqlcheck.test:
  A post-merge fix: use test, after current database is dropped, there
  is no current database.
mysql-test/t/mysqldump.test:
  Disable result log: it's dependent on binlog position.
mysql-test/t/sp-security.test:
  use test
sql/item_sum.cc:
  Adjust the call to the constructor after the merge.
sql/sp_head.cc:
  Add a missing DBUG_VOID_RETURN, move security checks out of
  execute_trigger to Table_triggers_list: in 5.1 we check for
  TRIGGER privilege, not SUPER privilege to execute triggers, so these
  checks lack table context inside execute_trigger and have to be
  performed when we have table object on hand.
sql/sql_db.cc:
  A post-merge fix: adjust load_db_opt_by_name and check_db_dir_existence
  (new functions added in 5.0) to be tablename-to-filename encoding 
  friendly.
sql/sql_lex.cc:
  A post-merge fix: make skip_rear_comments operate on const uchar *s.
sql/sql_lex.h:
  A post-merge fix.
sql/sql_show.cc:
  A post-merge fix: fix a bad merge, rename orig_sql_command -> sql_command.
sql/sql_trigger.cc:
  A post-merge fix: move security checks to process_triggers
  from execute_trigger.
sql/sql_view.cc:
  Adjust to the new signature of skip_rear_comments.
sql/sql_yacc.yy:
  Adjust to the new signature of init_strings.
2006-08-14 13:27:11 +04:00
unknown
f68085c4e7 Merge bodhi.local:/opt/local/work/tmp_merge
into  bodhi.local:/opt/local/work/mysql-5.1-runtime-merge


BitKeeper/etc/ignore:
  auto-union
BitKeeper/deleted/.del-im_options_set.result~59278f56be61d921:
  Auto merged
BitKeeper/deleted/.del-mysqld.dsp~ffdbf2d234e23e56:
  Auto merged
BitKeeper/deleted/.del-mysys.dsp~32695fee91189326:
  Auto merged
BitKeeper/deleted/.del-im_options_set.imtest~b53d9d60e5684833:
  Auto merged
BitKeeper/deleted/.del-im_options_unset.imtest~768eb186b51d0048:
  Auto merged
BitKeeper/deleted/.del-im_options_unset.result~20a4790cd3c70a4f:
  Auto merged
client/mysql.cc:
  Auto merged
client/mysqlbinlog.cc:
  Auto merged
client/mysqlcheck.c:
  Auto merged
client/mysqldump.c:
  Auto merged
client/mysqltest.c:
  Auto merged
dbug/dbug.c:
  Auto merged
extra/perror.c:
  Auto merged
extra/yassl/src/yassl_imp.cpp:
  Auto merged
extra/yassl/src/yassl_int.cpp:
  Auto merged
include/mysql.h:
  Auto merged
include/mysql_com.h:
  Auto merged
libmysql/libmysql.c:
  Auto merged
mysql-test/r/cast.result:
  Auto merged
mysql-test/r/date_formats.result:
  Auto merged
mysql-test/r/federated.result:
  Auto merged
mysql-test/r/func_compress.result:
  Auto merged
mysql-test/r/func_group.result:
  Auto merged
mysql-test/r/func_time.result:
  Auto merged
mysql-test/r/gis-rtree.result:
  Auto merged
mysql-test/r/gis.result:
  Auto merged
mysql-test/r/im_daemon_life_cycle.result:
  Auto merged
mysql-test/r/im_utils.result:
  Auto merged
mysql-test/r/join_outer.result:
  Auto merged
mysql-test/r/mysqlcheck.result:
  Auto merged
mysql-test/r/rpl_sp.result:
  Auto merged
mysql-test/r/rpl_trigger.result:
  Auto merged
mysql-test/r/sp-code.result:
  Auto merged
mysql-test/r/sp-security.result:
  Auto merged
mysql-test/r/strict.result:
  Auto merged
mysql-test/r/type_blob.result:
  Auto merged
mysql-test/r/type_datetime.result:
  Auto merged
mysql-test/r/type_ranges.result:
  Auto merged
mysql-test/r/udf.result:
  Auto merged
mysql-test/r/user_var.result:
  Auto merged
mysql-test/t/cast.test:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
mysql-test/t/func_group.test:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
mysql-test/t/im_daemon_life_cycle.imtest:
  Auto merged
mysql-test/t/im_life_cycle.imtest:
  Auto merged
mysql-test/t/im_utils.imtest:
  Auto merged
mysql-test/t/mysql.test:
  Auto merged
mysql-test/t/mysqlbinlog.test:
  Auto merged
mysql-test/t/mysqlcheck.test:
  Auto merged
mysql-test/t/ps.test:
  Auto merged
mysql-test/t/rpl_trigger.test:
  Auto merged
mysql-test/t/sp-security.test:
  Auto merged
mysql-test/t/strict.test:
  Auto merged
mysql-test/t/udf.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_strfunc.h:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_sum.h:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/protocol.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sp_head.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_udf.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/table.cc:
  Auto merged
sql-common/client.c:
  Auto merged
sql-common/my_time.c:
  Auto merged
sql/table.h:
  Auto merged
storage/ndb/src/kernel/error/ndbd_exit_codes.c:
  Auto merged
storage/ndb/src/mgmsrv/ConfigInfo.cpp:
  Auto merged
mysql-test/r/im_life_cycle.result:
  e
  use local
mysql-test/r/ps.result:
  use local
client/Makefile.am:
  Manual merge.
client/mysqlimport.c:
  Manual merge.
configure.in:
  Manual merge.
mysql-test/mysql-test-run.pl:
  Manual merge.
mysql-test/r/mysqldump.result:
  Manual merge.
mysql-test/r/mysqltest.result:
  Manual merge.
mysql-test/r/ndb_basic.result:
  Manual merge.
mysql-test/r/rpl_view.result:
  Manual merge.
mysql-test/r/show_check.result:
  Manual merge.
mysql-test/r/sp-error.result:
  Manual merge.
mysql-test/r/sp.result:
  Manual merge.
mysql-test/r/union.result:
  Manual merge.
mysql-test/t/mysqldump.test:
  Manual merge.
mysql-test/t/mysqltest.test:
  Manual merge.
mysql-test/t/ndb_basic.test:
  Manual merge.
mysql-test/t/rpl_sp.test:
  Manual merge.
mysql-test/t/rpl_view.test:
  Manual merge.
mysql-test/t/show_check.test:
  Manual merge.
mysql-test/t/sp-error.test:
  Manual merge.
mysql-test/t/sp.test:
  Manual merge.
sql/item_sum.cc:
  Manual merge.
sql/mysql_priv.h:
  Manual merge.
sql/sp_head.cc:
  Manual merge.
sql/sql_db.cc:
  Manual merge.
sql/sql_delete.cc:
  Manual merge.
sql/sql_lex.h:
  Manual merge.
sql/sql_show.cc:
  Manual merge.
sql/sql_table.cc:
  Manual merge.
sql/sql_trigger.cc:
  Manual merge.
sql/sql_yacc.yy:
  Manual merge.
tests/mysql_client_test.c:
  Manual merge.
2006-08-12 21:06:51 +04:00
unknown
68d265154e Merge sunlight.local:/local_work/leak_fix_orig
into  sunlight.local:/local_work/leak_fix-5.1-mysql


sql/sql_lex.h:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/sql_view.h:
  Auto merged
sql/unireg.h:
  Auto merged
sql/sql_base.cc:
  Manual merge
sql/table.cc:
  Manual merge
2006-08-09 02:49:29 +04:00
unknown
962d5b4d4e Merge sunlight.local:/home/evgen/bk-trees/mysql-5.0
into  sunlight.local:/local_work/leak_fix


sql/sql_base.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/table.cc:
  Auto merged
sql/sql_view.cc:
  Manually merged
2006-08-09 01:43:11 +04:00
unknown
1e9ebd010a sql_base.cc, unireg.h, sql_lex.h, table.cc, sql_view.h, sql_view.cc:
Correct memory leak fix


sql/unireg.h:
  Correct memory leak fix
sql/table.cc:
  Correct memory leak fix
sql/sql_view.h:
  Correct memory leak fix
sql/sql_view.cc:
  Correct memory leak fix
sql/sql_lex.h:
  Correct memory leak fix
sql/sql_base.cc:
  Correct memory leak fix
2006-08-09 00:05:42 +04:00
unknown
e44e344cac Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.local:/opt/local/work/mysql-5.0-runtime-merge


sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.h:
  Auto merged
mysql-test/r/sp.result:
  Manual merge.
mysql-test/r/udf.result:
  Manual merge.
mysql-test/t/sp.test:
  Manual merge.
mysql-test/t/udf.test:
  Manual merge.
2006-08-02 21:54:10 +04:00
unknown
8ce7848a52 Merge sunlight.local:/local_work/tmp_merge-5.0-opt-mysql
into  sunlight.local:/local_work/tmp_merge-5.1-opt-mysql


client/mysql.cc:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/t/view.test:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.h:
  Auto merged
sql/sql_view.cc:
  SCCS merged
2006-08-01 20:52:21 +04:00
unknown
c8673b09b8 Bug #21080: ALTER VIEW makes user restate SQL SECURITY mode, and ALGORITHM
When executing ALTER TABLE all the attributes of the view were overwritten.
  This is contrary to the user's expectations.
  So some of the view attributes are preserved now : namely security and 
  algorithm. This means that if they are not specified in ALTER VIEW
  their values are preserved from CREATE VIEW instead of being defaulted.


mysql-test/r/view.result:
  Bug #21080: ALTER VIEW makes user restate SQL SECURITY mode, and ALGORITHM
   - test suite
mysql-test/t/view.test:
  Bug #21080: ALTER VIEW makes user restate SQL SECURITY mode, and ALGORITHM
   - test suite
sql/sql_lex.h:
  Bug #21080: ALTER VIEW makes user restate SQL SECURITY mode, and ALGORITHM
   - must make create_view_suid a tristate : on/off/unspecified
sql/sql_view.cc:
  Bug #21080: ALTER VIEW makes user restate SQL SECURITY mode, and ALGORITHM
   - open the view to get it's attributes and put then as defaults 
     for ALTER VIEW
sql/sql_yacc.yy:
  Bug #21080: ALTER VIEW makes user restate SQL SECURITY mode, and ALGORITHM
   - must make create_view_suid a tristate : on/off/unspecified
sql/table.h:
  Bug #21080: ALTER VIEW makes user restate SQL SECURITY mode, and ALGORITHM
   - must make create_view_suid a tristate : on/off/unspecified
2006-07-31 17:33:37 +03:00
unknown
d36f578130 Fix for BUG#20438: CREATE statements for views, stored routines and triggers
can be not replicable.

Now CREATE statements for writing in the binlog are created as follows:
  - the beginning of the statement is re-created;
  - the rest of the statement is copied from the original query.

The problem appears when there is a version-specific comment (produced by
mysqldump), started in the re-created part of the statement and closed in the
copied part -- there is closing comment-parenthesis, but there is no opening
one.

The proper fix could be to re-create original statement, but we can not
implement it in 5.0. So, for 5.0 the fix is just to cut closing
comment-parenthesis. This technique is also used for SHOW CREATE PROCEDURE
statement (so we are able to reuse existing code).


mysql-test/r/rpl_sp.result:
  Updated result file.
mysql-test/r/rpl_trigger.result:
  Updated result file.
mysql-test/r/rpl_view.result:
  Updated result file.
mysql-test/t/rpl_sp.test:
  Added test case for BUG#20438.
mysql-test/t/rpl_trigger.test:
  Added test case for BUG#20438.
mysql-test/t/rpl_view.test:
  Added test case for BUG#20438.
sql/sp.cc:
  Trim comments at the end.
sql/sp_head.cc:
  Moved this code to the separate function to be re-used.
sql/sql_lex.cc:
  Added a new function.
sql/sql_lex.h:
  Added a new function.
sql/sql_trigger.cc:
  Trim comments at the end.
sql/sql_view.cc:
  Trim comments at the end.
2006-07-28 02:49:18 +04:00
unknown
5b6016c14e Merge bodhi.local:/opt/local/work/tmp_merge
into  bodhi.local:/opt/local/work/mysql-5.1-runtime-merge


BitKeeper/etc/ignore:
  auto-union
BitKeeper/deleted/.del-libmysqld.dsp~78dc6a589e5a4149:
  Auto merged
BitKeeper/deleted/.del-libmysqld.vcproj~a75d5b9a5967dea0:
  Auto merged
BitKeeper/deleted/.del-mysqld.dsp~ffdbf2d234e23e56:
  Auto merged
BitKeeper/deleted/.del-mysqld.vcproj~6aa7b3f9c3e28fcb:
  Auto merged
libmysqld/Makefile.am:
  Auto merged
mysql-test/Makefile.am:
  Auto merged
mysql-test/r/date_formats.result:
  Auto merged
mysql-test/r/view_grant.result:
  Auto merged
mysql-test/t/date_formats.test:
  Auto merged
mysql-test/t/init_connect.test:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
mysql-test/t/view_grant.test:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/handler.h:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_create.cc:
  Auto merged
sql/item_create.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_strfunc.h:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_cache.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_trigger.cc:
  Auto merged
sql/sql_udf.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
storage/ndb/include/kernel/GlobalSignalNumbers.h:
  Auto merged
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp:
  Auto merged
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
  Auto merged
storage/ndb/src/ndbapi/ndberror.c:
  Auto merged
support-files/mysql.spec.sh:
  Auto merged
mysql-test/r/federated.result:
  Use local.
mysql-test/r/myisam.result:
  Manual merge.
mysql-test/t/federated.test:
  Manual merge.
mysql-test/t/myisam.test:
  Manual merge.
sql/Makefile.am:
  Manual merge.
sql/set_var.cc:
  Manual merge.
sql/sql_parse.cc:
  Manual merge.
sql/sql_update.cc:
  Manual merge.
storage/myisam/mi_create.c:
  Manual merge.
2006-07-26 23:33:25 +04:00
unknown
5677612aea Merge bodhi.local:/opt/local/work/tmp_merge
into  bodhi.local:/opt/local/work/mysql-5.1-runtime-merge-5.0


mysql-test/r/func_sapdb.result:
  Auto merged
mysql-test/r/func_time.result:
  Auto merged
mysql-test/r/sp-vars.result:
  Auto merged
mysql-test/t/func_sapdb.test:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
sql/field_conv.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
mysql-test/r/information_schema.result:
  Use local
mysql-test/t/information_schema.test:
  Manual merge.
sql/sql_lex.h:
  Manual merge.
2006-07-15 01:04:51 +04:00
unknown
d013f9e53a Merge bodhi.local:/opt/local/work/tmp_merge
into  bodhi.local:/opt/local/work/mysql-5.1-runtime-merge-5.0


include/my_sys.h:
  Auto merged
mysql-test/r/auto_increment.result:
  Auto merged
mysql-test/r/func_math.result:
  Auto merged
mysql-test/r/func_system.result:
  Auto merged
mysql-test/r/func_time.result:
  Auto merged
mysql-test/r/information_schema.result:
  Auto merged
mysql-test/r/query_cache.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/r/trigger.result:
  Auto merged
mysql-test/r/type_blob.result:
  Auto merged
mysql-test/r/variables.result:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/t/trigger.test:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_trigger.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp:
  Auto merged
storage/ndb/src/mgmsrv/ConfigInfo.cpp:
  Auto merged
sql/slave.h:
  SCCS merged
mysql-test/r/show_check.result:
  Manual merge.
mysql-test/t/show_check.test:
  Manual merge.
sql/log_event.cc:
  Manual merge.
sql/share/errmsg.txt:
  Manual merge.
sql/sql_class.h:
  Manual merge.
sql/sql_db.cc:
  Manual merge.
2006-07-13 11:43:52 +04:00
unknown
c22a898199 Merge dl145k.mysql.com:/data0/mkindahl/bkroot/mysql-5.1-new-rpl
into  dl145k.mysql.com:/data0/mkindahl/bk/MERGE/mysql-5.1-merge


include/my_sys.h:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/rpl_row_create_table.result:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
mysql-test/t/rpl_row_create_table.test:
  Auto merged
mysys/my_malloc.c:
  Auto merged
server-tools/instance-manager/parse.h:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/handler.h:
  Auto merged
sql/log.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/set_var.h:
  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_insert.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
mysys/safemalloc.c:
  Merge of mysql-5.1-new-rpl into mysql-5.1
sql/ha_federated.cc:
  d
  Merge of mysql-5.1-new-rpl into mysql-5.1
sql/set_var.cc:
  Merge of mysql-5.1-new-rpl with mysql-5.1
sql/slave.cc:
  Merge of mysql-5.1-new-rpl into mysql-5.1
sql/sql_class.h:
  Merge of mysql-5.1-new-rpl into mysql-5.1
2006-07-11 12:17:19 +02:00
unknown
5d91dc2560 Manual merge
BitKeeper/etc/ignore:
  auto-union
mysql-test/r/events_logs_tests.result:
  Auto merged
mysql-test/t/events_logs_tests.test:
  Auto merged
mysql-test/t/events_stress.test:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_db.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/share/errmsg.txt:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/event_data_objects.cc:
  manual merge
sql/events.cc:
  manual merge
2006-07-10 14:42:29 +02:00
unknown
81a80049aa * Mixed replication mode * :
1) Fix for BUG#19630 "stored function inserting into two auto_increment breaks
statement-based binlog":
a stored function inserting into two such tables may fail to replicate
(inserting wrong data in the slave's copy of the second table) if the slave's
second table had an internal auto_increment counter different from master's.
Because the auto_increment value autogenerated by master for the 2nd table
does not go into binlog, only the first does, so the slave lacks information.
To fix this, if running in mixed binlogging mode, if the stored function or
trigger plans to update two different tables both having auto_increment
columns, we switch to row-based for the whole function.
We don't have a simple solution for statement-based binlogging mode, there
the bug remains and will be documented as a known problem.
Re-enabling rpl_switch_stm_row_mixed.
2) Fix for BUG#20630 "Mixed binlogging mode does not work with stored
functions, triggers, views", which was a documented limitation (in mixed
mode, we didn't detect that a stored function's execution needed row-based
binlogging (due to some UUID() call for example); same for
triggers, same for views (a view created from a SELECT UUID(), and doing
INSERT INTO sometable SELECT theview; would not replicate row-based).
This is implemented by, after parsing a routine's body, remembering in sp_head
that this routine needs row-based binlogging. Then when this routine is used,
the caller is marked to require row-based binlogging too.
Same for views: when we parse a view and detect that its SELECT needs
row-based binary logging, we mark the calling LEX as such.
3) Fix for BUG#20499 "mixed mode with temporary table breaks binlog":
a temporary table containing e.g. UUID has its changes not binlogged,
so any query updating a permanent table with data from the temporary table
will run wrongly on slave. Solution: in mixed mode we don't switch back
from row-based to statement-based when there exists temporary tables.
4) Attempt to test mysqlbinlog on a binlog generated by mysqlbinlog;
impossible due to BUG#11312 and BUG#20329, but test is in place for when
they are fixed.


mysql-test/r/rpl_switch_stm_row_mixed.result:
  testing BUG#19630 "stored function inserting into two auto_increment breaks
  statement-based binlog",
  testing BUG#20930 "Mixed binlogging mode does not work with stored functions,
  triggers, views.
  testing BUG#20499 "mixed mode with temporary table breaks binlog".
  I have carefully checked this big result file, it is correct.
mysql-test/t/disabled.def:
  re-enabling test
mysql-test/t/rpl_switch_stm_row_mixed.test:
  Test for BUG#19630 "stored function inserting into two auto_increment breaks
  statement-based binlog":
  we test that it goes row-based, but only when needed;
  without the bugfix, master and slave's data differed.
  Test for BUG#20499 "mixed mode with temporary table breaks binlog":
  without the bugfix, slave had 2 rows, not 3.
  Test for BUG#20930 "Mixed binlogging mode does not work with stored
  functions, triggers, views".
  Making strings used more different, for easier tracking of "by which routine
  was this binlog line generated".
  Towards the end, an attempt to test mysqlbinlog on a binlog generated by
  the mixed mode; attempt failed because of BUG#11312 and BUG#20929.
sql/item_create.cc:
  fix for build without row-based replication
sql/set_var.cc:
  cosmetic: in_sub_stmt is exactly meant to say if we are in stored
  function/trigger, so better use it.
sql/sp.cc:
  When a routine adds its tables to the top statement's tables, if this routine
  needs row-based binlogging, mark the entire top statement as well.
  Same for triggers.
  Needed for making the mixed replication mode work with stored functions
  and triggers.
sql/sp_head.cc:
  new enum value for sp_head::m_flags, remembers if, when parsing the 
  routine, we found at least one element (UUID(), UDF) requiring row-based
  binlogging.
sql/sp_head.h:
  new enum value for sp_head::m_flags (see sp_head.cc).
  An utility method, intended for attributes of a routine which need
  to propagate upwards to the caller; so far only used for binlogging
  information, but open to any other attribute.
sql/sql_base.cc:
  For BUG#19630 "stored function inserting into two auto_increment
  breaks statement-based binlog":
  When we come to locking tables, we have collected all tables used by
  functions, views and triggers, we detect if we're going to update two tables
  having auto_increment columns. If yes, statement-based binlogging won't work
  (Intvar_log_event records only one insert_id) so, if in mixed binlogging
  mode, switch to row-based.
  For making mixed mode work with stored functions using UUID/UDF:
  when we come to locking tables, we have parsed the whole body so know if
  some elements need row-based. Generation of row-based binlog events
  depends on locked tables, so this is the good place to decide of the binlog
  format.
sql/sql_class.h:
  Fix for BUG#20499 "mixed mode with temporary table breaks binlog".
  Making mixed mode work with stored functions/triggers: don't reset
  back to statement-based if in executing a stored function/trigger.
sql/sql_lex.cc:
  fix for build without row-based replication.
  binlog_row_based_if_mixed moves from st_lex to Query_tables_list, because
  that boolean should not be affected when a SELECT reads the INFORMATION_SCHEMA
  and thus implicitely parses a view or routine's body: this body may
  contain needing-row-based components like UUID() but the SELECT on
  INFORMATION_SCHEMA should not be affected by that and should not use
  row-based; as Query_tables_list is backed-up/reset/restored when parsing
  the view/routine's body, so does binlog_row_based_if_mixed and the
  top SELECT is not affected.
sql/sql_lex.h:
  fix for build without row-based replication.
  binlog_row_based_if_mixed moves from st_lex to Query_tables_list
  (see sql_lex.cc)
sql/sql_parse.cc:
  For the mixed mode to work with stored functions using UUID and UDF, we need
  to move the switch-back-from-row-to-statement out of
  mysql_execute_command() (which is executed for each statement, causing
  the binlogging mode to change in the middle of the function, which would
  not work)
  The switch to row-based is now done in lock_tables(), no need to keep it
  in mysql_execute_command(); in lock_tables() we also switch back from 
  row-based to statement-based (so in a stored procedure, all statements
  have their binlogging mode). We must however keep a resetting in
  mysql_reset_thd_for_next_command() as e.g. CREATE PROCEDURE does not call
  lock_tables().
sql/sql_view.cc:
  When a view's body needs row-based binlogging (e.g. the view is created
  from SELECT UUID()), propagate this fact to the top st_lex.
sql/sql_yacc.yy:
  use TRUE instead of 1, for binlog_row_based_if_mixed.
2006-07-09 17:00:47 +02:00
unknown
df9b4754b7 Merge bodhi.netgear:/opt/local/work/tmp_merge
into  bodhi.netgear:/opt/local/work/mysql-5.1-runtime-merge-with-5.0


mysql-test/r/create.result:
  Auto merged
mysql-test/r/ps.result:
  Auto merged
mysql-test/r/sp.result:
  Auto merged
mysql-test/t/create.test:
  Auto merged
mysql-test/t/ps.test:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sp.h:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sp_head.h:
  Auto merged
sql/sql_db.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_trigger.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/table.h:
  Auto merged
sql/tztime.cc:
  Auto merged
include/my_sys.h:
  Manual merge (second attempt).
mysql-test/r/bdb.result:
  Manual merge (second attempt).
mysql-test/t/bdb.test:
  Manual merge (second attempt).
mysys/my_malloc.c:
  Manual merge (second attempt).
mysys/safemalloc.c:
  Manual merge (second attempt).
sql/ha_federated.cc:
  Manual merge (second attempt).
sql/log_event.cc:
  Manual merge (second attempt).
sql/set_var.cc:
  Manual merge (second attempt).
sql/set_var.h:
  Manual merge (second attempt).
sql/slave.cc:
  Manual merge (second attempt).
sql/slave.h:
  Manual merge (second attempt).
sql/sql_class.h:
  Manual merge (second attempt).
sql/sql_table.cc:
  Manual merge (second attempt).
sql/sql_udf.cc:
  Manual merge (second attempt).
sql/sql_yacc.yy:
  Manual merge (second attempt).
2006-07-06 22:55:48 +04:00
unknown
6a8f2ee293 auxilliary -> auxiliary 2006-07-04 02:07:41 +04:00
unknown
0c7bc6e9d7 Remove a couple of unused/barely used names.
sql/sql_lex.cc:
  Remove an unused thread key.
sql/sql_lex.h:
  Remove an unused thread key, current_lex.
sql/sql_parse.cc:
  Remove an unused thread key, current_lex macro.
2006-07-01 00:14:28 +04:00
unknown
9fa9378b2e WL#3337 (Events new architecture)
This cut No 7 should finish the part of fixing the parsing of the events :
- Event_timed is no more used during parsing. Less problems because it has
  a mutex. Event_parse_data class is used during parsing. It is suited only
  for this purpose. It's pretty lightweight
- Late checking of data from parsing is being performed. This should solve
  the problems of nested events in SP or other events (for the situation 
  of no nested bodies). Before if an ALTER EVENT was in a SP, then when the
  SP was compiled, and not executed, the actual init_xxx methods of Event_timed
  were called, which is wrong.
- It could be a side effect of using a specialized class, but test events_stress is
  now 25% quicker.

Cut No8 will start splitting Event_scheduler into 2 parts, the QUEUE will be moved
to Event_queue.


mysql-test/r/events.result:
  update result
mysql-test/t/events.test:
  disabled is actually wrong, should be disable, but because of the early
  checking it was never parsed.
sql/event_data_objects.cc:
  move add init_xxx methods from Event_timed to Event_parse_data
  Event_parse data does not need definer_user and definer_host
  in Event_timed::compile() do not use lex.et, well there is no more lex.et :)
sql/event_data_objects.h:
  move parsing responsibilities from Event_timed to Event_parse_data
sql/event_db_repository.cc:
  No more Event_timed comes from parsing but Event_parse_data
  The initialization of Item*-s from parsing is done late, and not
  during the actual parsing. This is the right way to go because
  if an ALTER EVENT is inside a SP or CREATE EVENT it should not be
  executed (initialized) during parsing, as it was done.
sql/event_db_repository.h:
  No more Event_timed comes from parsing but Event_parse_data
  The initialization of Item*-s from parsing is done late, and not
  during the actual parsing. This is the right way to go because
  if an ALTER EVENT is inside a SP or CREATE EVENT it should not be
  executed (initialized) during parsing, as it was done.
sql/event_scheduler.cc:
  No more Event_timed comes from parsing but Event_parse_data
  The initialization of Item*-s from parsing is done late, and not
  during the actual parsing. This is the right way to go because
  if an ALTER EVENT is inside a SP or CREATE EVENT it should not be
  executed (initialized) during parsing, as it was done.
sql/event_scheduler.h:
  No more Event_timed comes from parsing but Event_parse_data
  The initialization of Item*-s from parsing is done late, and not
  during the actual parsing. This is the right way to go because
  if an ALTER EVENT is inside a SP or CREATE EVENT it should not be
  executed (initialized) during parsing, as it was done.
sql/events.cc:
  No more Event_timed comes from parsing but Event_parse_data
  The initialization of Item*-s from parsing is done late, and not
  during the actual parsing. This is the right way to go because
  if an ALTER EVENT is inside a SP or CREATE EVENT it should not be
  executed (initialized) during parsing, as it was done.
sql/events.h:
  No more Event_timed comes from parsing but Event_parse_data
  The initialization of Item*-s from parsing is done late, and not
  during the actual parsing. This is the right way to go because
  if an ALTER EVENT is inside a SP or CREATE EVENT it should not be
  executed (initialized) during parsing, as it was done.
sql/sql_lex.cc:
  lex->et_compile_phase and lex->et are no more.
  Use lex->event_parse_data
sql/sql_lex.h:
  lex->et_compile_phase and lex->et are no more.
  Use lex->event_parse_data
sql/sql_parse.cc:
  lex->et_compile_phase and lex->et are no more.
  Use lex->event_parse_data
  ACL checks were moved inside the Events subsystem.
  Also ending of the transaction is performed only just
  before doing disk operation. Therefore only when needed.
sql/sql_yacc.yy:
  lex->et and lex->et_parse_phase are no more
  Use the specialized for parsing Event_parse_data
2006-06-29 00:42:25 +02:00
unknown
98211beaee Merge
sql/CMakeLists.txt:
  Auto merged
sql/events.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.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/sql_yacc.yy:
  Auto merged
sql/sql_show.cc:
  SCCS merged
2006-06-28 15:54:09 +02:00
unknown
90cb4c03fd Bug#17203: "sql_no_cache sql_cache" in views created from prepared statement
The problem was that we restored SQL_CACHE, SQL_NO_CACHE flags in SELECT
statement from internal structures based on value set later at runtime, not
the original value set by the user.

The solution is to remember that original value.


mysql-test/r/auto_increment.result:
  Update result to not report SQL_NO_CACHE if it wasn't there at first place.
mysql-test/r/func_compress.result:
  Update result to not report SQL_NO_CACHE if it wasn't there at first place.
mysql-test/r/func_math.result:
  Update result to not report SQL_NO_CACHE if it wasn't there at first place.
mysql-test/r/func_system.result:
  Update result to not report SQL_NO_CACHE if it wasn't there at first place.
mysql-test/r/func_time.result:
  Update result to not report SQL_NO_CACHE if it wasn't there at first place.
mysql-test/r/information_schema.result:
  Update result to not report SQL_NO_CACHE if it wasn't there at first place.
mysql-test/r/query_cache.result:
  Update result to not report SQL_NO_CACHE if it wasn't there at first place.
mysql-test/r/rpl_get_lock.result:
  Update result to not report SQL_NO_CACHE if it wasn't there at first place.
mysql-test/r/rpl_master_pos_wait.result:
  Update result to not report SQL_NO_CACHE if it wasn't there at first place.
mysql-test/r/show_check.result:
  Add result for bug#17203.
mysql-test/r/subselect.result:
  Update result to not report SQL_NO_CACHE if it wasn't there at first place.
mysql-test/r/type_blob.result:
  Update result to not report SQL_NO_CACHE if it wasn't there at first place.
mysql-test/r/variables.result:
  Update result to not report SQL_NO_CACHE if it wasn't there at first place.
mysql-test/r/view.result:
  Update result to not report SQL_NO_CACHE if it wasn't there at first place.
mysql-test/t/show_check.test:
  Add test case for bug#17203.
sql/sql_lex.cc:
  Reset SELECT_LEX::sql_cache together with SELECT_LEX::options.
sql/sql_lex.h:
  Add SELECT_LEX::sql_cache field to store original user setting.
sql/sql_select.cc:
  Output SQL_CACHE and SQL_NO_CACHE depending on stored original user setting.
sql/sql_yacc.yy:
  Make effect of SQL_CACHE and SQL_NO_CACHE mutually exclusive.  Ignore
  SQL_CACHE if SQL_NO_CACHE was used.  Remember what was set by the user.
  Reset SELECT_LEX::sql_cache together with SELECT_LEX::options.
2006-06-27 21:28:32 +04:00
unknown
d2db48c69b WL#3337 (Events new infrasctructure)
Second cut of separating parsing phase from execution phase
Separate Event_timed from parsing phase and introducing Event_parse_data.


sql/event_data_objects.cc:
  second cut,
  copy Event_timed::init_body() to Event_parse_data::init_body()
  Init the body during parsing, everything else keep as a pointer to
  Item or some other pointer to use for later initialization.
sql/event_data_objects.h:
  get the identifier as sp_name*, later will initialize our structures
sql/events.cc:
  for easy transition add temporarily parse_data, later Event_timed *et will be removed.
  Do slow transition because Event_timed is so tightly integrated that a front-attack
  by removing things from this class was unsuccessful. Do things step by step by eliminating
  dependencies. Hence, the code could be checked with the current test suite too
  (early testing)
sql/events.h:
  for easy transition add temporarily parse_data, later Event_timed *et will be removed.
  Do slow transition because Event_timed is so tightly integrated that a front-attack
  by removing things from this class was unsuccessful. Do things step by step by eliminating
  dependencies. Hence, the code could be checked with the current test suite too
  (early testing)
BitKeeper/etc/ignore:
  Added libmysql/viosocket.o.6WmSJk libmysqld/event_data_objects.cc libmysqld/event_db_repository.cc libmysqld/event_queue.cc server-tools/instance-manager/net_serv.cc to the ignore list
sql/share/errmsg.txt:
  remove this message, not used and needed for now
sql/sql_lex.h:
  for easy transition add temporarily parse_data, later Event_timed *et will be removed.
  Do slow transition because Event_timed is so tightly integrated that a front-attack
  by removing things from this class was unsuccessful. Do things step by step by eliminating
  dependencies. Hence, the code could be checked with the current test suite too
  (early testing)
sql/sql_parse.cc:
  for easy transition add temporarily parse_data, later Event_timed *et will be removed.
  Do slow transition because Event_timed is so tightly integrated that a front-attack
  by removing things from this class was unsuccessful. Do things step by step by eliminating
  dependencies. Hence, the code could be checked with the current test suite too
  (early testing)
sql/sql_yacc.yy:
  for easy transition add temporarily parse_data, later Event_timed *et will be removed.
  Do slow transition because Event_timed is so tightly integrated that a front-attack
  by removing things from this class was unsuccessful. Do things step by step by eliminating
  dependencies. Hence, the code could be checked with the current test suite too
  (early testing)
2006-06-27 10:53:26 +02:00
unknown
cf119987f1 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  mysql.com:/opt/local/work/mysql-5.0-17199


mysql-test/r/create.result:
  Auto merged
mysql-test/t/create.test:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_db.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
mysql-test/r/sp.result:
  SCCS merged
mysql-test/t/sp.test:
  SCCS merged
2006-06-27 00:52:56 +04:00
unknown
d6bcbfbe92 A fix and a test case for
Bug#19022 "Memory bug when switching db during trigger execution"
 Bug#17199 "Problem when view calls function from another database."
 Bug#18444 "Fully qualified stored function names don't work correctly in
            SELECT statements"

 Documentation note: this patch introduces a change in behaviour of prepared
 statements.

 This patch adds a few new invariants with regard to how THD::db should
 be used. These invariants should be preserved in future:

  - one should never refer to THD::db by pointer and always make a deep copy
    (strmake, strdup)
  - one should never compare two databases by pointer, but use strncmp or
    my_strncasecmp
  - TABLE_LIST object table->db should be always initialized in the parser or
    by creator of the object.

    For prepared statements it means that if the current database is changed
    after a statement is prepared, the database that was current at prepare
    remains active. This also means that you can not prepare a statement that
    implicitly refers to the current database if the latter is not set.
    This is not documented, and therefore needs documentation. This is NOT a
    change in behavior for almost all SQL statements except:
     - ALTER TABLE t1 RENAME t2 
     - OPTIMIZE TABLE t1
     - ANALYZE TABLE t1
     - TRUNCATE TABLE t1 --
     until this patch t1 or t2 could be evaluated at the first execution of
     prepared statement. 

     CURRENT_DATABASE() still works OK and is evaluated at every execution
     of prepared statement.

     Note, that in stored routines this is not an issue as the default
     database is the database of the stored procedure and "use" statement
     is prohibited in stored routines.

  This patch makes obsolete the use of check_db_used (it was never used in the
  old code too) and all other places that check for table->db and assign it
  from THD::db if it's NULL, except the parser.

 How this patch was created: THD::{db,db_length} were replaced with a
 LEX_STRING, THD::db. All the places that refer to THD::{db,db_length} were
 manually checked and:
  - if the place uses thd->db by pointer, it was fixed to make a deep copy
  - if a place compared two db pointers, it was fixed to compare them by value
    (via strcmp/my_strcasecmp, whatever was approproate)
 Then this intermediate patch was used to write a smaller patch that does the
 same thing but without a rename.

 TODO in 5.1:
   - remove check_db_used
   - deploy THD::set_db in mysql_change_db

 See also comments to individual files.


mysql-test/r/create.result:
  Modify the result file: a database can never be NULL.
mysql-test/r/ps.result:
  Update test results (Bug#17199 et al)
mysql-test/r/sp.result:
  Update test results (Bug#17199 et al)
mysql-test/t/create.test:
  Update the id of the returned error.
mysql-test/t/ps.test:
  Add test coverage for prepared statements and current database. In scope of
  work on Bug#17199 "Problem when view calls function from another database."
mysql-test/t/sp.test:
  Add a test case for Bug#17199 "Problem when view calls function from another
  database." and Bug#18444 "Fully qualified stored function names don't work
  correctly in SELECT statements". Test a complementary problem.
sql/item_strfunc.cc:
  Touch the code that reads thd->db (cleanup).
sql/log_event.cc:
  While we are at it, replace direct access to thd->db with a method.
  Should simplify future conversion of THD::db to LEX_STRING.
sql/slave.cc:
  While we are at it, replace direct access to thd->db with a method.
  Should simplify future conversion of THD::db to LEX_STRING.
sql/slave.h:
  Remove a declaration for a method that is used only in one module.
sql/sp.cc:
  Rewrite sp_use_new_db: this is a cleanup that I needed in order to understand
  this function and ensure that it has no bugs.
sql/sp.h:
  Add a new declaration for sp_use_new_db (uses LEX_STRINGs) and a comment.
sql/sp_head.cc:
  - drop sp_name_current_db_new - a creator of sp_name class that was used
  when sp_name was created for an identifier without an explicitly initialized
  database. Now we pass thd->db to constructor of sp_name right in the 
  parser.
  - rewrite sp_head::init_strings: name->m_db is always set now
  - use the new variant of sp_use_new_db
  - we don't need to update thd->db with SP MEM_ROOT pointer anymore when
  parsing a stored procedure, as noone will refer to it (yes!)
sql/sp_head.h:
  - remove unneded methods and members
sql/sql_class.h:
  - introduce 3 THD  methods to work with THD::db:
    .set_db to assign the current database
    .reset_db to reset the current database (temporarily) or set it to NULL
    .opt_copy_db_to - to deep-copy thd->db to a pointer if it's not NULL
sql/sql_db.cc:
  While we are at it, replace direct access to thd->db with a method.
  Should simplify future conversion of THD::db to LEX_STRING.
sql/sql_insert.cc:
  - replace checks with asserts: table_list->db must be always set in the parser.
sql/sql_lex.h:
  - add a comment
sql/sql_parse.cc:
  - implement the invariant described in the changeset comment.
  - remove juggling with lex->sphead in SQLCOM_CREATE_PROCEDURE:
    now db_load_routine uses its own LEX object and doesn't damage the main
    LEX.
  - add DBUG_ASSERT(0) to unused "check_db_used"
sql/sql_table.cc:
  - replace a check with an assert (table_ident->db)
sql/sql_trigger.cc:
  While we are at it, replace direct access to thd->db with a method.
  Should simplify future conversion of THD::db to LEX_STRING.
sql/sql_udf.cc:
  - use thd->set_db instead of direct modification of to thd->db
sql/sql_view.cc:
  - replace a check with an assert (view->db)
sql/sql_yacc.yy:
  - make sure that we always copy table->db or name->db or ident->db or
    select_lex->db from thd->db if the former is not set. If thd->db
    is not set but is accessed, return an error.
sql/tztime.cc:
  - be nice, never copy thd->db by pointer.
2006-06-27 00:47:52 +04:00
unknown
f3a56a17da SHOW STATUS does not anymore change local status variables (except com_show_status). Global status variables are still updated.
SHOW STATUS are not anymore put in slow query log because of no index usage.

Implemntation done by removing orig_sql_command and moving logic of SHOW STATUS to mysql_excute_command()
This simplifies code and allows us to remove some if statements all over the code.

Upgraded uc_update_queries[] to sql_command_flags and added more bitmaps to better categorize commands.
This allowed some overall simplifaction when testing sql_command.

Fixes bugs:
Bug#10210: running SHOW STATUS increments counters it shouldn't
Bug#19764: SHOW commands end up in the slow log as table scans


mysql-test/r/grant_cache.result:
  Fixed results after SHOW STATUS doesn't anymore affect status variables
mysql-test/r/information_schema.result:
  Added extra test to cover more code
mysql-test/r/query_cache.result:
  Remove resuts from previous tests
mysql-test/r/status.result:
  Added more tests for testing of last_query_cost and how SHOW STATUS affects status variables.
  (Bug#10210)
mysql-test/r/temp_table.result:
  Fixed results after SHOW STATUS doesn't anymore affect status variables
mysql-test/r/union.result:
  Fixed results after SHOW STATUS is not logged to slow query log
  (Bug#19764)
mysql-test/t/events_microsec.test:
  Disable warnings at init
mysql-test/t/information_schema.test:
  Added extra test to cover more code
mysql-test/t/query_cache.test:
  Remove resuts from previous tests
mysql-test/t/status.test:
  Added more tests for testing of last_query_cost and how SHOW STATUS affects status variables.
  (Bug #10210)
sql/mysql_priv.h:
  Added 'sql_command_flags'
sql/sql_class.cc:
  New function add_diff_to_status(), used to update global status variables when using SHOW STATUS
sql/sql_class.h:
  New function 'fill_information_schema_tables()'
  (One could not anymore use fill_derived_tables() for this as only_view_structures() is not relevant for information schema tables)
  Added defines for bit flags in sql_command_flags[]
sql/sql_lex.cc:
  Remove orig_sql_command
sql/sql_lex.h:
  Remove orig_sql_command
sql/sql_parse.cc:
  Rename uc_update_queries -> sql_command_flags.
  Enhanced 'sql_command_flags' to better classify SQL commands
  uc_update_queries[] != 0 is changed to (sql_command_flags[] & CF_CHANGES_DATA)
  lex->orig_sql_command == SQLCOM_END is changed to (sql_command_flags[lex->sql_command] & CF_STATUS_COMMAND) == 0)
  
  Simplify incrementing of thd->status_var.com_stat[] as we don't have to do special handling for SHOW commands.
  
  Split SQLCOM_SELECT handling in mysql_execute_command() to a separate function.
  Added special handling of SHOW STATUS commands in mysql_execute_command() and call common SQLCOM_SELECT handling.
  These changes allows us to easily fix that we save and restore status variables during execution of a SHOW STATUS command.
  Don't log SHOW STATUS commands to slow query log.
  
  This fixes Bug#10210 and Bug#19764 without adding additional 'if' code.
  (The new code is faster than the original as we now have fewer if's than before)
sql/sql_prepare.cc:
  Clean up prepare-check handling of SQLCOM commands by using sql_command_flags[]
  This simplifes code and ensures that code works even if someone forgets to put a new status commands into the switch statement.
sql/sql_select.cc:
  Remove special handling of SHOW STATUS.
  (This is now done in SQLCOM_SHOW_STATUS part in mysql_execute_command())
sql/sql_show.cc:
  Remove orig_sql_command
  Only change sql_command during 'open_normal_and_derived_tables()' (for views) and not for the full duration of generating data.
  Changed 'show status' to use thd->initial_status_var to ensure that the current statement is not affecting the to-be-used values.
  Use thd->fill_information_schema_tables() instead of 'thd->fill_derived_tables()' as the later wrongly checks the value of sql_command.
sql/sql_yacc.yy:
  Remove usage of orig_sql_command.
  One side effect of this is that we need to test for cursors if the current command is a SELECT or a SHOW command.
sql/structs.h:
  Updated comment
2006-06-20 13:20:32 +03:00
unknown
610b1a4ebd Manually merged
configure.in:
  Auto merged
client/mysqlbinlog.cc:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/archive.result:
  Auto merged
mysql-test/r/auto_increment.result:
  Auto merged
mysql-test/r/cast.result:
  Auto merged
mysql-test/r/ctype_utf8.result:
  Auto merged
mysql-test/r/func_group.result:
  Auto merged
mysql-test/r/func_str.result:
  Auto merged
mysql-test/r/func_time.result:
  Auto merged
mysql-test/r/multi_update.result:
  Auto merged
mysql-test/r/ndb_lock.result:
  Auto merged
mysql-test/r/replace.result:
  Auto merged
mysql-test/r/union.result:
  Auto merged
mysql-test/t/archive.test:
  Auto merged
mysql-test/t/auto_increment.test:
  Auto merged
mysql-test/t/delayed.test:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
mysql-test/t/multi_update.test:
  Auto merged
mysql-test/t/ndb_lock.test:
  Auto merged
mysql-test/t/select.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/opt_sum.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  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_select.cc:
  Auto merged
sql/sql_select.h:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/structs.h:
  Auto merged
storage/archive/ha_archive.cc:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
2006-06-18 14:56:35 +04:00
unknown
de292d6799 Manually merged
configure.in:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/item_timefunc.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
2006-06-17 00:58:36 +04:00
unknown
683ebcd101 Fixed bug#19789: REPLACE was allowed for a VIEW with CHECK OPTION enabled.
The st_lex::which_check_option_applicable() function controls for which 
statements WITH CHECK OPTION clause should be taken into account. REPLACE and
REPLACE_SELECT wasn't in the list which results in allowing REPLACE to insert
wrong rows in a such view.

The st_lex::which_check_option_applicable() now includes REPLACE and 
REPLACE_SELECT in the list of statements for which WITH CHECK OPTION clause is
applicable.


mysql-test/t/replace.test:
  Added test case for bug#19789: REPLACE was allowed for a VIEW with CHECK OPTION enabled.
mysql-test/r/replace.result:
  Added test case for bug#19789: REPLACE was allowed for a VIEW with CHECK OPTION enabled.
sql/sql_lex.h:
  Fixed bug#19789: REPLACE was allowed for a VIEW with CHECK OPTION enabled.
  The st_lex::which_check_option_applicable() now includes REPLACE and 
  REPLACE_SELECT in the list of statements for which WITH CHECK OPTION clause is
  applicable.
2006-06-07 16:17:56 +04:00
unknown
ae26d2aa5a Merge a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-5.0
into  a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-new


mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/mysql-test-run.sh:
  Auto merged
mysql-test/r/grant.result:
  Auto merged
mysql-test/r/heap_btree.result:
  Auto merged
mysql-test/r/information_schema_db.result:
  Auto merged
mysql-test/r/lock_multi.result:
  Auto merged
mysql-test/r/sp.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/r/view_grant.result:
  Auto merged
mysql-test/t/lock_multi.test:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
mysql-test/t/view_grant.test:
  Auto merged
mysys/default.c:
  Auto merged
server-tools/instance-manager/guardian.cc:
  Auto merged
sql/field.h:
  Auto merged
sql/item.h:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/lock.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_load.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/table.cc:
  Auto merged
storage/heap/hp_write.c:
  Auto merged
storage/ndb/src/ndbapi/DictCache.cpp:
  Auto merged
storage/ndb/src/ndbapi/DictCache.hpp:
  Auto merged
client/mysqlbinlog.cc:
  Manual merge from 5.0
client/mysqldump.c:
  Manual merge from 5.0
configure.in:
  Manual merge from 5.0
mysql-test/r/mysqldump.result:
  Manual merge from 5.0
mysql-test/t/mysqldump.test:
  Manual merge from 5.0
mysql-test/t/rpl_insert_id.test:
  Manual merge from 5.0
server-tools/instance-manager/manager.cc:
  Manual merge from 5.0
sql/field.cc:
  Manual merge from 5.0
sql/ha_ndbcluster.cc:
  Manual merge from 5.0
sql/mysqld.cc:
  Manual merge from 5.0
sql/sql_base.cc:
  Manual merge from 5.0
sql/sql_lex.cc:
  Manual merge from 5.0
sql/sql_select.cc:
  Manual merge from 5.0
sql/sql_table.cc:
  Manual merge from 5.0
2006-05-30 16:07:49 +03:00
unknown
128c3942a8 Bug#17204 "second CALL to procedure crashes Server"
Bug#18282 "INFORMATION_SCHEMA.TABLES provides inconsistent info about invalid views"
This bug caused crashes or resulted in wrong data being returned
when one tried to obtain information from I_S tables about views
using stored functions.

It was caused by the fact that we were using LEX representing
statement which were doing select from I_S tables as active LEX
when contents of I_S table were built. So state of this LEX both
affected and was affected by open_tables() calls which happened
during this process. This resulted in wrong behavior and in
violations of some of invariants which caused crashes.

This fix tries to solve this problem by properly saving/resetting
and restoring part of LEX which affects and is affected by the
process of opening tables and views in get_all_tables() routine.
To simplify things we separated this part of LEX in a new class
and made LEX its descendant.


mysql-test/r/information_schema_db.result:
  test case
mysql-test/t/information_schema_db.test:
  test case
sql/sql_lex.cc:
  To simplify saving/resetting and restoring part of LEX which
  affects and is affected by the process of opening tables and
  views we moved it to new class Query_tables_list and made LEX
  descendant of this class. Also introduced two LEX methods 
  which can be used to save and reset or to restore this state.
sql/sql_lex.h:
  To simplify saving/resetting and restoring part of LEX which
  affects and is affected by the process of opening tables and
  views we moved it to new class Query_tables_list and made LEX
  descendant of this class. Also introduced two LEX methods 
  which can be used to save and reset or to restore this state.
sql/sql_show.cc:
  Now in get_all_tables() routine we properly save/reset and
  restore part of LEX (statement table list and information
  about routines used) which affects and is affected by the
  process of opening tables and views.
sql/sql_table.cc:
  Now we clean-up LEX after opening table (view) in two stages.
  In the first stage we call LEX::cleanup_after_one_table_open()
  to clean-up selects lists and derived tables state. In the
  second stage which happens after close_thread_tables() is
  invoked we call Query_tables_list::reset_query_tables_list(FALSE)
  to rollback changes in Query_tables_list.
2006-05-30 10:45:23 +05:00
unknown
821daed661 Merge baker@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into  zim.(none):/home/brian/mysql/dep-5.1


sql/lex.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2006-05-23 11:25:11 -07:00
unknown
f4781a7e4c fix for bug #17619 Scheduler race conditions
- Scheduler is either initialized at server start or never.
  Starting & stopping is now suspending & resuming.
- The scheduler has clear OO interface
- Now all calls to the scheduler are synchronous
- GLOBAL event_scheduler uses thd::sys_var_tmp (see set_var.cc)
- External API is encapsulated into class Events
- Includes fixes for all comments of Kostja's review of 19.05.2005

Starting to merge into 5.1-release (5.1.10) and push


BitKeeper/etc/ignore:
  Added libmysqld/event_scheduler.cc to the ignore list
libmysqld/Makefile.am:
  executor -> scheduler
mysql-test/r/events.result:
  update result
mysql-test/r/events_bugs.result:
  update result
mysql-test/r/events_logs_tests.result:
  update result
mysql-test/r/events_microsec.result:
  update result
mysql-test/r/events_scheduling.result:
  update result
mysql-test/r/events_stress.result:
  update result
mysql-test/t/disabled.def:
  enable these tests
mysql-test/t/events.test:
  optimize the test a bit for speed, save some seconds runtime
  remove FULL from SHOW EVENTS
  mostly use I_S.EVENTS
mysql-test/t/events_bugs.test:
  Skip irrelevant for the current design tests - all events are loaded
  on server startup. Change in mysql.event will be visible on next server start.
  Don't use numeric error codes.
mysql-test/t/events_logs_tests.test:
  optimize the test a bit for speed
mysql-test/t/events_microsec.test:
   Skip irrelevant for the current design tests - all events are loaded
      on server startup. Change in mysql.event will be visible on next server start.
      Don't use numeric error codes.
mysql-test/t/events_scheduling.test:
  broader test
mysql-test/t/events_stress.test:
  Rework the test to the new architecture of suspending/resuming.
  Use less events, no need for thousands, hundreds is still ok.
sql/Makefile.am:
  executor -> scheduler
sql/cmakelists.txt:
  executor -> scheduler
sql/event.cc:
  - remove todo comments
  - remove unneded evex_queue abstraction functions
  - move events_init() and events_shutdown() from event_executor.cc to here
  - export db_create_event
  - remove evex_load_and_compile_event, part of class Event_scheduler
  - integrate the public interface found in event.h and used by sql_parse.cc
    to use the new class Event_scheduler.
sql/event.h:
  - add COND_finished so if one thread kills a running event it waits on this
  - export callback event_timed_definer_equal, event_timed_identifier_equal(),
    event_timed_name_equal and event_timed_db_equal()
    to be used by Event_scheduler::drop_matching_events()
  - cleanup event.h
  - encapsulated all external interface into class Events
sql/event_executor.cc:
  make it empty, will delete after that
sql/event_priv.h:
  - more things in the private header
  - remove event queue abstraction functions. tightly bind to QUEUE
  - export privately db_drop_event, db_find_event, db_create_event()
  - made change_security_context() and restore_security_context() free functions
sql/event_timed.cc:
  - fix calculation of time when ENDS is set (STARTS is always set)
  - during Event_timed::compile() set the right Security_ctx. Prevents a crash
        during Event_scheduler::load_events_from_db()
  - add Event_timed::kill_thread()
  - implement event_timed_*_equal()
  - made change_security_context() and restore_security_context() free functions.
  - Comments cleanups
sql/lex.h:
  new word scheduler for SHOW SCHEDULER STATUS (available only debug builds)
sql/log.cc:
  move these from event_scheduler.cc
sql/mysql_priv.h:
  refactor kill_one_thread
  export sql_print_message_func and sql_print_message_handlers
sql/mysqld.cc:
  In close_connections, called by kill_server() skip the main scheduler
  thread and use events_shutdown() for shutting down the scheduler, in the same
  manner it's done for RPL.
  Add a new value to --event-scheduler :
  0 <- No scheduler available
  1 <- Start with scheduler enabled
  2 <- Start with scheduler suspended
sql/repl_failsafe.cc:
  refactor thd::system_thread to be an enum
sql/set_var.cc:
  move sys_var_event_executor::update() to set_var.cc
  executor -> scheduler
  use thd::sys_var_tmp
sql/set_var.h:
  executor -> scheduler
sql/share/errmsg.txt:
  3 new error messages
sql/sql_class.cc:
  refactor thd::system_thread to be an enum . more type-safety
sql/sql_class.h:
  refactor thd::system_thread to be an enum . more type-safety
sql/sql_db.cc:
  get the error from evex_drop_schema_events
sql/sql_error.h:
  export warning_level_names
sql/sql_lex.h:
  new command SHOW SCHEDULER STATUS, available only in debug build and
  for debug purposes.
sql/sql_parse.cc:
  refactor kill_one_thread() -> does the *dirty* work, and sql_kill
  just the reporting.
  add handler for SQLCOM_SHOW_SCHEDULER_STATUS
sql/sql_show.cc:
  fix verbosity handling (this will be obsoleted anyway by the fix for 17394).
sql/sql_yacc.yy:
  remove FULL from SHOW EVENTS
  add SHOW SCHEDULER STATUS in debug builds
sql/table.cc:
  Fix valgrind warning.
2006-05-22 20:46:13 +02:00
unknown
3aa2d18ca0 Merge baker@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into  zim.(none):/home/brian/mysql/dep-5.1


sql/lex.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2006-05-08 15:34:55 -07:00
unknown
3c099551d0 Cleanups after review of WL#602
Fixed warnings from test suite
Some fixes in mysql-test-run script to catch more warnings


mysql-test/lib/mtr_report.pl:
  Catch more warnings
mysql-test/mysql-test-run.sh:
  Catch warnings from mysqld
mysql-test/t/mysqldump.test:
  Add key_block_size to catch future changes in information schema
mysys/errors.c:
  Ensure that mysql-test-run catches if we call my_close() too many times
sql/handler.cc:
  Initialize all elements
sql/log.cc:
  true -> TRUE
sql/sql_class.h:
  Review change: key_info -> key_create_info
sql/sql_lex.h:
  Review change: key_info -> key_create_info
sql/sql_table.cc:
  Review change: key_info -> key_create_info
  Don't call mysql_close() if init_ddl_log is not called.
  Better error handling in init_ddl_log
sql/sql_yacc.yy:
  Review change: key_info -> key_create_info
2006-05-03 19:40:52 +03:00
unknown
d50ae16569 Added support for key_block_size for key and table level (WL#602)
Added support for key_block_size to MyISAM.
Simplify interface to 'new Key' to make it easier to add new key options.
mysqld option --new is used to define where key options are printed.
(In 5.3 we should move all key options to after key part definition to avoid problem with reserved names)
Fixed some compiler warnings and a memory leak in ssl


include/my_base.h:
  Added flag to check if block size for key was secified
include/my_sys.h:
  Added new support function to round up to a power of two
include/myisam.h:
  Rename block_size -> block_size_index to avoid confusion with 'block_size'
include/violite.h:
  Added function to free memory after new_VioSSLAcceptorFd
  (Will rename all vio_ssl functions in a future changeset)
mysql-test/mysql-test-run.pl:
  Don't print port number info when we use --extern
mysql-test/r/myisam.result:
  Added test for key_block_size
mysql-test/t/myisam.test:
  Added test for key_block_size
mysys/mf_keycache.c:
  Simplify code
mysys/my_bit.c:
  Added new support function to round up to a power of two
sql/ha_myisam.cc:
  Tell MyISAM to use the specified key_block_size
  MyISAM also updates the global key_block_size from the used values.
sql/handler.cc:
  Added 'default_key_create_info' to be used as 'dummy' argument to 'new Key'
sql/handler.h:
  Added KEY_CREATE_INFO, to be used as for general options for KEY's
sql/item_func.h:
  Removed compiler warning
sql/lex.h:
  Added new symbol
sql/mysqld.cc:
  Fixed memory leak in ssl (new_VioSSLAcceptorFd)
sql/sql_class.h:
  Change 'new Key' to use KEY_CREATE_INFO instead of 'algoritm', parser, key_page_size.
  This makes it easier to add new key options in the future.
sql/sql_lex.h:
  Added key create options
sql/sql_parse.cc:
  Use new interface to 'new Key'
sql/sql_show.cc:
  Added support for key_block_size
  If --new is used, key options are printed after the key part definition.
sql/sql_table.cc:
  Use new interface to 'new Key'
  Add support for key_block_size
sql/sql_yacc.yy:
  Add support for key_block_size
  Allow key options before and after key_parts (In future they should be always after the key_part defintion)
  Use new interface to 'new Key'
sql/structs.h:
  Added block_size to keys
sql/table.cc:
  Remmeber and read key_block_size for table and key level
sql/table.h:
  Added default key_block_size for table
sql/unireg.cc:
  Remember key_block_size for key
storage/myisam/ft_eval.c:
  Set block_length to 0 to get default key page size
storage/myisam/ft_test1.c:
  Set block_length to 0 to get default key page size
storage/myisam/mi_check.c:
  block_size -> block_size_index
storage/myisam/mi_create.c:
  Added support for block size per key.
  Block size is rounded up to next power of two and enforced between MIN and MAX KEY_BLOCK_LENGTH.
  Align start of key block to start at an even offset of max_key_block_length to ensure key cache works good if all key pages are of same size.
storage/myisam/mi_open.c:
  block_size -> block_size_index
storage/myisam/mi_page.c:
  block_size -> block_size_index
storage/myisam/mi_test1.c:
  Set block_length to 0 to get default key page size
storage/myisam/mi_test2.c:
  Set block_length to 0 to get default key page size
storage/myisam/mi_test3.c:
  Set block_length to 0 to get default key page size
storage/myisam/myisamdef.h:
  block_size -> block_size_index to avoid confusion with 'block_size' in MySQL
  Added block_size as argument to MI_BLOCK_SIZE
  Added missing prototypes to get rid of compiler warnings
storage/myisam/myisampack.c:
  Removed compiler warning
  block_size -> block_size_index
vio/viosslfactories.c:
  Fixed memory leak in ssl (new_VioSSLAcceptorFd)
mysql-test/r/myisam-system.result:
  New BitKeeper file ``mysql-test/r/myisam-system.result''
mysql-test/t/myisam-system.test:
  New BitKeeper file ``mysql-test/t/myisam-system.test''
2006-05-03 15:59:17 +03:00
unknown
12ede0e0be Added new show contributors command.
sql/lex.h:
  Additions for show contributors
sql/mysql_priv.h:
  Show contributors addition
sql/sp_head.cc:
  Added for show contributors
sql/sql_lex.h:
  Adding contributors addition
sql/sql_parse.cc:
  Execute for add contributors
sql/sql_show.cc:
  Adding show contributors
sql/sql_yacc.yy:
  Show contributors additio
mysql-test/r/contributors.result:
  New BitKeeper file ``mysql-test/r/contributors.result''
mysql-test/t/contributors.test:
  New BitKeeper file ``mysql-test/t/contributors.test''
sql/contributors.h:
  New BitKeeper file ``sql/contributors.h''
2006-05-02 17:53:26 -07:00
unknown
08f930375b Manually merged
client/mysql.cc:
  Auto merged
mysql-test/mysql-test-run.sh:
  Auto merged
mysql-test/r/func_gconcat.result:
  Auto merged
mysql-test/t/rpl_relayrotate.test:
  Auto merged
mysys/mf_keycache.c:
  Auto merged
BitKeeper/deleted/.del-innodb_unsafe_binlog-master.opt~9cbe1bb3d8696c5b:
  Auto merged
mysql-test/t/rpl_stm_until.test:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/lock.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_union.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/unireg.h:
  Auto merged
storage/ndb/src/kernel/SimBlockList.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp:
  Auto merged
2006-04-25 13:04:39 +04:00
unknown
103fbcee45 Merge rurik.mysql.com:/home/igor/dev/mysql-4.1-0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-0


mysql-test/r/order_by.result:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
mysql-test/t/func_gconcat.test:
  Manual merge
mysql-test/t/order_by.test:
  Manual merge
sql/sql_lex.h:
  Manual merge
sql/sql_parse.cc:
  Manual merge
sql/sql_union.cc:
  Manual merge
2006-04-21 00:36:20 -07:00
unknown
9225a51c58 Fixed bug #18767.
The bug caused wrong result sets for union constructs of the form
(SELECT ... ORDER BY order_list1 [LIMIT n]) ORDER BY order_list2.
For such queries order lists were concatenated and limit clause was
completely neglected. 


mysql-test/r/order_by.result:
  Added a test case for bug #18767.
mysql-test/t/order_by.test:
  Added a test case for bug #18767.
sql/sql_lex.h:
  Fixed bug #18767.
  Placed the code the created a fake SELECT_LEX into a separate function.
sql/sql_parse.cc:
  Fixed bug #18767.
  Placed the code the created a fake SELECT_LEX into a separate function.
sql/sql_select.cc:
  Fixed bug #18767.
  Changed the condition on which a SELECT is treated as part of a UNION.
  The SELECT in 
  (SELECT ... ORDER BY order_list1 [LIMIT n]) ORDER BY order_list2 
  now is handled in the same way as the first SELECT in a UNION
  sequence.
sql/sql_union.cc:
  Fixed bug #18767.
  Changed the condition at which a SELECT is treated as part of a UNION.
  The SELECT in 
  (SELECT ... ORDER BY order_list1 [LIMIT n]) ORDER BY order_list2 
  now is handled in the same way as the first SELECT in a UNION
  sequence.
sql/sql_yacc.yy:
  Fixed bug #18767.
  Changed the condition at which a SELECT is treated as part of a UNION.
  The SELECT in 
  (SELECT ... ORDER BY order_list1 [LIMIT n]) ORDER BY order_list2 
  now is handled in the same way as the first SELECT in a UNION
  sequence. In the same way is handled the SELECT in
  (SELECT ... LIMIT n) ORDER BY order list.
  Yet if there is neither ORDER BY nor LIMIT in the single-select
  union construct
  (SELECT ...) ORDER BY order_list
  then it is still handled as simple select with an order clause.
2006-04-20 22:15:38 -07:00
unknown
5569a87ebd Bug#18477 - MySQL/InnoDB Ignoring Foreign Keys in ALTER TABLE
InnoDB requires a full table rebuild for foreign key changes.
It was not possible in compare_tables() to detect such changes.

On Heikkis proposal I added a new flag to the syntax parser
where foreign key definition changes are done. I test for
this flag in compare_tables() now.


mysql-test/r/innodb.result:
  Bug#18477 - MySQL/InnoDB Ignoring Foreign Keys in ALTER TABLE
  Fixed an old test result.
  Added the new test result.
mysql-test/t/innodb.test:
  Bug#18477 - MySQL/InnoDB Ignoring Foreign Keys in ALTER TABLE
  Added the new test case.
sql/sql_lex.h:
  Bug#18477 - MySQL/InnoDB Ignoring Foreign Keys in ALTER TABLE
  Added a flag for foreign key definition changes.
sql/sql_table.cc:
  Bug#18477 - MySQL/InnoDB Ignoring Foreign Keys in ALTER TABLE
  Check for foreign key definition changes in 
  compare_tables(). If present, a table rebuild is required.
sql/sql_yacc.yy:
  Bug#18477 - MySQL/InnoDB Ignoring Foreign Keys in ALTER TABLE
  Marked foreign key definitions with the new flag.
  This flag is tested in ALTER TABLE only. It is
  ignored otherwise.
2006-03-30 20:55:54 +02:00
unknown
a5b8b7755e Merge mronstrom@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into  c-8808e253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/bug17754


mysql-test/r/partition.result:
  Auto merged
mysql-test/t/partition.test:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_partition.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
mysql-test/r/ndb_partition_key.result:
  manual merge
mysql-test/t/ndb_partition_key.test:
  manual merge
2006-03-20 14:41:50 -05:00
unknown
51f70d9ff7 BUG#17754
Added new syntax ALTER TABLE t1 REMOVE PARTITIONING,
changed semantics of ALTER TABLE t1 ENGINE=X; to not remove partitioning
Fix a number of mix engine bugs in partitioning


mysql-test/r/ndb_partition_key.result:
  Added a number of new test cases
mysql-test/r/partition.result:
  Added a number of new test cases
mysql-test/t/ndb_partition_key.test:
  Added a number of new test cases
mysql-test/t/partition.test:
  Added a number of new test cases
sql/lex.h:
  REMOVE and PARTITIONING added as keywords in parser
sql/sql_lex.h:
  Added flag to alter_info flag
sql/sql_partition.cc:
  Fixes for the new syntax, changes of the current semantics of the syntax.
  Fixes for errors in handling mixes of table handlers in partitioning syntax
  for ALTER TABLE
sql/sql_table.cc:
  Bug fix
sql/sql_yacc.yy:
  New syntax for REMOVE PARTITIONING
2006-03-20 14:36:21 -05:00
unknown
8caf2f0ccf Merge bk-internal.mysql.com:/home/bk/mysql-5.1-new
into  mysql.com:/opt/local/work/mysql-5.1-root


sql/sql_lex.h:
  Auto merged
2006-03-16 20:43:44 +03:00
unknown
01cce283a7 BUG#17772
A crash after ALTER TABLE t1 RENAME ...


mysql-test/r/partition.result:
  New test case
mysql-test/t/partition.test:
  New test case
sql/sql_lex.h:
  Introduced like name for CREATE TABLE t1 LIKE t2
sql/sql_parse.cc:
  Introduced like name for CREATE TABLE t1 LIKE t2
sql/sql_partition.cc:
  Introduced like name for CREATE TABLE t1 LIKE t2
sql/sql_yacc.yy:
  Introduced like name for CREATE TABLE t1 LIKE t2
2006-03-16 03:21:15 -08:00
unknown
f61a649c5e A post-review fix for Bug#17403 "Events: packets out of order
with show create event"


sql/sql_lex.h:
  Add a comment.
2006-03-16 13:50:00 +03:00