Commit graph

255 commits

Author SHA1 Message Date
unknown
8f760dc08c Merge neptunus.(none):/home/msvensson/mysql/mysqltest_var/my50-mysqltest_var
into  neptunus.(none):/home/msvensson/mysql/mysqltest_var/my50-mysqltest_var-integration


mysql-test/mysql-test-run.sh:
  Auto merged
mysql-test/r/rpl000001.result:
  Auto merged
mysql-test/r/trigger.result:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/t/rpl000001.test:
  Auto merged
mysql-test/t/symlink.test:
  Auto merged
mysql-test/t/trigger.test:
  Auto merged
mysql-test/t/type_varchar.test:
  Auto merged
mysql-test/t/view.test:
  Auto merged
mysql-test/mysql-test-run.pl:
  Manual merge
mysql-test/r/mysqltest.result:
  Manual merge
mysql-test/t/mysqltest.test:
  Manual merge
mysql-test/t/trigger-compat.test:
  Manual merge, remove the "--text" argument, not portable
mysql-test/t/trigger-grant.test:
  Manual merge, remove the "--text" argument, not portable
2006-01-24 08:43:34 +01:00
unknown
d40f7056ae Make it possible to run mysql-test-run.pl with default test suite in different vardir.
mysql-test/include/have_outfile.inc:
  Use MYSQLTEST_VARDIR
mysql-test/include/test_outfile.inc:
  Use MYSQLTEST_VARDIR
mysql-test/mysql-test-run.pl:
  Create variable $MYSQLTEST_VARDIR that points to  the vardir
  Don't create a symlink from var/ to the physical vardir if it's somewhere else
  Setup a symlink(or copy dir on windows) for std_data so it is available in the physical vardir
  Use "../tmp" as slave-load-tmpdir, since the server is started in var/master-data and slave in var/slave-data they will both find the dumps in "../tmp"
mysql-test/mysql-test-run.sh:
  Export MYSQLTEST_VARDIR, always pointing at mysql-test/var
mysql-test/r/backup.result:
  Use MYSQLTEST_VARDIR
mysql-test/r/blackhole.result:
  Use "../std_data_ln" to find std_data files
mysql-test/r/loaddata.result:
  Use "../std_data_ln" to find std_data files
mysql-test/r/mysqlbinlog.result:
  Use "../std_data_ln" to find std_data files
mysql-test/r/mysqltest.result:
  Use MYSQLTEST_VARDIR
mysql-test/r/outfile.result:
  Use MYSQLTEST_VARDIR
mysql-test/r/query_cache.result:
  Add missing drop function
mysql-test/r/rpl000001.result:
  Use "../std_data_ln" to find std_data files
mysql-test/r/rpl000004.result:
  Use "../std_data_ln" to find std_data files
mysql-test/r/rpl_innodb.result:
  Use "../std_data_ln" to find std_data files
mysql-test/r/rpl_loaddata.result:
  Use "../std_data_ln" to find std_data files
mysql-test/r/rpl_loaddata_rule_m.result:
  Use "../std_data_ln" to find std_data files
mysql-test/r/rpl_loaddata_rule_s.result:
  Use "../std_data_ln" to find std_data files
mysql-test/r/rpl_loaddatalocal.result:
  Use MYSQLTEST_VARDIR
mysql-test/r/rpl_log.result:
  Use "../std_data_ln" to find std_data files
mysql-test/r/rpl_misc_functions.result:
  Use MYSQLTEST_VARDIR
mysql-test/r/rpl_replicate_do.result:
  Use "../std_data_ln" to find std_data files
mysql-test/r/rpl_rewrite_db.result:
  Use "../std_data_ln" to find std_data files
mysql-test/r/rpl_timezone.result:
  Use "../std_data_ln" to find std_data files
mysql-test/r/symlink.result:
  Use MYSQLTEST_VARDIR
mysql-test/r/trigger.result:
  Use "../std_data_ln" to find std_data files
mysql-test/r/view.result:
  Use "../std_data_ln" to find std_data files
mysql-test/r/warnings.result:
  Use "../std_data_ln" to find std_data files
mysql-test/t/backup-master.sh:
  Use MYSQLTEST_VARDIR
mysql-test/t/backup.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/blackhole.test:
  Use "../std_data_ln" to find std_data files
mysql-test/t/ctype_ucs_binlog.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/im_daemon_life_cycle-im.opt:
  Use MYSQLTEST_VARDIR
mysql-test/t/im_options_set.imtest:
  Use MYSQLTEST_VARDIR
mysql-test/t/im_options_unset.imtest:
  Use MYSQLTEST_VARDIR
mysql-test/t/loaddata.test:
  Use "../std_data_ln" to find std_data files
