1. 11 May, 2007 1 commit
    • dlenev@mockturtle.local's avatar
      Fix for: · 8b93e52e
      dlenev@mockturtle.local authored
        Bug #20662 "Infinite loop in CREATE TABLE IF NOT EXISTS ... SELECT
                    with locked tables"
        Bug #20903 "Crash when using CREATE TABLE .. SELECT and triggers"
        Bug #24738 "CREATE TABLE ... SELECT is not isolated properly"
        Bug #24508 "Inconsistent results of CREATE TABLE ... SELECT when
                    temporary table exists"
       
      Deadlock occured when one tried to execute CREATE TABLE IF NOT
      EXISTS ... SELECT statement under LOCK TABLES which held
      read lock on target table.
      Attempt to execute the same statement for already existing
      target table with triggers caused server crashes.
      Also concurrent execution of CREATE TABLE ... SELECT statement
      and other statements involving target table suffered from
      various races (some of which might've led to deadlocks).
      Finally, attempt to execute CREATE TABLE ... SELECT in case
      when a temporary table with same name was already present
      led to the insertion of data into this temporary table and
      creation of empty non-temporary table.
       
      All above problems stemmed from the old implementation of CREATE
      TABLE ... SELECT in which we created, opened and locked target
      table without any special protection in a separate step and not
      with the rest of tables used by this statement.
      This underminded deadlock-avoidance approach used in server
      and created window for races. It also excluded target table
      from prelocking causing problems with trigger execution.
        
      The patch solves these problems by implementing new approach to
      handling of CREATE TABLE ... SELECT for base tables.
      We try to open and lock table to be created at the same time as
      the rest of tables used by this statement. If such table does not
      exist at this moment we create and place in the table cache special
      placeholder for it which prevents its creation or any other usage
      by other threads.
      
      We still use old approach for creation of temporary tables.
      
      Also note that we decided to postpone introduction of some tests
      for concurrent behaviour of CREATE TABLE ... SELECT till 5.1.
      The main reason for this is absence in 5.0 ability to set @@debug
      variable at runtime, which can be circumvented only by using several
      test files with individual .opt files. Since the latter is likely
      to slowdown test-suite unnecessary we chose not to push this tests
      into 5.0, but run them manually for this version and later push
      their optimized version into 5.1
      8b93e52e
  2. 02 May, 2007 2 commits
  3. 01 May, 2007 2 commits
  4. 30 Apr, 2007 9 commits
  5. 29 Apr, 2007 14 commits
  6. 28 Apr, 2007 7 commits
  7. 27 Apr, 2007 5 commits
    • tsmith@quadxeon.mysql.com's avatar
      Merge quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/50 · acee0c8e
      tsmith@quadxeon.mysql.com authored
      into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/50
      acee0c8e
    • tsmith@quadxeon.mysql.com's avatar
      Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.0-maint · df2d9ca9
      tsmith@quadxeon.mysql.com authored
      into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/50
      df2d9ca9
    • tsmith@quadxeon.mysql.com's avatar
      Merge quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/b27653/50 · 33a74e41
      tsmith@quadxeon.mysql.com authored
      into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/50
      33a74e41
    • tsmith@quadxeon.mysql.com's avatar
      Bug #27390: mysqld_multi --config-file= not working as documented · b90b0c7e
      tsmith@quadxeon.mysql.com authored
      Recognize the --no-defaults, --defaults-file and --defaults-extra-file
      options.  Treat old --config-file argument as if --defaults-extra-file
      had been specified instead.
      
      Plus a few other defaults-related cleanups.
      b90b0c7e
    • malff/marcsql@weblab.(none)'s avatar
      Bug#21513 (SP having body starting with quoted label rendered unusable) · 012f841f
      malff/marcsql@weblab.(none) authored
      Before this fix, the parser would sometime change where a token starts by
      altering Lex_input_string::tok_start, which later confused the code in
      sql_yacc.yy that needs to capture the source code of a SQL statement,
      like to represent the body of a stored procedure.
      
      This line of code in sql_lex.cc :
      
      case MY_LEX_USER_VARIABLE_DELIMITER:
        lip->tok_start= lip->ptr; // Skip first `
      
      would <skip the first back quote> ... and cause the bug reported.
      
      In general, the responsibility of sql_lex.cc is to *find* where token are
      in the SQL text, but is *not* to make up fake or incomplete tokens.
      With a quoted label like `my_label`, the token starts on the first quote.
      Extracting the token value should not change that (it did).
      
      With this fix, the lexical analysis has been cleaned up to not change
      lip->tok_start (in the case found for this bug).
      
      The functions get_token() and get_quoted_token() now have an extra
      parameters, used when some characters from the beginning of the token need
      to be skipped when extracting a token value, like when extracting 'AB' from
      '0xAB', for example, for a HEX_NUM token.
      
      This exposed a bad assumption in Item_hex_string and Item_bin_string,
      which has been fixed:
      
      The assumption was that the string given, 'AB', was in fact preceded in
      memory by '0x', which might be false (it can be preceded by "x'" and
      followed by "'" -- or not be preceded by valid memory at all)
      
      If a name is needed for Item_hex_string or Item_bin_string, the name is
      taken from the original and true source code ('0xAB'), and assigned in
      the select_item rule, instead of relying on assumptions related to how
      memory is used.
      012f841f