An error occurred fetching the project authors.
  1. 12 Jul, 2005 1 commit
    • unknown's avatar
      view.result, view.test: · f36db354
      unknown authored
        Added a test case for bug #11771.
      item.h:
        Fixed bug #11771.
        Added method reset_query_id_processor to be able to adjust
        query_id for fields generated from * in queries like this:
        SELECT * FROM <view> ...
      sql_base.cc:
        Fixed bug #11771.
        Adjusted query_id for fields generated from * in queries
        like this: SELECT * FROM <view> ...
      
      
      sql/sql_base.cc:
        Fixed bug #11771.
        Adjusted query_id for fields generated from * in queries
        like this: SELECT * FROM <view> ...
      sql/item.h:
        Fixed bug #11771.
        Added method reset_query_id_processor to be able to adjust
        query_id for fields generated from * in queries like this:
        SELECT * FROM <view> ...
      mysql-test/t/view.test:
        Added a test case for bug #11771.
      mysql-test/r/view.result:
        Added a test case for bug #11771.
      f36db354
  2. 09 Jul, 2005 1 commit
    • unknown's avatar
      Enable support of access to tables from triggers. Thus fix bug #8406 "Triggers · 14b1f91b
      unknown authored
      crash if referencing a table" and several other related bugs.
      Fix for bug #11834 "Re-execution of prepared statement with dropped function
      crashes server." which was spotted during work on previous bugs.
      
      Also couple of nice cleanups:
      - Replaced two separate hashes for stored routines used by statement with one.
      - Now instead of doing one pass through all routines used in statement for
        caching them and then doing another pass for adding their tables to table
        list, we do only one pass during which do both things.
      
      
      mysql-test/r/sp-error.result:
        Added test for bug #11834 "Re-execution of prepared statement with dropped
        function crashes server" also covering handling of prepared statements
        which use stored functions but does not require prelocking.
      mysql-test/r/sp.result:
        Updated test for LOCK TABLES with views in table list.
        (Old version of statement used in this test will work ok now, since prelocking
         algorithm was tuned and will lock only one multi-set of tables for each routine
         even if this routine is used in several different views).
      mysql-test/r/trigger.result:
        Added several tests for triggers using tables.
      mysql-test/t/sp-error.test:
        Added test for bug #11834 "Re-execution of prepared statement with dropped
        function crashes server" also covering handling of prepared statements
        which use stored functions but does not require prelocking.
      mysql-test/t/sp.test:
        Updated comment about recursive views to reflect current situation.
        Updated test for LOCK TABLES with views in table list.
        (Old version of statement used in this test will work ok now, since prelocking
         algorithm was tuned and will lock only one multi-set of tables for each routine
         even if this routine is used in several different views).
      mysql-test/t/trigger.test:
        Added several tests for triggers using tables.
      sql/item_func.cc:
        Item_func_sp::cleanup():
          By next statement execution stored function can be dropped or altered so
          we can't assume that sp_head object for it will be still valid.
      sql/sp.cc:
        - Added Sroutine_hash_entry structure that represents element in the set of
          stored routines used by statement or routine. We can't as before use
          LEX_STRING for this purprose because we want link all elements of this set
          in list.
        - Replaced sp_add_to_hash() with sp_add_used_routine() which takes into account
          that now we use one hash for stored routines used by statement instead of two
          and which mantains list linking all elelemnts in this hash.
        - Renamed sp_merge_hash() to sp_update_sp_used_routines().
        - Introduced sp_update_stmt_used_routines() for adding elements to the set of
          routines used by statement from another similar set for statement or routine.
          This function will also mantain list linking elements of destination set.
        - Now instead of one sp_cache_routines() function we have family of 
          sp_cache_routines_and_add_tables() functions which are also responsible for
          adding tables used by routines being cached to statement table list. Nice
          optimization - thanks to list linking all elements in the hash of routines
          used by statement we don't need to perform several iterations over this hash
          (as it was before in cases when we have added new elements to it).
      sql/sp.h:
        Added declarations of functions used for manipulations with set (hash) of stored
        routines used by statement.
      sql/sp_head.cc:
        sp_name::init_qname():
          Now sp_name also holds key identifying routine in the set (hash) of
          stored routines used by statement. 
        sp_head:
          Instead of two separate hashes sp_funs/m_spprocs representing sets of stored
          routines used by this routine we use one hash - m_sroutines. 
        sp_instr_set_trigger_field:
          Added support for subqueries in assignments to row accessors in triggers.
        Removed definition of sp_add_sp_tables_to_table_list() and auxilary functions 
        since now we don't have separate stage on which we add tables used by routines
        used by statement to table list for prelocking. We do it on the same stage as
        we load those routines in SP cache. So all this functionality moved to
        sp_cache_routines_and_add_tables() family of functions.
      sql/sp_head.h:
        sp_name:
          Now this class also holds key identifying routine in the set (hash) of stored
          routines used by statement. 
        sp_head:
          Instead of two separate hashes sp_funs/m_spprocs representing sets of stored
          routines used by this routine we use one hash - m_sroutines. 
        sp_instr_set_trigger_field:
          Added support for subqueries in assignments to row accessors in triggers.
        Removed declaration of sp_add_sp_tables_to_table_list() since now we don't have
        separate stage on which we add tables used by routines used by statement to
        table list for prelocking. We do it on the same stage as we load those routines
        in SP cache.
      sql/sql_base.cc:
        open_tables():
        - LEX::spfuns/spprocs hashes were replaced with one LEX::sroutines hash.
        - Now instead of doing one pass through all routines used in statement for
          caching them and then doing another pass for adding their tables to table
          list, we do only one pass during which do both things. It is easy to do
          since all routines in the set of routines used by statement are linked in
          the list. This also allows us to calculate table list for prelocking more
          precisely.
        - Now triggers properly inform prelocking algorithm about tables they use.
      sql/sql_lex.cc:
        lex_start():
          Replaced LEX::spfuns/spprocs with with one LEX::sroutines hash.
          Added LEX::sroutines_list list linking all elements in this hash.
        st_lex::st_lex():
          Moved definition of LEX constructor to sql_lex.cc file to be able
          use sp_sroutine_key declaration from sp.h in it.
      sql/sql_lex.h:
        LEX:
          Replaced two separate hashes for stored routines used by statement with one.
          Added list linking all elements in this hash to be able to iterate through all
          elements and add new elements to this hash at the same time.
          Moved constructor definition to sql_lex.cc.
      sql/sql_parse.cc:
        mysql_execute_command():
          Replaced LEX::spfuns/spprocs with one LEX::sroutines hash.
      sql/sql_trigger.cc:
        Added missing GNU GPL notice.
        Table_triggers_list::check_n_load()
          Added initialization of sroutines_key which stores key representing
          triggers of this table in the set (hash) of routines used by this statement.
      sql/sql_trigger.h:
        Added missing GNU GPL notice.
        Table_triggers_list:
          Added sroutines_key member to store key representing triggers of this
          table in the set (hash) of routines used by this statement.
          Declared sp_cache_routines_and_add_tables_for_triggers() as friend since
          it needs access to sroutines_key and trigger bodies.
      sql/sql_yacc.yy:
        - Now we use sp_add_used_routine() instead of sp_add_to_hash() for adding
          elements to the set of stored routines used in statement.
        - Enabled support of subqueries as right sides in assignments to triggers' row
          accessors.
      14b1f91b
  3. 04 Jul, 2005 1 commit
    • unknown's avatar
      After merge fixes · 428830c5
      unknown authored
      Better fix for ON DUPLICATE KEY UPDATE
      
      
      mysql-test/r/group_by.result:
        After merge fixes
      mysql-test/r/select.result:
        Reorder test to match 4.1 tests (will make future merges easier)
      mysql-test/t/group_by.test:
        Added --disable_ps_protocol to avoid extra warning
      mysql-test/t/select.test:
        Reorder test to match 4.1 tests (will make future merges easier)
      sql/mysql_priv.h:
        Better fix for ON DUPLICATE KEY UPDATE
      sql/sql_base.cc:
        After merge fixes
      sql/sql_insert.cc:
        Better fix for ON DUPLICATE KEY UPDATE
        (old solution gave problem with item->cached_table)
      sql/sql_prepare.cc:
        Better fix for ON DUPLICATE KEY UPDATE
      428830c5
  4. 02 Jul, 2005 1 commit
    • unknown's avatar
      do not register changes of stack variable · 6d9bc9c8
      unknown authored
      sql/item.cc:
        new argument of find_field_in_tables()
      sql/mysql_priv.h:
        new argument of find_field_in_tables()
      sql/sp.cc:
        new argument of find_field_in_tables()
      sql/sql_base.cc:
        new argument of find_field_in_tables()
      sql/sql_help.cc:
        new argument of find_field_in_tables()
      6d9bc9c8
  5. 01 Jul, 2005 1 commit
    • unknown's avatar
      Name resolution context added (BUG#6443) · b4f595b9
      unknown authored
      include/my_bitmap.h:
        new bitmap operation
      mysql-test/r/view.result:
        added warnings
        Correct inserting data check (absence of default value) for view underlying tables (BUG#6443)
      mysql-test/t/view.test:
        Correct inserting data check (absence of default value) for view underlying tables (BUG#6443)
      mysys/my_bitmap.c:
        new bitmap operation
      sql/field.h:
        index of field in table added
      sql/item.cc:
        Name resolution context added
        table list removed from fix_fields() arguments
      sql/item.h:
        Name resolution context added
        table list removed from fix_fields() arguments
      sql/item_cmpfunc.cc:
        table list removed from fix_fields() arguments
      sql/item_cmpfunc.h:
        table list removed from fix_fields() arguments
      sql/item_func.cc:
        table list removed from fix_fields() arguments
      sql/item_func.h:
        table list removed from fix_fields() arguments
      sql/item_row.cc:
        table list removed from fix_fields() arguments
      sql/item_row.h:
        table list removed from fix_fields() arguments
      sql/item_strfunc.cc:
        fixed server crash on NULL argument
      sql/item_strfunc.h:
        table list removed from fix_fields() arguments
      sql/item_subselect.cc:
        table list removed from fix_fields() arguments
      sql/item_subselect.h:
        table list removed from fix_fields() arguments
      sql/item_sum.cc:
        table list removed from fix_fields() arguments
      sql/item_sum.h:
        table list removed from fix_fields() arguments
      sql/item_timefunc.cc:
        table list removed from fix_fields() arguments
      sql/item_timefunc.h:
        table list removed from fix_fields() arguments
      sql/item_uniq.h:
        table list removed from fix_fields() arguments
      sql/log_event.cc:
        Name resolution context added
      sql/log_event.h:
        Name resolution context added
      sql/mysql_priv.h:
        Name resolution context added
      sql/set_var.cc:
        table list removed from fix_fields() arguments
      sql/share/errmsg.txt:
        new error message
      sql/sp.cc:
        Name resolution context added
      sql/sp_head.cc:
        table list removed from fix_fields() arguments
      sql/sp_head.h:
        Name resolution context added
      sql/sql_base.cc:
        table list removed from fix_fields() arguments
        Name resolution context added
      sql/sql_class.cc:
        renamed variable
      sql/sql_delete.cc:
        Name resolution context added
      sql/sql_derived.cc:
        Name resolution context added
      sql/sql_do.cc:
        table list removed from fix_fields() arguments
      sql/sql_handler.cc:
        Name resolution context added
      sql/sql_help.cc:
        Name resolution context added
      sql/sql_insert.cc:
        Name resolution context added
        table list removed from fix_fields() arguments
      sql/sql_lex.cc:
        Name resolution context added
      sql/sql_lex.h:
        removed resolve mode (information stored into name resolution context)
      sql/sql_load.cc:
        table list removed from fix_fields() arguments
      sql/sql_olap.cc:
        Name resolution context added
      sql/sql_parse.cc:
        Name resolution context added
      sql/sql_prepare.cc:
        table list removed from fix_fields() arguments
      sql/sql_select.cc:
        table list removed from fix_fields() arguments
      sql/sql_show.cc:
        Name resolution context added
      sql/sql_trigger.cc:
        table list removed from fix_fields() arguments
      sql/sql_udf.h:
        table list removed from fix_fields() arguments
      sql/sql_union.cc:
        Name resolution context added
      sql/sql_update.cc:
        Name resolution context added
      sql/sql_view.cc:
        Name resolution context added
      sql/sql_view.h:
        table list removed from fix_fields() arguments
      sql/sql_yacc.yy:
        Name resolution context added
      sql/table.cc:
        Name resolution context added
        merged view processing moved
      sql/table.h:
        merged view processing moved
      b4f595b9
  6. 28 Jun, 2005 1 commit
  7. 27 Jun, 2005 1 commit
    • unknown's avatar
      Better bug fix for: · d10877ce
      unknown authored
      #9728  'Decreased functionality in "on duplicate key update
      #8147  'a column proclaimed ambigous in INSERT ... SELECT .. ON DUPLICATE'
      
      This ensures fields are uniquely qualified and also that one can't update other tables in the ON DUPLICATE KEY UPDATE part
      
      
      mysql-test/r/insert_select.result:
        More tests for bug #9728 and #8147
      mysql-test/r/insert_update.result:
        Updated tests after changing how INSERT ... SELECT .. ON DUPLICATE KEY works
      mysql-test/t/insert_select.test:
        More tests for bug #9728 and #8147
      mysql-test/t/insert_update.test:
        Updated tests after changing how INSERT ... SELECT .. ON DUPLICATE KEY works
      mysys/my_access.c:
        Cleanup (shorter loop variable names)
      sql/ha_ndbcluster.cc:
        Indentation fixes
      sql/item.cc:
        Remove item_flags
      sql/item.h:
        Remove item_flags
      sql/mysql_priv.h:
        New arguments to mysql_prepare_insert
      sql/sql_base.cc:
        Remove old fix for bug #8147
      sql/sql_insert.cc:
        Extend mysql_prepare_insert() with new field list for tables that can be used in the values port of ON DUPLICATE KEY UPDATE
      sql/sql_parse.cc:
        Revert fix for #9728
        Allow one to use other tables in ON DUPLICATE_KEY for INSERT ... SELECT if there is no GROUP BY clause
      sql/sql_prepare.cc:
        New arguments to mysql_prepare_insert
      sql/sql_yacc.yy:
        Revert bug fix for #9728
      d10877ce
  8. 22 Jun, 2005 2 commits
    • unknown's avatar
      insert_update.result, insert_update.test, sql_base.cc: · 55718473
      unknown authored
        Fix for bugfix #9728 merge
      
      
      sql/sql_base.cc:
        Fix for bugfix #9728 merge
      mysql-test/t/insert_update.test:
        Fix for bugfix #9728 merge
      mysql-test/r/insert_update.result:
        Fix for bugfix #9728 merge
      55718473
    • unknown's avatar
      Fix bug #9728 decreased functionality in "on duplicate key update" · a6c7fb45
      unknown authored
      Remove changes made by bug fix #8147. They strips list of insert_table_list to
      only insert table, which results in error reported in bug #9728.
      Added flag to Item to resolve ambigous fields reported in bug #8147.
      
      
      sql/item.h:
        Fix bug#9728  decreased functionality in "on duplicate key update".
      sql/item.cc:
        Fix bug#9728  decreased functionality in "on duplicate key update"
      sql/sql_parse.cc:
        Fix bug#9728  decreased functionality in "on duplicate key update"
      sql/sql_base.cc:
        Fix bug#9728  decreased functionality in "on duplicate key update".
      sql/sql_yacc.yy:
        Fix bug#9728  decreased functionality in "on duplicate key update"
      mysql-test/t/insert_select.test:
        Test case for bug#9728 Decreased functionality in "on duplicate key update".
      mysql-test/r/insert_select.result:
        Test case for bug#9728 Decreased functionality in "on duplicate key update".
      a6c7fb45
  9. 21 Jun, 2005 1 commit
    • unknown's avatar
      A preparatory patch to help adding JOIN::transform() and move one-time · 04f6f63d
      unknown authored
      query transformations to the PREPARE stage (prepared statements).
      
      
      sql/item.h:
        Remove an unused friend declaration.
      sql/mysql_priv.h:
        Change signature of insert_fields()
      sql/sp_head.cc:
        Make is_stmt_prepare_or_first_sp_execute really work: reset SP state
        to EXECUTED after execution.
      sql/sql_base.cc:
        allocate_view_names flag of insert_fields is removed.
        The purpose of this variable was to amend the case when a view
        is replaced with a base table between subsequent executions of a prepared
        statement: in that case the new table theoretically can be used instead
        of the view. If allocate_view_names was set,
        all the references to the view expressions were replaced with Item_field's
        which in turn could have been resolved by their names.
        But this approach doesn't work for other reasons, so let's not try
        to help what must be solved by TDC.
      sql/sql_class.h:
        Add is_first_sp_execute() helper method.
      sql/sql_handler.cc:
        insert_fields signature changed.
      sql/sql_lex.h:
        Add a comment for variable 'first_execution'.
      04f6f63d
  10. 16 Jun, 2005 1 commit
    • unknown's avatar
      BUG10365 Cluster handler uses non-standard error code · d18e5622
      unknown authored
        - Updated after review
      
      
      sql/ha_ndbcluster.cc:
        Return -1 if table does not exists
      sql/handler.cc:
        Return -1 if table does not exists
        Return 0 if table exists and it could be created
        Return >0 if table existed but it could not be created.
      sql/sql_base.cc:
        Only need to call ha_create_table_from_engine and check if result is > 0. If that is the case, print error message
      d18e5622
  11. 15 Jun, 2005 1 commit
    • unknown's avatar
      renamed: · f1e42a0b
      unknown authored
        Item_buff -> Cached_item
        Item_arena -> Query_arena
        TEST_ASSERT -> YYERROR_UNLESS
      
      
      sql/item.h:
        renamed:
          Item_buff -> Cached_item
      sql/item_buff.cc:
        renamed:
          Item_buff -> Cached_item
      sql/item_func.cc:
        renamed:
          Item_arena -> Query_arena
      sql/item_subselect.cc:
        renamed:
          Item_arena -> Query_arena
      sql/sp_head.cc:
        renamed:
          Item_arena -> Query_arena
      sql/sp_head.h:
        renamed:
          Item_arena -> Query_arena
      sql/sql_base.cc:
        renamed:
          Item_arena -> Query_arena
      sql/sql_class.cc:
        renamed:
          Item_arena -> Query_arena
      sql/sql_class.h:
        renamed:
          Item_arena -> Query_arena
      sql/sql_lex.cc:
        renamed:
          Item_arena -> Query_arena
      sql/sql_prepare.cc:
        renamed:
          Item_arena -> Query_arena
      sql/sql_select.cc:
        renamed:
          Item_arena -> Query_arena
      sql/sql_select.h:
        renamed:
          Item_buff -> Cached_item
          Item_arena -> Query_arena
      sql/sql_union.cc:
        renamed:
          Item_arena -> Query_arena
      sql/sql_view.cc:
        renamed:
          Item_arena -> Query_arena
      sql/sql_yacc.yy:
        renamed:
          TEST_ASSERT -> YYERROR_UNLESS
      sql/table.cc:
        renamed:
          Item_arena -> Query_arena
      f1e42a0b
  12. 08 Jun, 2005 2 commits
    • unknown's avatar
      Fix for bug #11158 "Can't perform multi-delete in stored procedure". · 4e0bbc1b
      unknown authored
      In order to make multi-delete SP friendly we need to have all table 
      locks for the elements of main statement table list properly set 
      at the end of parsing.
      
      Also performed small cleanup: We don't need relink_tables_for_multidelete()
      any longer since the only case now when TABLE_LIST::correspondent_table
      is non-zero are tables in auxilary table list of multi-delete and these
      tables are handled specially in mysql_multi_delete_prepare().
      
      
      mysql-test/r/sp-threads.result:
        Added test case for bug #11158 "Can't perform multi-delete in stored
        procedure".
      mysql-test/t/sp-threads.test:
        Added test case for bug #11158 "Can't perform multi-delete in stored
        procedure".
      sql/mysql_priv.h:
        - Removed third argument from the declaration of multi_delete_precheck()
          as nowdays we calculate number of tables in multi-delete from which
          we are going to delete rows right at the end of statement parsing.
        - Introduced definition of multi_delete_set_locks_and_link_aux_tables()
          which is responsible for propagation of proper table locks from
          multi-delete's auxilary table list to the main list and binding
          corresponding tables in these two lists.
      sql/sql_base.cc:
        Removed relink_tables_for_multidelete() routine and its invocations.
        We don't need them in 5.0 since the only case now when
        TABLE_LIST::correspondent_table is non-zero are tables in auxilary table
        list of multi-delete and these tables are handled specially in
        mysql_multi_delete_prepare().
      sql/sql_lex.h:
        LEX::table_count
          Added description of new role of this LEX member for multi-delete. 
          Now for this statement we store number of tables from which we should
          delete records there.
      sql/sql_parse.cc:
        multi_delete_precheck():
          Moved code which is responsible for iterating through auxilary table
          list and binding its elements with corresponding elements of main
          table list, and properly updating locks in it to separate function -
          multi_delete_set_locks_and_link_aux_tables(). This is because in order
          to make multi-delete SP friendly we need to have all locks set properly
          at the end of statement parsing. So we are introducing new function
          which will be called from parser.
          We also calculate number of tables from which we are going to perform
          deletions there and store this number for later usage in
          LEX::table_count.
          Also removed some no longer needed code.
      sql/sql_prepare.cc:
        mysql_test_multidelete():
          Now multi_delete_precheck() takes only two arguments, so we don't
          need to pass fake third parameter.
      sql/sql_yacc.yy:
        delete:
          In order to make multi-delete SP friendly we need to have all table 
          locks for the elements of main statement table list properly set 
          at the end of parsing.
      4e0bbc1b
    • unknown's avatar
      BUG#10365 Cluster handler uses non-standard error codes · 09944efd
      unknown authored
       - Added better error messages when trying to open a table that can't be discovered or unpacked. The most likely cause of this is that it does not have any frm data, probably since it has been created from NdbApi or is a NDB system table.
       - Separated functionality that was in ha_create_table_from_engine into two functions. One that checks if the table exists and another one that tries to create the table from the engine.
      
      
      mysql-test/r/ndb_autodiscover.result:
        Add tests for reading from a table that can't be discovered(SYSTAB_0)
        Discovery is not performed during create table anymore.
      mysql-test/t/ndb_autodiscover.test:
        Add tests for reading from a table that can't be discovered(SYSTAB_0)
        Discovery is not performed during create table anymore.
      ndb/test/ndbapi/create_tab.cpp:
        Set connectstring before creating Ndb object.
      sql/ha_ndbcluster.cc:
        Rename and use the function ndbcluster_table_exists_in_engine.
        Correct return valu from ndbcluster_discover
        Remove old code "ndb_discover_tables"
      sql/ha_ndbcluster.h:
        Rename function ndbcluster_table_exists to ndb ndbcluster_table_exists_in_engine
      sql/handler.cc:
        Update comment of ha_create_table_from_engine
        Remove parameter create_if_found from ha_create_table_from_engine, the function ha_table_exists_in_engine is now used toi check if table is found in engine.
        Cleanup return codes from ha_create_table_from_engine.
        Change name of ha_table_exists to ha_table_exists_in_engine, update comment and returne codes.
      sql/handler.h:
        Remove paramter create_if_cound from  ha_create_table_from_engine
        Rename ha_table_exists to ha_table_exists_in_engine
      sql/sql_base.cc:
        Use the function ha_table_exists_in_engine to detect if table exists in enegine. 
        If it exists, call function ha_create_table_from_engine to try and create it.
        If create of table fails, set correct error message.
      sql/sql_table.cc:
        Add comments, remove parameter create_if_found to ha_create_table_from_engine.
        When dropping a table, try to discover it from engine. If discover fails, use same error message as if the table didn't exists. 
        Maybe another message should be displayed here, ex: "Table could not be dropped, unpack failed"
        
        When creating a new table, use ha_table_exists_in_engine to check if a table with the given name already exists.
      09944efd
  13. 07 Jun, 2005 1 commit
    • unknown's avatar
      Fix for bug #10015 "Crash in InnoDB if stored routines are used". · 49357ae8
      unknown authored
      We should not allow explicit or implicit transaction commits inside
      of stored functions or triggers (so in autocommit mode we should not
      do commits after execution of sub-statement).
      Also since we don't support nested statement transactions in 5.0,
      we shouldn't commit or rollback stmt transactions while we are inside
      stored functions or triggers. This should be fixed in later (>=5.1)
      releases.
      
      
      mysql-test/r/sp_trans.result:
        Added test for bug #10015 "Crash in InnoDB if stored routines are used"
        and for general transaction handling inside of functions.
      mysql-test/t/sp_trans.test:
        Added test for bug #10015 "Crash in InnoDB if stored routines are used"
        and for general transaction handling inside of functions.
      sql/handler.cc:
        ha_trans_commit()/ha_trans_rollback():
          Since we don't support nested statement transactions in 5.0,
          we can't commit or rollback stmt transactions while we are inside
          stored functions or triggers. So we simply do nothing now.
          This should be fixed in later ( >= 5.1) releases.
      sql/item_func.cc:
        Item_func_sp::execute():
          Set THD::transaction.in_sub_stmt flag to TRUE during stored function
          execution to prevent commits and rollbacks for statement level
          transactions, since doing them will ruin such transaction for
          stateemtn which calls this function.
      sql/share/errmsg.txt:
        Added error message which says that statements doing explicit or implicit
        commits are disallowed in triggers and stored functions.
      sql/sql_base.cc:
        close_thread_tables():
          Clarified comment about committing of statement transactions in
          prelocked mode.
      sql/sql_class.h:
        THD::transaction:
          Added in_sub_stmt method which indicates that we are executing
          statements from trigger or stored function now, and thus
          statement transaction belongs to statement which invoked this
          routine and we should not commit or rollback it while executing
          these sub-statements.
      sql/sql_parse.cc:
        end_active_trans()/begin_trans()/end_trans():
          We should not commit or rollback global (non-stmt) transaction
          if we are executing stored function or trigger. These checks will
          catch situation when we are trying to do commit or rollback in stored
          procedure which is called from function or trigger.
      sql/sql_trigger.h:
        Table_triggers_list::process_triggers():
          Set THD::transaction.in_sub_stmt flag to TRUE during trigger
          execution to prevent commits and rollbacks for statement level
          transactions, since doing them will ruin such transaction for
          stateemtn which invokes this trigger.
      sql/sql_yacc.yy:
        Prohibited usage of statements which do explicit or implicit commit or
        rollback inside of stored functions and triggers.
      49357ae8
  14. 02 Jun, 2005 2 commits
    • unknown's avatar
      Removed duplicated and wrong merged code · 1b999482
      unknown authored
      sql/sql_base.cc:
        Fixed wrong comment
      1b999482
    • unknown's avatar
      misc. fixes for windoze builds · 1dd50e46
      unknown authored
      VC++Files/client/mysql.dsp:
        added missing mysys.lib
      VC++Files/client/mysqladmin.dsp:
        added missing mysys.lib
      VC++Files/client/mysqlimport.dsp:
        added missing mysys.lib
      VC++Files/client/mysqlshow.dsp:
        added missing mysys.lib
      VC++Files/libmysql/libmysql.dsp:
        added missing mysys.lib
      VC++Files/mysql.dsw:
        added dependencies on mysys
      include/config-win.h:
        added missing constant
      sql/sql_base.cc:
        pulled declaration of table_list out of for-scope
      1dd50e46
  15. 01 Jun, 2005 2 commits
    • unknown's avatar
      Code cleanups during code reviews · 906b210a
      unknown authored
      Ensure we get error if INSERT IGNORE ... SELECT fails
      Fixed wrong key_part->key_length usage in index_merge
      
      
      client/mysql.cc:
        Code cleanups & simply optimizations
      mysql-test/r/information_schema.result:
        Safety
      mysql-test/t/information_schema.test:
        Safety
      sql/ha_ndbcluster.cc:
        Code cleanups
      sql/item.cc:
        Code cleanups
      sql/item_subselect.cc:
        Code cleanups
      sql/item_sum.cc:
        Code cleanups
      sql/opt_range.cc:
        Made get_index_only_read_time() static (instad of inline) to increase portability (function was not declared before use)
        Simple optimization
        Fixed wrong key_part->key_length usage in index_merge
        Removed not used variable n_used_covered
        Indentation fixes & comment cleanups
      sql/parse_file.cc:
        Code cleanups
      sql/sql_base.cc:
        Code cleanups
      sql/sql_bitmap.h:
        Added missing return
      sql/sql_insert.cc:
        Ensure we get error if INSERT IGNORE ... SELECT fails
      sql/sql_select.cc:
        Code cleanups
      sql/sql_show.cc:
        Safety fix if a LOT of errors are ignored
      sql/sql_update.cc:
        Code cleanups
      sql/table.cc:
        Code cleanups
      sql/table.h:
        Code cleanups
      sql/uniques.cc:
        Code cleanups
      strings/decimal.c:
        Simple optimization
        Code cleanups
      906b210a
    • unknown's avatar
      388d9df1
  16. 31 May, 2005 1 commit
    • unknown's avatar
      Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement. · cf2188ca
      unknown authored
      1.) Added a new option to mysql_lock_tables() for ignoring FLUSH TABLES.
      Used the new option in create_table_from_items().
      It is necessary to prevent the SELECT table from being reopend.
      It would get new storage assigned for its fields, while the
      SELECT part of the command would still use the old (freed) storage.
      2.) Protected the CREATE TABLE and CREATE TABLE ... SELECT commands
      against a global read lock. This prevents a deadlock in
      CREATE TABLE ... SELECT in conjunction with FLUSH TABLES WITH READ LOCK
      and avoids the creation of new tables during a global read lock.
      3.) Replaced set_protect_against_global_read_lock() and
      unset_protect_against_global_read_lock() by
      wait_if_global_read_lock() and start_waiting_global_read_lock()
      in the INSERT DELAYED handling.
      
      
      mysql-test/r/create.result:
        Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
        Added test results.
      mysql-test/t/create.test:
        Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
        Added tests which do not require concurrency.
      sql/lock.cc:
        Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
        Added a new option to mysql_lock_tables() for ignoring FLUSH TABLES.
        Changed the parameter list.
        Removed two unnecessary functions. Their functionality is included in
        wait_if_global_read_lock() and start_waiting_global_read_lock().
      sql/mysql_priv.h:
        Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
        Changed the declaration of mysql_lock_tables().
        Added definitions for the new options.
      sql/sql_acl.cc:
        Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
        Adjusted mysql_lock_tables() calls to the new argument list.
      sql/sql_base.cc:
        Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
        Adjusted mysql_lock_tables() calls to the new argument list.
      sql/sql_handler.cc:
        Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
        Adjusted mysql_lock_tables() calls to the new argument list.
      sql/sql_insert.cc:
        Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
        Replaced set_protect_against_global_read_lock() and
        unset_protect_against_global_read_lock() by
        wait_if_global_read_lock() and start_waiting_global_read_lock()
        in the INSERT DELAYED handling.
        Adjusted mysql_lock_tables() calls to the new argument list.
      sql/sql_parse.cc:
        Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
        Protected the CREATE TABLE and CREATE TABLE ... SELECT commands
        against a global read lock. This prevents a deadlock in
        CREATE TABLE ... SELECT in conjunction with FLUSH TABLES WITH READ LOCK
        and avoids the creation of new tables during a global read lock.
      sql/sql_table.cc:
        Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
        Adjusted mysql_lock_tables() calls to the new argument list.
        Used the new option in create_table_from_items().
      cf2188ca
  17. 30 May, 2005 1 commit
    • unknown's avatar
      Preparatory (and the most problematic) patch for Bug#7306 · 78422442
      unknown authored
      "the server side preparedStatement error for LIMIT placeholder",
      which moves all uses of LIMIT clause from PREPARE to OPTIMIZE
      and later steps.
      After-review fixes.
      
      
      mysql-test/r/group_min_max.result:
        Test results fixed for EXPLAINs when using GROUP_MIN_MAX access plan.
      sql/item_subselect.cc:
        Move setting of the internal LIMIT used for IN/ALL/ANY/EXISTS 
        subqueries to one place: Item_exists_subselect::fix_length_and_dec().
        This implies that unit->select_limit_cnt is not set until the item is 
        fixed. This is OK, as now LIMIT values are not used until JOIN::optimize.
      sql/mysql_priv.h:
        setup_tables no longer needs a special flag for the case when
        it's called from JOIN::reinit() (we don't need to call setup_tables
        between two executions of a correlated subquery).
      sql/opt_range.cc:
        Fix a glitch in GROUP_MIN_MAX access plan: we should use table metadata,
        not field data, to evaluate max_used_key_length, which is then
        used for explain.
      sql/sp.cc:
        - setup_tables signature changed.
      sql/sql_base.cc:
        - setup_tables no longer needs a special mode for subqueries.
          Unused checks were removed.
      sql/sql_delete.cc:
        - setup_tables signature changed
      sql/sql_help.cc:
        - setup_tables signature changed
      sql/sql_insert.cc:
        - setup_tables signature changed
      sql/sql_lex.cc:
        Consolidate setting of internal LIMIT for IN/ALL/ANY/EXISTS subqeries
        in one place, and hence remove it from st_select_lex::test_limit().
      sql/sql_lex.h:
        Cleanup signature of st_select_lex_unit::init_prepare_fake_select_lex().
      sql/sql_load.cc:
        - setup_tables signature changed
      sql/sql_olap.cc:
        - setup_tables signature changed
      sql/sql_parse.cc:
        - st_select_lex_unit::set_limit() signature changed
      sql/sql_select.cc:
        Move setting of JOIN::select_limit from JOIN::prepare
        to JOIN::optimize. At prepare, limit is unknown yet.
        Remove excessive cleanups from JOIN::reinit which were overwriting
        join->join_tab[i]->table->used_keys. This fixes the bug which was triggered
        by the change in item_subselect.cc.
      sql/sql_union.cc:
        Class st_select_lex_unit was changed to avoid calls to 
         st_select_lex_unit::set_limit from places where it may be unknown.
        Now unit->select_limit_cnt is set at ::exec(). 
        st_select_lex_unit::init_prepare_fake_select_lex(): 
         - move out set_limit functionality
         - remove a few lines of dead code.
        st_select_lex_unit::prepare():
          - now we don't call set_limit at the time of prepare, so the value  
            of unit->select_limit_cnt may be unknown here. Use sl->select_limit
            instead.
        st_select_lex_unit::exec():
          - cleanup
          - call set_limit explicitly as it has been moved out of 
           init_prepare_fake_select_lex.
      sql/sql_update.cc:
        - setup_tables signature changed
      78422442
  18. 25 May, 2005 1 commit
    • unknown's avatar
      Cleanup's during review · c6283dbb
      unknown authored
      Added ASSERT() to detect wrongly packed fields
      
      
      sql/field.h:
        Fixed comments to right format
      sql/opt_range.cc:
        Merged code
      sql/sql_base.cc:
        Fixed indentation
      sql/sql_insert.cc:
        Fixed comments to right format
      sql/sql_select.cc:
        Simplify code
      sql/unireg.cc:
        Simply code for calculating key_buff_length
        Added ASSERT() to detect wrongly packed fields
      c6283dbb
  19. 24 May, 2005 1 commit
    • unknown's avatar
      Fix for bugs: · 1fa7c69d
      unknown authored
       #5860 "Multi-table UPDATE does not activate update triggers"
       #6812 "Triggers are not activated for INSERT ... SELECT"
       #8755 "Trigger is not activated by LOAD DATA".
      This patch also implements proper handling of triggers for special forms
      of insert like REPLACE or INSERT ... ON DUPLICATE KEY UPDATE. 
      Also now we don't call after trigger in case when we have failed to
      inserted/update or delete row. Trigger failure should stop statement
      execution.
      
      I have not properly tested handling of errors which happen inside of
      triggers in this patch, since it is simplier to do this once we will be
      able to access tables from triggers.
      
      
      mysql-test/r/trigger.result:
        Added tests for triggers behavior for various non-standard forms of
        INSERT such as REPLACE and INSERT ... ON DUPLICATE KEY UPDATE.
        Also added tests for bugs #5860 "Multi-table UPDATE does not activate
        update triggers", #6812 "Triggers are not activated for INSERT ... SELECT"
        and #8755 "Trigger is not activated by LOAD DATA".
      mysql-test/t/trigger.test:
        Added tests for triggers behavior for various non-standard forms of
        INSERT such as REPLACE and INSERT ... ON DUPLICATE KEY UPDATE.
        Also added tests for bugs #5860 "Multi-table UPDATE does not activate
        update triggers", #6812 "Triggers are not activated for INSERT ... SELECT"
        and #8755 "Trigger is not activated by LOAD DATA".
      sql/item.cc:
        Since it turned out that at trigger loading time we can't say in which
        buffer TABLE::record[0] or record[1] old version of row will be stored
        we have to change our approach to binding of Item_trigger_field to
        Field instances.
        Now after trigger parsing (in Item_trigger_field::setup_table()) we only
        find index of proper Field in the TABLE::field array. Then before trigger
        is invoked we set Table_triggers_list::old_field/new_field so they point
        to arrays holding Field instances bound to buffers with proper row
        versions. And as last step in Item_trigger_field::fix_fields() we get
        pointer to Field from those arrays using saved field index.
        
        Item_trigger_field::setup_field()/fix_fields() were changed to implement
        this approach.
      sql/item.h:
        Since it turned out that at trigger loading time we can't say in which
        buffer TABLE::record[0] or record[1] old version of row will be stored
        we have to change our approach to binding of Item_trigger_field to
        Field instances.
        Now after trigger parsing (in Item_trigger_field::setup_table()) we only
        find index of proper Field in the TABLE::field array. Then before trigger
        is invoked we set Table_triggers_list::old_field/new_field so they point
        to arrays holding Field instances bound to buffers with proper row
        versions. And as last step in Item_trigger_field::fix_fields() we get
        pointer to Field from those arrays using saved field index.
        
        Item_trigger_field:
        - Added field_idx member to store index of Field object corresponding to
          this Item in TABLE::field array.
        - Added triggers member to be able to access to parent Table_trigger_list
          object from fix_fields() method.
        - setup_field() no longer needs to know for which type of event this
          trigger is, since it does not make decision Field for which buffer
          (record[0] or record[1] is appropriate for this Item_trigger_field)
      sql/mysql_priv.h:
        Added fill_record_n_invoke_before_triggers() methods. They are simple
        wrappers around fill_record() which invoke proper before trigger right
        after filling record with values.
      sql/sql_base.cc:
        Added fill_record_n_invoke_before_triggers() methods. They are simple
        wrappers around fill_record() which invoke proper before trigger right
        after filling record with values.
      sql/sql_delete.cc:
        mysql_delete():
          Now we stop statement execution if one of triggers failed, we also
          don't execute after delete trigger if we failed to delete row from
          the table (We also pass information about which buffer contains old
          version of row to process_triggers()).
        multi_delete::send_data()/do_deletes():
          Now we also invoke triggers in case of multi-delete.
      sql/sql_insert.cc:
        mysql_insert():
          Moved invocation of before triggers to fill_record_n_invoke_before_triggers()
          method. After triggers are now executed as part of write_record().
          (as nice side effect now we also stop statement execution if one of
          triggers fail).
        write_record():
          Invoke after insert trigger after performing insert. Also invoke proper
          triggers if insert is converted to update or conflicting row is deleted.
          Cleaned up error handling a bit - no sense to report error via
          handler::print_error if it was not generated by handler method and
          was reported before.
          Also now we will execute after trigger only if we really have written
          row to the table. 
        select_insert::send_data()/store_values():
          We should also execute INSERT triggers for INSERT ... SELECT statement.
      sql/sql_load.cc:
        read_fixed_length()/read_sep_field():
          We should execute INSERT triggers when processing LOAD DATA statement.
          Small cleanup in auto-increment related code. Also moved check for
          thd->killed which is used to abort LOAD DATA in case of problems
          in 'traditional' mode to better place..
      sql/sql_trigger.cc:
        Since it turned out that at trigger loading time we can't say in which
        buffer TABLE::record[0] or record[1] old version of row will be stored
        we have to change our approach to binding of Item_trigger_field to
        Field instances.
        Now after trigger parsing (in Item_trigger_field::setup_table()) we only
        find index of proper Field in the TABLE::field array. Then before trigger
        is invoked we set Table_triggers_list::old_field/new_field so they point
        to arrays holding Field instances bound to buffers with proper row
        versions. And as last step in Item_trigger_field::fix_fields() we get
        pointer to Field from those arrays using saved field index.
        
        Table_triggers_list methods were changed to implement this approach
        (see also comments for sql_trigger.h).
      sql/sql_trigger.h:
        Since it turned out that at trigger loading time we can't say in which
        buffer TABLE::record[0] or record[1] old version of row will be stored
        we have to change our approach to binding of Item_trigger_field to
        Field instances.
        Now after trigger parsing (in Item_trigger_field::setup_table()) we only
        find index of proper Field in the TABLE::field array. Then before trigger
        is invoked we set Table_triggers_list::old_field/new_field so they point
        to arrays holding Field instances bound to buffers with proper row
        versions. And as last step in Item_trigger_field::fix_fields() we get
        pointer to Field from those arrays using saved field index.
        
        Changed Table_triggers_list to implement this new approach:
        - Added record1_field member to store array of Field objects bound
          to TABLE::record[1] buffer (instead of existing old_field member)
        - Added new_field member and changed meaning of old_field member.
          During trigger execution they should point to arrays of Field objects
          bound to buffers holding new and old versions of row respectively.
        - Added 'table' member to be able to get access to TABLE instance
          (for which this trigger list object was created) from process_triggers()
          method.
        - Now process_triggers() method sets old_field and new_field members
          properly before executing triggers body (basing on new 
          old_row_is_record1 parameter value).
        - Renamed prepare_old_row_accessors_method() to prepare_record1_accessors()
        
        Also added has_before_update_triggers() method which allows to check
        whenever any before update triggers exist for table.
      sql/sql_update.cc:
        mysql_update():
          Now we invoke before triggers in fill_record_n_invoke_before_triggers()
          method. Also now we abort statement execution when one of triggers fail.
        safe_update_on_fly():
          When we are trying to understand if we can update first table in multi
          update on the fly we should take into account that BEFORE UPDATE
          trigger can change field values.
        multi_update::send_data()/do_updates()
          We should execute proper triggers when doing multi-update
          (in both cases when we do it on the fly and using temporary tables).
      1fa7c69d
  20. 17 May, 2005 3 commits
    • unknown's avatar
      After merge fix · 3f819973
      unknown authored
      sql/sql_update.cc:
        Add missing join method
      3f819973
    • unknown's avatar
      Bug#10246 - Parser: bad syntax for GRANT EXECUTE · 55171821
      unknown authored
        Rename some functions
        more fine-grained sp privileges
        make grant/revoke sp grammar less ambigious
      
      
      mysql-test/r/sp-security.result:
        change test for new syntax
      mysql-test/r/system_mysql_db.result:
        change test for new syntax
      mysql-test/t/sp-security.test:
        change test for new syntax
      scripts/mysql_create_system_tables.sh:
        now store routine_type for procs_priv
      scripts/mysql_fix_privilege_tables.sql:
        now store routine_type for procs_priv
      sql/item_func.cc:
        rename of function
      sql/mysql_priv.h:
        rename of function
      sql/sp_head.cc:
        extra arg for check_some_routine_access
      sql/sql_acl.cc:
        rename of function. now handle func/proc acls seperately
      sql/sql_acl.h:
        rename of function
      sql/sql_parse.cc:
        rename of function
        grants for procs handled distinctly from funcs
      sql/sql_show.cc:
        check_some_routine_access extra arg
      sql/sql_base.cc:
        fix for build
      sql/sql_yacc.yy:
        fix for build
      55171821
    • unknown's avatar
      sql_yacc.yy: · afaa3c89
      unknown authored
        missing semicolon added
      sql_base.cc:
        bad merge fixed
      sp_head.cc, view.test, view.result:
        Correct restoring view name in SP table locking BUG#9758
      configure.in:
        restore -fno-implicit-templates -fno-exceptions -fno-rtti in configure
      
      
      configure.in:
        restore -fno-implicit-templates -fno-exceptions -fno-rtti in configure
      mysql-test/r/view.result:
        Correct restoring view name in SP table locking BUG#9758
      mysql-test/t/view.test:
        Correct restoring view name in SP table locking BUG#9758
      sql/sp_head.cc:
        Correct restoring view name in SP table locking BUG#9758
      sql/sql_base.cc:
        bad merge fixed
      sql/sql_yacc.yy:
        missing semicolon added
      afaa3c89
  21. 16 May, 2005 1 commit
    • unknown's avatar
      Fix memory leak · f80fa96d
      unknown authored
      client/mysql.cc:
        Remove usage of c_ptr_safe() as this causes a linkage problem when compiling MySQL without inline functions
      sql/sql_base.cc:
        Don't use c_ptr_safe() on this string as this causes a realloc and the String object (allocated by sql_yacc.yy) is never freed
      f80fa96d
  22. 13 May, 2005 1 commit
    • unknown's avatar
      sql/ha_blackhole.cc · c3f73a42
      unknown authored
          bug#10175 - blackhole.test hangs with "Warning: prev link 1 didn't point at previous lock at read: read lock with no write locks"
      sql/sql_base.cc
          libmysqld/examples/mysql.cc linking problem
      
      
      sql/ha_blackhole.cc:
        bug#10175 - blackhole.test hangs with "Warning: prev link 1 didn't point at previous lock at read: read lock with no write locks"
      sql/sql_base.cc:
        libmysqld/examples/mysql.cc linking problem
      c3f73a42
  23. 10 May, 2005 1 commit
    • unknown's avatar
      Many files: · e02416c5
      unknown authored
        Fixed bug #8528.
        Representation for single-table views was made similar to
        representation for multi-table views.
      view.test:
        Added test case for bug #8528.
      view.result:
        Added test case for bug #8528. Fixed other test cases.
      
      
      mysql-test/r/view.result:
        Added test case for bug #8528. Fixed other test cases.
      mysql-test/t/view.test:
        Added test case for bug #8528.
      sql/sql_base.cc:
        Fixed bug #8528.
        Representation for single-table views was made similar to
        representation for multi-table views.
      sql/sql_delete.cc:
        Fixed bug #8528.
        Representation for single-table views was made similar to
        representation for multi-table views.
      sql/sql_insert.cc:
        Fixed bug #8528.
        Representation for single-table views was made similar to
        representation for multi-table views.
      sql/sql_parse.cc:
        Fixed bug #8528.
        Representation for single-table views was made similar to
        representation for multi-table views.
      sql/sql_prepare.cc:
        Fixed bug #8528.
        Representation for single-table views was made similar to
        representation for multi-table views.
      sql/sql_select.cc:
        Fixed bug #8528.
        Representation for single-table views was made similar to
        representation for multi-table views.
      sql/sql_update.cc:
        Fixed bug #8528.
        Representation for single-table views was made similar to
        representation for multi-table views.
      sql/sql_view.cc:
        Fixed bug #8528.
        Representation for single-table views was made similar to
        representation for multi-table views.
      sql/table.cc:
        Fixed bug #8528.
        Representation for single-table views was made similar to
        representation for multi-table views.
      sql/table.h:
        Fixed bug #8528.
        Representation for single-table views was made similar to
        representation for multi-table views.
      e02416c5
  24. 06 May, 2005 1 commit
    • unknown's avatar
      Bug#6616 · 079910b6
      unknown authored
        MySQL server 100% CPU if FLUSH TABLES WITH READ LOCK + INSERT
        Infinite loop caused by missing update to thd version.
      
      
      sql/sql_base.cc:
        Bug#6616
          thd version needs to be updated before reopening tables
          to prevent an infinite loop.
      BitKeeper/etc/logging_ok:
        Logging to logging@openlogging.org accepted
      079910b6
  25. 30 Apr, 2005 1 commit
    • unknown's avatar
      postreview changes · d45f95f0
      unknown authored
      sql/item.cc:
        changed parameters order
      sql/item.h:
        changed parameters order
      sql/sql_base.cc:
        fixed comment
        changed parameters order
      d45f95f0
  26. 29 Apr, 2005 1 commit
    • unknown's avatar
      Fix for #6553 and #8776 (no errors on bad spatial data) · 1df25ccd
      unknown authored
      mysql-test/r/gis-rtree.result:
        test result fixed
      mysql-test/r/gis.result:
        test result fixed
      mysql-test/t/gis-rtree.test:
        test case fixed
      mysql-test/t/gis.test:
        test case added
      sql/field.cc:
        error messages launched now when we try to put bad spatial
        data in the GEOMETRY field
      sql/field.h:
        interface fixed
      sql/item_geofunc.cc:
        bad_data sign now instead of NULL now returned from
        Item_geometry_from_text::val_str
      sql/share/errmsg.txt:
        error message added
      sql/spatial.cc:
        bad_geometry data instance
      sql/spatial.h:
        bad_geometry_data declaration
      sql/sql_base.cc:
        messages now created in store_* function
      1df25ccd
  27. 28 Apr, 2005 1 commit
    • unknown's avatar
      if outer refernce (identifier) was resolved with help of cache all subqueries... · ca119d39
      unknown authored
      if outer refernce (identifier) was resolved with help of cache all subqueries and resolved item itseld have to be correctly marked as dependent
      (BUG#10041)
      
      
      sql/item.cc:
        depended_from shoudl be cleaned
        layout fixed
        function to mark range of SELECTs as dependent (used if item was resolved with PS cache of resolving identifiers)
      sql/item.h:
        function to mark range of SELECTs as dependent (used if item was resolved with PS cache of resolving identifiers)
      sql/item_subselect.h:
        function to mark range of SELECTs as dependent (used if item was resolved with PS cache of resolving identifiers)
      sql/sql_base.cc:
        if outer refernce (identifier) was resolved with help of cache all subqueries and resolved item itseld have to be correctly marked as dependent
      ca119d39
  28. 14 Apr, 2005 1 commit
    • unknown's avatar
      information_schema.result, information_schema.test: · cfefd88d
      unknown authored
        Added a test in connection with the fix for
        bug #6106.
      view.result, view.test:
        Added test cases for bugs #6106/6107.
      sql_show.cc:
        The addition of the case for items of the type REF_ITEM in the
        function uses_only_table_name_fields became necessary after
        the fix for bug #6106.
      sql_base.cc:
        The problem was due to the fact that two different column
        references were glued together though one of them belonged to
        a subquery while another to an outer query. This caused
        eventually a wrong calculation of values for the used_tables
        attribute.
      
      
      sql/sql_base.cc:
        The problem was due to the fact that two different column
        references were glued together though one of them belonged to
        a subquery while another to an outer query. This caused
        eventually a wrong calculation of values for the used_tables
        attribute.
      sql/sql_show.cc:
        The addition of the case for items of the type REF_ITEM in the
        function uses_only_table_name_fields became necessary after
        the fix for bug #6106.
      mysql-test/t/view.test:
        Added test cases for bugs #6106/6107.
      mysql-test/r/view.result:
        Added test cases for bugs #6106/6107.
      mysql-test/t/information_schema.test:
        Added a test in connection with the fix for
        bug #6106.
      mysql-test/r/information_schema.result:
        Added a test in connection with the fix for
        bug #6106.
      cfefd88d
  29. 05 Apr, 2005 1 commit
    • unknown's avatar
      remove the rest of isam/merge references · cd0a50bf
      unknown authored
      fix a race condition in TC_LOG_BINLOG::unlog
      
      
      include/Makefile.am:
        remove the rest of isam/merge references
      include/config-win.h:
        unused and abused macro removed
      include/my_pthread.h:
        unused and abused macro removed
      include/my_sys.h:
        MY_IGNORE_BADFD flag
      include/mysql_embed.h:
        remove the rest of isam/merge references
      mysql-test/r/replace.result:
        remove the rest of isam/merge references
      mysql-test/t/replace.test:
        remove the rest of isam/merge references
      mysql-test/t/xa.test:
        comment
      mysys/my_sync.c:
        MY_IGNORE_BADFD flag
      sql/handler.cc:
        remove the rest of isam/merge references
      sql/log.cc:
        fix a race condition in TC_LOG_BINLOG::unlog
        preparation for binlog group commit
      sql/mysql_priv.h:
        remove duplicates
      sql/mysqld.cc:
        remove the rest of isam/merge references
      sql/opt_range.cc:
        remove the rest of isam/merge references
      sql/set_var.cc:
        hide unused variables. simplify sync_binlog code
      sql/sql_base.cc:
        remove the rest of isam/merge references
      sql/sql_class.h:
        cleanup
      cd0a50bf
  30. 04 Apr, 2005 1 commit
    • unknown's avatar
      Now one gets an error if one tries to insert an invalid value via a stored... · ae25f8df
      unknown authored
      Now one gets an error if one tries to insert an invalid value via a stored procedure in STRICT mode. (Bug #5907)
      
      
      client/mysqldump.c:
        Changed some function and variable names to MySQL syntax
        Fixed indentation for last few pushes
        (No logic changes)
      mysql-test/r/strict.result:
        Test for bug #5907 (Traditional mode: invalid value can be inserted via a stored procedure)
      mysql-test/t/strict.test:
        Test for bug #5907 (Traditional mode: invalid value can be inserted via a stored procedure)
      sql/sql_base.cc:
        More comments
      sql/sql_error.cc:
        Ensure that PS gives error for invalid values in 'strict' mode
      ae25f8df
  31. 02 Apr, 2005 1 commit
    • unknown's avatar
      - stackoverflow check added for view of view processing · a50bf2f0
      unknown authored
      - fixed bug in join view processing
      - postreview fixes (BUG#9398 & BUG#8703)
      
      
      sql/sql_base.cc:
        used original TABLE object to get correct name of table and db
      sql/sql_view.cc:
        fixed bug of assigning select_lex for join view
      sql/table.cc:
        comment fixed
        stack overflow check added
        new method for underlying base table finding
      sql/table.h:
        comment fixed
        new method for underlying base table finding
      a50bf2f0
  32. 28 Mar, 2005 1 commit
    • unknown's avatar
      fixed mechanism of detection selection from table wich we update · daddf263
      unknown authored
      (BUG##9398, BUG#8703)
      fixed wrong join view detection in multi-delete which lead to server crash
      
      
      mysql-test/r/lowercase_view.result:
        added new tests of updation and selection from the same table
      mysql-test/r/view.result:
        added new tests of updation and selection from the same table
        added test of multidelete command over join view which lead to server crash
        test suite from bugs #9398 and #8703
      mysql-test/t/lowercase_view.test:
        added new tests of updation and selection from the same table
      mysql-test/t/view.test:
        added new tests of updation and selection from the same table
        added test of multidelete command over join view which lead to server crash
        test suite from bugs #9398 and #8703
      sql/sql_base.cc:
        changed procedure of finding tables
      sql/sql_class.cc:
        added derived table procession detection
      sql/sql_class.h:
        added derived table procession detection
      sql/sql_delete.cc:
        fixed detection of selection from table which update for multidelete
      sql/sql_derived.cc:
        added derived table procession detection
      sql/sql_lex.cc:
        added detection os SELECTs processed inside derived tables
        removed old mechanism of multidelete/multiupdate table duplication detection (which can't work with views)
      sql/sql_lex.h:
        added detection os SELECTs processed inside derived tables
        removed old mechanism of multidelete/multiupdate table duplication detection (which can't work with views)
      sql/sql_parse.cc:
        removed wrong test of join view (for multidelete in can be not only first table)
      sql/sql_prepare.cc:
        added detection os SELECTs processed inside derived tables (reset it for reusing in PS/SP)
      sql/sql_select.cc:
        added detection os SELECTs processed inside derived tables
      sql/sql_update.cc:
        fixed detection of selection from table which update for multiupdate
      daddf263
  33. 16 Mar, 2005 1 commit
    • unknown's avatar
      Cleanup during reviews · 284b8b8b
      unknown authored
      Removed some optional arguments
      Fixed portability problem in federated tests
      
      
      client/sql_string.cc:
        update from sql/sql_string.cc
      client/sql_string.h:
        update from sql/sql_string.h
      mysql-test/r/federated.result:
        Fixed error message
      sql/field.cc:
        Cleanup during review
        Remove const in 'const unsigned int'
      sql/field.h:
        Remove const in 'const unsigned int'
      sql/ha_federated.cc:
        Better error string.  Add missing argument to error (before 'errno' was picked up from stack)
      sql/handler.cc:
        Removed compiler warning
      sql/item_func.cc:
        Cleanup during review
      sql/item_sum.cc:
        Cleanup during review
      sql/lock.cc:
        Remove optional arguments
      sql/log_event.cc:
        Remove optional arguments
      sql/mysql_priv.h:
        Remove optional arguments
        cahnge preapre_create_fields to use pointers instead of references
      sql/opt_range.cc:
        Fix arguments so that return value is last
      sql/sql_base.cc:
        Remove optional arguments
      sql/sql_delete.cc:
        Remove optional arguments
      sql/sql_error.cc:
        Remove optional arguments
      sql/sql_help.cc:
        Remove optional arguments
      sql/sql_parse.cc:
        Remove optional arguments
      sql/sql_prepare.cc:
        Remove optional arguments
      sql/sql_rename.cc:
        Remove optional arguments
      sql/sql_select.cc:
        Remove optional arguments
      sql/sql_show.cc:
        Cleanup during review
      sql/sql_string.cc:
        Simple optimization
      sql/sql_table.cc:
        Remove optional arguments
        Fixed indentation
      sql/sql_update.cc:
        Remove optional arguments
      sql/sql_yacc.yy:
        Change references to pointers
      284b8b8b
  34. 09 Mar, 2005 1 commit