mysql-test/t/myisam.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/mysqlbinlog.test:
  Use "../std_data_ln" to find std_data files
mysql-test/t/mysqlbinlog2.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/mysqldump.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/mysqltest.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/ndb_autodiscover.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/outfile.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/query_cache.test:
  Add missing drop function
mysql-test/t/repair.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl000001.test:
  Use "../std_data_ln" to find std_data files
mysql-test/t/rpl000004.test:
  Use "../std_data_ln" to find std_data files
mysql-test/t/rpl000009.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl000015-slave.sh:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl000017-slave.sh:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl_EE_error.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl_charset.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl_drop_db.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl_flush_log_loop-master.opt:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl_flush_log_loop-master.sh:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl_flush_log_loop-slave.opt:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl_flush_log_loop-slave.sh:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl_innodb.test:
  Use "../std_data_ln" to find std_data files
mysql-test/t/rpl_loaddata.test:
  Use "../std_data_ln" to find std_data files
mysql-test/t/rpl_loaddata_rule_m.test:
  Use "../std_data_ln" to find std_data files
mysql-test/t/rpl_loaddata_rule_s.test:
  Use "../std_data_ln" to find std_data files
mysql-test/t/rpl_loaddatalocal.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl_log.test:
  Use "../std_data_ln" to find std_data files
mysql-test/t/rpl_misc_functions-slave.sh:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl_misc_functions.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl_replicate_do.test:
  Use "../std_data_ln" to find std_data files
mysql-test/t/rpl_rewrite_db.test:
  Use "../std_data_ln" to find std_data files
mysql-test/t/rpl_rotate_logs-slave.sh:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl_rotate_logs.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/rpl_timezone.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/show_check.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/sp-destruct.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/symlink.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/temp_table-master.opt:
  Use MYSQLTEST_VARDIR
mysql-test/t/trigger-compat.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/trigger-grant.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/trigger.test:
  Use "../std_data_ln" to find std_data files
mysql-test/t/type_varchar.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/user_var-binlog.test:
  Use MYSQLTEST_VARDIR
mysql-test/t/view.test:
  Use "../std_data_ln" to find std_data files
mysql-test/t/warnings.test:
  Use "../std_data_ln" to find std_data files
mysql-test/include/sourced.inc:
  New BitKeeper file ``mysql-test/include/sourced.inc''
mysql-test/include/sourced1.inc:
  New BitKeeper file ``mysql-test/include/sourced1.inc''
2006-01-24 08:30:54 +01:00
unknown
312c2f4759 Fixed bug #16016: MIN/MAX optimization was not applied to views.
mysql-test/r/view.result:
  Added a test case for bug #16016.
mysql-test/t/view.test:
  Added a test case for bug #16016.
sql/opt_sum.cc:
  Fixed bug #16016: MIN/MAX optimization was not applied to views.
  The fix employs the standard way of handling direct references to view fields.
2006-01-06 22:28:26 -08:00
unknown
29fde52802 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0


mysql-test/r/create.result:
  Auto merged
mysql-test/r/trigger.result:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/t/create.test:
  Auto merged
mysql-test/t/trigger.test:
  Auto merged
mysql-test/t/view.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sp_head.h:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
mysql-test/t/disabled.def:
  Manual merge
sql/mysqld.cc:
  Manual merge
sql/sp_head.cc:
  Manual merge
sql/sql_trigger.cc:
  Manual merge
2006-01-06 01:08:48 +02:00
unknown
64206b1850 Review fixes of new pushed code
- Fixed tests
- Optimized new code
- Fixed some unlikely core dumps
- Better bug fixes for:
  - #14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
  - #14850 (ERROR 1062 when a quering a view using a Group By on a column that can be null


mysql-test/r/create.result:
  Update results after removing wrong warnings for CREATE ... SELECT
  New tests
mysql-test/r/handler.result:
  Drop used tables
mysql-test/r/kill.result:
  Make test portable
mysql-test/r/mysqlshow.result:
  Drop tables used by previous test
mysql-test/r/trigger.result:
  Reuse old procedure name
mysql-test/r/view.result:
  Extra tests
mysql-test/t/create.test:
  New tests to test fix of removing wrong warnings for CREATE ... SELECT
mysql-test/t/disabled.def:
  Enable 'kill' test (should now be portable)
mysql-test/t/handler.test:
  Drop used tables
mysql-test/t/kill.test:
  Make test portable even if kill doesn't work at once
mysql-test/t/mysqlshow.test:
  Drop tables used by previous test
mysql-test/t/trigger.test:
  Reuse old procedure name
mysql-test/t/view.test:
  Extra tests
sql/field.cc:
  Removed compiler warning
sql/ha_federated.cc:
  my_snprintf -> strmake()
  (Simple optimization)
