An error occurred fetching the project authors.
  1. 26 Nov, 2007 1 commit
  2. 23 Nov, 2007 1 commit
  3. 16 Nov, 2007 1 commit
    • mkindahl@dl145h.mysql.com's avatar
      Bug#32435: · e0ae1050
      mkindahl@dl145h.mysql.com authored
      DROP DATABASE statement writes changes to mysql.proc table under RBR
      
      When replicating a DROP DATABASE statement with a database holding
      stored procedures, the changes to the mysql.proc table was recorded
      in the binary log under row-based replication.
      
      With this patch, the thread uses statement-logging format for the
      duration of the DROP DATABASE statement. The logging format is
      (already) reset at the end of the statement, so no additional code
      for resetting the logging format is necessary.
      e0ae1050
  4. 10 Sep, 2007 1 commit
  5. 31 Aug, 2007 1 commit
    • anozdrin/alik@ibm.opbmk's avatar
      Fix for BUG#25843: changing default database between PREPARE and EXECUTE · d6f94b06
      anozdrin/alik@ibm.opbmk authored
      of statement breaks binlog.
      
      There were two problems discovered by this bug:
      
        1. Default (current) database is not fixed at the creation time.
           That leads to wrong output of DATABASE() function.
      
        2. Database attributes (@@collation_database) are not fixed at
           the creation time. That leads to wrong resultset.
      
      Binlog breakage and Query Cache wrong output happened because of
      the first problem.
      
      The fix is to remember the current database at the PREPARE-time and
      set it each time at EXECUTE.
      d6f94b06
  6. 30 Aug, 2007 1 commit
  7. 15 Aug, 2007 1 commit
  8. 13 Aug, 2007 1 commit
    • monty@mysql.com/nosik.monty.fi's avatar
      Fixed a lot of compiler warnings and errors detected by Forte C++ on Solaris · e53a73e2
      monty@mysql.com/nosik.monty.fi authored
      Faster thr_alarm()
      Added 'Opened_files' status variable to track calls to my_open()
      Don't give warnings when running mysql_install_db
      Added option --source-install to mysql_install_db
      
      I had to do the following renames() as used polymorphism didn't work with Forte compiler on 64 bit systems
      index_read()      -> index_read_map()
      index_read_idx()  -> index_read_idx_map()
      index_read_last() -> index_read_last_map()
      e53a73e2
  9. 13 Jul, 2007 1 commit
    • kostja@bodhi.(none)'s avatar
      A follow up after the patch for Bug#21074 - even though · f5267530
      kostja@bodhi.(none) authored
      we now have exclusive name lock on the table name in mysql_rm_table_part2,
      we still should keep LOCK_open - some storage engines are not
      ready for locking scope change and assume that LOCK_open is kept.
      Still, the binary logging and query cache invalidation calls
      moved out of LOCK_open scope.
      Fixes some of the broken 5.1-runtime tests (tests break on asserts).
      f5267530
  10. 04 Jul, 2007 1 commit
    • kostja@bodhi.(none)'s avatar
      A fix and a teset case for Bug#28551 The warning · c3f37e0b
      kostja@bodhi.(none) authored
      'No database selected' is reported when calling stored procedures
      
      Remove the offending warning introduced by the fix for Bug
      25082
      This minimal patch relies on the intrinsic knowledge of the fact that
      mysql_change_db is never called with 'force_switch' set to TRUE
      when such a warning may be needed:
       * every stored routine belongs to a database (unlike, e.g., a 
      user defined function, which does not), so if we're activating the
      database of a stored routine, it can never be NULL.
      Therefore, this branch is never called for activation.
       * if we're restoring the 'old' current database after routine
      execution is complete, we should not issue a warning, since it's OK to 
      call a routine without having previously selected the current database.
      
      TODO: 'force_switch' is an ambiguous flag, since we do not actually
      have to 'force' the switch in case of stored routines at all.
      When we activate the routine's database, we should perform
      all the checks as in case of 'use db', and so we already do (in this
      case 'force_switch' is unused).
      When we load a routine into cache, we should not use mysql_change_db
      at all, since there it's enough to call thd->reset_db(). We
      do it this way for triggers, but code for routines is different (wrongly). 
      
      TODO: bugs are lurking in replication, since it bypasses mysql_change_db
      and calls thd->[re_]set_db to set the current database.
      The latter does not change thd->db_charset, thd->sctx->db_access
      and thd->variables.collation_database (and this may have nasty side
      effects).
      
      These todo items are to be addressed in a separate patch, if at all.
      c3f37e0b
  11. 02 Jul, 2007 1 commit
  12. 14 Jun, 2007 1 commit
    • anozdrin/alik@ibm.'s avatar
      This the 4-th patch in scope of CS patch (BUG#11986). · 62e3e462
      anozdrin/alik@ibm. authored
      The patch contains the following changes:
        - Introduce auxilary functions to convenient work with character sets:
          - resolve_charset();
          - resolve_collation();
          - get_default_db_collation();
        - Introduce lex_string_set();
        - Refactor Table_trigger_list::process_triggers() &
          sp_head::execute_trigger() to be consistent with other code;
        - Move reusable code from add_table_for_trigger() into
          build_trn_path(), check_trn_exists() and load_table_name_for_trigger()
          to be used in the following patch.
        - Rename triggers_file_ext and trigname_file_ext into TRN_EXT and
          TRG_EXT respectively.
      62e3e462
  13. 28 May, 2007 1 commit
  14. 10 May, 2007 1 commit
    • monty@mysql.com/narttu.mysql.fi's avatar
      WL#3817: Simplify string / memory area types and make things more consistent (first part) · 088e2395
      monty@mysql.com/narttu.mysql.fi authored
      The following type conversions was done:
      
      - Changed byte to uchar
      - Changed gptr to uchar*
      - Change my_string to char *
      - Change my_size_t to size_t
      - Change size_s to size_t
      
      Removed declaration of byte, gptr, my_string, my_size_t and size_s. 
      
      Following function parameter changes was done:
      - All string functions in mysys/strings was changed to use size_t
        instead of uint for string lengths.
      - All read()/write() functions changed to use size_t (including vio).
      - All protocoll functions changed to use size_t instead of uint
      - Functions that used a pointer to a string length was changed to use size_t*
      - Changed malloc(), free() and related functions from using gptr to use void *
        as this requires fewer casts in the code and is more in line with how the
        standard functions work.
      - Added extra length argument to dirname_part() to return the length of the
        created string.
      - Changed (at least) following functions to take uchar* as argument:
        - db_dump()
        - my_net_write()
        - net_write_command()
        - net_store_data()
        - DBUG_DUMP()
        - decimal2bin() & bin2decimal()
      - Changed my_compress() and my_uncompress() to use size_t. Changed one
        argument to my_uncompress() from a pointer to a value as we only return
        one value (makes function easier to use).
      - Changed type of 'pack_data' argument to packfrm() to avoid casts.
      - Changed in readfrm() and writefrom(), ha_discover and handler::discover()
        the type for argument 'frmdata' to uchar** to avoid casts.
      - Changed most Field functions to use uchar* instead of char* (reduced a lot of
        casts).
      - Changed field->val_xxx(xxx, new_ptr) to take const pointers.
      
      Other changes:
      - Removed a lot of not needed casts
      - Added a few new cast required by other changes
      - Added some cast to my_multi_malloc() arguments for safety (as string lengths
        needs to be uint, not size_t).
      - Fixed all calls to hash-get-key functions to use size_t*. (Needed to be done
        explicitely as this conflict was often hided by casting the function to
        hash_get_key).
      - Changed some buffers to memory regions to uchar* to avoid casts.
      - Changed some string lengths from uint to size_t.
      - Changed field->ptr to be uchar* instead of char*. This allowed us to
        get rid of a lot of casts.
      - Some changes from true -> TRUE, false -> FALSE, unsigned char -> uchar
      - Include zlib.h in some files as we needed declaration of crc32()
      - Changed MY_FILE_ERROR to be (size_t) -1.
      - Changed many variables to hold the result of my_read() / my_write() to be
        size_t. This was needed to properly detect errors (which are
        returned as (size_t) -1).
      - Removed some very old VMS code
      - Changed packfrm()/unpackfrm() to not be depending on uint size
        (portability fix)
      - Removed windows specific code to restore cursor position as this
        causes slowdown on windows and we should not mix read() and pread()
        calls anyway as this is not thread safe. Updated function comment to
        reflect this. Changed function that depended on original behavior of
        my_pwrite() to itself restore the cursor position (one such case).
      - Added some missing checking of return value of malloc().
      - Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid 'long' overflow.
      - Changed type of table_def::m_size from my_size_t to ulong to reflect that
        m_size is the number of elements in the array, not a string/memory
        length.
      - Moved THD::max_row_length() to table.cc (as it's not depending on THD).
        Inlined max_row_length_blob() into this function.
      - More function comments
      - Fixed some compiler warnings when compiled without partitions.
      - Removed setting of LEX_STRING() arguments in declaration (portability fix).
      - Some trivial indentation/variable name changes.
      - Some trivial code simplifications:
        - Replaced some calls to alloc_root + memcpy to use
          strmake_root()/strdup_root().
        - Changed some calls from memdup() to strmake() (Safety fix)
        - Simpler loops in client-simple.c
      088e2395
  15. 05 Apr, 2007 1 commit
    • kostja@vajra.(none)'s avatar
      A set of changes aiming to make the Event Scheduler more user-friendly · 98db2300
      kostja@vajra.(none) authored
      when there are no up-to-date system tables to support it:
       - initialize the scheduler before reporting "Ready for connections".
         This ensures that warnings, if any, are printed before "Ready for
         connections", and this message is not mangled.
       - do not abort the scheduler if there are no system tables
       - check the tables once at start up, remember the status and disable
         the scheduler if the tables are not up to date.
         If one attempts to use the scheduler with bad tables,
         issue an error message.
       - clean up the behaviour of the module under LOCK TABLES and pre-locking
         mode
       - make sure implicit commit of Events DDL works as expected.
       - add more tests
      
      
      Collateral clean ups in the events code.
      
      This patch fixes Bug#23631 Events: SHOW VARIABLES doesn't work 
      when mysql.event is damaged
      98db2300
  16. 03 Apr, 2007 1 commit
    • anozdrin/alik@ibm.opbmk's avatar
      Fix for BUG#27337: Privileges are not properly restored. · 5441aefd
      anozdrin/alik@ibm.opbmk authored
      The problem was that THD::db_access variable was not restored after
      database switch in stored-routine-execution code.
      
      The fix is to restore THD::db_access in this case.
      
      Unfortunately, this fix requires additional changes,
      because in prepare_schema_table(), called on the parsing stage, we checked
      privileges. That was wrong according to our design, but this flaw haven't
      struck so far, because it was masked. All privilege checkings must be
      done on the execution stage in order to be compatible with prepared statements
      and stored routines. So, this patch also contains patch for
      prepare_schema_table(), which moves the checkings to the execution phase.
      5441aefd
  17. 29 Mar, 2007 1 commit
  18. 27 Mar, 2007 1 commit
    • anozdrin/alik@alik.opbmk's avatar
      Fix for BUG#25082: default database change on trigger · cc83bb07
      anozdrin/alik@alik.opbmk authored
      execution breaks replication.
      
      When a stored routine is executed, we switch current
      database to the database, in which the routine
      has been created. When the stored routine finishes,
      we switch back to the original database.
      
      The problem was that if the original database does not
      exist (anymore) after routine execution, we raised an error.
      
      The fix is to report a warning, and switch to the NULL database.
      cc83bb07
  19. 23 Dec, 2006 1 commit
  20. 30 Nov, 2006 2 commits
    • monty@mysql.com/narttu.mysql.fi's avatar
      Fixed portability issue in my_thr_init.c (was added in my last push) · 3d409560
      monty@mysql.com/narttu.mysql.fi authored
      Fixed compiler warnings (detected by VC++):
      - Removed not used variables
      - Added casts
      - Fixed wrong assignments to bool
      - Fixed wrong calls with bool arguments
      - Added missing argument to store(longlong), which caused wrong store method to be called.
      3d409560
    • monty@mysql.com/narttu.mysql.fi's avatar
      Fixed compiler warnings (Mostly VC++): · 3a35c300
      monty@mysql.com/narttu.mysql.fi authored
      - Removed not used variables
      - Changed some ulong parameters/variables to ulonglong (possible serious bug)
      - Added casts to get rid of safe assignment from longlong to long (and similar)
      - Added casts to function parameters
      - Fixed signed/unsigned compares
      - Added some constructores to structures
      - Removed some not portable constructs
      
      Better fix for bug Bug #21428 "skipped 9 bytes from file: socket (3)" on "mysqladmin shutdown"
      (Added new parameter to net_clear() to define when we want the communication buffer to be emptied)
      3a35c300
  21. 16 Oct, 2006 1 commit
  22. 03 Oct, 2006 1 commit
    • cmiller@zippy.cornsilk.net's avatar
      Bug #14262: SP: DROP PROCEDURE|VIEW (maybe more) write to binlog too late \ · 5512100c
      cmiller@zippy.cornsilk.net authored
      	(race cond)
      
      It was possible for one thread to interrupt a Data Definition Language 
      statement and thereby get messages to the binlog out of order.  Consider:
      
      Connection 1: Drop Foo x
      Connection 2: Create or replace Foo x
      Connection 2: Log "Create or replace Foo x"
      Connection 1: Log "Drop Foo x"
      
      Local end would have Foo x, but the replicated slaves would not.
      
      The fix for this is to wrap all DDL and logging of a kind in the same mutex.  
      Since we already use mutexes for the various parts of altering the server, 
      this only entails moving the logging events down close to the action, inside 
      the mutex protection.
      5512100c
  23. 17 Aug, 2006 1 commit
  24. 14 Aug, 2006 1 commit
  25. 02 Aug, 2006 1 commit
    • ingo/istruewing@chilla.local's avatar
      Bug#18775 - Temporary table from alter table visible to other threads · 8e4c36ad
      ingo/istruewing@chilla.local authored
      Continued implementation of WL#1324 (table name to filename encoding)
      
      The intermediate (not temporary) files of the new table
      during ALTER TABLE was visible for SHOW TABLES. These
      intermediate files are copies of the original table with
      the changes done by ALTER TABLE. After all the data is
      copied over from the original table, these files are renamed 
      to the original tables file names. So they are not temporary 
      files. They persist after ALTER TABLE, but just with another 
      name.
      
      In 5.0 the intermediate files are invisible for SHOW TABLES
      because all file names beginning with "#sql" were suppressed.
      
      This failed since 5.1.6 because even temporary table names were
      converted when making file names from them. The prefix became
      converted to "@0023sql". Converting the prefix during SHOW TABLES
      would suppress the listing of user tables that start with "#sql".
      
      The solution of the problem is to continue the implementation of
      the table name to file name conversion feature. One requirement
      is to suppress the conversion for temporary table names.
      
      This change is straightforward for real temporary tables as there
      is a function that creates temporary file names.
      
      But the generated path names are located in TMPDIR and have no
      relation to the internal table name. This cannot be used for
      ALTER TABLE. Its intermediate files need to be in the same
      directory as the old table files. And it is necessary to be
      able to deduce the same path from the same table name repeatedly.
      
      Consequently the intermediate table files must be handled like normal
      tables. Their internal names shall start with tmp_file_prefix
      (#sql) and they shall not be converted like normal table names.
      
      I added a flags parameter to all relevant functions that are
      called from ALTER TABLE. It is used to suppress the conversion
      for the intermediate table files.
      
      The outcome is that the suppression of #sql in SHOW TABLES
      works again. It does not suppress user tables as these are
      converted to @0023sql on file level.
      
      This patch does also fix ALTER TABLE ... RENAME, which could not 
      rename a table with non-ASCII characters in its name.
      
      It does also fix the problem that a user could create a table like
      `#sql-xxxx-yyyy`, where xxxx is mysqld's pid and yyyy is the thread
      ID of some other thread, which prevented this thread from running 
      ALTER TABLE.
      
      Some of the above problems are mentioned in Bug 1405, which can
      be closed with this patch.
      
      This patch does also contain some minor fixes for other forgotten
      conversions. Still known problems are reported as bugs 21370,
      21373, and 21387.
      8e4c36ad
  26. 27 Jul, 2006 1 commit
    • anozdrin/alik@booka.'s avatar
      Fix for BUG#16211: Stored function return type for strings is ignored. · b7f403b5
      anozdrin/alik@booka. authored
      Fix for BUG#16676: Database CHARSET not used for stored procedures
      
      The problem in BUG#16211 is that CHARSET-clause of the return type for
      stored functions is just ignored.
      
      The problem in BUG#16676 is that if character set is not explicitly
      specified for sp-variable, the server character set is used instead
      of the database one.
      
      The fix has two parts:
      
        - always store CHARSET-clause of the return type along with the
          type definition in mysql.proc.returns column. "Always" means that
          CHARSET-clause is appended even if it has not been explicitly
          specified in CREATE FUNCTION statement (this affects BUG#16211 only).
      
          Storing CHARSET-clause if it is not specified is essential to avoid
          changing character set if the database character set is altered in
          the future.
      
          NOTE: this change is not backward compatible with the previous releases.
      
        - use database default character set if CHARSET-clause is not explicitly
          specified (this affects both BUG#16211 and BUG#16676).
      
          NOTE: this also breaks backward compatibility.
      b7f403b5
  27. 28 Jun, 2006 1 commit
    • konstantin@mysql.com's avatar
      A fix for Bug#19022 "Memory bug when switching db during trigger execution". · 55d148c5
      konstantin@mysql.com authored
      No test case as the bug is in an existing test case (rpl_trigger.test
      when it is run under valgrind).
      The warning was caused by memory corruption in replication slave: thd->db
      was pointing at a stack address that was previously used by 
      sp_head::execute()::old_db. This happened because mysql_change_db
      behaved differently in replication slave and did not make a copy of the 
      argument to assign to thd->db. 
      The solution is to always free the old value of thd->db and allocate a new
      copy, regardless whether we're running in a replication slave or not.
      55d148c5
  28. 27 Jun, 2006 1 commit
    • andrey@lmy004.'s avatar
      WL#3337 (Events new architecture) · 9309fae9
      andrey@lmy004. authored
      5th cut, moved DB related code to Event_db_repository and
      updated accordingly the remanining code.
      Moved change/restore_security_context() to class THD
      Removed events_priv.h
      Next step is to reorganize create/update_event() and parsing for them.
      But probably some other refactoring could be done in the meanwhile.
      The changes so far pass the test suite.
      9309fae9
  29. 26 Jun, 2006 1 commit
    • konstantin@mysql.com's avatar
      A fix and a test case for · 117b76a5
      konstantin@mysql.com authored
       Bug#19022 "Memory bug when switching db during trigger execution"
       Bug#17199 "Problem when view calls function from another database."
       Bug#18444 "Fully qualified stored function names don't work correctly in
                  SELECT statements"
      
       Documentation note: this patch introduces a change in behaviour of prepared
       statements.
      
       This patch adds a few new invariants with regard to how THD::db should
       be used. These invariants should be preserved in future:
      
        - one should never refer to THD::db by pointer and always make a deep copy
          (strmake, strdup)
        - one should never compare two databases by pointer, but use strncmp or
          my_strncasecmp
        - TABLE_LIST object table->db should be always initialized in the parser or
          by creator of the object.
      
          For prepared statements it means that if the current database is changed
          after a statement is prepared, the database that was current at prepare
          remains active. This also means that you can not prepare a statement that
          implicitly refers to the current database if the latter is not set.
          This is not documented, and therefore needs documentation. This is NOT a
          change in behavior for almost all SQL statements except:
           - ALTER TABLE t1 RENAME t2 
           - OPTIMIZE TABLE t1
           - ANALYZE TABLE t1
           - TRUNCATE TABLE t1 --
           until this patch t1 or t2 could be evaluated at the first execution of
           prepared statement. 
      
           CURRENT_DATABASE() still works OK and is evaluated at every execution
           of prepared statement.
      
           Note, that in stored routines this is not an issue as the default
           database is the database of the stored procedure and "use" statement
           is prohibited in stored routines.
      
        This patch makes obsolete the use of check_db_used (it was never used in the
        old code too) and all other places that check for table->db and assign it
        from THD::db if it's NULL, except the parser.
      
       How this patch was created: THD::{db,db_length} were replaced with a
       LEX_STRING, THD::db. All the places that refer to THD::{db,db_length} were
       manually checked and:
        - if the place uses thd->db by pointer, it was fixed to make a deep copy
        - if a place compared two db pointers, it was fixed to compare them by value
          (via strcmp/my_strcasecmp, whatever was approproate)
       Then this intermediate patch was used to write a smaller patch that does the
       same thing but without a rename.
      
       TODO in 5.1:
         - remove check_db_used
         - deploy THD::set_db in mysql_change_db
      
       See also comments to individual files.
      117b76a5
  30. 08 Jun, 2006 1 commit
    • andrey@lmy004.'s avatar
      Reorganize, physically the events code · 1d1e9d10
      andrey@lmy004. authored
      Unify method naming -> create/update/drop_event
      Move class Event_timed to event_timed.h
      class Events is in events.h (renamed from event.h)
      The implementation is in events.cc (renamed from event.h)
      1d1e9d10
  31. 29 May, 2006 1 commit
    • ingo@mysql.com's avatar
      Bug#19815 - CREATE/RENAME/DROP DATABASE can deadlock on a global read lock · d00441e3
      ingo@mysql.com authored
      The order of acquiring LOCK_mysql_create_db
      and wait_if_global_read_lock() was wrong. It could happen
      that a thread held LOCK_mysql_create_db while waiting for
      the global read lock to be released. The thread with the
      global read lock could try to administrate a database too.
      It would first try to lock LOCK_mysql_create_db and hang...
      
      The check if the current thread has the global read lock
      is done in wait_if_global_read_lock(), which could not be
      reached because of the hang in LOCK_mysql_create_db.
      
      Now I exchanged the order of acquiring LOCK_mysql_create_db
      and wait_if_global_read_lock(). This makes 
      wait_if_global_read_lock() fail with an error message for
      the thread with the global read lock. No deadlock happens.
      d00441e3
  32. 22 May, 2006 1 commit
    • andrey@lmy004.'s avatar
      fix for bug #17619 Scheduler race conditions · b429d73d
      andrey@lmy004. authored
      - Scheduler is either initialized at server start or never.
        Starting & stopping is now suspending & resuming.
      - The scheduler has clear OO interface
      - Now all calls to the scheduler are synchronous
      - GLOBAL event_scheduler uses thd::sys_var_tmp (see set_var.cc)
      - External API is encapsulated into class Events
      - Includes fixes for all comments of Kostja's review of 19.05.2005
      
      Starting to merge into 5.1-release (5.1.10) and push
      b429d73d
  33. 18 May, 2006 2 commits
    • bar@mysql.com's avatar
      sql_db.cc: · bcb2ceec
      bar@mysql.com authored
        Bug#19392: Rename Database: Crash if case change
        Additional minor fix, to avoid compiler warnings.
      bcb2ceec
    • bar@mysql.com's avatar
      Bug#19392 Rename Database: Crash if case change · 53bc4d51
      bar@mysql.com authored
      Problem:
      Renaming a database to itself crashed server.
      It hapenned because of wrong DBUG_ASSERT.
      Fix: removing wrong DBUG_ASSERT. Now it reports
      a correct error message "database alreadt exists".
      53bc4d51
  34. 01 Mar, 2006 1 commit
  35. 25 Feb, 2006 3 commits
  36. 15 Feb, 2006 1 commit