An error occurred fetching the project authors.
  1. 07 Dec, 2005 1 commit
    • unknown's avatar
      BUG#5390 - problems with merge tables · f6cac54b
      unknown authored
      Problem #1: INSERT...SELECT, Version for 4.1.
      INSERT ... SELECT with the same table on both sides (hidden
      below a MERGE table) does now work by buffering the select result.
      The duplicate detection works now after open_and_lock_tables() 
      on the locks.
      I did not find a test case that failed without the change in
      sql_update.cc. I made the change anyway as it should in theory
      fix a possible MERGE table problem with multi-table update.
      
      
      libmysqld/ha_blackhole.cc:
        BUG#5390 - problems with merge tables
        No idea, how the symlink change made it into my patch.
      mysql-test/r/create.result:
        BUG#5390 - problems with merge tables
        Removed a duplicate test.
      mysql-test/r/merge.result:
        BUG#5390 - problems with merge tables
        Problem #1: INSERT...SELECT, Version for 4.1.
        Added test results.
      mysql-test/t/create.test:
        BUG#5390 - problems with merge tables
        Removed a duplicate test.
      mysql-test/t/merge.test:
        BUG#5390 - problems with merge tables
        Problem #1: INSERT...SELECT, Version for 4.1.
        Added tests.
      sql/lock.cc:
        BUG#5390 - problems with merge tables
        Problem #1: INSERT...SELECT, Version for 4.1.
        Added a new function to find a duplicate lock in a list of tables.
      sql/mysql_priv.h:
        BUG#5390 - problems with merge tables
        Problem #1: INSERT...SELECT, Version for 4.1.
        Added a declaration for the new function.
      sql/sql_parse.cc:
        BUG#5390 - problems with merge tables
        Problem #1: INSERT...SELECT, Version for 4.1.
        Changed the duplicate tables detection for INSERT ... SELECT
        to use the new function, which does also work for MERGE tables.
      sql/sql_update.cc:
        BUG#5390 - problems with merge tables
        Problem #1: INSERT...SELECT, Version for 4.1.
        Changed the duplicate tables detection for UPDATE
        to use the new function, which does also work for MERGE tables.
      f6cac54b
  2. 29 Nov, 2005 1 commit
    • unknown's avatar
      BUG#5390 - problems with merge tables · 38b7ede9
      unknown authored
      Problem #1: INSERT...SELECT
      INSERT ... SELECT with the same table on both sides (hidden
      below a MERGE table) does now work by buffering the select result.
      The duplicate detection works now after open_and_lock_tables() 
      on the locks.
      I did not find a test case that failed without the change in
      sql_update.cc. I made the change anyway as it should in theory
      fix a possible MERGE table problem with multi-table update.
      
      
      mysql-test/r/create.result:
        BUG#5390 - problems with merge tables
        Removed a duplicate test.
      mysql-test/r/merge.result:
        BUG#5390 - problems with merge tables
        Problem #1: INSERT...SELECT
        Added test results.
      mysql-test/t/create.test:
        BUG#5390 - problems with merge tables
        Removed a duplicate test.
      mysql-test/t/merge.test:
        BUG#5390 - problems with merge tables
        Problem #1: INSERT...SELECT
        Added tests.
      sql/lock.cc:
        BUG#5390 - problems with merge tables
        Problem #1: INSERT...SELECT
        Added a new function to find a duplicate lock in a list of tables.
      sql/mysql_priv.h:
        BUG#5390 - problems with merge tables
        Problem #1: INSERT...SELECT
        Added a declaration for the new function.
      sql/sql_parse.cc:
        BUG#5390 - problems with merge tables
        Problem #1: INSERT...SELECT
        Changed the duplicate tables detection for INSERT ... SELECT
        to use the new function, which does also work for MERGE tables.
      sql/sql_update.cc:
        BUG#5390 - problems with merge tables
        Changed the duplicate tables detection for UPDATE
        to use the new function, which does also work for MERGE tables.
      38b7ede9
  3. 25 Nov, 2005 1 commit
    • unknown's avatar
      A fix and a test case for Bug#14410 "Crash in Enum or Set type in · 2a1ae3a5
      unknown authored
      CREATE TABLE and PS/SP": make sure that 'typelib' object for
      ENUM values and 'Item_string' object for DEFAULT clause are 
      created in the statement memory root.
      
      
      mysql-test/r/ps.result:
        Test results has been fixed (Bug#14410)
      mysql-test/t/ps.test:
        A test case for Bug#14410 "Crash in Enum or Set type in CREATE 
        TABLE and PS/SP"
      sql/mysql_priv.h:
        typelib() function declaration has been changed.
      sql/sql_table.cc:
        Supply the statement memory root to use in typelib() and
        safe_charset_converter() functions to ensure that objects 
        created during the first execution of CREATE TABLE statement
        are allocated in persistent memory of the statement.
      sql/table.cc:
        Change typelib() function to require MEM_ROOT.
      2a1ae3a5
  4. 03 Nov, 2005 1 commit
    • unknown's avatar
      Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash · 7d183320
      unknown authored
      Version for 4.0.
      It fixes two problems:
      1. The cause of the bug was that we did not check the table version for
         the HANDLER ... READ commands. We did not notice when a table was
         replaced by a new one. This can happen during ALTER TABLE, REPAIR
         TABLE, and OPTIMIZE TABLE (there might be more cases). I call the fix
         for this problem "the primary bug fix".
      2. mysql_ha_flush() was not always called with a locked LOCK_open.
         Though the function comment clearly said it must.
         I changed the code so that the locking is done when required. I call
         the fix for this problem "the secondary fix".
      
      
      mysql-test/r/handler.result:
        Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
        The test result.
      mysql-test/t/handler.test:
        Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
        The test case.
      sql/mysql_priv.h:
        Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
        Changed a definition for the secondary fix.
      sql/sql_base.cc:
        Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
        Changed function calls for the secondary fix.
      sql/sql_class.cc:
        Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
        Changed a function call for the secondary fix.
      sql/sql_handler.cc:
        Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
        The first two diffs make the primary bug fix.
        The rest is for the secondary fix.
      sql/sql_table.cc:
        Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
        Changed function calls for the secondary fix.
      7d183320
  5. 30 Sep, 2005 1 commit
    • unknown's avatar
      BUG#12915: Added single-table UPDATE/DELTE ... ORDER BY ... LIMIT · 1fe423ae
      unknown authored
      optimization: now can use index to find records to update/delete
      when there is no WHERE clause.
      
      
      mysql-test/r/update.result:
        Testcase for BUG#12915
      mysql-test/t/update.test:
        Testcase for BUG#12915
      sql/mysql_priv.h:
        BUG#12915: Added init_read_record_idx function.
      sql/opt_range.cc:
        BUG#12915: Added get_index_for_order() - find an index that can be
        used to get first N table records in given ordering cheaper then 
        one would with full table scan.
      sql/opt_range.h:
        BUG#12915: Added get_index_for_order() function
      sql/records.cc:
        BUG#12915: Added init_read_record_idx(), rr_index() that allow to scan
        index using init_read_record()/read_record.read_record()
      sql/sql_delete.cc:
        BUG#12915: Added single-table DELETE ... ORDER BY ... LIMIT optimization: 
        now can use index to find records to delete when there is no WHERE clause.
      sql/sql_update.cc:
        BUG#12915: Added single-table UPDATE ... ORDER BY ... LIMIT optimization: 
        now can use index to find records to update when there is no WHERE clause.
      sql/structs.h:
        BUG#12915: Added init_read_record_idx(), rr_index() that allow to scan
        index using init_read_record()/READ_RECORD::read_record()
      1fe423ae
  6. 14 Sep, 2005 1 commit
    • unknown's avatar
      fix for BUG#11139 (multi-delete with alias breaking replication if table rules are · f89424f8
      unknown authored
       present): the problem originally was that the tables in auxilliary_tables did not have 
      the correct real_name, which caused problems in the second call to tables_ok(). 
      The fix corrects the real_name problem, and also sets the updating flag properly, 
      which makes the second call to tables_ok() unnecessary.
      
      
      mysql-test/r/rpl_multi_delete2.result:
        updates for for BUG#11139
      mysql-test/t/rpl_multi_delete2-slave.opt:
        updates for for BUG#11139
      mysql-test/t/rpl_multi_delete2.test:
        updates for for BUG#11139
      sql/mysql_priv.h:
        fix for BUG#11139 (multi-delete with alias breaking replication if table rules are
         present)
      sql/slave.cc:
        fix for BUG#11139 (multi-delete with alias breaking replication if table rules are
         present)
      sql/sql_parse.cc:
        fix for BUG#11139 (multi-delete with alias breaking replication if table rules are
         present)
      sql/sql_yacc.yy:
        fix for BUG#11139 (multi-delete with alias breaking replication if table rules are
         present)
      f89424f8
  7. 06 Sep, 2005 1 commit
    • unknown's avatar
      support of concurent query cache resizing (BUG#12848) · f5f896b4
      unknown authored
      sql/mysql_priv.h:
        initialisation moved to mysqld.cc
      sql/mysqld.cc:
        initialisation moved to mysqld.cc
      sql/sql_cache.cc:
        support of concurent query cache resizing:
              - resizing made atomic
              - check stack size after each quard mutex lock
      sql/sql_cache.h:
        initialisation moved to mysqld.cc
        removed uneed parameter (now it is always under guard mutex protection or called from destruction)
      f5f896b4
  8. 05 Sep, 2005 1 commit
    • unknown's avatar
      mysqld.cc, mysql_priv.h, sql_parse.cc: · 50c44c9b
      unknown authored
        bug#9948
        changed client-charset behavior in 4.1.x libmysql, which issue BC prob
        after review fixes
      
      
      sql/mysql_priv.h:
        bug#9948
        changed client-charset behavior in 4.1.x libmysql, which issue BC prob
        after review fixes
      sql/mysqld.cc:
        bug#9948
        changed client-charset behavior in 4.1.x libmysql, which issue BC prob
        after review fixes
      50c44c9b
  9. 19 Aug, 2005 1 commit
    • unknown's avatar
      updated patch for BUG#4680 (incomplete DROP DATABASE breaking replication). · 4652c6b0
      unknown authored
      We binlog the DROP TABLE for each table that was actually dropped. Per Sergei's 
      suggestion a fixed buffer for the DROP TABLE query is pre-allocated from THD pool, and 
      logging now is done in batches - new batch is started if the buffer becomes full.
      Reduced memory usage by reusing the table list instead of accumulating a list of 
      dropped table names. Also fixed the problem if the table was not actually dropped, eg
      due to permissions. Extended the test case to make sure batched query 
      logging does work.  
      
      
      mysql-test/r/rpl_drop_db.result:
        test for query buffer overrun
      mysql-test/t/rpl_drop_db.test:
        test for query buffer overrun
      sql/mysql_priv.h:
        updated patch for BUG#4680 (incomplete DROP DATABASE breaking replication)
      BitKeeper/etc/ignore:
        Added support-files/MacOSX/postflight support-files/MacOSX/preflight to the ignore list
      sql/sql_db.cc:
        updated patch for BUG#4680 (incomplete DROP DATABASE breaking replication)
      sql/sql_table.cc:
        updated patch for BUG#4680 (incomplete DROP DATABASE breaking replication)
      sql/table.h:
        updated patch for BUG#4680 (incomplete DROP DATABASE breaking replication)
      4652c6b0
  10. 06 Aug, 2005 1 commit
    • unknown's avatar
      BUG#11869 (cont'd, eliminating "table type doesn't support FULLTEXT" error): · 852dcb75
      unknown authored
      When creating temporary table for UNION, pass TMP_TABLE_FORCE_MYISAM flag to 
      create_tmp_table if we will be using fulltext function(s) when reading from the 
      temp. table.
      
      
      mysql-test/r/fulltext_order_by.result:
        Testcase for BUG#11869 (cont'd, eliminating "table type doesn't support FULLTEXT" error)
      mysql-test/t/fulltext_order_by.test:
        Testcase for BUG#11869 (cont'd, eliminating "table type doesn't support FULLTEXT" error)
      sql/mysql_priv.h:
        BUG#11869 (cont'd, eliminating "table type doesn't support FULLTEXT" error):
        Added TMP_TABLE_FORCE_MYISAM flag
      sql/sql_select.cc:
        BUG#11869 (cont'd, eliminating "table type doesn't support FULLTEXT" error):
        In create_tmp_table(), honor the TMP_TABLE_FORCE_MYISAM flag
      852dcb75
  11. 04 Aug, 2005 2 commits
  12. 27 Jul, 2005 1 commit
    • unknown's avatar
      Review of new code: · 34b340c4
      unknown authored
      Change argument order to be database, tablename for some functions
      
      
      sql/lock.cc:
        Remove not needed block
      sql/mysql_priv.h:
        Change argument order to be database, tablename (like in most other functions)
      sql/sql_table.cc:
        Change argument order to be database, tablename (like in most other functions)
        Make 'flags' inline
      sql/table.cc:
        Change argument order to be database, tablename (like in most other functions)
      sql/unireg.cc:
        Change argument order to be database, tablename (like in most other functions)
      34b340c4
  13. 26 Jul, 2005 1 commit
    • unknown's avatar
      Review fixes: · 90e41fac
      unknown authored
      Fixed portability problem with bool in C programs
      Moved close_thread_tables out from LOCK_thread_count mutex (safety fix)
      my_sleep() -> pthread_cond_timedwait()
      
      
      include/thr_lock.h:
        bool -> my_bool (bool is not portable in C programs)
      mysys/thr_lock.c:
        bool -> my_bool (bool is not portable in C programs)
      sql/lock.cc:
        Added comment
        Don't use | on bool variable
      sql/mysql_priv.h:
        Added comment
      sql/slave.cc:
        Moved close_thread_tables out from LOCK_thread_count mutex (safety fix)
      sql/sql_base.cc:
        Added comments
        my_sleep() -> pthread_cond_timedwait() to get less code and potentitally faster loop
      BitKeeper/etc/ignore:
        added ac_available_languages_fragment
      90e41fac
  14. 22 Jul, 2005 1 commit
    • unknown's avatar
      Fix error message generated when trying to create a table in a · 41984105
      unknown authored
      non-existent database. (Bug #10407)
      
      
      mysql-test/r/create.result:
        Update results
      mysql-test/t/create.test:
        Update error numbers
      sql/mysql_priv.h:
        Adjust some other function signature so table and db information
        is passed down into create_frm().
      sql/sql_table.cc:
        Check for database not existing after hitting an error when
        copying the .frm file for 'CREATE TABLE ... LIKE ...', and
        pass table and db name into rea_create_table().
      sql/table.cc:
        Generate specific error message when .frm creation fails because
        the database does not exist.
      sql/unireg.cc:
        Pass database and table name down into create_frm().
      41984105
  15. 20 Jul, 2005 1 commit
    • unknown's avatar
      Bug #10600 After review fixes · af1dfb61
      unknown authored
      sql/lock.cc:
        Used flags immediately in call
      sql/mysql_priv.h:
        Added RTFC (short for remove_table_from_cache)
        for constants and used hex syntax to clarify it is bits
        in the flags
      sql/sql_base.cc:
        Use flags parameter immediately and use flags immediately in call
        Change to other variant of eternal loop variant
      sql/sql_table.cc:
        Use flags immediately in call
      af1dfb61
  16. 19 Jul, 2005 1 commit
    • unknown's avatar
      Simple fixes during review of new code · 3a31f7b9
      unknown authored
      include/my_global.h:
        Added floatget() to read unaligned flaot
      mysql-test/r/select.result:
        Added test for found_rows()
      mysql-test/t/select.test:
        Added test for found_rows()
      sql/des_key_file.cc:
        Moved initalization of LOCK_des_key_file to mysqld to make simpler code and avoid theoretical race condition
      sql/field_conv.cc:
        Added optimizzed varsion of do_cut_string (for simple character sets)
      sql/item_func.cc:
        Simplify code (and ensure DBUG_ENTER is excuted before main code)
      sql/item_strfunc.cc:
        Safe calculation of max_length
        This was needed as max_length can now be 1<<32-1 (after konstantins recent patch to fix BLOB_LENGTH)
        Remove init_des_key_file() as this is not initialized in mysqld.cc
      sql/item_timefunc.cc:
        Safe calculation of max_length
        This was needed as max_length can now be 1<<32-1 (after konstantins recent patch to fix BLOB_LENGTH)
      sql/log_event.cc:
        Simplify code
      sql/mysql_priv.h:
        Moved initalization of LOCK_des_key_file to mysqld to make simpler code and avoid theoretical race condition
      sql/mysqld.cc:
        Moved initalization of LOCK_des_key_file to mysqld to make simpler code and avoid theoretical race condition
        Revert wrong patch of calling close_connection() in first close_connections() loop. (Bug #7403)
        Instead we now print a warning for closed connections only if mysqld is sarted with --warnings
        Added comments to make the close_connections() logic clearer
      sql/sql_prepare.cc:
        Use floatget() and doubleget() to protect against unaligned data
      sql/sql_select.cc:
        Fixed some cases unlikely cases where found_rows() would return wrong for queries that would return 0 or 1 rows
      3a31f7b9
  17. 18 Jul, 2005 1 commit
    • unknown's avatar
      Bug #10600 · 6d29b23b
      unknown authored
      remove_table_from_cache fails to signal other thread and gets
      blocked when other thread also gets blocked
      
      
      include/thr_lock.h:
        Report if any threads was signalled
      mysys/thr_lock.c:
        Report if any threads was signalled
      sql/lock.cc:
        Report if any threads was signalled
        Use new interface for remove_table_from_cache
      sql/mysql_priv.h:
        New interface for remove_table_from_cache
        + mysql_lock_abort_for_thread
      sql/sql_base.cc:
        Use new interface of remove_table_cache
        Rewrote remove_table_from_cache to fix bug
      sql/sql_table.cc:
        Use new interface of remove_table_from_cache
      6d29b23b
  18. 15 Jul, 2005 1 commit
    • unknown's avatar
      A fix and a test case for Bug#9359 "Prepared statements take snapshot · e83e1053
      unknown authored
       of system vars at PREPARE time": implement a special Item
      to handle system variables. This item substitutes itself with 
      a basic constant containing variable value at fix_fields.
      
      
      mysql-test/r/ps.result:
        - test results fixed (Bug#9359).
      mysql-test/t/ps.test:
        - add a test case for Bug#9359 "Prepared statements take snapshot
         of system vars at PREPARE time"
      sql/item_func.cc:
        - implement Item_func_get_system_var: we should not evaluate system
        variables in the parser, but instead should create an item which 
        is evaluated to a constant at execute.
        - remove an unused function
      sql/item_func.h:
        Add a new item, Item_func_get_system_var
      sql/mysql_priv.h:
        Move necessary declarations to make set_var.h objects visible in 
        item_func.h
      sql/set_var.cc:
        - we should not print to network from get_system_var: if it's called
        from prepared statement prepare, we get packets out of order when using
        the binary protocol. Instead report the error to be sent to the user later.
        This is a backport from 5.0.
      sql/set_var.h:
        - declaration of enum_var_type moved to mysql_priv.h
      e83e1053
  19. 13 Jul, 2005 1 commit
    • unknown's avatar
      - a fix for Bug#11458 "Prepared statement with subselects return random · ece17ba3
      unknown authored
      data": remove the fix for another bug (8807) that
      added OUTER_REF_TABLE_BIT to all subqueries that used a placeholder
      to prevent their evaluation at prepare. As this bit hanged in 
      Item_subselect::used_tables_cache for ever, a constant subquery with
      a placeholder was never evaluated as such, which caused wrong 
      choice of the execution plan for the statement.
      - to fix Bug#8807 backport a better fix from 5.0
      - post-review fixes.
      
      
      mysql-test/r/ps.result:
        Bug#11458: test results fixed
      mysql-test/t/ps.test:
        - add a test case for Bug#11458 "Prepared statement with subselects return 
        random data"
      sql/item.cc:
        - remove unnecessary Item_param::fix_fields
        - fix Item_param::set_null to set item_type accordingly (safety:
          Item_param should behave like a basic constant).
      sql/item.h:
        Remove Item_param::fix_fields
      sql/item_subselect.h:
        Remove no more existing friend.
      sql/mysql_priv.h:
        Add UNCACHEABLE_PREPARE to mark all subqueries as uncacheable if
        in statement prepare (backport from 5.0).
      sql/sql_lex.h:
        Comment fixed.
      sql/sql_parse.cc:
        If in statement prepare, mark all subqueries as uncacheable (backport
        from 5.0)
      sql/sql_prepare.cc:
        Switch off the uncacheable flag from all subqueries after statement
        prepare is done (backport from 5.0)
      ece17ba3
  20. 07 Jul, 2005 1 commit
    • unknown's avatar
      Fix crash caused by calling DES_ENCRYPT() without the --des-key-file · 01b66f3f
      unknown authored
      option having been passed to the server. (Bug #11643)
      
      
      sql/des_key_file.cc:
        Split initialization of mutex to new function, and make sure static
        initialization variable is initialized.
      sql/item_strfunc.cc:
        Make sure to initialize mutex before using it
      sql/mysql_priv.h:
        Add init_des_key_file() declaration
      mysql-test/r/func_des_encrypt.result:
        New BitKeeper file ``mysql-test/r/func_des_encrypt.result''
      mysql-test/t/func_des_encrypt.test:
        New BitKeeper file ``mysql-test/t/func_des_encrypt.test''
      BitKeeper/etc/config:
        Disable openlogging
      01b66f3f
  21. 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
  22. 16 Jun, 2005 2 commits
    • unknown's avatar
      Fix Bug#9334 "PS API queries in log file" and · c0484a30
      unknown authored
      Bug#8367 "low log doesn't gives complete information about prepared 
      statements"
      Implement status variables for prepared statements commands (a port of
      the patch by Andrey Hristov).
      See details in comments to the changed files.
      No test case as there is no way to test slow log/general log in 
      mysqltest.
      
      
      mysql-test/r/ps_grant.result:
        Now execute is logged with tag 'Execute' (changed result file).
      sql/mysql_priv.h:
        - remove obsolete macro.
        - add declarations for new status variables.
        - export function log_slow_statement, which now is used in sql_prepare.cc
      sql/mysqld.cc:
        Add status variables for prepared statements API: now we record
        mysql_stmt_close, mysql_stmt_reset, mysql_stmt_prepare, mysql_stmt_execute
        mysql_stmt_send_long_data, PREPARE, EXECUTE, DEALLOCATE.
      sql/sql_parse.cc:
        - account DEALLOCATE prepare as a Com_stmt_close command (close of a
        prepared statement).
      sql/sql_prepare.cc:
        - fix a bug in SQL syntax for prepared statements + logging:
          if we use --log and EXECUTE stmt USING @no_such_variable;, the
          server crashed because the old code assumed that the variable 
          returned by get_var_with_binlog is never NULL.
        - account statistics for 
          mysql_stmt_{prepare,execute,close,reset,send_long_data} in
          Com_stmt_{prepare,execute,close,reset,send_long_data} correspondingly.
        - log slow statements into the slow log early, when thd->query
          points to a valid (with expanded placeholder values) query.
          The previous version was logging it in sql_parse, when thd->query
          is empty. Prevent the server from logging the statement twice by 
          setting thd->enable_slow_log= FALSE.
        - now in case of EXECUTE stmt in SQL syntax for prepared statements the 
          general log gets two queries, e.g.
          Query    EXECUTE stmt USING @A, @b, @c
          Execute  INSERT INTO t1 VALUES (1, 2, 3)
          This makes the behavior consistent with PREPARE command, which
          also logs the statement twice.
      c0484a30
    • unknown's avatar
      A fix for Bug#9141 "4.1 does not log into slow log · 51cd70da
      unknown authored
      ALTER, OPTIMIZE and ANALYZE statements".
      In 4.1 we disabled logging of slow admin statements. The fix adds an 
      option to enable it back.
      No test case (slow log is not tested in the test suite), but tested
      manually.
      + post-review fixes (word police mainly).
      
      
      sql/mysql_priv.h:
        - declaration for a new option
      sql/mysqld.cc:
        Add server option '--log-slow-admin-statements' to log slow
        optimize/alter/etc statements to the slow log if it's enabled.
        Add warnings that this option works only if the slow log is open.
      sql/sql_class.h:
        Rename 'thd->slow_command' to thd->enable_slow_log (negates
        the meaning of this variable, and so resolves the need to negate
        value opt_log_slow_admin_statements when setting it).
      sql/sql_parse.cc:
        Implement optional logging of administrative statements in the slow log.
      51cd70da
  23. 03 Jun, 2005 1 commit
    • unknown's avatar
      Move USE_PRAGMA_IMPLEMENTATION to proper place · 72dd44b9
      unknown authored
      Ensure that 'null_value' is not accessed before val() is called in FIELD() functions
      Fixed initialization of key maps. This fixes some problems with keys when you have more than 64 keys
      Fixed that ROLLUP don't always create a temporary table. This fix ensures that func_gconcat.test results are now predictable
      
      
      mysql-test/r/func_gconcat.result:
        Move innodb specific test to innodb.test
        Changed table name r2 -> t2
        More test to see how ROLLUP was optimized
      mysql-test/r/innodb.result:
        Moved test here form func_gconcat
      mysql-test/r/olap.result:
        New test results after optimization
      mysql-test/t/func_gconcat.test:
        Move innodb specific test to innodb.test
        Changed table name r2 -> t2
        More test to see how ROLLUP was optimized
      mysql-test/t/innodb.test:
        Moved test here form func_gconcat
      sql/field.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/ha_berkeley.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/ha_blackhole.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/ha_heap.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/ha_innodb.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/ha_isam.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/ha_isammrg.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/ha_myisam.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/ha_myisammrg.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/ha_ndbcluster.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/handler.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/hash_filo.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/item.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/item_cmpfunc.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/item_func.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
        Ensure that 'null_value' is not accessed before val() is called
      sql/item_geofunc.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/item_strfunc.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/item_subselect.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/item_sum.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/item_timefunc.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/item_uniq.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/log_event.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/mysql_priv.h:
        Change key_map_full to not be const as we are giving it a proper value on startup
      sql/mysqld.cc:
        Move key_map variables here and initialize key_map_full properly
      sql/opt_range.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/opt_range.h:
        Fix that test_quick_select() works with any ammount of keys
      sql/procedure.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/protocol.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/protocol_cursor.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/set_var.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/sql_analyse.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/sql_class.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/sql_crypt.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/sql_insert.cc:
        Fixed that max_rows is ulong
      sql/sql_list.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/sql_map.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/sql_olap.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/sql_select.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
        Fixed that ROLLUP don't have to always create a temporary table
        Added new argument to remove_const() to make above possible
        Fixed some errors that creapt up when we don't always do a temporary table for ROLLUP
      sql/sql_string.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/sql_table.cc:
        Simple optimizations
        Fixed wrong checking of build_table_path() in undef-ed code
      sql/sql_udf.cc:
        Move USE_PRAGMA_IMPLEMENTATION to proper place
      sql/sql_yacc.yy:
        removed extra {}
      72dd44b9
  24. 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
  25. 09 May, 2005 1 commit
    • unknown's avatar
      Bug#8733 - server accepts malformed query (multiply mentioned distinct) · 19b86438
      unknown authored
        Detect conflicting options in SELECT
      
      
      mysql-test/r/select.result:
        Test for bug#8733
      mysql-test/t/select.test:
        Test for bug#8733
      sql/mysql_priv.h:
        New bit for ALL
      sql/sql_yacc.yy:
        We want to complain if DISTINCT or ALL is used in SELECT when a
        conflicting option is already selected.
      19b86438
  26. 27 Apr, 2005 1 commit
    • unknown's avatar
      Bug#7823 - FLUSH TABLES WITH READ LOCK + INSERT DELAYED = deadlock · f63c8f53
      unknown authored
      Added protection against global read lock while creating and
      initializing a delayed insert handler.
      Allowed to ignore a global read lock when locking the table
      inside the delayed insert handler.
      Added some minor improvements.
      
      
      sql/lock.cc:
        Bug#7823 - FLUSH TABLES WITH READ LOCK + INSERT DELAYED = deadlock
        Changed mysql_lock_tables() to allow for ignoring global read lock.
        Added functions to set/unset protection against global read lock.
      sql/mysql_priv.h:
        Bug#7823 - FLUSH TABLES WITH READ LOCK + INSERT DELAYED = deadlock
        Changed existing and added new function declarations.
      sql/sql_insert.cc:
        Bug#7823 - FLUSH TABLES WITH READ LOCK + INSERT DELAYED = deadlock
        Added and extended some comments.
        Added a protection against global read lock while a handler is
        created and initialized.
        Moved the unlock of the delayed insert object past its last usage
        in delayed_get_table().
        Changed the table locking in handle_delayed_insert() so that it
        does not wait for global read lock.
      f63c8f53
  27. 19 Apr, 2005 1 commit
    • unknown's avatar
      Bug#7806 - insert on duplicate key and auto-update of timestamp · 3be2d489
      unknown authored
      Modified the check for the timestamp field so that the flags for
      the automatic for inserts and updates are cleared independently.
      
      
      mysql-test/r/type_timestamp.result:
        Bug#7806 - insert on duplicate key and auto-update of timestamp
        The test result.
      mysql-test/t/type_timestamp.test:
        Bug#7806 - insert on duplicate key and auto-update of timestamp
        The test case.
      sql/mysql_priv.h:
        Bug#7806 - insert on duplicate key and auto-update of timestamp
        Made check_insert_fields() static. It is used only in sql_insert.cc.
      sql/sql_insert.cc:
        Bug#7806 - insert on duplicate key and auto-update of timestamp
        Modified the check of the insert fields so that an explicit
        assignment of the timestamp field does only disable the automatic
        for inserts and retains the automatic for updates.
        Added a check if the update fields contain the timestamp field.
        In this case, the automatic on update is disabled, but not the
        automatic on insert. This is called from mysql_prepare_insert().
      sql/table.h:
        Bug#7806 - insert on duplicate key and auto-update of timestamp
        Extended a comment to warn about usage of enum timestamp_auto_set_type.
      3be2d489
  28. 31 Mar, 2005 1 commit
    • unknown's avatar
      Fixes for bugs reported by Stefano Di Paola (stefano.dipaola@wisec.it) · 896e6e56
      unknown authored
      Originally contained in 2005/03/03 19:51:29+01:00 serg@serg.mylan;
      contained in MySQL 4.1.10a;
      re-committed for archival purposes.
      
      
      include/my_global.h:
        O_NOFOLLOW
      isam/create.c:
        create table files with O_EXCL|O_NOFOLLOW
      merge/mrg_create.c:
        create table files with O_EXCL|O_NOFOLLOW
      myisam/mi_create.c:
        create files of temporary tables with O_EXCL|O_NOFOLLOW
      myisammrg/myrg_create.c:
        create table files with O_EXCL|O_NOFOLLOW
      mysys/mf_tempfile.c:
        create temporary files with O_EXCL|O_NOFOLLOW
      sql/ha_myisam.cc:
        let mi_create know if the table is TEMPORARY
      sql/mysql_priv.h:
        --allow_suspicious_udfs
      sql/mysqld.cc:
        --allow_suspicious_udfs
      sql/share/english/errmsg.txt:
        typo
      sql/sql_udf.cc:
        --allow_suspicious_udfs
        don't allow xxx() udf without any of xxx_init/deinit/add/reset
        check paths when loading from mysql.func
      sql/table.cc:
        create frm of temporary table with O_EXCL|O_NOFOLLOW
      896e6e56
  29. 23 Mar, 2005 1 commit
    • unknown's avatar
      Additional storage engine called "blackhole". Customer request, and for that... · 8a99997d
      unknown authored
      Additional storage engine called "blackhole". Customer request, and for that matter a Zawodny request.  With this you can alter table to a type of table that would never store data. Its a /dev/null for a database.  
      
      
      acinclude.m4:
        New macro rule for ha_blackhole.
      configure.in:
        Rule enabling blackhole engine
      sql/Makefile.am:
        Additions to Makefile for blackhole engine
      sql/handler.cc:
        Ifdef enable code for blackhole (and message for "what does this thing do").
      sql/handler.h:
        Flag for storage engine type.
      sql/mysql_priv.h:
        Added blackhole type.
      sql/mysqld.cc:
        Updates for building backhole.
      sql/set_var.cc:
        Show variable for blackhole engine
      8a99997d
  30. 03 Mar, 2005 1 commit
    • unknown's avatar
      Fixes for bugs reported by Stefano Di Paola (stefano.dipaola@wisec.it) · 8104faa0
      unknown authored
      include/my_global.h:
        O_NOFOLLOW
      isam/create.c:
        create table files with O_EXCL|O_NOFOLLOW
      merge/mrg_create.c:
        create table files with O_EXCL|O_NOFOLLOW
      myisam/mi_create.c:
        create files of temporary tables with O_EXCL|O_NOFOLLOW
      myisammrg/myrg_create.c:
        create table files with O_EXCL|O_NOFOLLOW
      mysys/mf_tempfile.c:
        create temporary files with O_EXCL|O_NOFOLLOW
      sql/ha_myisam.cc:
        let mi_create know if the table is TEMPORARY
      sql/mysql_priv.h:
        --allow_suspicious_udfs
      sql/mysqld.cc:
        --allow_suspicious_udfs
      sql/share/english/errmsg.txt:
        typo
      sql/sql_udf.cc:
        --allow_suspicious_udfs
        don't allow xxx() udf without any of xxx_init/deinit/add/reset
        check paths when loading from mysql.func
      sql/table.cc:
        create frm of temporary table with O_EXCL|O_NOFOLLOW
      8104faa0
  31. 02 Mar, 2005 1 commit
    • unknown's avatar
      Fix for BUG#8325 "Deadlock in replication thread stops replication": · d7e0784c
      unknown authored
      in slave SQL thread: if a transaction fails because of InnoDB deadlock or innodb_lock_wait_timeout exceeded,
      optionally retry the transaction a certain number of times (new variable --slave_transaction_retries).
      
      
      sql/mysql_priv.h:
        new var slave_transaction_retries
      sql/mysqld.cc:
        new variable slave_transaction_retries. Plus fixing a typo.
      sql/set_var.cc:
        new global variable slave_transaction_retries (will be one per subslave, when we have multimaster).
      sql/slave.cc:
        Slave SQL thread: if a transaction fails because of InnoDB deadlock or innodb_lock_wait_timeout exceeded,
        optionally retry the transaction a certain number of times (--slave_transaction_retries).
      sql/slave.h:
        new RELAY_LOG_INFO::trans_retries.
      d7e0784c
  32. 22 Feb, 2005 1 commit
  33. 21 Feb, 2005 1 commit
  34. 08 Feb, 2005 1 commit
    • unknown's avatar
      Fix removal of tables from cache when the database they are contained · 1de817e9
      unknown authored
      within is dropped and lower_case_table_names is set. (Bug #8355)
      
      
      mysql-test/t/lowercase_table2.test:
        Add new regression test
      mysql-test/r/lowercase_table2.result:
        Add results for regression test
      sql/mysql_priv.h:
        Change remove_db_from_cache() to use char* instead of my_string
      sql/sql_base.cc:
        Lowercase database name in remove_db_from_cache so
        that all of the correct entries are removed.
      1de817e9
  35. 30 Jan, 2005 1 commit
    • unknown's avatar
      Bug#7011 · 934fde09
      unknown authored
        Fix replication for multi-update
        new test - rpl_multi_update2
      
      
      sql/mysql_priv.h:
        Bug#7011
          New function mysql_multi_update_lock()
      sql/sql_parse.cc:
        Bug#7011
          New function check_multi_update_lock()
          For multi-update on slave, perform an early open&lock
      sql/sql_update.cc:
        Bug#7011
          Split out multi-update locking into its own function,
            mysql_multi_update_lock()
      934fde09
  36. 21 Jan, 2005 1 commit
  37. 19 Jan, 2005 1 commit
    • unknown's avatar
      Final patch for BUG#4285. · 8e1e1e73
      unknown authored
      This patch collects all previous patches into one.
      
      The main problem was due to that there is are two variables -
      dflt_key_cache and sql_key_cache with have more or less duplicate
      function. The reson for the bug was that the default value in the key
      cache hash was set to dflt_key_cache, then sql_key_cache was set to a
      new key cache object, and then dflt_key_cache was set to sql_key_cache
      which was different from the dflt_key_cache_var. After sending SIGHUP,
      the server was using the original default value for the key cache hash,
      which was different from the actual key cache object used for the
      default key cache.
      
      
      include/keycache.h:
        Import patch 4285.diff
      mysys/mf_keycache.c:
        Import patch 4285.diff
      sql/mysql_priv.h:
        Import patch 4285.diff
      sql/mysqld.cc:
        Import patch 4285.diff
      sql/set_var.cc:
        Import patch 4285.diff
      sql/sql_parse.cc:
        Import patch 4285.diff
      sql/sql_show.cc:
        Import patch 4285.diff
      8e1e1e73
  38. 18 Jan, 2005 1 commit