sql/ha_ndbcluster.cc:
  Indentation cleanups and trival optimization
sql/item.cc:
  Moved save_org_in_field() to item.cc to make it easier to test
  Remove setting of null_value as this is not needed
sql/item.h:
  Moved save_org_in_field() to item.cc to make it easier to test
sql/log_event.cc:
  Remove inline of slave_load_file_stem()
  Added 'extension' parameter to slave_load_file_stem() to get smaller code
  Removed not critical (or needed) DBUG_ASSERT()'s
  Cleaned up usage of slave_load_file_stem() to not depend on constant string lengths
  Indentation fixes
sql/opt_range.cc:
  Moved code from declaration to function body
  (To make it more readable)
sql/parse_file.cc:
  Fixed DBUG_PRINT
sql/sp.cc:
  Simple cleanups
  - Removed not needed {} level
  - Ensure saved variables starts with old_
sql/sp_head.cc:
  Indentation fixes
  Remove core dump when using --debug when m_next_cached_sp == 0
  Fixed compiler warnings
  Trivial optimizations
sql/sp_head.h:
  Changed argument to set_definer() to const
  Added THD argument to recursion_level_error() to avoid call to current_thd
sql/sql_acl.cc:
  Removed not needed test (first_not_own_table is the guard)
sql/sql_base.cc:
  Removed extra empty line
sql/sql_handler.cc:
  Don't test table version in mysql_ha_read() as this is already tested in lock_tables()
  Moved call to insert_fields to be after lock_table() to guard aganst reopen of tables
  (Better fix for Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash)
sql/sql_insert.cc:
  Mark fields that are set in CREATE ... SELECT as used
  (Removed wrong warnings about field not having a default value)
sql/sql_parse.cc:
  Removed not needed test of 'tables' (first_not_own_table is the guard)
  Simplify code
sql/sql_select.cc:
  Use group->field to check if value is null instead of item called by 'save_org_in_field'
  This is a better bug fix for #14850 (ERROR 1062 when a quering a view using a Group By on a column that can be null)
sql/sql_trigger.cc:
  Move sql_modes_parameters outside of function
  Indentation fixes
  Fixed compiler warning
  Ensure that thd->lex->query_tables_own_last is set properly before calling check_table_access()
  (This allows us to remove the extra test in check_grant() and check_table_access())
2006-01-06 00:47:49 +02:00
unknown
c7a440d1c6 Fix for bug#14861 aliased column names are not preserved.
Create tmp table filed using original item name when it's necessary


mysql-test/r/view.result:
  Fix for bug#14861 aliased column names are not preserved.
    test case
mysql-test/t/view.test:
  Fix for bug#14861 aliased column names are not preserved.
    test case
2005-12-19 15:36:03 +04:00
unknown
a2023cf018 Merge mysqldev@production.mysql.com:my/mysql-5.0-release
into  mysql.com:/home/dlenev/src/mysql-5.0-bg11555-2


mysql-test/r/view.result:
  Auto merged
mysql-test/t/sp-error.test:
  Auto merged
sql/sp_head.cc:
  Auto merged
mysql-test/r/sp-error.result:
  SCCS merged
2005-12-07 14:38:20 +03:00
unknown
24af7680d4 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/dlenev/src/mysql-5.0-bg11555-2


mysql-test/r/sp-error.result:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/t/view.test:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_trigger.h:
  Auto merged
sql/sp.cc:
  Manual merge.
sql/sp.h:
  Manual merge.
sql/sql_base.cc:
  Manual merge.
2005-12-07 12:47:25 +03:00
unknown
361977c0da Fix for bug #11555 "Stored procedures: current SP tables locking make
impossible view security".

We should not expose names of tables which are explicitly or implicitly (via
routine or trigger) used by view even if we find that they are missing.
So during building of list of prelocked tables for statement we track which
routines (and therefore tables for these routines) are used from views. We
mark elements of LEX::routines set which correspond to routines used in views
by setting Sroutine_hash_entry::belong_to_view member to point to TABLE_LIST
object for topmost view which uses routine. We propagate this mark to all
routines which are used by this routine and which we add to this set. We also
mark tables used by such routine which we add to the list of tables for
prelocking as belonging to this view.


mysql-test/r/sp-error.result:
  Added test for bug #11555 "Stored procedures: current SP tables locking make 
  impossible view security".
mysql-test/r/view.result:
  We should not expose tables which are expicitly/implicitly used in view in
  check table statement.
mysql-test/t/sp-error.test:
  Added test for bug #11555 "Stored procedures: current SP tables locking make 
  impossible view security".
mysql-test/t/view.test:
  Removed comment obsoleted by bugfix.
