1. 17 May, 2007 6 commits
    • unknown's avatar
      Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.1-maint · 65cdf2a8
      unknown authored
      into  siva.hindu.god:/home/tsmith/m/bk/maint/51
      
      65cdf2a8
    • unknown's avatar
      Merge siva.hindu.god:/home/tsmith/m/bk/51 · 4206bbd2
      unknown authored
      into  siva.hindu.god:/home/tsmith/m/bk/maint/51
      
      
      client/mysqltest.c:
        Auto merged
      configure.in:
        Auto merged
      include/my_global.h:
        Auto merged
      mysql-test/mysql-test-run.pl:
        Auto merged
      mysql-test/r/type_datetime.result:
        Auto merged
      mysql-test/t/outfile.test:
        Auto merged
      mysql-test/t/type_datetime.test:
        Auto merged
      sql/field.cc:
        Auto merged
      sql/field.h:
        Auto merged
      sql/item.cc:
        Auto merged
      sql/item.h:
        Auto merged
      sql/item_cmpfunc.cc:
        Auto merged
      sql/item_func.cc:
        Auto merged
      sql/item_func.h:
        Auto merged
      sql/log.cc:
        Auto merged
      sql/my_decimal.cc:
        Auto merged
      sql/my_decimal.h:
        Auto merged
      sql/mysql_priv.h:
        Auto merged
      sql/mysqld.cc:
        Auto merged
      sql/sp.cc:
        Auto merged
      sql/sql_base.cc:
        Auto merged
      sql/sql_class.h:
        Auto merged
      sql/sql_show.cc:
        Auto merged
      sql/structs.h:
        Auto merged
      storage/myisam/ha_myisam.cc:
        Auto merged
      4206bbd2
    • unknown's avatar
      Merge damien-katzs-computer.local:/Users/dkatz/mysql50 · 862de5c7
      unknown authored
      into  damien-katzs-computer.local:/Users/dkatz/mysql51
      
      
      sql/filesort.cc:
        Auto merged
      storage/myisam/sort.c:
        Auto merged
      862de5c7
    • unknown's avatar
      Merge damien-katzs-computer.local:/Users/dkatz/mysql50 · aa7aad70
      unknown authored
      into  damien-katzs-computer.local:/Users/dkatz/50_div_zero
      
      aa7aad70
    • unknown's avatar
      Merge siva.hindu.god:/home/tsmith/m/bk/maint/50 · 7cdebad0
      unknown authored
      into  siva.hindu.god:/home/tsmith/m/bk/maint/51
      
      
      client/mysqltest.c:
        Auto merged
      BitKeeper/deleted/.del-ps_6bdb.result:
        Auto merged
      7cdebad0
    • unknown's avatar
      ps_6bdb.result: · 4c111b69
      unknown authored
        Fix bad merge of test results
      
      
      mysql-test/r/ps_6bdb.result:
        Fix bad merge of test results
      4c111b69
  2. 16 May, 2007 22 commits
    • unknown's avatar
      Bug #27119 server crash with integer division by zero during filesort on huge result · 3b7a6ae3
      unknown authored
      Added checks to detect integer overflow and fixed other bugs on the error path.
      
      
      myisam/sort.c:
        Replaced a break statement with a goto statement so that a failure will instead break
      sql/filesort.cc:
        Fixed an allocation routine to detect integer overflow, and as an optimization a check that prevents the number of buffpeks being larger than can possibly fit into memory.
            
        Fixed several unchecked error codes.
            
        Changed an index variable from int to uint to the match the type of the variable it's
        being compared with.
            
            Replaced a break statement with a goto statement so that a failure will instead break
        out of the higher level while-loop, instead of just the nested for-loop.
      3b7a6ae3
    • unknown's avatar
      Merge pilot.blaudden:/home/msvensson/mysql/mysql-4.1-maint · 5c0b5389
      unknown authored
      into  pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
      
      
      client/mysqltest.c:
        Auto merged
      5c0b5389
    • unknown's avatar
      Bug#28470 mysqltest scripts need to know protocol · a25f4d6d
      unknown authored
      
      client/mysqltest.c:
        Make it possible for test scripts to know what protocol is being used
      a25f4d6d
    • unknown's avatar
      Merge pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint · a7d187cd
      unknown authored
      into  pilot.blaudden:/home/msvensson/mysql/mysql-5.1-new-maint
      
      
      BitKeeper/deleted/.del-ps_6bdb.result:
        Auto merged
      a7d187cd
    • unknown's avatar
      Bug#21103: "DATE column not compared as DATE" · 0fe5c3f5
      unknown authored
      BDB results fixed (not p/o 5.1 fix)
      
      
      mysql-test/r/ps_6bdb.result:
        Now we get a note when we insert a datetime value into a date column
      0fe5c3f5
    • unknown's avatar
      Update to 5.1 format · 89e0b87b
      unknown authored
      89e0b87b
    • unknown's avatar
      Make a stab at events_bugs.test failure under valgrind (no · d198d8df
      unknown authored
      open bug report, reproduced in the runtime team tree).
      
      
      sql/event_data_objects.cc:
        Make a stub at fixing a race in event_bugs.test under valgrind:
        read of uninitialized byte in SHOW PROCESSLIST from an event thread.
      d198d8df
    • unknown's avatar
      Merge pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint · b9fd441c
      unknown authored
      into  pilot.blaudden:/home/msvensson/mysql/mysql-5.1-new-maint
      
      
      include/my_time.h:
        Auto merged
      mysql-test/r/date_formats.result:
        Auto merged
      mysql-test/r/func_sapdb.result:
        Auto merged
      mysql-test/r/ps_2myisam.result:
        Auto merged
      mysql-test/r/ps_3innodb.result:
        Auto merged
      mysql-test/r/ps_4heap.result:
        Auto merged
      mysql-test/r/ps_5merge.result:
        Auto merged
      mysql-test/r/ps_7ndb.result:
        Auto merged
      mysql-test/r/strict.result:
        Auto merged
      mysql-test/r/type_datetime.result:
        Auto merged
      mysql-test/t/date_formats.test:
        Auto merged
      mysql-test/t/func_sapdb.test:
        Auto merged
      mysql-test/t/type_date.test:
        Auto merged
      mysql-test/t/type_datetime.test:
        Auto merged
      sql/field.h:
        Auto merged
      sql/item.cc:
        Auto merged
      sql/item.h:
        Auto merged
      sql/item_func.h:
        Auto merged
      sql/my_decimal.cc:
        Auto merged
      sql/my_decimal.h:
        Auto merged
      sql/protocol.h:
        Auto merged
      sql/sp.cc:
        Auto merged
      sql/sql_base.cc:
        Auto merged
      sql-common/my_time.c:
        Auto merged
      sql/sql_class.h:
        Auto merged
      sql/sql_show.cc:
        Auto merged
      sql/structs.h:
        Auto merged
      sql/tztime.cc:
        Auto merged
      sql/tztime.h:
        Auto merged
      sql/unireg.cc:
        Auto merged
      mysql-test/r/type_date.result:
        Use local
      sql/field.cc:
        Use local
      sql/item_cmpfunc.cc:
        Use local
        ul
      sql/item_timefunc.cc:
        Use local
      sql/item_timefunc.h:
        Use local
      sql/mysql_priv.h:
        Use local
      sql/protocol.cc:
        Use local
      sql/time.cc:
        Use local
      b9fd441c
    • unknown's avatar
      Merge pilot.blaudden:/home/msvensson/mysql/bk_fix/mysql-5.0-maint-patch4 · d7cb19de
      unknown authored
      into  pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
      
      d7cb19de
    • unknown's avatar
      Merge pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint · 5e52b937
      unknown authored
      into  pilot.blaudden:/home/msvensson/mysql/mysql-5.1-new-maint
      
      
      client/mysqldump.c:
        Auto merged
      mysql-test/mysql-test-run.pl:
        Auto merged
      mysql-test/r/mysqldump.result:
        Use local
      5e52b937
    • unknown's avatar
      Backport of TIME->MYSQL_TIME / Y2K fixset · 509fc656
      unknown authored
         
      Made year 2000 handling more uniform
      Removed year 2000 handling out from calc_days()
      The above removes some bugs in date/datetimes with year between 0 and 200
      Now we get a note when we insert a datetime value into a date column
      For default values to CREATE, don't give errors for warning level NOTE
      Fixed some compiler failures
      Added library ws2_32 for windows compilation (needed if we want to compile with IOCP support)
      Removed duplicate typedef TIME and replaced it with MYSQL_TIME
      
      Better (more complete) fix for: Bug#21103 "DATE column not compared as DATE"
      Fixed properly Bug#18997 "DATE_ADD and DATE_SUB perform year2K autoconversion magic on 4-digit year value"
      Fixed Bug#23093 "Implicit conversion of 9912101 to date does not match cast(9912101 as date)"
       
      
      
      include/my_time.h:
        Removed not used define YY_MAGIC_BELOW
        Added prototype for year_2000_handling()
      mysql-test/r/date_formats.result:
        Updated results (fixed bug in date_format() with year < 99
      mysql-test/r/func_sapdb.result:
        Added more testing of make_date()
      mysql-test/r/ps_2myisam.result:
        Now we get a note when we insert a datetime value into a date column
      mysql-test/r/ps_3innodb.result:
        Now we get a note when we insert a datetime value into a date column
      mysql-test/r/ps_4heap.result:
        Now we get a note when we insert a datetime value into a date column
      mysql-test/r/ps_5merge.result:
        Now we get a note when we insert a datetime value into a date column
      mysql-test/r/ps_7ndb.result:
        Now we get a note when we insert a datetime value into a date column
      mysql-test/r/strict.result:
        zero-year in str_to_date() throws warning in strict
      mysql-test/r/type_date.result:
        Added test for date conversions
      mysql-test/r/type_datetime.result:
        Added testcase for datetime to date conversion.
      mysql-test/t/date_formats.test:
        Added testing of dates < 200
      mysql-test/t/func_sapdb.test:
        More testing of makedate()
      mysql-test/t/type_date.test:
        Added test for date conversions
      mysql-test/t/type_datetime.test:
        Added testcase for datetime to date conversion
      sql/field.cc:
        Give note if we insert a datetime value in a date field
        Don't give notes if we are doing internal test conversions (like from convert_constant_item())
        More documentation (store functions can now return '3' to inform that the function did return a NOTE (not warning or error))
        Revert some changes in Field_newdate::store() to get more optimal code
        Field::set_warning() will now ignore notes if CHECK_FIELD_IGNORE is set.
        New parameters to make_truncated_value_warning()
      sql/field.h:
        Give note if we insert a datetime value in a date field
        Don't give notes if we are doing internal test conversions (like from convert_constant_item())
        More documentation (store functions can now return '3' to inform that the function did return a NOTE (not warning or error))
        Revert some changes in Field_newdate::store() to get more optimal code
        Field::set_warning() will now ignore notes if CHECK_FIELD_IGNORE is set.
        New parameters to make_truncated_value_warning()
      sql/item.cc:
        Give note if we insert a datetime value in a date field
        Don't give notes if we are doing internal test conversions (like from convert_constant_item())
        More documentation (store functions can now return '3' to inform that the function did return a NOTE (not warning or error))
        Revert some changes in Field_newdate::store() to get more optimal code
        Field::set_warning() will now ignore notes if CHECK_FIELD_IGNORE is set.
        New parameters to make_truncated_value_warning()
      sql/item.h:
        TIME -> MYSQL_TIME
      sql/item_cmpfunc.cc:
        Don't print notes in convert_constant_item()
      sql/item_func.h:
        TIME -> MYSQL_TIME
      sql/item_timefunc.cc:
        New parameters to make_truncated_value_warning()
        Moved year 2000 handling out from calc_days()
      sql/item_timefunc.h:
        TIME -> MYSQL_TIME
      sql/my_decimal.cc:
        TIME -> MYSQL_TIME
      sql/my_decimal.h:
        TIME -> MYSQL_TIME
      sql/mysql_priv.h:
        Added error level to make_truncated_value_warning()
      sql/protocol.cc:
        TIME -> MYSQL_TIME
      sql/protocol.h:
        TIME -> MYSQL_TIME
      sql/sp.cc:
        TIME -> MYSQL_TIME
      sql/sql_base.cc:
        Make testing of result value of save_in_field() uniform
      sql/sql_class.h:
        TIME -> MYSQL_TIME
      sql/sql_show.cc:
        TIME -> MYSQL_TIME
      sql/structs.h:
        TIME -> MYSQL_TIME
      sql/time.cc:
        Added error level to make_truncated_value_warning()
      sql/tztime.cc:
        TIME -> MYSQL_TIME
      sql/tztime.h:
        TIME -> MYSQL_TIME
      sql/unireg.cc:
        For default values to CREATE, don't give errors for warning level NOTE
        (Fixed failed CREATE when we give a datetime value to a date field)
      sql-common/my_time.c:
        Added year_2000_handling()
        Removed year 2000 handling from calc_daynr()
      509fc656
    • unknown's avatar
      Merge pilot.blaudden:/home/msvensson/mysql/bk_fix/mysql-5.0-maint-patch3 · 9007e686
      unknown authored
      into  pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
      
      9007e686
    • unknown's avatar
      Merge bk-internal:/home/bk/mysql-5.0-maint · 8ccc55e4
      unknown authored
      into  pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
      
      8ccc55e4
    • unknown's avatar
      Merge pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint · 70b5a5b7
      unknown authored
      into  pilot.blaudden:/home/msvensson/mysql/mysql-5.1-new-maint
      
      
      configure.in:
        Auto merged
      include/my_global.h:
        Auto merged
      sql/item_func.cc:
        Auto merged
      strings/strtod.c:
        Auto merged
      70b5a5b7
    • unknown's avatar
      Bug#28223: mysqldump --compact --routines restores from @OLD_SQL_MODE w/o ever setting it · ca773904
      unknown authored
        - mysqldump generated output that set OLD_SQL_MODE twice, to different values
          (for triggers), or not at all (for routines) in some cases.
      
      
      client/mysqldump.c:
        Only save SQL_MODE in dump_triggers if in --compact mode. Otherwise,
        it's already been saved in write_header(). Likewise for dumpe_routines,
        where it was never saved.
      mysql-test/r/mysqldump.result:
        mysqldump output has subtly changed. Adjust test-results. This also shows
        OLD_SQL_MODE is always set exactly once now
      ca773904
    • unknown's avatar
      Fix for bug #28240: "isinf()" cannot be used in C++ for lack of prototype · a8fa3f14
      unknown authored
      - Since isinf() portability across various platforms and
        compilers is a complicated question, we should not use
        it directly. Instead, the my_isinf() macro should be used,
        which is defined as an alias to the system-defined isinf()
        if it is safe to use, or a workaround implementation otherwise
      
      
      configure.in:
        Added a check to define HAVE_ISINF only if it can be used
        in C++ code as well.
      include/my_global.h:
        Define my_isinf() as an alias to isinf(), if it is available
        in both C and C++ code. Otherwise, define it to a workaround
        implementation.
      sql/item_func.cc:
        Replaced isinf() with my_isinf().
      strings/strtod.c:
        Replaced isinf() with my_isinf().
      a8fa3f14
    • unknown's avatar
      Merge vajra.(none):/opt/local/work/mysql-5.0-21483 · efe44813
      unknown authored
      into  vajra.(none):/opt/local/work/mysql-5.1-21483
      
      
      sql/sql_insert.cc:
        Auto merged
      efe44813
    • unknown's avatar
      Fix a failing assert. · e7ec12f7
      unknown authored
      
      sql/sql_insert.cc:
        Do not access delayed thread memory without a mutex.
      e7ec12f7
    • unknown's avatar
      Correct a merge error. · 28fb78f1
      unknown authored
      
      sql/sql_insert.cc:
        Correct a merge error (wrong declaration was used).
      28fb78f1
    • unknown's avatar
      Merge vajra.(none):/opt/local/work/mysql-5.0-21483 · 0744fa5c
      unknown authored
      into  vajra.(none):/opt/local/work/mysql-5.1-21483
      
      
      sql/sp_head.cc:
        Auto merged
      sql/sql_base.cc:
        Auto merged
      sql/sql_lex.h:
        Auto merged
      mysql-test/r/insert.result:
        Manual merge.
      mysql-test/t/insert.test:
        Manual merge.
      sql/sql_insert.cc:
        Manual merge.
      0744fa5c
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime · a2cb3dfd
      unknown authored
      into  vajra.(none):/opt/local/work/mysql-5.0-21483
      
      
      sql/sp_head.cc:
        Auto merged
      sql/sql_base.cc:
        Auto merged
      sql/sql_insert.cc:
        Auto merged
      sql/sql_lex.h:
        Auto merged
      a2cb3dfd
    • unknown's avatar
      A fix and a test case for · 4adc007e
      unknown authored
      Bug#21483 "Server abort or deadlock on INSERT DELAYED with another
      implicit insert"
      Also fixes and adds test cases for bugs:
      20497 "Trigger with INSERT DELAYED causes Error 1165"
      21714 "Wrong NEW.value and server abort on INSERT DELAYED to a
      table with a trigger".
      Post-review fixes.
      
      Problem:
      In MySQL INSERT DELAYED is a way to pipe all inserts into a
      given table through a dedicated thread. This is necessary for
      simplistic storage engines like MyISAM, which do not have internal
      concurrency control or threading and thus can not
      achieve efficient INSERT throughput without support from SQL layer.
      DELAYED INSERT works as follows:
      For every distinct table, which can accept DELAYED inserts and has
      pending data to insert, a dedicated thread is created to write data
      to disk. All user connection threads that attempt to
      delayed-insert into this table interact with the dedicated thread in
      producer/consumer fashion: all records to-be inserted are pushed
      into a queue of the dedicated thread, which fetches the records and 
      writes them.
      In this design, client connection threads never open or lock
      the delayed insert table.
      This functionality was introduced in version 3.23 and does not take 
      into account existence of triggers, views, or pre-locking.
      E.g. if INSERT DELAYED is called from a stored function, which,
      in turn, is called from another stored function that uses the delayed
      table, a deadlock can occur, because delayed locking by-passes
      pre-locking. Besides:
       * the delayed thread works directly with the subject table through
         the storage engine API and does not invoke triggers
       * even if it was patched to invoke triggers, if triggers,
         in turn, used other tables, the delayed thread would
         have to open and lock involved tables (use pre-locking).
       * even if it was patched to use pre-locking, without deadlock
         detection the delayed thread could easily lock out user 
         connection threads in case when the same table is used both
         in a trigger and on the right side of the insert query: 
         the delayed thread would not release locks until all inserts 
         are complete, and user connection can not complete inserts 
         without having locks on the tables used on the right side of the
         query.
      
      Solution:
      
      These considerations suggest two general alternatives for the
      future of INSERT DELAYED:
       * it is considered a full-fledged alternative to normal INSERT
       * it is regarded as an optimisation that is only relevant 
         for simplistic engines.
      Since we missed our chance to provide complete support of new
      features when 5.0 was in development, the first alternative
      currently renders infeasible.
      However, even the second alternative, which is to detect
      new features and convert DELAYED insert into a normal insert, 
      is not easy to implement.
      The catch-22 is that we don't know if the subject table has triggers
      or is a view before we open it, and we only open it in the
      delayed thread. We don't know if the query involves pre-locking
      until we have opened all tables, and we always first create
      the delayed thread, and only then open the remaining tables.
      This patch detects the problematic scenarios and converts
      DELAYED INSERT to a normal INSERT using the following approach:
       * if the statement is executed under pre-locking (e.g. from
         within a stored function or trigger) or the right
         side may require pre-locking, we detect the situation
         before creating a delayed insert thread and convert the statement
         to a conventional INSERT.
        * if the subject table is a view or has triggers, we shutdown
         the delayed thread and convert the statement to a conventional
         INSERT.
      
      
      mysql-test/r/insert.result:
        Update test results.
      mysql-test/t/insert.test:
        Add a test case for Bug#21483, Bug#20497, Bug#21714 (INSERT DELAYED
        and stored routines, triggers).
      sql/sp_head.cc:
        Upgrade lock type to TL_WRITE when computing the pre-locking set.
      sql/sql_base.cc:
        Use a new method.
      sql/sql_insert.cc:
        INSERT DELAYED and pre-locking:
        - if  under pre-locking, upgrade the lock type to TL_WRITE
        and proceed as a normal write
        - if DELAYED table has triggers, also request a lock upgrade.
        - make sure errors in the delayed thread are propagated
        correctly
      sql/sql_lex.h:
        Add a method to check if a parsed tree refers to stored
        routines.
      4adc007e
  3. 15 May, 2007 12 commits