An error occurred fetching the project authors.
  1. 10 Nov, 2005 1 commit
    • unknown's avatar
      WL#2818 (Add creator to the trigger definition for privilege · 7dbea7df
      unknown authored
      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
      7dbea7df
  2. 09 Nov, 2005 1 commit
    • unknown's avatar
      Fixed BUG#14719: Views DEFINER grammar is incorrect · b5e8347f
      unknown authored
        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[()]".)
      b5e8347f
  3. 06 Nov, 2005 1 commit
  4. 03 Nov, 2005 2 commits
  5. 02 Nov, 2005 2 commits
    • unknown's avatar
      #view.test#: · 8a809365
      unknown authored
        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.
      8a809365
    • unknown's avatar
      BUG#14026: When doing the end-of-prepare fix up for TABLE_LISTs used in the PS, do the fixup · 17fcbcf7
      unknown authored
      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
      17fcbcf7
  6. 01 Nov, 2005 1 commit
    • unknown's avatar
      Fix bug #14466 lost sort order in GROUP_CONCAT() in a view · 7dd86f75
      unknown authored
      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
      7dd86f75
  7. 28 Oct, 2005 1 commit
    • unknown's avatar
      Fixed BUG#14256: definer in view definition is not fully qualified · 25d1e014
      unknown authored
        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().)
      25d1e014
  8. 27 Oct, 2005 1 commit
    • unknown's avatar
      support of view underlying tables and SP functions security check added (BUG#9505) (WL#2787) · 24ac4019
      unknown authored
      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
      24ac4019
  9. 11 Oct, 2005 1 commit
    • unknown's avatar
      Reviewing new pushed code · 0ce12f70
      unknown authored
      - 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()
      0ce12f70
  10. 10 Oct, 2005 1 commit
    • unknown's avatar
      Fix bug#13327 check_equality() wasn't checking view's fields · ee5795f2
      unknown authored
      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
      ee5795f2
  11. 01 Oct, 2005 1 commit
    • unknown's avatar
      Fix for BUG#13410 - qualified reference to a view column in the HAVING clause cannot be resolved. · 58263844
      unknown authored
      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
      58263844
  12. 27 Sep, 2005 2 commits
    • unknown's avatar
      item.cc: · d7e4e1a5
      unknown authored
        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.
      d7e4e1a5
    • unknown's avatar
      sql_base.cc, item.cc: · f6a552b1
      unknown authored
        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.
      f6a552b1
  13. 16 Sep, 2005 1 commit
    • unknown's avatar
      Fix for bug#5508 after Sanja's review · bf58b698
      unknown authored
      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
      bf58b698
  14. 14 Sep, 2005 6 commits
    • unknown's avatar
      Updated test results for view test. · 11e0bdd7
      unknown authored
      mysql-test/r/view.result:
        Updated test results
      11e0bdd7
    • unknown's avatar
      Fix bug #11416 Server crash if using a view that uses function convert_tz · de4fbc21
      unknown authored
      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
      de4fbc21
    • unknown's avatar
      Fixed BUG#12963, BUG#13000: wrong VIEW creation with DAYNAME(), · b214671e
      unknown authored
       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.
      b214671e
    • unknown's avatar
      postmerge fix · eae520f3
      unknown authored
      eae520f3
    • unknown's avatar
      postmerge fix · 98b6fd87
      unknown authored
      98b6fd87
    • unknown's avatar
      part 1 (ver 2, postreview fix) of WL#2787 · f7aeb6f9
      unknown authored
      view definer information syntax/storage/replication
      fixed SOURCE field of .frm
      
      
      mysql-test/r/func_in.result:
        definer information added to CREATE VIEW
      mysql-test/r/lowercase_view.result:
        definer information added to CREATE VIEW
      mysql-test/r/mysqldump.result:
        definer information added to CREATE VIEW
      mysql-test/r/rpl_view.result:
        check log of queries
      mysql-test/r/skip_grants.result:
        --skip-grants do not allow use user information
      mysql-test/r/sql_mode.result:
        definer information added to CREATE VIEW
      mysql-test/r/temp_table.result:
        definer information added to CREATE VIEW
      mysql-test/r/view.result:
        definer information added to CREATE VIEW
        test of storing/restoring definer information
      mysql-test/r/view_grant.result:
        test of grant check of definer information
        definer information added to CREATE VIEW
      mysql-test/t/rpl_view.test:
        check log of queries
      mysql-test/t/skip_grants.test:
        --skip-grants do not allow use user information
      mysql-test/t/view.test:
        test of storing/restoring definer information
      mysql-test/t/view_grant.test:
        test of grant check of definer information
      sql/mysql_priv.h:
        CREATE/ALTER VIEW print support
        set current user as definer procedure
      sql/share/errmsg.txt:
        new errors/warnings
      sql/sql_acl.cc:
        make find_acl_user public to allow to check user
      sql/sql_acl.h:
        make find_acl_user public to allow to check user
      sql/sql_lex.h:
        storing definer information
      sql/sql_parse.cc:
        send CREATE/ALTER VIEW for replication with full list of options
        set current user as definer procedure
      sql/sql_show.cc:
        new CREATE VIEW options printed
      sql/sql_view.cc:
        check of definer clause
        changes in .frm file
        definer information storage support
        now we store only original SELECT in SOURCE field of .frm
      sql/sql_yacc.yy:
        definer information sintax support
        getting SOURCE field information for .frm
      sql/table.h:
        definer information storage
      f7aeb6f9
  15. 13 Sep, 2005 1 commit
    • unknown's avatar
      BUG#10713 mysqldump includes database in create view and referenced tables · 2761c648
      unknown authored
       - Update test results
       - Updates after review
      
      
      mysql-test/r/func_in.result:
        Update test results
      mysql-test/r/lowercase_view.result:
        Update test results
      mysql-test/r/mysqldump.result:
        Update test results
      mysql-test/r/sql_mode.result:
        Update test results
      mysql-test/r/temp_table.result:
        Update test results
      mysql-test/r/view.result:
        Update test results
      mysql-test/t/mysqldump.test:
        Update test results
      sql/sql_show.cc:
        Updated after review
      2761c648
  16. 12 Sep, 2005 1 commit
    • unknown's avatar
      Fix for BUG#6808. · d2789003
      unknown authored
      The problem was in that add_table_to_list was testing for duplicate tables
      in a list of tables that included the created view.
      
      
      mysql-test/r/view.result:
        Test for BUG#6808
      mysql-test/t/view.test:
        Test for BUG#6808
      sql/sql_parse.cc:
        When testing for table name uniquness, skip the first table the current
        statement is CREATE VIEW. Notice that the first table is skipped differently
        for CREATE TABLE ... SELECT ... statements, so we don't have to handle that
        case here (see production 'create_select', the call 'to save_and_clear').
      d2789003
  17. 11 Sep, 2005 1 commit
    • unknown's avatar
      Fix bug #12993 View column rename broken in subselect · b3dc4ea3
      unknown authored
      When view column aliased in subselect alias is set on ref which represents
      field. When tmp table is created for subselect, it takes name of original field
      not ref. Because of this alias on view column in subselect is lost. Which
      results in reported error.
      
      Now when alias is set on ref, it's set on ref real item too.
      
      
      mysql-test/r/view.result:
        Test case for bug #12993  View column rename broken in subselect
      mysql-test/t/view.test:
        Test case for bug #12993  View column rename broken in subselect
      sql/sql_base.cc:
        Fix bug #12993 View column rename broken in subselect
        Now when alias is set on ref, it's set on ref real item too.
      b3dc4ea3
  18. 07 Sep, 2005 2 commits
    • unknown's avatar
      Fix bug #12922 if(sum(),...) with group from view returns wrong results · 792221e3
      unknown authored
      Fields of view represented by Item_direct_view_ref. When complex expression
      such as if(sum()>...,...) is splited in simpler parts by refs was ignored.
      Beside this direct ref doesn't use it's result_field and thus can't store
      it's result in tmp table which is needed for sum() ... group.
      All this results in reported bug.
      
      Item::split_sum_func2() now converts Item_direct_view_ref to Item_ref to
      make fields from view being storable in tmp table.
      
      
      sql/item.h:
        Fix bug #12922 if(sum(),...) with group from view returns wrong results
        Added function ref_type() to distinguish Item_ref subclasses
      sql/item.cc:
        Fix bug #12922 if(sum(),...) with group from view returns wrong results
         Item::split_sum_func2() now converts Item_direct_view_ref to Item_ref to make fields from view being storable in tmp table.
      mysql-test/t/view.test:
        Test case for bug#12922 if(sum(),...) with group from view returns wrong results
      mysql-test/r/view.result:
        Test case for bug#12922 if(sum(),...) with group from view returns wrong results
      792221e3
    • unknown's avatar
      Fix for BUG#12941: in create_tmp_field(), if the passed item is an Item_ref, put newly · 3003e5a0
      unknown authored
      created item into item->result_field, not *(item->ref)->result_field.
      
      
      mysql-test/r/view.result:
        Tescase for BUG#12941
      mysql-test/t/view.test:
        Tescase for BUG#12941
      3003e5a0
  19. 30 Aug, 2005 1 commit
    • unknown's avatar
      Fix bug #12489 wrongly printed strcmp() function results in creation of broken · 0ccb16d6
      unknown authored
      view.
      
      For Item_func_strcmp print() was not defined and for this class was called
      print_op of it's parent class. Because of this strcmp() was printed wrongly
      and this results int creation of broken view.
      
      Added function Item_func_strcmp::print() which correctly prints strcmp()
      function.
      
      
      sql/item_cmpfunc.h:
        Fix bug #12489 wrongly printed strcmp() function results in creation of broken view.
      mysql-test/r/view.result:
        Test case for bug #12489 wrongly printed strcmp() function results in creation of broken view.
      mysql-test/t/view.test:
        Test case for bug #12489 wrongly printed strcmp() function results in creation of broken view.
      0ccb16d6
  20. 25 Aug, 2005 1 commit
  21. 24 Aug, 2005 1 commit
  22. 18 Aug, 2005 1 commit
    • unknown's avatar
      view.test: · c9fa6a47
      unknown authored
        Added a test case for bug #10970.
      view.result:
        Added a test case for bug #10970.
        Modified the error messages for error ER_VIEW_SELECT_TMPTABLE.
      sql_view.cc:
        Fixed bug #10970.
        In the function mysql_create_view if a view does not refer
        any tables directly the variable table must be updated
        after the call of open_and_lock_tables.
      errmsg.txt:
        Modified the error messages for error ER_VIEW_SELECT_TMPTABLE
        (when fixing bug #10970).
      
      
      sql/share/errmsg.txt:
        Modified the error messages for error ER_VIEW_SELECT_TMPTABLE
        (when fixing bug #10970).
      sql/sql_view.cc:
        Fixed bug #10970.
        In the function mysql_create_view if a view does not refer
        any tables directly the variable table must be updated
        after the call of open_and_lock_tables.
      mysql-test/r/view.result:
        Fixed bug #10970.
        Modified the error messages for error ER_VIEW_SELECT_TMPTABLE.
      mysql-test/t/view.test:
        Added a test case for bug #10970.
      c9fa6a47
  23. 17 Aug, 2005 1 commit
    • unknown's avatar
      sql_view.cc: · cf7b1241
      unknown authored
        correct exit from mysql_create_view to restore ennvironment (BUG#12468)
      view.result, view.test:
        test of CRETE VIEW in SP
      
      
      mysql-test/t/view.test:
        test of CRETE VIEW in SP
      mysql-test/r/view.result:
        test of CRETE VIEW in SP
      sql/sql_view.cc:
        correct exit from mysql_create_view to restore ennvironment
      cf7b1241
  24. 15 Aug, 2005 1 commit
    • unknown's avatar
      Fix bug #10624 Views with multiple UNION and UNION ALL produce incorrect · def42df9
      unknown authored
      results.
      
      st_select_lex_unit::print() was losing UNION ALL if in statement were present
      UNION DISTINCT.
      
      
      mysql-test/r/view.result:
        Test case for bug #10624  Views with multiple UNION and UNION ALL produce incorrect results.
      mysql-test/t/view.test:
        Test case for bug #10624  Views with multiple UNION and UNION ALL produce incorrect results.
      sql/sql_lex.cc:
        Fix bug #10624 Views with multiple UNION and UNION ALL produce incorrect results.
      def42df9
  25. 12 Aug, 2005 2 commits
    • unknown's avatar
      Fix bug #12298 Typo in timestampdiff() function name results in erroneous · d32c4314
      unknown authored
      view being created.
      
      Item_func_timestamp_diff::func_name() were returning function name as
      "timestamp_diff" thus when view was executed function parameters wasn't 
      properly recognized and error was raised.
      
      
      mysql-test/r/func_time.result:
        Fix test result after bugfix #12298
      sql/item_timefunc.h:
        Fix bug #12298 Typo in timestampdiff() function name results in wrong view being created.
      mysql-test/t/view.test:
        Test case for bug #12298 Typo in timestampdiff()  function name results in erroneous view being created.
      mysql-test/r/view.result:
        Test case for bug #12298 Typo in timestampdiff() function name results in erroneous view being created.
      d32c4314
    • unknown's avatar
      sql_base.cc: · 82822612
      unknown authored
        Fixed bug #12470.
        A misplaced initialization of the cond_count counter
        resulted in a wrong calculation of it. This caused a memory
        corruption since this counter was used as a parameter of
        some memory allocation.
      view.test:
        Added a test case for bug #12470.
      
      
      mysql-test/t/view.test:
        Added a test case for bug #12470.
      sql/sql_base.cc:
        Fixed bug #12470.
        A misplaced initialization of the cond_count counter
        resulted in a wrong calculation of it. This caused a memory
        corruption since this counter was used as a parameter of
        some memory allocation.
      82822612
  26. 11 Aug, 2005 1 commit
    • unknown's avatar
      sql_base.cc: · 743fde24
      unknown authored
        Fixed bug #12382.
        INSERT statement effectively changed thd->set_query_id to 0,
        while SELECT statement changed it to 0. As a result
        the insert_fields function that expanded '*' was called
        with different values of thd->set_query_id for the query
        SELECT * FROM view depending on whether it was run after
        an INSERT or after a SELECT statement. This was corrected
        by restoring the old value of thd->set_query_id when
        returning from the function setup_fields where possible
        reset could occur.
        If the value of thd->set_query_id == 0 then the fields
        substituted instead of '*' were not registered as used
        for bitmaps used_keys. This caused selection of an invalid
        execution plan for the query SELECT * from <view>.
      view.result, view.test:
        Added a test case for bug #12382.
      
      
      mysql-test/t/view.test:
        Added a test case for bug #12382.
      mysql-test/r/view.result:
        Added a test case for bug #12382.
      sql/sql_base.cc:
        Fixed bug #12382.
        INSERT statement effectively changed thd->set_query_id to 0,
        while SELECT statement changed it to 0. As a result
        the insert_fields function that expanded '*' was called
        with different values of thd->set_query_id for the query
        SELECT * FROM view depending on whether it was run after
        an INSERT or after a SELECT statement. This was corrected
        by restoring the old value of thd->set_query_id when
        returning from the function setup_fields where possible
        reset could occur.
        If the value of thd->set_query_id == 0 then the fields
        substituted instead of '*' were not registered as used
        for bitmaps used_keys. This caused selection of an invalid
        execution plan for the query SELECT * from <view>.
      743fde24
  27. 08 Aug, 2005 1 commit
    • unknown's avatar
      Fix for BUG#12228: SP cache code: · 502e97f8
      unknown authored
      * Cleanup SP Cache code, now SP Cache only deletes sp_head objects in 
        sp_cache_flush_obsolete() invalidates all pointers to routines in the cache.
      * Use new SP Cache use contract in the code.
      
      There is no test case because it doesn't seem to be possible to cause thread races to end
      the same way they end in heavy-load test. This patch removes the crash in heavy test.
      
      
      mysql-test/r/type_bit.result:
        Drop the tables this test tries to create
      mysql-test/r/view.result:
        Drop function this test creates
      mysql-test/t/type_bit.test:
        Drop the tables this test tries to create
      mysql-test/t/view.test:
        Drop function this test creates
      sql/sp.cc:
        Fix for BUG#12228: When a routine is deleted/modified, invalidate all cached SPs in all
        threads. We need to do so because sp_lex_keeper::{prelocking_tables, query_tables_own_last}
        in one SP may depend on another SP sp_lex_keeper::m_lex is using.
      sql/sp_cache.cc:
        Fix for BUG#12228:
        * Move class sp_cache to here from sp_cache.h, document the functions.
        * sp_cache_insert, sp_cache_remove, sp_cache_invalidate and sp_cache_lookup must not delete
          sp_head* objects as they may be called during SP execution when sp_head objects are used.
        * Added sp_cache_flush_obsolete() function that may delete sp_head objects.
        * Removed sp_cache_remove as there is no need for it now - when we change one SP we should
          invalidate all other SPs, because sp_lex_keeper::{prelocking_tables, 
          query_tables_own_last} from one SP depend on content of another SP (used in 
          sp_lex_keeper::m_lex).
      sql/sp_cache.h:
        Fix for BUG#12228:
        * Move class sp_cache to sp_cache.cc it is not needed in .h file
        * Added comments
      sql/sql_parse.cc:
        Fix for BUG#12228: Call new sp_cache_flush_obsolete() function before running the query
      sql/sql_prepare.cc:
        Fix for BUG#12228: Call new sp_cache_flush_obsolete() function before preparing/executing a PS
      502e97f8
  28. 04 Aug, 2005 1 commit
  29. 02 Aug, 2005 1 commit
    • unknown's avatar
      issue correct error message in case of view presence for duplicated table on update (BUG#10773) · 705118d1
      unknown authored
      frequently used command sequence replaced with inline function
      
      
      BitKeeper/etc/config:
        logging switching off
      mysql-test/r/lowercase_view.result:
        hided view underlying tables from error message
      mysql-test/r/view.result:
        hided view underlying tables from error message
      mysql-test/t/lowercase_view.test:
        hided view underlying tables from error message
      mysql-test/t/view.test:
        hided view underlying tables from error message
      sql/mysql_priv.h:
        subroutine which return correct error message
      sql/share/errmsg.txt:
        new error message
      sql/sql_base.cc:
        subroutine which issue correct error message in case of view presence for duplicated table on update
      sql/sql_delete.cc:
        issue correct error message in case of view presence for duplicated table on update
      sql/sql_insert.cc:
        issue correct error message in case of view presence for duplicated table on update
      sql/sql_parse.cc:
        issue correct error message in case of view presence for duplicated table on update
      sql/sql_update.cc:
        issue correct error message in case of view presence for duplicated table on update
      sql/sql_view.cc:
        frequently used command sequence replaced with inline function
      sql/table.cc:
        frequently used command sequence replaced with inline function
      sql/table.h:
        frequently used command sequence replaced with inline function
      705118d1
  30. 30 Jul, 2005 1 commit
    • unknown's avatar
      Added Non-prelocked SP execution: Now a PROCEDURE doesn't enter/leave prelocked mode for · 11abe15e
      unknown authored
      its body, but lets each statement to get/release its own locks. This allows a broader set
      of statements to be executed inside PROCEDUREs (but breaks replication)
      This patch should fix BUG#8072, BUG#8766, BUG#9563, BUG#11126
      
      
      mysql-test/r/sp-security.result:
        Drop tables this test attempts to create
      mysql-test/r/sp-threads.result:
        Update test results
      mysql-test/r/sp.result:
        Disabled a test that triggers BUG#11986, cleanup used tables when tests start.
      mysql-test/r/view.result:
        Enabled a test case that now works with prelocking-free SPs
      mysql-test/t/sp-security.test:
        Drop tables this test attempts to create
      mysql-test/t/sp.test:
        Disabled a test that triggers BUG#11986, cleanup used tables when tests start.
      mysql-test/t/view.test:
        Enabled a test case that now works with prelocking-free SPs
      sql/handler.cc:
        Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt
      sql/item_func.cc:
        Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt
      sql/sp.cc:
        Non-prelocked SP execution: Added support for skipping prelocking of procedure body for
        "CALL proc(...)" statements.
      sql/sp.h:
        Non-prelocked SP execution: Added support for skipping prelocking of procedure body for
        "CALL proc(...)" statements.
      sql/sp_cache.h:
        Added comments
      sql/sp_head.cc:
        Non-prelocked SP execution:
        * Try to unlock tables after PROCEDURE arguments have been evaluated.
        * Make sp_lex_keeper be able to execute in 2 modes: A) when already in prelocked mode
          B) when its statement enters/leaves prelocked mode itself.
      sql/sp_head.h:
        Non-prelocked SP execution:  Make sp_lex_keeper to additionally keep list of tables it 
        needs to prelock when its statement enters/leaves prelocked mode on its own.
      sql/sql_base.cc:
        Non-prelocked SP execution: Make open_tables() to
         * detect 'CALL proc(...)' and not to do prelocking for procedure body statements.
         * Make lex->query_tables_last to point precisely to a boundary in lex->query_tables 
           list where 'own' tables and views' tables end and added-for-prelocking tables begin.
           (it was not true before - view's tables could end up after query_tables_own_last)
      sql/sql_class.cc:
        Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt
      sql/sql_class.h:
        Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt
      sql/sql_lex.cc:
        Non-prelocked SP execution: More rigourous cleanup in st_lex::cleanup_after_one_table_open()
      sql/sql_parse.cc:
        Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt, remove outdated comments
      sql/sql_trigger.h:
        Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt
      11abe15e