sql/sp.cc:
  We should not expose names of tables which are explicitly or implicitly
  (via routine or trigger) used by view even if we find that they are missing.
  So during building of list of prelocked tables for statement we track which
  routines (and therefore tables for these routines) are used from views. We
  mark elements of LEX::routines set which correspond to routines used in views
  by setting Sroutine_hash_entry::belong_to_view member to point to TABLE_LIST
  object for topmost view which uses routine. We propagate this mark to all
  routines which are used by this routine and which we add to this set. We also
  mark tables used by such routine which we add to the list of tables for
  prelocking as belonging to this view.
sql/sp.h:
  sp_cache_routines_and_add_tables_for_view()/for_triggers():
    To be able to determine correctly uppermost view which uses this view/table
    with trigger we have to pass pointer to TABLE_LIST object instead of pointer
    to view's LEX or to Table_triggers_list object.
sql/sp_head.cc:
  sp_head::add_used_tables_to_table_list():
    Added new argument which allows to mark tables which are added to table
    list for prelocking as belonging to view (this allows properly hide names
    of tables which are used in routines used by views).
sql/sp_head.h:
  sp_head::add_used_tables_to_table_list():
    Added new argument which allows to mark tables which are added to table
    list for prelocking as belonging to view (this allows properly hide names
    of tables which are used in routines used by views).
sql/sql_base.cc:
  open_tables():
    sp_cache_routines_and_add_tables_for_view()/for_triggers() now accept
    pointer to table list element as last argument, this allows them to determine
    correctly uppermost view which uses this view/table with trigger.
sql/sql_trigger.h:
  Table_triggers_list:
    sp_cache_routines_and_add_tables_for_triggers() now accept pointer to table
    list element as last argument, this allows to determine correctly uppermost
    view which uses this table with trigger.
2005-12-07 12:27:17 +03:00
unknown
3e1fed7b11 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into serg.mylan:/usr/home/serg/Abk/mysql-5.0


mysql-test/r/sp.result:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2005-12-05 18:18:56 +01:00
unknown
d9c233ae76 better error for optimize/repair/etc a view 2005-12-05 12:08:30 +01:00
unknown
5dac7516e2 Merge sanja.is.com.ua:/home/bell/mysql/bk/work-bug1-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-merge1-5.0


sql/sp_head.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
mysql-test/r/view.result:
  SCCS merged
mysql-test/t/view.test:
  SCCS merged
