1. 17 Jan, 2011 2 commits
    • He Zhenxing's avatar
      BUG#57953 my_load_defaults return junk argument ----args-separator---- to caller · 96e952ee
      He Zhenxing authored
      After fix of bug#25192, load_defaults() will add an args separator
      to distinguish options loaded from configure files from that provided
      in the command line. One problem of this is that the args separator
      would be added no matter the application need it or not.
      
      Fixed the problem by adding an option:
        bool my_getopt_use_args_separator;
      to control whether the separator will be added or not. And also
      added functions:
        bool my_getopt_is_args_separator(const char* arg);
      to check if the argument is the separator or not.
      96e952ee
    • John H. Embretsen's avatar
      Fix for Bug#45730 - Test case disabled in show_check.test due to WL#1324. · b4f4ce23
      John H. Embretsen authored
      Enabled test snippet for bug 4374, tested on Mac OS X 10.6 as well as Solaris.
      Moved test snippet to a different place in the file, in order to avoid having 
      to save and restore "SET NAMES" setting. New surroundings expect latin1, as is 
      used in the testsnippet.
      
      An extra copy of the commented test snippet is removed, a comment is added,
      SQL keywords are converted to uppercase, and engine name "heap" is updated to 
      "Memory".
      
      Also added Copyright statement and a notice about the file's encoding(s).
      b4f4ce23
  2. 16 Jan, 2011 1 commit
    • Nirbhay Choubey's avatar
      Bug#58139 : default-auth option not recognized in MySQL standard · 25f433bd
      Nirbhay Choubey authored
                  command line clients.
      
      Postfix covering other mysql standard clients like mysql_upgrade,
      mysqlbinlog, mysqlcheck, mysqlimport, mysqlshow and mysqlslap.
      
      
      client/client_priv.h:
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients
        
        Added an entry for 'default-auth' option.
      client/mysql.cc:
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients
        
        Updated the id entry for default_auth option.
      client/mysql_upgrade.c:
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients.
        
        Introduced two new variables to hold values from default-auth and
        plugin-dir options and further pushed them to client's st_mysql
        instance.
      client/mysqladmin.cc:
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients
        
        Updated the id entry for default_auth option.
      client/mysqlbinlog.cc:
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients.
        
        Introduced two new variables to hold values from default-auth and
        plugin-dir options and further pushed them to client's st_mysql
        instance.
      client/mysqlcheck.c:
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients.
        
        Introduced two new variables to hold values from default-auth and
        plugin-dir options and further pushed them to client's st_mysql
        instance.
      client/mysqldump.c:
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients
        
        Updated the id entry for default_auth option.
      client/mysqlimport.c:
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients.
        
        Introduced two new variables to hold values from default-auth and
        plugin-dir options and further pushed them to client's st_mysql
        instance.
      client/mysqlshow.c:
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients.
        
        Introduced two new variables to hold values from default-auth and
        plugin-dir options and further pushed them to client's st_mysql
        instance.
      client/mysqlslap.c:
        Bug#58139 : default-auth option not recognized in MySQL standard
                    command line clients.
        
        Introduced two new variables to hold values from default-auth and
        plugin-dir options and further pushed them to client's st_mysql
        instance.
      mysql-test/r/plugin_auth.result:
        Added test case for Bug#58139 for mysql_upgrade.
      mysql-test/t/plugin_auth.test:
        Added test case for Bug#58139 for mysql_upgrade.
      25f433bd
  3. 15 Jan, 2011 5 commits
    • Nirbhay Choubey's avatar
    • Nirbhay Choubey's avatar
      Bug#58221 : mysqladmin --sleep=x --count=x keeps looping · c884d136
      Nirbhay Choubey authored
      When mysqldadmin is run with sleep and count options,
      it goes into an infinite loop and keeps executing the
      specified command.
      
      This happened because the statement, responsible for
      decrementing the count value, was missing.
      
      Fixed by adding a statement which will decrement the
      count value for each iteration.
      
      
      client/mysqladmin.cc:
        Bug#58221 : mysqladmin --sleep=x --count=x keeps looping
        
        Added a condition to check and decrement the count
        value stored in nr_iterations per iteration.
      mysql-test/r/mysqladmin.result:
        Added a testcase for Bug#58221.
      mysql-test/t/mysqladmin.test:
        Added a testcase for Bug#58221.
      c884d136
    • unknown's avatar
      Auto merge · bd3daafb
      unknown authored
      bd3daafb
    • unknown's avatar
      Null merge from 5.0 · d69860ea
      unknown authored
      It is a backported patch.
      d69860ea
    • unknown's avatar
      BUG#49124 Security issue with /*!-versioned */ SQL statements on Slave · 263e63a4
      unknown authored
      Backport to 5.0.
      
      /*![:version:] Query Code */, where [:version:] is a sequence of 5 
      digits representing the mysql server version(e.g /*!50200 ... */),
      is a special comment that the query in it can be executed on those 
      servers whose versions are larger than the version appearing in the 
      comment. It leads to a security issue when slave's version is larger 
      than master's. A malicious user can improve his privileges on slaves. 
      Because slave SQL thread is running with SUPER privileges, so it can
      execute queries that he/she does not have privileges on master.
            
      This bug is fixed with the logic below: 
      - To replace '!' with ' ' in the magic comments which are not applied on
        master. So they become common comments and will not be applied on slave.
            
      - Example:
        'INSERT INTO t1 VALUES (1) /*!10000, (2)*/ /*!99999 ,(3)*/
         will be binlogged as
        'INSERT INTO t1 VALUES (1) /*!10000, (2)*/ /* 99999 ,(3)*/
      263e63a4
  4. 14 Jan, 2011 13 commits
    • Alexey Botchkov's avatar
      Bug#46393 If for slow_query_log a string is entered it does not complain. · cd7de761
      Alexey Botchkov authored
              For all the boolean system variables we now issue warnings if the
              value wasn't recognized. Before that we just silently set them
              to FALSE in this case.
      
      per-file comments:
        mysys/my_getopt.c
      Bug #46393 If for slow_query_log a string is entered it does not complain.
              warning issued if no documented value was specified.
      cd7de761
    • Alexey Botchkov's avatar
      merging. · 97a0bbbf
      Alexey Botchkov authored
      97a0bbbf
    • Alexey Botchkov's avatar
      Bug#52208 gis fails on some platforms (Solaris, HP-UX, Linux) · 9e8935eb
      Alexey Botchkov authored
              IA64 and some other arcitectures use different float rounding mode and
              i find no decent way to make it consistent.
              So the test changed to be insensitive to this.
      
      per-file messages:
        mysql-test/t/gis.test
      Bug#52208      gis fails on some platforms (Solaris, HP-UX, Linux)
              --replace_result added
      9e8935eb
    • Nirbhay Choubey's avatar
      Bug#13618 : mysqldump --xml omits comment on table field · aeda5996
      Nirbhay Choubey authored
      When mysqldump tries to dump information in xml format,
      the result does not contain field level comments.
      
      In order to retrieve various informations for a field/column,
      mysqldump currently uses 'show fields from <tab>' statement.
      The attributes returned by the statement lacks the information
      regarding field comments.
      
      Fixed by changing the query to one that probes I_S to retrieve
      required field informations, including the field comment.
      
      
      client/mysqldump.c:
        Bug#13618 : mysqldump --xml omits comment on table field.
        
        Replaced the 'show fields' command by a statement that
        queries I_S, in order to retrieve information on all the
        attributes that 'show fields' returns along-with an additional
        column_comment information.
      mysql-test/r/client_xml.result:
        Result modifications for bug#13618.
      mysql-test/r/mysqldump.result:
        Result modifications for bug#13618.
      mysql-test/t/mysqldump.test:
        Added a testcase for bug#13618.
      aeda5996
    • Tor Didriksen's avatar
      Bug #59498 div function broken in mysql-trunk · da94fc5d
      Tor Didriksen authored
      
      mysql-test/r/func_math.result:
        New test case.
      mysql-test/t/func_math.test:
        New test case.
      sql/item_func.cc:
        Check for null before converting value to my_decimal.
      da94fc5d
    • Nirbhay Choubey's avatar
      Merging fix of Bug#13618 from mysql-5.1. · 3ea2b498
      Nirbhay Choubey authored
      3ea2b498
    • Guilhem Bichot's avatar
      Fix for BUG#59432 "--autocommit=on does not work (@@global.autocommit is 0)" · 3ddfad4a
      Guilhem Bichot authored
      mysql-test/r/mysqld--help-notwin.result:
        consequence of introducing opt_autocommit and its default
      mysql-test/suite/sys_vars/r/autocommit_func4.result:
        Before this fix, this test would have shown @@global.autocommit == 0
        in spite of --autocommit=on.
      mysql-test/suite/sys_vars/r/autocommit_func5.result:
        result unchanged by the fix
      sql/mysqld.cc:
        atoi(argument) was reliable for =0|1 parameters. Now that boolean options
        must support =on/off/true/false, atoi(argument) is wrong (being always 0
        for those strings). Instead, let the internal logic of my_getopt
        (in particular get_bool_argument()) set a boolean opt_autocommit
        properly, and use that to set global_system_variables.option_bits.
      3ddfad4a
    • Georgi Kodinov's avatar
      Bug #55509 : main.lowercase_table2 fails on Mac OSX (again) · c5a95841
      Georgi Kodinov authored
      The test passes on MacOSX. removing it from the experimental list.
      c5a95841
    • Luis Soares's avatar
      e41b1b81
    • Sven Sandberg's avatar
      cfb019cd
    • Sven Sandberg's avatar
      BUG#59063: rpl_migration_crash_safe fails on Windows · 8309a50c
      Sven Sandberg authored
      Backported the fix to 5.1.
      Problem: the auxiliary test files rpl_start_server.inc and rpl_stop_server.inc
      write a file that is later read by mtr. The bug was that the file was written
      with platform-dependent newline terminators, i.e., \r\n on windows, whereas mtr
      only understands \n.
      Fix: write the file so that it uses \n on all platforms.
      
      
      mysql-test/include/rpl_start_server.inc:
        Force test to use \n instead of platform-dependent newline terminator.
      mysql-test/include/rpl_stop_server.inc:
        Force test to use \n instead of platform-dependent newline terminator.
      8309a50c
    • Georgi Kodinov's avatar
      bumped up the version · 5f8b4cbc
      Georgi Kodinov authored
      5f8b4cbc
    • Tor Didriksen's avatar
      Bug #59241 invalid memory read in do_div_mod with doubly assigned variables · dfb9e8ca
      Tor Didriksen authored
      Fix: copy my_decimal by value, to avoid dangling pointers.
      
      
      mysql-test/r/func_math.result:
        New test case.
      mysql-test/t/func_math.test:
        New test case.
      sql/item_cmpfunc.cc:
        No need to call fix_buffer_pointer() anymore.
      sql/item_func.cc:
        Copy my_decimal by value, to avoid dangling pointers.
      sql/my_decimal.h:
        Implement proper copy constructor and assignment operator for my_decimal.
      sql/sql_analyse.cc:
        No need to call fix_buffer_pointer() anymore.
      strings/decimal.c:
        Remove #line directive: it messes up TAGS and it confuses gdb when debugging.
      dfb9e8ca
  5. 13 Jan, 2011 9 commits
  6. 12 Jan, 2011 2 commits
    • Bjorn Munch's avatar
      merge from 5.1-mtr · 7def3081
      Bjorn Munch authored
      7def3081
    • Davi Arnaut's avatar
      Bug#42054: SELECT CURDATE() is returning bad value · 7ba98a4a
      Davi Arnaut authored
      The problem from a user point of view was that on Solaris the
      time related functions (e.g. NOW(), SYSDATE(), etc) would always
      return a fixed time.
      
      This bug was happening due to a logic in the time retrieving
      wrapper function which would only call the time() function every
      half second. This interval between calls would be calculated
      using the gethrtime() and the logic relied on the fact that time
      returned by it is monotonic.
      
      Unfortunately, due to bugs in the gethrtime() implementation,
      there are some cases where the time returned by it can drift
      (See Solaris bug id 6600939), potentially causing the interval
      calculation logic to fail.
      
      Since newer versions of Solaris (10+) have alleviated the
      performance degradation associated with time(2), the solution is
      to simply directly rely on time() at each invocation.
      
      This simplification has an upside that it allows us to eliminate
      a lock which was used to control access to the variables used
      to track the half second interval, thus improving the overall
      scalability of timekeeping related functions (e.g. NOW()).
      
      Benchmarks runs have shown no significant degradation associated
      with this change. With this, there are actually improvements in
      performance for cases involving many connections.
      
      In summary, the changes introduced by this patch are:
      
      a) my_time() and my_micro_time_and_time() no longer use gethrtime().
         Instead, time() and gettimeofdate() are used correspondingly.
      
      b) my_micro_time() is changed to not use gethrtime() so as to
         have the same time source as my_micro_time_and_time().
         There shouldn't be any performance impact from this change
         since this function is used only a few times during statement
         execution and, on Solaris, gettimeofday() shows acceptable
         performance.
      
      mysys/my_getsystime.c:
        Use time() even if gethrtime() is available. Remove logic which
        relied on gethrtime() to only call time() every half second.
        Since gethrtime() is not used anymore, also remove it from
        my_micro_time() to keep a common time source.
        
        Also, function comments are cleaned up (fixed typos and wrong
        information) and converted to doxygen.
      mysys/my_thr_init.c:
        Remove mutex which is no longer used.
      mysys/mysys_priv.h:
        Remove mutex which is no longer used.
      7ba98a4a
  7. 13 Jan, 2011 6 commits
    • Ole John Aske's avatar
      Fix for #58422: Incorrect result when OUTER JOIN'ing with an empty table. · e3cd0582
      Ole John Aske authored
      Fixed incorrect checks in join_read_const_table() for when to 
      accept a non-existing, or empty const-row as a part of the const'ified 
      set of tables.
            
      Intention of this test is to only accept NULL-rows if this table is outer joined
      into the resultset. (In case of an inner-join we can conclude at this point that 
      resultset will be empty, end we want to return 'error' to signal this.)
            
      Initially 'maybe_null' is set to the same value as 'outer_join' in 
      setup_table_map(), mysql_priv.h ~line 2424. Later simplify_joins() will
      attemp to replace outer joins by inner join whenever possible. This
      will cause 'outer_join' to be updated. However, 'maybe_null' is *not* updated
      to reflect this rewrite as this field is used to currectly set the 'nullability'
      property for the columns in the resultset.
            
      We should therefore change join_read_const_table() to check the 'outer_join'
      property instead of 'maybe_null', as this correctly reflect the nullability of
      the *execution plan* (not *resultset*).
      e3cd0582
    • Nirbhay Choubey's avatar
      Merging from mysql-5.1. · d5950254
      Nirbhay Choubey authored
      d5950254
    • Ole John Aske's avatar
      Fix for bug#58134: 'Incorrectly condition pushdown inside subquery to NDB engine' · a4663115
      Ole John Aske authored
      An incorrect 'table_map' containing both the table itself, 
      and possible any outer-refs if this was the last table in 
      the subquery, was presented to make_cond_for_table().
            
      As a pushed condition is only able to refer column from the table
      the condition is pushed to, nothing else than columns from the
      table itself (tab->table->map) may be refered in the pushed condition
      constructed by 'push_cond= make_cond_for_table()'. 
            
      Also fix a minor 'copy and paste' bug in a comment 
      inside make_cond_for_table().
      
      No testcase is possible on mainbranch as the NDB engine is not available (yet)
      on mysql >= 5.5
      a4663115
    • Georgi Kodinov's avatar
      null merge of the version bumps. · d4198e24
      Georgi Kodinov authored
      d4198e24
    • Ole John Aske's avatar
      Fix for Bug#57034 incorrect OUTER JOIN result when joined on unique key · 8abae5c6
      Ole John Aske authored
      Item_equal::val_int() checked for NULL-values by checking Item::null_value
      *before* the respective ::store_value() and ::cmp(Item*) metods where called.
      
      As Item::null_value is set by these metods, the value of 'null_value' 
      is not valid until *after* ::store_value() or ::cmp() has
      been called for the Item object.
            
      Fix is to swap order of ::store_value()/::cmp() and checking of Item::null_value.
      This pattern is widely used other places inside item_cmpfunc.cc .
      
      8abae5c6
    • Martin Hansson's avatar
      Merge of fix for Bug#58165. · e25ee9e7
      Martin Hansson authored
      e25ee9e7
  8. 12 Jan, 2011 2 commits