An error occurred fetching the project authors.
  1. 14 Oct, 2009 1 commit
    • Alexander Barkov's avatar
      A postfix for backporting WL#1397 convert XML -> SQL · 4def5216
      Alexander Barkov authored
      mysql-test/r/loadxml.result
      mysql-test/t/loadxml.test
        Fixing non-deterministic test results
      
      sql/sql_yacc.yy
        Initializing fname_first using get_tok_end() instead of get_ptr().
        The latter is grammar-dependant. The former is not.
      4def5216
  2. 12 Oct, 2009 1 commit
  3. 28 Sep, 2009 1 commit
  4. 10 Sep, 2009 3 commits
  5. 07 Sep, 2009 1 commit
    • Martin Hansson's avatar
      Bug#46259: 5.0.83 -> 5.1.36, query doesn't work · 2cb3a131
      Martin Hansson authored
            
      The parser rule for expressions in a udf parameter list contains 
      two hacks: 
      First, the parser input stream is read verbatim, bypassing 
      the lexer.
      Second, the Item::name field is overwritten. If the argument to a
      udf was a field, the field's name as seen by name resolution was
      overwritten this way.
      If the field name was quoted or escaped, it would appear as e.g. "`field`".
      Fixed by not overwriting field names.
      
      mysql-test/r/udf.result:
        Bug#46259: Test result.
      mysql-test/t/udf.test:
        Bug#46259: Test case.
      sql/sql_yacc.yy:
        Bug#46259: Fix.
      2cb3a131
  6. 29 Aug, 2009 1 commit
    • unknown's avatar
      Bug #44331 Restore of database with events produces warning in replication · f32c08bd
      unknown authored
      If an EVENT is created without the DEFINER clause set explicitly or with it set  
      to CURRENT_USER, the master and slaves become inconsistent. This issue stems from 
      the fact that in both cases, the DEFINER is set to the CURRENT_USER of the current 
      thread. On the master, the CURRENT_USER is the mysqld's user, while on the slave,  
      the CURRENT_USER is empty for the SQL Thread which is responsible for executing 
      the statement.
      
      To fix the problem, we do what follows. If the definer is not set explicitly,  
      a DEFINER clause is added when writing the query into binlog; if 'CURRENT_USER' is 
      used as the DEFINER, it is replaced with the value of the current user before 
      writing to binlog.
      
      mysql-test/suite/rpl/r/rpl_create_if_not_exists.result:
        Updated the result file after fixing bug#44331
      mysql-test/suite/rpl/r/rpl_drop_if_exists.result:
        Updated the result file after fixing bug#44331
      mysql-test/suite/rpl/r/rpl_events.result:
        Test result of Bug#44331
      mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result:
        Updated the result file after fixing bug#44331
      mysql-test/suite/rpl/t/rpl_events.test:
        Added test to verify if the definer is consistent between master and slave
        when the event is created without the DEFINER clause set explicitly or the
        DEFINER is set to CURRENT_USER
      sql/events.cc:
        The "create_query_string" function is added to create a new query string 
        for removing executable comments.
      sql/sql_yacc.yy:
        The remember_name token was added for recording the offset of EVENT_SYM.
      f32c08bd
  7. 27 Aug, 2009 1 commit
    • Sergey Glukhov's avatar
      Bug#46184 Crash, SELECT ... FROM derived table procedure analyze · 367c14b8
      Sergey Glukhov authored
      The crash happens because select_union object is used as result set
      for queries which have derived tables.
      select_union use temporary table as data storage and if
      fields count exceeds 10(count of values for procedure ANALYSE())
      then we get a crash on fill_record() function.
      
      
      mysql-test/r/analyse.result:
        test result
      mysql-test/r/subselect.result:
        result fix
      mysql-test/t/analyse.test:
        test case
      mysql-test/t/subselect.test:
        test fix
      sql/sql_yacc.yy:
        The crash happens because select_union object is used as result set
        for queries which have derived tables.
        select_union use temporary table as data storage and if
        fields count exceeds 10(count of values for procedure ANALYSE())
        then we get a crash on fill_record() function.
      367c14b8
  8. 12 Aug, 2009 1 commit
  9. 31 Jul, 2009 1 commit
    • Gleb Shchepa's avatar
      Bug# 30946: mysqldump silently ignores --default-character-set · 4e95179a
      Gleb Shchepa authored
                  when used with --tab
      
      1) New syntax: added CHARACTER SET clause to the
        SELECT ... INTO OUTFILE (to complement the same clause in
        LOAD DATA INFILE).
        mysqldump is updated to use this in --tab mode.
      
      2) ESCAPED BY/ENCLOSED BY field parameters are documented as
         accepting CHAR argument, however SELECT .. INTO OUTFILE
         silently ignored rests of multisymbol arguments.
         For the symmetrical behavior with LOAD DATA INFILE the
         server has been modified to fail with the same error:
      
           ERROR 42000: Field separator argument is not what is
                        expected; check the manual
      
      3) Current LOAD DATA INFILE recognizes field/line separators
         "as is" without converting from client charset to data
         file charset. So, it is supposed, that input file of
         LOAD DATA INFILE consists of data in one charset and
         separators in other charset. For the compatibility with
         that [buggy] behaviour SELECT INTO OUTFILE implementation
         has been saved "as is" too, but the new warning message
         has been added:
      
           Non-ASCII separator arguments are not fully supported
      
         This message warns on field/line separators that contain
         non-ASCII symbols.
      
      
      client/mysqldump.c:
        mysqldump has been updated to call SELECT ... INTO OUTFILE
        statement with a charset from the --default-charset command
        line parameter.
      mysql-test/r/mysqldump.result:
        Added test case for bug #30946.
      mysql-test/r/outfile_loaddata.result:
        Added test case for bug #30946.
      mysql-test/t/mysqldump.test:
        Added test case for bug #30946.
      mysql-test/t/outfile_loaddata.test:
        Added test case for bug #30946.
      sql/field.cc:
        String conversion code has been moved from check_string_copy_error()
        to convert_to_printable() for reuse.
      sql/share/errmsg.txt:
        New WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED message has been added.
      sql/sql_class.cc:
        The select_export::prepare() method has been modified to:
        
          1) raise the ER_WRONG_FIELD_TERMINATORS error on multisymbol
             ENCLOSED BY/ESCAPED BY field arguments like LOAD DATA INFILE;
        
          2) warn with a new WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED
             message on non-ASCII field or line separators.
        
        The select_export::send_data() merhod has been modified to
        convert item data to output charset (see new SELECT INTO OUTFILE
        syntax). By default the BINARY charset is used for backward
        compatibility.
      sql/sql_class.h:
        The select_export::write_cs field added to keep output
        charset.
      sql/sql_load.cc:
        mysql_load has been modified to warn on non-ASCII field or
        line separators with a new WARN_NON_ASCII_SEPARATOR_NOT_IMPLEMENTED
        message.
      sql/sql_string.cc:
        New global function has been added: convert_to_printable()
        (common code has been moved from check_string_copy_error()).
      sql/sql_string.h:
        New String::is_ascii() method and new global convert_to_printable()
        function have been added.
      sql/sql_yacc.yy:
        New syntax: added CHARACTER SET clause to the
        SELECT ... INTO OUTFILE (to complement the same clause in
        LOAD DATA INFILE). By default the BINARY charset is used for
        backward compatibility.
      4e95179a
  10. 29 Jul, 2009 2 commits
    • Mikael Ronstrom's avatar
      Bug#46354, when defining partitions without subpartition definition after... · a8e7535e
      Mikael Ronstrom authored
      Bug#46354, when defining partitions without subpartition definition after defining it with the first partition and using list partition caused crash, fixed by more error checks in parser
      a8e7535e
    • Guilhem Bichot's avatar
      Bug#45829 "CREATE TABLE TRANSACTIONAL PAGE_CHECKSUM ROW_FORMAT=PAGE accepted, does nothing": · a58b887c
      Guilhem Bichot authored
      those keywords do nothing in 5.1 (they are meant for future versions, for example featuring the Maria engine)
      so they are here removed from the syntax. Adding those keywords to future versions when needed is:
      - WL#5034 "Add TRANSACTIONA=0|1 and PAGE_CHECKSUM=0|1 clauses to CREATE TABLE"
      - WL#5037 "New ROW_FORMAT value for CREATE TABLE: PAGE"
      
      mysql-test/r/create.result:
        test that syntax is not accepted
      mysql-test/t/create.test:
        test that syntax is not accepted
      sql/handler.cc:
        remove ROW_FORMAT=PAGE
      sql/handler.h:
        Mark unused objects, but I don't remove them by fear of breaking any plugin which includes this file
        (see also table.h)
      sql/lex.h:
        removing syntax
      sql/sql_show.cc:
        removing output of noise keywords in SHOW CREATE TABLE and INFORMATION_SCHEMA.TABLES
      sql/sql_table.cc:
        removing TRANSACTIONAL
      sql/sql_yacc.yy:
        removing syntax
      sql/table.cc:
        removing TRANSACTIONAL, PAGE_CHECKSUM. Their place in the frm file is not reclaimed,
        for compatibility with older 5.1.
      sql/table.h:
        Mark unused objects, but I don't remove them by fear of breaking any plugin which includes this file
        (and there are several engines which use the content TABLE_SHARE and thus rely on a certain binary
        layout of this structure).
      a58b887c
  11. 16 Jul, 2009 1 commit
  12. 15 Jul, 2009 1 commit
    • Georgi Kodinov's avatar
      Bug #45287: phase 1 : 32 bit compilation warnings · 45b687c0
      Georgi Kodinov authored
      Fixed the following problems:
      1. cmake 2.6 warning because of a changed default on
      how the dependencies to libraries with a specified 
      path are resolved.
      Fixed by requiring cmake 2.6.
      2. Removed an obsolete pre-NT4 hack including defining
      Windows system defines to alter the behavior of windows.h.
      3. Disabled warning C4065 on compiling sql_yacc.cc because
      of a know incompatibility in some of the newer bison binaries.
      45b687c0
  13. 11 Jul, 2009 1 commit
    • Gleb Shchepa's avatar
      Bug #41156: List of derived tables acts like a chain of · 8b278847
      Gleb Shchepa authored
                  mutually-nested subqueries
      
      Queries of the form
      
        SELECT * FROM (SELECT 1) AS t1,
                      (SELECT 2) AS t2,...
                      (SELECT 32) AS t32
      
      caused the "Too high level of nesting for select" error
      as if the query has a form
      
        SELECT * FROM (SELECT 1 FROM (SELECT 2 FROM (SELECT 3 FROM...
      
      
      The table_factor parser rule has been modified to adjust
      the LEX::nest_level variable value after every derived table.
      
      
      mysql-test/r/derived.result:
        Added test case for bug #41156.
      mysql-test/t/derived.test:
        Added test case for bug #41156.
      sql/sql_yacc.yy:
        Bug #41156: List of derived tables acts like a chain of
                    mutually-nested subqueries
        
        The select_derived2 parser rule calls mysql_new_select()
        calls push_context() and nest_level++, however only
        the pop_context() was called at the end of derived table
        parsing at the table_factor rule.
        
        The table_factor parser rule has been modified to adjust
        the LEX::nest_level variable value after every derived table.
      8b278847
  14. 24 Jun, 2009 1 commit
    • MySQL Build Team's avatar
      Backport into build-200906240007-5.1.34sp1 · 11d2b7fe
      MySQL Build Team authored
      > ------------------------------------------------------------
      > revno: 2852.2.3
      > revision-id: davi.arnaut@sun.com-20090403194600-60ufn0tz1gx1kl0l
      > parent: gni@mysql.com-20090403184200-vnjtpsv4an79w8bu
      > parent: davi.arnaut@sun.com-20090403191154-0ho2nai3chjsmpof
      > committer: Davi Arnaut <Davi.Arnaut@Sun.COM>
      > branch nick: 43230-5.1
      > timestamp: Fri 2009-04-03 16:46:00 -0300
      > message:
      >   Merge Bug#43230 into mysql-5.1-bugteam
      >     ------------------------------------------------------------
      >     revno: 1810.3855.16
      >     revision-id: davi.arnaut@sun.com-20090403191154-0ho2nai3chjsmpof
      >     parent: chad@mysql.com-20090402152928-3ld60a56h86njcpg
      >     committer: Davi Arnaut <Davi.Arnaut@Sun.COM>
      >     branch nick: 43230-5.0
      >     timestamp: Fri 2009-04-03 16:11:54 -0300
      >     message:
      >       Bug#43230: SELECT ... FOR UPDATE can hang with FLUSH TABLES WITH READ LOCK indefinitely
      >       
      >       The problem is that a SELECT .. FOR UPDATE statement might open
      >       a table and later wait for a impeding global read lock without
      >       noticing whether it is holding a table that is being waited upon
      >       the the flush phase of the process that took the global read
      >       lock.
      >       
      >       The same problem also affected the following statements:
      >       
      >       LOCK TABLES .. WRITE
      >       UPDATE .. SET (update and multi-table update)
      >       TRUNCATE TABLE ..
      >       LOAD DATA ..
      >       
      >       The solution is to make the above statements wait for a impending
      >       global read lock before opening the tables. If there is no
      >       impending global read lock, the statement raises a temporary
      >       protection against global read locks and progresses smoothly
      >       towards completion.
      >       
      >       Important notice: the patch does not try to address all possible
      >       cases, only those which are common and can be fixed unintrusively
      >       enough for 5.0.
      11d2b7fe
  15. 23 Jun, 2009 1 commit
    • Alexey Botchkov's avatar
      Bug#44676 5.4 deprecation messages allege feature removal in lower version · 24af8a43
      Alexey Botchkov authored
          changed the deprecation border to 6.0 in this case
      
      per-file comments:
        mysql-test/r/backup.result
          Bug#44676      5.4 deprecation messages allege feature removal in lower version
          test result fixed
        mysql-test/r/show_check.result
          Bug#44676      5.4 deprecation messages allege feature removal in lower version
          test result fixed
        mysql-test/r/sp-error.result
          Bug#44676      5.4 deprecation messages allege feature removal in lower version
          test result fixed
        mysql-test/r/sp.result
          Bug#44676      5.4 deprecation messages allege feature removal in lower version
          test result fixed
        mysql-test/r/sp_trans.result
          Bug#44676      5.4 deprecation messages allege feature removal in lower version
          test result fixed
        mysql-test/r/warnings.result
          Bug#44676      5.4 deprecation messages allege feature removal in lower version
          test result fixed
        mysql-test/suite/rpl/r/rpl_sp.result
          Bug#44676      5.4 deprecation messages allege feature removal in lower version
          test result fixed
        sql/mysqld.cc
      Bug#44676      5.4 deprecation messages allege feature removal in lower version
        sql/set_var.cc
      Bug#44676      5.4 deprecation messages allege feature removal in lower version
        sql/sql_table.cc
      Bug#44676      5.4 deprecation messages allege feature removal in lower version
        sql/sql_yacc.yy
      Bug#44676      5.4 deprecation messages allege feature removal in lower version
      24af8a43
  16. 17 Jun, 2009 1 commit
    • Staale Smedseng's avatar
      Bug #43414 Parenthesis (and other) warnings compiling MySQL · 3b0e6e41
      Staale Smedseng authored
      with gcc 4.3.2
            
      Compiling MySQL with gcc 4.3.2 and later produces a number of 
      warnings, many of which are new with the recent compiler
      versions.
                        
      This bug will be resolved in more than one patch to limit the
      size of changesets. This is the second patch, fixing more
      of the warnings.
      3b0e6e41
  17. 10 Jun, 2009 1 commit
    • Staale Smedseng's avatar
      Bug #43414 Parenthesis (and other) warnings compiling MySQL · a1035097
      Staale Smedseng authored
      with gcc 4.3.2
      
      Compiling MySQL with gcc 4.3.2 and later produces a number of 
      warnings, many of which are new with the recent compiler
      versions.
                  
      This bug will be resolved in more than one patch to limit the
      size of changesets. This is the second patch, fixing more
      of the warnings.
      a1035097
  18. 27 May, 2009 2 commits
    • Georgi Kodinov's avatar
      Bug #38159: Function parsing problem generates misleading error message · 80730df7
      Georgi Kodinov authored
            
      Added a more detailed error message on calling an ambiguous missing function.
      
      mysql-test/r/ps.result:
        Bug #38159: fixed existing tests
      mysql-test/r/sp-error.result:
        Bug #38159: test case
      mysql-test/t/ps.test:
        Bug #38159: fixed existing tests
      mysql-test/t/sp-error.test:
        Bug #38159: test case
      sql/item_func.cc:
        Bug #38159: generate more detailed error message
      sql/share/errmsg.txt:
        Bug #38159: add a more detailed error message
      sql/sql_derived.cc:
        Bug #38159: treat the detailed error message the same way as the
        generic one
      sql/sql_lex.cc:
        Bug #38159: 
          - detect if the token is ambiguous and print the appropriate error.
          - backport is_lex_native_function() from 5.1
      sql/sql_lex.h:
        Bug #38159: detect if the token is ambiguous and print the appropriate error.
      sql/sql_yacc.yy:
        Bug #38159: generate more detailed error message
      sql/table.cc:
        Bug #38159: treat the detailed error message the same way as the
        generic one
      80730df7
    • Alexey Kopytov's avatar
      Bug #44767: invalid memory reads in password() and · 1b8322c3
      Alexey Kopytov authored
                  old_password() functions   
      The PASSWORD() and OLD_PASSWORD() functions could lead to   
      memory reads outside of an internal buffer when used with BLOB   
      arguments.   
        
      String::c_ptr() assumes there is at least one extra byte  
      in the internally allocated buffer when adding the trailing  
      '\0'.  This, however, may not be the case when a String object  
      was initialized with externally allocated buffer.  
        
      The bug was fixed by adding an additional "length" argument to  
      make_scrambled_password_323() and make_scrambled_password() in  
      order to avoid String::c_ptr() calls for  
      PASSWORD()/OLD_PASSWORD().  
        
      However, since the make_scrambled_password[_323] functions are  
      a part of the client library ABI, the functions with the new  
      interfaces were implemented with the 'my_' prefix in their  
      names, with the old functions changed to be wrappers around  
      the new ones to maintain interface compatibility.  
      
      mysql-test/r/func_crypt.result:
        Added a test case for bug #44767.
      mysql-test/t/func_crypt.test:
        Added a test case for bug #44767.
      sql/item_strfunc.cc:
        Use the new my_make_scrambled_password*() to avoid 
        String::c_ptr().
      sql/item_strfunc.h:
        Changed Item_func[_old]_password::alloc() interfaces so that
        we can use the new my_make_scrambled_password*() functions.
      sql/mysql_priv.h:
        Added declarations for the new my_make_scrambled_password*() 
        functions.
      sql/password.c:
        Added new my_make_scrambled_password*() functions with an
        additional "length" argument. Changed ones to be wrappers
        around the new ones to maintain interface compatibility.
      sql/sql_yacc.yy:
        Utilize the new password hashing functions with additional length
        argument.
      1b8322c3
  19. 03 Apr, 2009 1 commit
    • Davi Arnaut's avatar
      Bug#43230: SELECT ... FOR UPDATE can hang with FLUSH TABLES WITH READ LOCK indefinitely · 72e97882
      Davi Arnaut authored
      The problem is that a SELECT .. FOR UPDATE statement might open
      a table and later wait for a impeding global read lock without
      noticing whether it is holding a table that is being waited upon
      the the flush phase of the process that took the global read
      lock.
      
      The same problem also affected the following statements:
      
      LOCK TABLES .. WRITE
      UPDATE .. SET (update and multi-table update)
      TRUNCATE TABLE ..
      LOAD DATA ..
      
      The solution is to make the above statements wait for a impending
      global read lock before opening the tables. If there is no
      impending global read lock, the statement raises a temporary
      protection against global read locks and progresses smoothly
      towards completion.
      
      Important notice: the patch does not try to address all possible
      cases, only those which are common and can be fixed unintrusively
      enough for 5.0.
      
      mysql-test/r/lock_multi.result:
        Add test case result for Bug#43230
      mysql-test/t/lock_multi.test:
        Add test case for Bug#43230
      sql/sql_lex.cc:
        Initialize flag.
      sql/sql_lex.h:
        Add a flag to the lexer.
      sql/sql_parse.cc:
        Wait for the global read lock is a write lock is going to be
        taken. The wait is done before opening tables.
      sql/sql_yacc.yy:
        Protect against the GRL if its a SELECT .. FOR UPDATE or LOCK TABLES
        .. WRITE statement.
      72e97882
  20. 05 Mar, 2009 1 commit
    • Kristofer Pettersson's avatar
      Bug#39843 DELETE requires write access to table in subquery in where clause · ddaede80
      Kristofer Pettersson authored
      An unnecessarily restrictive lock were taken on sub-SELECTs during DELETE.
      
      During parsing, a global structure is reused for sub-SELECTs and the attribute
      keeping track of lock options were not reset properly.
      This patch introduces a new attribute to keep track on the syntactical lock
      option elements found in a sub-SELECT and then sets the lock options accordingly.
      
      Now the sub-SELECTs will try to acquire a READ lock if possible
      instead of a WRITE lock as inherited from the outer DELETE statement.
      
      
      mysql-test/r/lock.result:
        Added test case for bug39843
      mysql-test/t/lock.test:
        Added test case for bug39843
      sql/sql_lex.cc:
        * Reset member variable lock_option on each new query.
      sql/sql_lex.h:
        * Introduced new member variable 'lock_option' which is keeping track
          of the syntactical lock option of a (sub-)select query.
      sql/sql_parse.cc:
        * Wrote comments to functions.
      sql/sql_yacc.yy:
        * Introduced an attribute to keep track of syntactical lock options
          in sub-selects.
        * Made sure that the default value TL_READ_DEFAULT is at the begining
          of each subselect-rule.
      ddaede80
  21. 16 Feb, 2009 1 commit
  22. 12 Feb, 2009 1 commit
    • Georgi Kodinov's avatar
      Bug #33813: Schema names are case-sensitive in DROP FUNCTION · 1c5fa3b6
      Georgi Kodinov authored
            
      Additional fix:
       1. Revert the unification of DROP FUNCTION
      and DROP PROCEDURE, because DROP FUNCTION can be used to
      drop UDFs (that have a non-qualified name and don't require
      database name to be present and valid).
       2. Fixed the case sensitivity problem by adding a call to 
      check_db_name() (similar to the sp_name production).
      1c5fa3b6
  23. 10 Feb, 2009 1 commit
    • Georgi Kodinov's avatar
      Bug #33813: Schema names are case-sensitive in DROP FUNCTION · 0669b793
      Georgi Kodinov authored
      The parser was not using the correct fully-qualified-name
      production for DROP FUNCTION.
      Fixed by copying the production from DROP PROCEDURE.
      Tested in the windows specific suite to make sure it's 
      tested on a case-insensitive file system.
      
      mysql-test/r/windows.result:
        Bug #33813: test case
      mysql-test/t/windows.test:
        Bug #33813: test case
      sql/sql_yacc.yy:
        Bug #33813: use the correct production for the name in
        DROP PROCEDURE
      0669b793
  24. 08 Jan, 2009 1 commit
    • Mattias Jonsson's avatar
      Bug#39893: Crash if select on a partitioned table, when partitioning is disabled · 48e0325c
      Mattias Jonsson authored
      Problem was that it tried to run partitioning function calls when
      opening a partitioned table, when it was explicitly disabled.
      
      Solution is to check if the partitioning plugin is ready to use before
      using any partitioning specific calls.
      
      mysql-test/r/disabled_partition.require:
        Bug#39893: Crash if select on a partitioned table, when partitioning is disabled
        
        New require file to use when partitioning is disabled (but compiled in)
      mysql-test/r/not_partition.result:
        Bug#39893: Crash if select on a partitioned table, when partitioning is disabled
        
        Updated testcase
      mysql-test/r/partition_disabled.result:
        Bug#39893: Crash if select on a partitioned table, when partitioning is disabled
        
        New result file
      mysql-test/std_data/parts/t1.frm:
        Bug#39893: Crash if select on a partitioned table, when partitioning is disabled
        
        frm file for 'create table t1 (a int) partition by hash (a)'
      mysql-test/t/not_partition.test:
        Bug#39893: Crash if select on a partitioned table, when partitioning is disabled
        
        Updated test cases
      mysql-test/t/partition_disabled-master.opt:
        Bug#39893: Crash if select on a partitioned table, when partitioning is disabled
        
        New opt file
      mysql-test/t/partition_disabled.test:
        Bug#39893: Crash if select on a partitioned table, when partitioning is disabled
        
        New test file (looks like not_partition.test, but with different errors)
      sql/sql_yacc.yy:
        Bug#39893: Crash if select on a partitioned table, when partitioning is disabled
        
        Better error message (it is already built with partitioning, but is explicitly
        disabled).
      sql/table.cc:
        Bug#39893: Crash if select on a partitioned table, when partitioning is disabled
        
        If the partitioning plugin is not ready, fail to open the table.
      48e0325c
  25. 21 Nov, 2008 1 commit
    • Alexey Botchkov's avatar
      Bug#25058 ignored return codes in memory allocation functions · d445b215
      Alexey Botchkov authored
         memory allocation error checks added for functions
         calling insert_dynamic()
      
      per-file messages:
        myisam/mi_delete.c
      Bug#25058 ignored return codes in memory allocation functions
          out-of-memory errors handled
        myisam/mi_write.c
      Bug#25058 ignored return codes in memory allocation functions
          out-of-memory errors handled
        server-tools/instance-manager/instance_options.cc
      Bug#25058 ignored return codes in memory allocation functions
          out-of-memory errors handled
        sql/slave.cc
      Bug#25058 ignored return codes in memory allocation functions
          out-of-memory errors handled
        sql/sp_head.cc
      Bug#25058 ignored return codes in memory allocation functions
          out-of-memory errors handled
        sql/sp_head.h
      Bug#25058 ignored return codes in memory allocation functions
          out-of-memory errors handled
        sql/sp_pcontext.cc
      Bug#25058 ignored return codes in memory allocation functions
          out-of-memory errors handled
        sql/sp_pcontext.h
      Bug#25058 ignored return codes in memory allocation functions
          out-of-memory errors handled
        sql/sql_select.cc
      Bug#25058 ignored return codes in memory allocation functions
          out-of-memory errors handled
        sql/sql_yacc.yy
      Bug#25058 ignored return codes in memory allocation functions
          out-of-memory errors handled
      d445b215
  26. 10 Nov, 2008 1 commit
  27. 23 Oct, 2008 1 commit
  28. 10 Oct, 2008 1 commit
    • Mattias Jonsson's avatar
      Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work · c6115db4
      Mattias Jonsson authored
      on non-partitioned table
      
      Problem was that partitioning specific commands was accepted
      for non partitioned tables and treated like
      ANALYZE/CHECK/OPTIMIZE/REPAIR TABLE, after bug-20129 was fixed,
      which changed the code path from mysql_alter_table to
      mysql_admin_table.
      
      Solution was to check if the table was partitioned before
      trying to execute the admin command
      
      mysql-test/r/partition_mgm_err.result:
        Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
        on non-partitioned table
        
        Updated test result
      mysql-test/t/partition_mgm_err.test:
        Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
        on non-partitioned table
        
        Updated test case
      sql/ha_partition.cc:
        Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
        on non-partitioned table
        
        Simplified the code by using ALTER_ADMIN_PARTITION for all
        commands that go through mysql_admin_tables and is set
        for partitioning specific commands that.
      sql/ha_partition.h:
        Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
        on non-partitioned table
        
        Simplified the code by using ALTER_ADMIN_PARTITION for all
        commands that go through mysql_admin_tables and is set
        for partitioning specific commands that.
      sql/sql_lex.h:
        Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
        on non-partitioned table
        
        Simplified the code by using ALTER_ADMIN_PARTITION for all
        commands that go through mysql_admin_tables and is set
        for partitioning specific commands that.
        
        Removed ALTER_ANALYZE/CHECK/OPTIMIZE/REPAIR_PARTITION and
        added ALTER_ADMIN_PARTITION instead.
      sql/sql_partition.cc:
        Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
        on non-partitioned table
        
        Simplified the code by using ALTER_ADMIN_PARTITION for all
        commands that go through mysql_admin_tables and is set
        for partitioning specific commands that.
        
        Removed ALTER_ANALYZE/CHECK/OPTIMIZE/REPAIR_PARTITION and
        added ALTER_ADMIN_PARTITION instead.
      sql/sql_table.cc:
        Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
        on non-partitioned table
        
        Give error and return if trying partitioning admin command
        on non partitioned table.
        
        Simplified the code by using ALTER_ADMIN_PARTITION for all
        commands that go through mysql_admin_tables and is set
        for partitioning specific commands that.
        
        Removed ALTER_ANALYZE/CHECK/OPTIMIZE/REPAIR_PARTITION and
        added ALTER_ADMIN_PARTITION instead.
      sql/sql_yacc.yy:
        Bug#39434: ALTER TABLE CHECK/OPTIMIZE/ANALYZE PARTITION work
        on non-partitioned table
        
        Simplified the code by using ALTER_ADMIN_PARTITION for all
        commands that go through mysql_admin_tables and is set
        for partitioning specific commands that.
        
        Removed ALTER_ANALYZE/CHECK/OPTIMIZE/REPAIR_PARTITION and
        added ALTER_ADMIN_PARTITION instead.
      c6115db4
  29. 02 Oct, 2008 1 commit
    • Sergey Glukhov's avatar
      Bug#35924 DEFINER should be stored 'quoted' in I_S · d51e2c07
      Sergey Glukhov authored
      The '@' symbol can not be used in the host name according to rfc952.
      The fix:
      added function check_host_name(LEX_STRING *str)
      which checks that all symbols in host name string are valid and
      host name length is not more than max host name length
      (just moved check_string_length() function from the parser into check_host_name()).
      
      
      mysql-test/r/create.result:
        test result
      mysql-test/t/create.test:
        test case
      sql/mysql_priv.h:
        added function check_host_name(LEX_STRING *str)
      sql/sql_parse.cc:
        added function check_host_name(LEX_STRING *str)
        which checks that all symbols in host name string are valid and
        host name length is not more than max host name length(HOSTNAME_LENGTH).
      sql/sql_yacc.yy:
        using newly added function check_host_name()
      d51e2c07
  30. 29 Sep, 2008 1 commit
    • Davi Arnaut's avatar
      Bug#34306: Can't make copy of log tables when server binary log is enabled · 0406d409
      Davi Arnaut authored
      The problem is that when statement-based replication was enabled,
      statements such as INSERT INTO .. SELECT FROM .. and CREATE TABLE
      .. SELECT FROM need to grab a read lock on the source table that
      does not permit concurrent inserts, which would in turn be denied
      if the source table is a log table because log tables can't be
      locked exclusively.
      
      The solution is to not take such a lock when the source table is
      a log table as it is unsafe to replicate log tables under statement
      based replication. Furthermore, the read lock that does not permits
      concurrent inserts is now only taken if statement-based replication
      is enabled and if the source table is not a log table.
      
      include/thr_lock.h:
        Introduce yet another lock type that my get upgraded depending
        on the binary log format. This is not a optimal solution but
        can be easily improved later.
      mysql-test/r/log_tables.result:
        Add test case result for Bug#34306
      mysql-test/suite/binlog/r/binlog_stm_row.result:
        Add test case result for Bug#34306
      mysql-test/suite/binlog/t/binlog_stm_row.test:
        Add test case for Bug#34306
      mysql-test/t/log_tables.test:
        Add test case for Bug#34306
      sql/lock.cc:
        Assert that TL_READ_DEFAULT is not a real lock type.
      sql/mysql_priv.h:
        Export new function.
      sql/mysqld.cc:
        Remove using_update_log.
      sql/sql_base.cc:
        Introduce function that returns the appropriate read lock type
        depending on how the statement is going to be replicated. It will
        only take a TL_READ_NO_INSERT log if the binary is enabled and the
        binary log format is statement-based and the table is not a log table.
      sql/sql_parse.cc:
        Remove using_update_log.
      sql/sql_update.cc:
        Use new function to choose read lock type.
      sql/sql_yacc.yy:
        The lock type is now decided at open_tables time. This old behavior was
        actually misleading as the binary log format can be dynamically switched
        and this would not change for statements that have already been parsed
        when the binary log format is changed (ie: prepared statements).
      0406d409
  31. 18 Sep, 2008 1 commit
    • Gleb Shchepa's avatar
      Bug#26020: User-Defined Variables are not consistent with · e9cb71fc
      Gleb Shchepa authored
                 columns data types
      
      The "SELECT @lastId, @lastId := Id FROM t" query returns
      different result sets depending on the type of the Id column
      (INT or BIGINT).
      
      Note: this fix doesn't cover the case when a select query
      references an user variable and stored function that
      updates a value of that variable, in this case a result
      is indeterminate.
      
      
      The server uses incorrect assumption about a constantness of
      an user variable value as a select list item: 
      
      The server caches a last query number where that variable
      was changed and compares this number with a current query
      number. If these numbers are different, the server guesses,
      that the variable is not updating in the current query, so
      a respective select list item is a constant. However, in some
      common cases the server updates cached query number too late.
      
      
      The server has been modified to memorize user variable
      assignments during the parse phase to take them into account
      on the next (query preparation) phase independently of the
      order of user variable references/assignments in a select
      item list.
      
      
      mysql-test/r/user_var.result:
        Added test case for bug #26020.
      mysql-test/t/user_var.test:
        Added test case for bug #26020.
      sql/item_func.cc:
        An update of entry and update_query_id variables has been
        moved from Item_func_set_user_var::fix_fields() to a separate
        method, Item_func_set_user_var::set_entry().
      sql/item_func.h:
        1. The Item_func_set_user_var::set_entry() method has been
        added to update Item_func_set_user_var::entry.
        
        2. The Item_func_set_user_var::entry_thd field has beend
        added to update Item_func_set_user_var::entry only when
        needed.
      sql/sql_base.cc:
        Fix: setup_fiedls() calls Item_func_set_user_var::set_entry()
        for all items from the thd->lex->set_var_list before the first
        call of ::fix_fields().
      sql/sql_lex.cc:
        The lex_start function has been modified to reset
        the st_lex::set_var_list list.
      sql/sql_lex.h:
        New st_lex::set_var_list field has been added to
        memorize all user variable assignments in the current
        select query.
      sql/sql_yacc.yy:
        The variable_aux rule has been modified to memorize
        in-query user variable assignments in the
        st_lex::set_var_list list.
      e9cb71fc
  32. 05 Sep, 2008 1 commit
    • Evgeny Potemkin's avatar
      Bug#37908: Skipped access right check caused server crash. · 1588c116
      Evgeny Potemkin authored
            
      The check_table_access function initializes per-table grant info and performs
      access rights check. It wasn't called for SHOW STATUS statement thus left
      grants info uninitialized. In some cases this led to server crash. In other
      cases it allowed a user to check for presence/absence of arbitrary values in
      any tables.
            
      Now the check_table_access function is called prior to the statement
      processing.
      
      
      mysql-test/r/status.result:
        Added a test case for the bug#37908.
      mysql-test/t/status.test:
        Added a test case for the bug#37908.
      sql/sql_parse.cc:
        Bug#37908: Skipped access right check caused server crash.
        Now the check_table_access function is called when the SHOW STATUS statement
        uses any table except information.STATUS.
      sql/sql_yacc.yy:
        Bug#37908: Skipped access right check caused server crash.
        For the SHOW PROCEDURE/FUNCTION STATUS the 'mysql.proc' table isn't added
        to the table list anymore as there is no need.
      1588c116
  33. 18 Aug, 2008 1 commit
    • Tatiana A. Nurnberg's avatar
      Bug#35981: ALTER EVENT causes the server to change the PRESERVE option. · 02f30551
      Tatiana A. Nurnberg authored
      If [NOT] PRESERVE was not given, parser always defaulted to NOT
      PRESERVE, making it impossible for the "not given = no change"
      rule to work in ALTER EVENT. Leaving out the PRESERVE-clause
      defaults to NOT PRESERVE on CREATE now, and to "no change" in
      ALTER.
      
      mysql-test/r/events_2.result:
        show that giving no PRESERVE-clause to ALTER EVENT
        results in no change. show that giving no PRESERVE-clause
        to CREATE EVENT defaults to NOT PRESERVE as per the docs.
        Show specifically that this is also handled correctly when
        trying to ALTER EVENTs into the past.
      mysql-test/t/events_2.test:
        show that giving no PRESERVE-clause to ALTER EVENT
        results in no change. show that giving no PRESERVE-clause
        to CREATE EVENT defaults to NOT PRESERVE as per the docs.
        Show specifically that this is also handled correctly when
        trying to ALTER EVENTs into the past.
      sql/event_db_repository.cc:
        If ALTER EVENT was given no PRESERVE-clause (meaning "no change"),
        we don't know the previous PRESERVE-setting by the time we check
        the parse-data. If ALTER EVENT was given dates that are in the past,
        we don't know how to react, lacking the PRESERVE-setting. Heal this
        by running the check later when we have actually read the previous
        EVENT-data.
      sql/event_parse_data.cc:
        Change default for ON COMPLETION to indicate, "not specified."
        Also defer throwing errors when ALTER EVENT is given dates in
        the past but not PRESERVE-clause until we know the previous
        PRESERVE-value.
      sql/event_parse_data.h:
        Add third state for ON COMPLETION [NOT] PRESERVE (preserve,
        don't, not specified).
        
        Make check_dates() public so we can defer this check until
        deeper in the callstack where we have all the required data.
      sql/sql_yacc.yy:
        If CREATE EVENT is not given ON COMPLETION [NOT] PRESERVE,
        we default to NOT, as per the docs.
      02f30551
  34. 12 Aug, 2008 1 commit
    • Marc Alff's avatar
      Bug#38296 (low memory crash with many conditions in a query) · 7ea370d2
      Marc Alff authored
      This fix is for 5.1 only : back porting the 6.0 patch manually
      
      The parser code in sql/sql_yacc.yy needs to be more robust to out of
      memory conditions, so that when parsing a query fails due to OOM,
      the thread gracefully returns an error.
      
      Before this fix, a new/alloc returning NULL could:
      - cause a crash, if dereferencing the NULL pointer,
      - produce a corrupted parsed tree, containing NULL nodes,
      - alter the semantic of a query, by silently dropping token values or nodes
      
      With this fix:
      - C++ constructors are *not* executed with a NULL "this" pointer
      when operator new fails.
      This is achieved by declaring "operator new" with a "throw ()" clause,
      so that a failed new gracefully returns NULL on OOM conditions.
      
      - calls to new/alloc are tested for a NULL result,
      
      - The thread diagnostic area is set to an error status when OOM occurs.
      This ensures that a request failing in the server properly returns an
      ER_OUT_OF_RESOURCES error to the client.
      
      - OOM conditions cause the parser to stop immediately (MYSQL_YYABORT).
      This prevents causing further crashes when using a partially built parsed
      tree in further rules in the parser.
      
      No test scripts are provided, since automating OOM failures is not
      instrumented in the server.
      Tested under the debugger, to verify that an error in alloc_root cause the
      thread to returns gracefully all the way to the client application, with
      an ER_OUT_OF_RESOURCES error.
      7ea370d2
  35. 11 Aug, 2008 2 commits
    • Mattias Jonsson's avatar
      Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that · f50c4207
      Mattias Jonsson authored
      partition is corrupt
      
      The main problem was that ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR
      PARTITION took another code path (over mysql_alter_table instead of
      mysql_admin_table) which differs in two ways:
      1) alter table opens the tables in a different way than admin tables do
         resulting in returning with error before it tried the command
      2) alter table does not start to send any diagnostic rows to the client
         which the lower admin functions continue to use -> resulting in
         assertion crash
      
      The fix:
      Remapped ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION to use
      the same code path as ANALYZE/CHECK/OPTIMIZE/REPAIR TABLE t.
      Adding check in mysql_admin_table to setup the partition list for
      which partitions that should be used.
      
      
      Partitioned tables will still not work with
      REPAIR TABLE/PARTITION USE_FRM, since that requires moving partitions
      to tables, REPAIR TABLE t USE_FRM, and check that the data still
      fulfills the partitioning function and then move the table back to
      being a partition.
      
      NOTE: I have removed the following functions from the handler
      interface:
      analyze_partitions, check_partitions, optimize_partitions,
      repair_partitions
      Since they are not longer needed.
      THIS ALTERS THE STORAGE ENGINE API
      
      mysql-test/r/handler_innodb.result:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Added a note result row.
      mysql-test/r/innodb.result:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Added a note result row.
      mysql-test/r/innodb_mysql.result:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Added a note result row.
      mysql-test/r/partition.result:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
        tables.
      mysql-test/r/trigger-trans.result:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Added a note result row.
      mysql-test/suite/ndb/r/ndb_partition_key.result:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
        tables.
      mysql-test/suite/ndb/t/ndb_partition_key.test:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
        tables.
      mysql-test/suite/parts/inc/partition_alter4.inc:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
        tables.
      mysql-test/suite/parts/r/partition_alter4_innodb.result:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
        tables.
      mysql-test/suite/parts/r/partition_alter4_myisam.result:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
        tables.
      mysql-test/suite/rpl/r/rpl_failed_optimize.result:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Added a note result row.
      mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Added a note result row.
      mysql-test/t/partition.test:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Updated after fixing ANALYZE/CHECK/OPTIMIZE/REPAIR partitioned
        tables.
      sql/ha_partition.cc:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Added a function for returning admin commands result rows
        Updated handle_opt_partitions to handle admin commands result rows,
        and some error filtering (as mysql_admin_table do).
        
        Removed the functions analyze/check/optimize/repair_partitions
        since they have no longer any use.
      sql/ha_partition.h:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Removed analyze/check/optimize/repair_partitions since they
        are no longer are needed.
      sql/handler.cc:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Removed analyze/check/optimize/repair_partitions since they
        are no longer are needed.
      sql/handler.h:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Removed analyze/check/optimize/repair_partitions since they
        are no longer are needed.
      sql/mysql_priv.h:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Added set_part_state for reuse of code in mysql_admin_table.
        (Originally fond in sql/sql_partition.cc:prep_alter_part_table)
      sql/protocol.cc:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Added one assert and a debug print.
      sql/sql_partition.cc:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Refactored code for setting up partition state, set_part_state,
        now used in both prep_alter_part_table and
        sql_table.cc:mysql_admin_table.
        Removed code for handling ANALYZE/CHECK/OPTIMIZE/REPAIR partitions,
        since it is now handled by mysql_admin_table.
      sql/sql_table.cc:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Added functionality in mysql_admin_table to work with partitioned
        tables.
        Fixed a possible assertion bug for HA_ADMIN_TRY_ALTER
        (If analyze would output a row, it fails since the row was already
        started).
      sql/sql_yacc.yy:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Remapped ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION
        to use the same code path as ANALYZE/CHECK/OPTIMIZE/REPAIR TABLE
        instead of taking the ALTER TABLE path.
        Added reset of alter_info for ANALYZE/CHECK/OPTIMIZE/REPAIR TABLE
        since it is now used by partitioned tables.
      storage/myisam/mi_check.c:
        Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
        partition is corrupt
        
        Changed warning message from "Found X parts  Should be: Y parts"
        to "Found X key parts. Should be Y", since it could be confusing
        with partitioned tables.
      f50c4207
    • Marc Alff's avatar
      Bug#38296 (low memory crash with many conditions in a query) · e04dfffb
      Marc Alff authored
      This fix is for 5.0 only : back porting the 6.0 patch manually
      
      The parser code in sql/sql_yacc.yy needs to be more robust to out of
      memory conditions, so that when parsing a query fails due to OOM,
      the thread gracefully returns an error.
      
      Before this fix, a new/alloc returning NULL could:
      - cause a crash, if dereferencing the NULL pointer,
      - produce a corrupted parsed tree, containing NULL nodes,
      - alter the semantic of a query, by silently dropping token values or nodes
      
      With this fix:
      - C++ constructors are *not* executed with a NULL "this" pointer
      when operator new fails.
      This is achieved by declaring "operator new" with a "throw ()" clause,
      so that a failed new gracefully returns NULL on OOM conditions.
      
      - calls to new/alloc are tested for a NULL result,
      
      - The thread diagnostic area is set to an error status when OOM occurs.
      This ensures that a request failing in the server properly returns an
      ER_OUT_OF_RESOURCES error to the client.
      
      - OOM conditions cause the parser to stop immediately (MYSQL_YYABORT).
      This prevents causing further crashes when using a partially built parsed
      tree in further rules in the parser.
      
      No test scripts are provided, since automating OOM failures is not
      instrumented in the server.
      Tested under the debugger, to verify that an error in alloc_root cause the
      thread to returns gracefully all the way to the client application, with
      an ER_OUT_OF_RESOURCES error.
      e04dfffb