2005-12-02 21:20:25 +02:00
unknown
4202271065 Now we shall store only position (index of first character)
of SELECT from query begining, to be independet of query buffer
allocation.
Correct procedure used to find beginning of the current statement
during parsing (BUG#14885).


mysql-test/r/view.result:
  BUG#14885 test suite.
mysql-test/t/view.test:
  BUG#14885 test suite.
sql/sp_head.cc:
  The debug print statement fixed to prevent crash in case of NULL
  in m_next_cached_sp.
sql/sql_lex.h:
  Now we shall store only position (index of first character)
  of SELECT from query beginning.
sql/sql_view.cc:
  Position of the SELECT used to output it to .frm.
sql/sql_yacc.yy:
  Now we shall store only position (index of first character)
  of SELECT from query beginning.
  Correct procedure used to find beginning of the current statement
  during parsing.
2005-12-02 21:18:12 +02:00
unknown
3e4d4a3656 View creation code fixed to expect empty TABLE_LIST::table pointer (BUG#15096).
mysql-test/r/view.result:
  BUG#15096 test suite.
mysql-test/t/view.test:
  BUG#15096 test suite.
sql/sql_view.cc:
  View placed in a function never get TABLE during view creation,
  because we have never executed that function in this process.
  So we should expect empty TABLE_LIST::table pointer.
2005-12-01 12:15:48 +02:00
unknown
18ca0d6302 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0
into moonbone.local:/work/13622-bug-5.0-mysql


mysql-test/r/view.result:
  Auto merged
mysql-test/t/view.test:
  Auto merged
2005-11-18 17:26:44 +03:00
unknown
283962473c WL#2486 - natural/using joins according to SQL:2003.
Enabled view tests that didn't work before.


mysql-test/r/view.result:
  Enabled natural outer join tests with views - now they work after WL#2486 was pushed.
mysql-test/t/view.test:
  Enabled natural outer join tests with views - now they work after WL#2486 was pushed.
2005-11-18 10:51:46 +02:00
unknown
d29438f25e Manually merged
sql/sql_view.cc:
  Auto merged
2005-11-18 01:16:15 +03:00
unknown
9de8e3b0ef Merge
mysql-test/r/view.result:
  SCCS merged
mysql-test/t/view.test:
  SCCS merged
2005-11-16 02:08:20 +03:00
unknown
0a9badeca4 Fix bug #14816 test_if_order_by_key() expected only Item_fields.
test_if_order_by_key() expected only Item_fields to be in order->item, thus
failing to find available index on view's field, which results in reported
error.

Now test_if_order_by_key() calls order->item->real_item() to get field for
choosing index.


sql/sql_select.cc:
  Fix bug #14816 test_if_order_by_key() expected only Item_fields.
  Make test_if_order_by_key() use real_item() to get field.
mysql-test/r/view.result:
  Test case for bug#14816 test_if_order_by_key() expected only Item_fields.
mysql-test/t/view.test:
  Test case for bug#14816 test_if_order_by_key() expected only Item_fields.
2005-11-14 22:10:34 +03:00
unknown
6c708fadcb Fix bug #14850 Item_ref's null_value wasn't updated
Item_ref's null_value wasn't updated in save_org_in_field() causing reported
error.


sql/item.h:
  Fix bug #14850 Item_ref's null_value wasn't updated
  Make save_org_in_field() update Item_ref's null_value.
mysql-test/r/view.result:
  Test case for bug #14850 Item_ref's null_value wasn't updated
mysql-test/t/view.test:
   Test case for bug #14850 Item_ref's null_value wasn't updated
2005-11-14 21:52:39 +03:00
unknown
56f43d9d02 Fix bug #13622 Wrong view .frm created if some field's alias contain \n
View .frm parser assumes that query string will take only 1 line, with \n in
aliases query stringmay take several lines thus produces bad .frm file.

'query' parameter type changed from 'string' to 'escaped string'


sql/sql_view.cc:
  Fix bug #13622 \n in column alias results in broken .frm
  'query' parameter type changed to 'escaped string'
mysql-test/r/view.result:
  Test case for bug #13622 Wrong view .frm created if some field's alias contain \n
mysql-test/t/view.test:
  Test case for bug #13622 Wrong view .frm created if some field's alias contain \n
2005-11-11 20:03:32 +03:00
unknown
7dbea7df27 WL#2818 (Add creator to the trigger definition for privilege
checks on trigger activation)


mysql-test/r/information_schema.result:
  Update result file: a new column DEFINER has been added to
  INFORMATION_SCHEMA.TRIGGERS.
mysql-test/r/mysqldump.result:
  Update result file: a new column DEFINER has been added to
  INFORMATION_SCHEMA.TRIGGERS.
mysql-test/r/rpl_ddl.result:
  Update result file: a new column DEFINER has been added to
  INFORMATION_SCHEMA.TRIGGERS.
mysql-test/r/rpl_sp.result:
  Update result file: a new clause DEFINER has been added to
  CREATE TRIGGER statement.
mysql-test/r/rpl_trigger.result:
  Results for new test cases were added.
mysql-test/r/skip_grants.result:
  Error message has been changed.
mysql-test/r/trigger.result:
  Added DEFINER column.
mysql-test/r/view.result:
  Error messages have been changed.
mysql-test/r/view_grant.result:
  Error messages have been changed.
mysql-test/t/mysqldump.test:
  Drop created procedure to not affect further tests.
mysql-test/t/rpl_trigger.test:
  Add tests for new column in information schema.
mysql-test/t/skip_grants.test:
  Error tag has been renamed.
mysql-test/t/view.test:
  Error tag has been renamed.
mysql-test/t/view_grant.test:
  Error tag has been changed.
sql/item_func.cc:
  Fix typo in comments.
sql/mysql_priv.h:
  A try to minimize copy&paste:
    - introduce operations to be used from sql_yacc.yy;
    - introduce an operation to be used from trigger and
      view processing code.
sql/share/errmsg.txt:
  - Rename ER_NO_VIEW_USER to ER_MALFORMED_DEFINER in order to
    be shared for view and trigger implementations;
  - Fix a typo;
  - Add a new error code for trigger warning.
sql/sp.cc:
  set_info() was split into set_info() and set_definer().
sql/sp_head.cc:
  set_info() was split into set_info() and set_definer().
sql/sp_head.h:
  set_info() was split into set_info() and set_definer().
sql/sql_acl.cc:
  Add a new check: exit from the cycle if the table is NULL.
sql/sql_lex.h:
  - Rename create_view_definer to definer, since it is used for views
    and triggers;
  - Change st_lex_user to LEX_USER, since st_lex_user is a structure.
    So, formally, it should be "struct st_lex_user", which is longer
    than just LEX_USER;
  - Add trigger_definition_begin.
sql/sql_parse.cc:
  - Add a new check: exit from the cycle if the table is NULL;
  - Implement definer-related functions.
sql/sql_show.cc:
  Add DEFINER column.
sql/sql_trigger.cc:
  Add DEFINER support for triggers.
sql/sql_trigger.h:
  Add DEFINER support for triggers.
sql/sql_view.cc:
  Rename create_view_definer to definer.
sql/sql_yacc.yy:
  Add support for DEFINER-clause in CREATE TRIGGER statement.
  
  Since CREATE TRIGGER and CREATE VIEW can be similar at the start,
  yacc is unable to distinguish between them. So, had to modify both
  statements in order to make it parsable by yacc.
mysql-test/r/trigger-compat.result:
  Result file for triggers backward compatibility test.
mysql-test/r/trigger-grant.result:
  Result file of the test for WL#2818.
mysql-test/t/trigger-compat.test:
  Triggers backward compatibility test: check that the server
  still can load triggers w/o definer attribute and modify
  tables with such triggers (add a new trigger, etc).
mysql-test/t/trigger-grant.test:
  Test for WL#2818 -- check that DEFINER support in triggers
  works properly
2005-11-10 22:25:03 +03:00
unknown
b5e8347f81 Fixed BUG#14719: Views DEFINER grammar is incorrect
Corrected the syntax for the current_user() case.
  (It's "definer = current_user[()]", not just "current_user[()]".)


mysql-test/r/view.result:
  New test case for BUG#14719
mysql-test/t/view.test:
  New test case for BUG#14719
sql/sql_yacc.yy:
  Corrected the CREATE VIEW syntax for the current_user() DEFINER case.
  (It's "definer = current_user[()]", not just "current_user[()]".)
2005-11-09 16:51:00 +01:00
unknown
a67e6fdf8b Merge rurik.mysql.com:/home/igor/mysql-5.0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-0


mysql-test/r/view.result:
  Manual merge.
mysql-test/t/view.test:
  Manual merge.
2005-11-05 22:45:54 -08:00
unknown
502495271d Post review fixes. 2005-11-05 22:41:36 -08:00
unknown
a7956c817e Post-merge fixes 2005-11-03 12:38:46 +03:00
unknown
883b38a2cd Merged 2005-11-03 10:28:12 +03:00
unknown
2b1652046d Merge rurik.mysql.com:/home/igor/mysql-5.0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-0


mysql-test/r/view.result:
  Manual merge.
mysql-test/t/view.test:
  Manual merge.
2005-11-02 22:24:36 -08:00
unknown
3e2e44f044 Post review fixes.
sql/sql_table.cc:
  Post review fixes
2005-11-02 22:13:10 -08:00
unknown
8a80936517 #view.test#:
new file
sql_table.cc, handler.h:
  Fixed bug #14540.
  Added error mnemonic code HA_ADMIN_NOT_BASE_TABLE
  to report that an operation cannot be applied for views.
view.test, view.result:
  Added a test case for bug #14540.
errmsg.txt:
  Fixed bug #14540.
  Added error ER_CHECK_NOT_BASE_TABLE.


mysql-test/r/view.result:
  Added a test case for bug #14540.
mysql-test/t/view.test:
  Added a test case for bug #14540.
sql/handler.h:
  Fixed bug #14540.
  Added error mnemonic code HA_ADMIN_NOT_BASE_TABLE
  to report that an operation cannot be applied for views.
sql/share/errmsg.txt:
  Added error ER_CHECK_NOT_BASE_TABLE.
sql/sql_table.cc:
  Fixed bug #14540.
  Added error mnemonic code HA_ADMIN_NOT_BASE_TABLE
  to report that an operation cannot be applied for views.
2005-11-02 13:44:58 -08:00
unknown
17fcbcf772 BUG#14026: When doing the end-of-prepare fix up for TABLE_LISTs used in the PS, do the fixup
for underlying tables of a merge VIEWs, too.


mysql-test/r/view.result:
  Testcase for BUG#14026
mysql-test/t/view.test:
  Testcase for BUG#14026
2005-11-02 07:05:19 +03:00
unknown
7dd86f7570 Fix bug #14466 lost sort order in GROUP_CONCAT() in a view
Item_func_group_concat::print() wasn't printing sort order thus creating wrong
view. This results in reported error.


sql/item_sum.cc:
  Fix bug #14466 lost sort order in GROUP_CONCAT() in a view
  Now Item_func_group_concat::print() prints sort order.
mysql-test/r/view.result:
  Test case for bug #14466 lost sort order in GROUP_CONCAT() in a view
mysql-test/t/view.test:
  Test case for bug #14466 lost sort order in GROUP_CONCAT() in a view
2005-11-01 17:27:10 +03:00
unknown
fbb2fd3e58 Merge mysql.com:/usr/local/bk/mysql-5.0
into  mysql.com:/usr/home/pem/bug14256/mysql-5.0


mysql-test/r/view.result:
  Auto merged
mysql-test/r/view_grant.result:
  Merge fix.
mysql-test/t/view_grant.test:
  Merge fix.
2005-10-28 14:55:01 +02:00
unknown
25d1e01409 Fixed BUG#14256: definer in view definition is not fully qualified
Changed the parser test for wildcards in hostname to checking for empty
  strings instead (analogous with the test in default_view_definer()),
  since wildcards do appear in the definer's host-part sometimes.


mysql-test/r/view.result:
  Updated result.
mysql-test/r/view_grant.result:
  Added test for BUG#14256.
mysql-test/t/view.test:
  Changed test for explicit definer; wildcards in host are ok, empty host-part is not.
mysql-test/t/view_grant.test:
  Added test for BUG#14256.
sql/sql_yacc.yy:
  Changed test for wildcards in hostpart of explicit view definer to test for empty
  host part instead. (Analogous with sql_parse.cc:default_view_definer().)
2005-10-28 12:11:32 +02:00
unknown
24ac4019c5 support of view underlying tables and SP functions security check added (BUG#9505) (WL#2787)
mysql-test/r/information_schema.result:
  error message changed
mysql-test/r/sp.result:
  error message changed
mysql-test/r/sql_mode.result:
  fixed test suite
mysql-test/r/view.result:
  error message changed
mysql-test/r/view_grant.result:
  test of underlying view tables check
mysql-test/t/sql_mode.test:
  fixed test suite
mysql-test/t/view_grant.test:
  test of underlying view tables check
sql/item.cc:
  check of underlying tables privilege added
sql/item.h:
  Name the resolution context points to the security  context of view (if item belong to the view)
sql/item_func.cc:
  a view error hiding for execution of prepared function belonged to a view
  fixed checking privileges if stored functions belonds to some view
sql/mysql_priv.h:
  refult of derived table processing functions changed to bool
  Security_context added as an argument to find_field_in_table()
sql/share/errmsg.txt:
  error message fixed
sql/sql_acl.cc:
  Storing requested privileges of tables added
  View underlying tables privilege check added
sql/sql_base.cc:
  View underlying tables privilege check added
sql/sql_cache.cc:
  Code cleunup: we should not register underlying tables of view second time
sql/sql_delete.cc:
  ancestor -> merge_underlying_list renaming
sql/sql_derived.cc:
  refult of derived table processing functions changed to bool
  do not give SELECT_ACL for TEMPTABLE views
sql/sql_lex.h:
  The comment added
sql/sql_parse.cc:
  registration of requested privileges added
sql/sql_prepare.cc:
  registration of requested privileges added
sql/sql_update.cc:
  manipulation of requested privileges for underlying tables made the same as for table which we are updating
sql/sql_view.cc:
  underlying tables of view security check support added
sql/table.cc:
  renaming and fixing view preparation methods, methods for checking underlyoing tables security context added
sql/table.h:
  storege for reuested privileges added
2005-10-28 00:18:23 +03:00
unknown
706157f025 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0


mysql-test/r/view.result:
  Auto merged
mysql-test/t/view.test:
  Auto merged
server-tools/instance-manager/instance.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_manager.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/table.cc:
  Auto merged
sql/unireg.cc:
  Auto merged
2005-10-12 00:59:52 +03:00
unknown
0ce12f70ed Reviewing new pushed code
- CHAR() now returns binary string as default
- CHAR(X*65536+Y*256+Z) is now equal to CHAR(X,Y,Z) independent of the character set for CHAR()
- Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
  (Some old systems returns ETIME and it's safer to test for both values
   than to try to write a wrapper for each old system)
- Fixed new introduced bug in NOT BETWEEN X and X
- Ensure we call commit_by_xid or rollback_by_xid for all engines, even if one engine has failed
- Use octet2hex() for all conversion of string to hex
- Simplify and optimize code


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

To fix this problem check_equality() now takes real item of
Item_direct_view_ref, except outer view refs (with depended_from set).


sql/sql_select.cc:
  Fix bug #13327 VIEW performs index scan
   For proper views fields handling check_equality() now takes real item from Item_direct_view_ref, with exception of outer view refs.
mysql-test/r/view.result:
  Test case for bug#13327 VIEW performs index scan
mysql-test/t/view.test:
  Test case for bug#13327 VIEW performs index scan
2005-10-10 18:53:57 +04:00
unknown
58263844c7 Fix for BUG#13410 - qualified reference to a view column in the HAVING clause cannot be resolved.
The problem was then when a column reference was resolved to a view column, the new Item
created for this column contained the name of the view, and not the view alias.


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


mysql-test/t/view.test:
  Added a test case for bug #13410.
mysql-test/r/view.result:
  Added a test case for bug #13410.
sql/item.cc:
  Fixed bug #13410.
  Fixed name resolution for qualified reference to a view column
  in the HAVING clause.
2005-09-26 23:29:02 -07:00
unknown
f6a552b1cb sql_base.cc, item.cc:
Fixed bug #13411.
  Fixed name resolution for non-qualified reference to a view column
  in the HAVING clause.
view.result, view.test:
  Added a test case for bug #13411.


mysql-test/t/view.test:
  Added a test case for bug #13411.
mysql-test/r/view.result:
  Added a test case for bug #13411.
sql/item.cc:
  Fixed bug #13411.
  Fixed name resolution for non-qualified reference to a view column
  in the HAVING clause.
sql/sql_base.cc:
  Fixed bug #13411.
  Fixed name resolution for non-qualified reference to a view column
  in the HAVING clause.
2005-09-26 20:18:59 -07:00
unknown
015d55b754 Merge grichter@bk-internal.mysql.com:/home/bk/mysql-5.0
into lmy002.wdf.sap.corp:/home/georg/work/mysql/bugs/mysql-5.0-master


mysql-test/r/view.result:
  Auto merged
mysql-test/t/view.test:
  Auto merged
sql/sql_view.cc:
  Auto merged
2005-09-19 05:32:38 +02:00
unknown
bf58b698e2 Fix for bug#5508 after Sanja's review
mysql-test/r/view.result:
  test results for rename table view1 to view2
mysql-test/t/view.test:
  tests for rename table view1 to view2
sql/share/errmsg.txt:
  added new errormessage (schema change not allowed in rename table view)
sql/sql_rename.cc:
  added support for renaming views
sql/sql_view.cc:
  added new function mysql_rename_view
sql/sql_view.h:
  added prototype mysql_rename_view
2005-09-16 17:13:21 +02:00
unknown
d01927dc7e Merge
mysql-test/r/view.result:
  SCCS merged
mysql-test/t/view.test:
  SCCS merged
2005-09-15 20:50:10 +04:00
unknown
11e0bdd70b Updated test results for view test.
mysql-test/r/view.result:
  Updated test results
2005-09-14 16:27:55 -04:00
unknown
de4fbc212c Fix bug #11416 Server crash if using a view that uses function convert_tz
When parser parses function convert_tz it loads available timezone tables in
thd->lex->time_zone_tables_used. But view have another lex that main query.
Thus time_zone_tables_used of main query left uninitialized.
When Item_func_conver_tz is fixed it takes timezone tables from main query
and later when it executed it assumes that timezone tables are loaded and
failed that assertion.



sql/sql_view.cc:
  Fix bug #11416 Server crash if using a view that uses function convert_tz
mysql-test/r/view.result:
  Test case for bug#11416 Server crash if using a view that uses function convert_tz
mysql-test/t/view.test:
  Test case for bug#11416 Server crash if using a view that uses function convert_tz
2005-09-15 00:08:12 +04:00
unknown
97bea9092e Merge mysql.com:/home/alexi/mysql-5.0
into  mysql.com:/home/alexi/dev/mysql-5.0-13000


mysql-test/r/view.result:
  Auto merged
mysql-test/t/view.test:
  Auto merged
2005-09-14 20:32:59 +04:00
unknown
b214671e09 Fixed BUG#12963, BUG#13000: wrong VIEW creation with DAYNAME(),
DAYOFWEEK(), and WEEKDAY().


mysql-test/r/func_time.result:
  Fixed new results for testcases containing EXPLAIN EXTENDED SELECT ...
   WEEKDAY ... DAYNAME. The new results are correct and correspond to
   the changes in create_func_weekday() and create_func_dayname().
mysql-test/r/view.result:
  Fixed some testcases results (bugs #12963, #13000).
mysql-test/t/view.test:
  Added testcases for for bugs #12963, #13000.
sql/item_create.cc:
  Fixed bugs #12963, #13000: wrong VIEW creation with DAYNAME(),
   DAYOFWEEK(), and WEEKDAY().
   Modified create_func_dayname(), create_func_dayofweek(), and
   create_func_weekday(). They don´t insert Item_func_to_days
   object now.
sql/item_timefunc.cc:
  Fixed bugs #12963, #13000: wrong VIEW creation with DAYNAME(),
   DAYOFWEEK(), and WEEKDAY().
   Modified Item_func_weekday::val_int(). The argument of weekday should
   not be considered now to be Item_func_to_days object.
sql/item_timefunc.h:
  Fixed bugs #12963, 13000: wrong VIEW creation with DAYNAME(),
   DAYOFWEEK(), and WEEKDAY.
   Modified Item_func_weekday::func_name(). It returns now different
   names depending on the odbc_type attribute value.
2005-09-14 20:25:00 +04:00
unknown
eae520f383 postmerge fix 2005-09-14 17:27:33 +03:00
unknown
98b6fd8797 postmerge fix 2005-09-14 12:24:14 +03:00