1. 22 Jun, 2007 1 commit
    • unknown's avatar
      Bug#28846 Use of undocumented Prepared Statements crashes server · 099be801
      unknown authored
      ALTER VIEW is currently not supported as a prepared statement
      and should be disabled as such as they otherwise could cause server crashes.
      
      ALTER VIEW is currently not supported when called from stored
      procedures or functions for related reasons and should also be disabled.
      
      This patch disables these DDL statements and adjusts the appropriate test
      cases accordingly.
      
      Additional tests has been added to reflect on the fact that we do support
      CREATE/ALTER/DROP TABLE for Prepared Statements (PS), Stored Procedures (SP)
      and PS within SP.
      
      
      mysql-test/r/ps_1general.result:
        - Updated test to reflect on the new policy to disallow ALTER VIEW within SP.
      mysql-test/r/sp-dynamic.result:
        - Added PS ALTER TABLE test from within SP-context to demonstrate that CREATE/ALTER/DROP
        TABLE statements is working.
        - Added PS CREATE/ALTER/DROP VIEW tests from within SP-context to show that
        ALTER VIEW is not supported, CREATE VIEW/DROP VIEW are supported.
      mysql-test/r/sp-error.result:
        - Updated test to reflect on the new policy to disallow VIEW DDL within SP.
      mysql-test/t/ps_1general.test:
        - Updated test to reflect on the new policy to disallow VIEW DDL within SP.
      mysql-test/t/sp-dynamic.test:
        - Add PS ALTER TABLE test from within SP to demonstrate that CREATE/ALTER/DROP
        TABLE statements are supported.
      mysql-test/t/sp-error.test:
        - Updated test to reflect on the new policy to disallow ALTER VIEW
        within SP-context.
        - Changed error code 1314 to the more abstract ER_SP_BADSTATEMENT.
      sql/sql_class.h:
        - Added comment for clarity
      sql/sql_parse.cc:
        - Added comment for clarity
      sql/sql_prepare.cc:
        - Disallow ALTER VIEW as prepared statements until they are
          properly supported. Note that SQLCOM_CREATE_VIEW also handles ALTER VIEW
          statements.
      sql/sql_view.cc:
        - converted to doxygen comments
        - Added comment for clarity
      sql/sql_yacc.yy:
        - Disallow ALTER VIEW statements within a SP.
        If the parser is operating within the SP context, this is shown
        on the sp->sphead pointer. If this flag is set for view DDL operations
        we stop parsing with the error 'ER_SP_BAD_STATEMENT'.
      099be801
  2. 07 Jun, 2007 4 commits
  3. 01 Jun, 2007 4 commits
  4. 31 May, 2007 1 commit
  5. 30 May, 2007 3 commits
    • unknown's avatar
      bug#22725 · dd190b0e
      unknown authored
      refining the test because of Bug #28786 'reset master' does not reset binlogging on embeded server
      
      
      mysql-test/t/binlog_killed.test:
        the test can not pass on embedded server. Setting the include-guard.
      dd190b0e
    • unknown's avatar
      bug#22725 · e5c4d97c
      unknown authored
      test comments correction
      
      
      mysql-test/r/binlog_killed.result:
        changed
      mysql-test/t/binlog_killed.test:
        wrong comments (but important ones) left;
        little refinement in result calc
      e5c4d97c
    • unknown's avatar
      Disable IM-tests. · 9f15fe64
      unknown authored
      9f15fe64
  6. 29 May, 2007 6 commits
    • unknown's avatar
      bug#22725 · 9a1e9de9
      unknown authored
      combining the final result variable in such way that either option of the test execution
      will yield zero.
      
      
      mysql-test/r/binlog_killed.result:
        results changed
      mysql-test/t/binlog_killed.test:
        there are two options for the test passing:
        1. no rows inserted and the INSERT gets killed, then there is no INSERT query in binlog
        2. all rows inserted, then INSERT gets to binlog and error_code is zero
      9a1e9de9
    • unknown's avatar
      bug#22725 · 54e1f2f0
      unknown authored
      tests refining, see binlog_killed.test file for details
      
      
      mysql-test/r/binlog_killed.result:
        results changed
      mysql-test/t/binlog_killed.test:
        killer conn waits for the first row to appear;
        log-disabling kill query since prey's id is not deterministic;
        correcting pattern to search in binlog for insert query;
      54e1f2f0
    • unknown's avatar
      bug#22725 · 70a530e4
      unknown authored
      refining the test.
      
      
      mysql-test/t/binlog_killed.test:
        due to killing reap may catch an error though it's indeterministic.
      70a530e4
    • unknown's avatar
      bug#22725 · daa7b8a5
      unknown authored
      result file updated
      
      
      mysql-test/r/binlog_killed.result:
        results updated
      daa7b8a5
    • unknown's avatar
      Bug#22725 Replication outages from ER_SERVER_SHUTDOWN (1053) set in replication events · 00710d17
      unknown authored
        
      Refining the tests since pb revealed the older version's fragality - the error from SF() due to killed
      may be different on different env:s.
      DBUG_ASSERT instead of assert.
      
      
      mysql-test/r/binlog_killed.result:
        new result file
      mysql-test/t/binlog_killed.test:
        regression for bug#22725 simplified. tests for bug27563, BUG#27565 made inactive.
      sql/sql_insert.cc:
        DBUG_ASSERT
      00710d17
    • unknown's avatar
      Merge adventure.(none):/home/thek/Development/cpp/bug24988/my50-bug24988 · 2212ad47
      unknown authored
      into  adventure.(none):/home/thek/Development/cpp/mysql-5.0-runtime
      
      
      sql/mysqld.cc:
        Auto merged
      2212ad47
  7. 28 May, 2007 3 commits
    • unknown's avatar
      Bug#22725 Replication outages from ER_SERVER_SHUTDOWN (1053) set in replication events · f27bf2b4
      unknown authored
        
      The reason for the bug was that replaying of a query on slave could not be possible since its event
      was recorded with the killed error. Due to the specific of handling INSERT, which per-row-while-loop is 
      unbreakable to killing, the query on transactional table should have not appeared in binlog unless
      there was  a call to a stored routine that got interrupted with killing (and then there must be an error
      returned out of the loop).
         
      The offered solution added the following rule for binlogging of INSERT that accounts the above
      specifics:
      For INSERT on transactional-table if the error was not set the only raised flag
      is harmless and is ignored via masking out on time of creation of binlog event.
         
      For both table types the combination of raised error and KILLED flag indicates that there
      was potentially partial execution on master and consistency is under the question.
      In that case the code continues to binlog an event with an appropriate killed error.
       
      The fix relies on the specified behaviour of stored routine that must propagate the error 
      to the top level query handling if the thd->killed flag was raised in the routine execution.
         
      The patch adds an arg with the default killed-status-unset value to Query_log_event::Query_log_event.
      
      
      sql/log_event.cc:
        killed_status as the value of thd->killed can be passed as an arg to the constructor.
        if the value is different from the default the arg is set to the current thd->killed value.
        A caller might need to masquerade thd->killed with THD::NOT_KILLED.
        So far only mysql_insert() uses such explicit way to tell the constructor about killing status.
      sql/log_event.h:
        default arg to the constructor with meaning of killed status of the query. 
        if the arg is not explicitly provided the status of thd->killed will be snapshot 
        inside of the constuctor, which is potentially incorrect (see bug#27571)
      sql/sql_class.h:
        extending killed_state with no-state member.
      sql/sql_insert.cc:
        ignore the KILLED flag incl KILL_BAD_DATA when the INSERT query event 
        is created without an `error';
      sql/sql_update.cc:
        Suggestion how to fix bug#27571 as comments.
      mysql-test/r/binlog_killed.result:
        new result file
      mysql-test/t/binlog_killed.test:
        regression tests also apply for bug27563, BUG#27565
      f27bf2b4
    • unknown's avatar
      Bug#24988 FLUSH PRIVILEGES causes brief unavailability · 96d16d96
      unknown authored
      - A race condition caused brief unavailablility when trying to acccess
        a table.
      - The unprotected variable 'grant_option' wasn't intended to alternate
        during normal execution. Variable initialization moved to grant_init
        a lines responsible for the alternation are removed. 
      
      
      sql/mysqld.cc:
        - Added documentation to describe grant_option flag.
      sql/sql_acl.cc:
        - This patch removes lines which causes grant_option to alternate and moves
          variable initialization to the grant_init()-function.
      96d16d96
    • unknown's avatar
      Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.0-rpl · 9f757559
      unknown authored
      into  mysql.com:/nfsdisk1/lars/MERGE/mysql-5.0-merge
      
      
      mysql-test/mysql-test-run.pl:
        Auto merged
      mysql-test/t/disabled.def:
        Auto merged
      sql/sql_load.cc:
        Auto merged
      9f757559
  8. 25 May, 2007 2 commits
    • unknown's avatar
      Code review comments · 5ed76763
      unknown authored
      
      sql/sql_lex.cc:
        Fixed parenthese typo, found during code review
      5ed76763
    • unknown's avatar
      Bug#27876 (SF with cyrillic variable name fails during execution (regression)) · 1e33b063
      unknown authored
      The root cause of this bug is related to the function skip_rear_comments,
      in sql_lex.cc
      
      Recent code changes in skip_rear_comments changed the prototype from
      "const uchar*" to "const char*", which had an unforseen impact on this test:
        (endp[-1] < ' ')
      With unsigned characters, this code filters bytes of value [0x00 - 0x20]
      With *signed* characters, this also filters bytes of value [0x80 - 0xFF].
      
      This caused the regression reported, considering cyrillic characters in the
      parameter name to be whitespace, and truncated.
      Note that the regression is present both in 5.0 and 5.1.
      
      With this fix:
      - [0x80 - 0xFF] bytes are no longer considered whitespace.
      This alone fixes the regression.
      
      In addition, filtering [0x00 - 0x20] was found bogus and abusive,
      so that the code now filters uses my_isspace when looking for whitespace.
      
      Note that this fix is only addressing the regression affecting UTF-8
      in general, but does not address a more fundamental problem with
      skip_rear_comments: parsing a string *backwards*, starting at end[-1],
      is not safe with multi-bytes characters, so that end[-1] can confuse the
      last byte of a multi-byte characters with a characters to filter out.
      
      The only known impact of this remaining issue affects objects that have to
      meet all the conditions below:
      
      - the object is a FUNCTION / PROCEDURE / TRIGGER / EVENT / VIEW
      - the body consist of only *1* instruction, and does *not* contain a
        BEGIN-END block
      - the instruction ends, lexically, with <ident> <whitespace>* ';'?
        For example, "select <ident>;" or "return <ident>;"
      - The last character of <ident> is a multi-byte character
      - the last byte of this character is ';' '*', '/' or whitespace
      
      In this case, the body of the object will be truncated after parsing,
      and stored in an invalid format.
      
      This last issue has not been fixed in this patch, since the real fix
      will be implemented by Bug 25411 (trigger code truncated), which is caused
      by the very same code.
      The real problem is that the function skip_rear_comments is only a
      work-around, and should be removed entirely: see the proposed patch for
      bug 25411 for details.
      
      
      sql/sp_head.cc:
        In skip_rear_comments,
        Filter out only whitespace, not other (non ascii or control) valid characters
      sql/sql_lex.cc:
        In skip_rear_comments,
        Filter out only whitespace, not other (non ascii or control) valid characters
      sql/sql_lex.h:
        In skip_rear_comments,
        Filter out only whitespace, not other (non ascii or control) valid characters
      sql/sql_view.cc:
        In skip_rear_comments,
        Filter out only whitespace, not other (non ascii or control) valid characters
      tests/mysql_client_test.c:
        Bug#27876 (SF with cyrillic variable name fails during execution (regression))
      1e33b063
  9. 24 May, 2007 4 commits
  10. 23 May, 2007 7 commits
    • unknown's avatar
      Bug#27636 mysqlbinlog-cp932 and ctype_cp932 tests fails if LC_* variables set to *_*.UTF-8 · a53b80b3
      unknown authored
      As MySQL character set tests can print results in many character sets
      (latin1, utf8-8, sjis, cp932 and others) - its output can be incompatible
      with the current locale settings, which makes PERL confuse.
      
      Fix: reset LC_ALL and LC_CTYPE to "C", which is compatible with
      any character set.
      
      
      mysql-test/mysql-test-run.pl:
        Ignore current locale settings, because "mysqltest" output
        can be not compatible with the locale.
      a53b80b3
    • unknown's avatar
      5.0 version of fix for: · f9d7642e
      unknown authored
       Bug #23667 "CREATE TABLE LIKE is not isolated from alteration
                   by other connections"
       Bug #18950 "CREATE TABLE LIKE does not obtain LOCK_open"
      As well as:
       Bug #25578 "CREATE TABLE LIKE does not require any privileges
                   on source table".
      
      The first and the second bugs resulted in various errors and wrong
      binary log order when one tried to execute concurrently CREATE TABLE LIKE
      statement and DDL statements on source table or DML/DDL statements on its
      target table.
      
      The problem was caused by incomplete protection/table-locking against
      concurrent statements implemented in mysql_create_like_table() routine.
      We solve it by simply implementing such protection in proper way (see
      comment for sql_table.cc for details).
      
      The third bug allowed user who didn't have any privileges on table create
      its copy and therefore circumvent privilege check for SHOW CREATE TABLE.
      
      This patch solves this problem by adding privilege check, which was missing.
      
      Finally it also removes some duplicated code from mysql_create_like_table().
      
      Note that, altough tests covering concurrency-related aspects of CREATE TABLE
      LIKE behaviour will only be introduced in 5.1, they were run manually for
      this patch as well.
      
      
      mysql-test/r/grant2.result:
        Added test for bug#25578 "CREATE TABLE LIKE does not require any privileges
        on source table".
      mysql-test/t/grant2.test:
        Added test for bug#25578 "CREATE TABLE LIKE does not require any privileges
        on source table".
      sql/handler.h:
        Introduced new flag for HA_CREATE_INFO::options in order to be able to
        distinguish CREATE TABLE ... LIKE from other types of CREATE TABLE.
      sql/mysql_priv.h:
        mysql_create_like_table() now takes source table name not as a
        Table_ident object but as regular table list element.
      sql/sql_parse.cc:
        CREATE TABLE ... LIKE implementation now uses statement's table list
        for storing information about the source table. We also use flag
        in LEX::create_info.options for distinguishing it from other types
        of CREATE TABLE.
        Finally CREATE TABLE ... LIKE now requires the same privileges on
        the source tables as SHOW CREATE TABLE. Moved this privilege check
        to check_show_create_table_access() function.
      sql/sql_table.cc:
        mysql_create_like_table():
         - Provided proper protection from concurrent statements.
           This is achieved by keeping name-lock on the source table and holding
           LOCK_open mutex during whole operation. This gives protection against
           concurrent DDL on source table. Also holding this mutex makes copying
           of .frm file, call to ha_create_table() and binlogging atomic against
           concurrent DML and DDL operations on target table.
         - Get rid of duplicated code related to source database/table name
           handling. All these operations are already done in
           st_select_lex::add_table_to_list(), so we achieve the same effect
           by including source table into the statement's table list.
      sql/sql_yacc.yy:
        Now we use special flag in LEX::create_info::options for distinguishing
        CREATE TABLE ... LIKE from other types of CREATE TABLE and store name
        of source table as regular element in statement's table list.
      f9d7642e
    • unknown's avatar
      Merge pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.0.42 · 5e236f85
      unknown authored
      into  pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.0-build
      
      
      configure.in:
        Auto merged
      sql/item_func.cc:
        Auto merged
      5e236f85
    • unknown's avatar
      Merge mysql.com:/home/svoj/devel/mysql/merge/mysql-4.1-engines · 351abe5a
      unknown authored
      into  mysql.com:/home/svoj/devel/mysql/merge/mysql-5.0-engines
      
      
      351abe5a
    • unknown's avatar
      Merge mysql.com:/home/svoj/devel/bk/mysql-5.0 · adef6736
      unknown authored
      into  mysql.com:/home/svoj/devel/mysql/merge/mysql-5.0-engines
      
      
      adef6736
    • unknown's avatar
      Merge mysql.com:/home/svoj/devel/bk/mysql-4.1 · e5b2adea
      unknown authored
      into  mysql.com:/home/svoj/devel/mysql/merge/mysql-4.1-engines
      
      
      e5b2adea
    • unknown's avatar
      Merge pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.0-build · 4f3b4af2
      unknown authored
      into  pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.0-build-work
      
      
      4f3b4af2
  11. 22 May, 2007 5 commits