1. 26 Jun, 2006 5 commits
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime · cf119987
      unknown authored
      into  mysql.com:/opt/local/work/mysql-5.0-17199
      
      
      mysql-test/r/create.result:
        Auto merged
      mysql-test/t/create.test:
        Auto merged
      sql/item_strfunc.cc:
        Auto merged
      sql/log_event.cc:
        Auto merged
      sql/slave.cc:
        Auto merged
      sql/sp_head.cc:
        Auto merged
      sql/sql_class.h:
        Auto merged
      sql/sql_db.cc:
        Auto merged
      sql/sql_insert.cc:
        Auto merged
      sql/sql_lex.h:
        Auto merged
      sql/sql_parse.cc:
        Auto merged
      sql/sql_table.cc:
        Auto merged
      sql/sql_yacc.yy:
        Auto merged
      mysql-test/r/sp.result:
        SCCS merged
      mysql-test/t/sp.test:
        SCCS merged
      cf119987
    • unknown's avatar
      A fix and a test case for · d6bcbfbe
      unknown authored
       Bug#19022 "Memory bug when switching db during trigger execution"
       Bug#17199 "Problem when view calls function from another database."
       Bug#18444 "Fully qualified stored function names don't work correctly in
                  SELECT statements"
      
       Documentation note: this patch introduces a change in behaviour of prepared
       statements.
      
       This patch adds a few new invariants with regard to how THD::db should
       be used. These invariants should be preserved in future:
      
        - one should never refer to THD::db by pointer and always make a deep copy
          (strmake, strdup)
        - one should never compare two databases by pointer, but use strncmp or
          my_strncasecmp
        - TABLE_LIST object table->db should be always initialized in the parser or
          by creator of the object.
      
          For prepared statements it means that if the current database is changed
          after a statement is prepared, the database that was current at prepare
          remains active. This also means that you can not prepare a statement that
          implicitly refers to the current database if the latter is not set.
          This is not documented, and therefore needs documentation. This is NOT a
          change in behavior for almost all SQL statements except:
           - ALTER TABLE t1 RENAME t2 
           - OPTIMIZE TABLE t1
           - ANALYZE TABLE t1
           - TRUNCATE TABLE t1 --
           until this patch t1 or t2 could be evaluated at the first execution of
           prepared statement. 
      
           CURRENT_DATABASE() still works OK and is evaluated at every execution
           of prepared statement.
      
           Note, that in stored routines this is not an issue as the default
           database is the database of the stored procedure and "use" statement
           is prohibited in stored routines.
      
        This patch makes obsolete the use of check_db_used (it was never used in the
        old code too) and all other places that check for table->db and assign it
        from THD::db if it's NULL, except the parser.
      
       How this patch was created: THD::{db,db_length} were replaced with a
       LEX_STRING, THD::db. All the places that refer to THD::{db,db_length} were
       manually checked and:
        - if the place uses thd->db by pointer, it was fixed to make a deep copy
        - if a place compared two db pointers, it was fixed to compare them by value
          (via strcmp/my_strcasecmp, whatever was approproate)
       Then this intermediate patch was used to write a smaller patch that does the
       same thing but without a rename.
      
       TODO in 5.1:
         - remove check_db_used
         - deploy THD::set_db in mysql_change_db
      
       See also comments to individual files.
      
      
      mysql-test/r/create.result:
        Modify the result file: a database can never be NULL.
      mysql-test/r/ps.result:
        Update test results (Bug#17199 et al)
      mysql-test/r/sp.result:
        Update test results (Bug#17199 et al)
      mysql-test/t/create.test:
        Update the id of the returned error.
      mysql-test/t/ps.test:
        Add test coverage for prepared statements and current database. In scope of
        work on Bug#17199 "Problem when view calls function from another database."
      mysql-test/t/sp.test:
        Add a test case for Bug#17199 "Problem when view calls function from another
        database." and Bug#18444 "Fully qualified stored function names don't work
        correctly in SELECT statements". Test a complementary problem.
      sql/item_strfunc.cc:
        Touch the code that reads thd->db (cleanup).
      sql/log_event.cc:
        While we are at it, replace direct access to thd->db with a method.
        Should simplify future conversion of THD::db to LEX_STRING.
      sql/slave.cc:
        While we are at it, replace direct access to thd->db with a method.
        Should simplify future conversion of THD::db to LEX_STRING.
      sql/slave.h:
        Remove a declaration for a method that is used only in one module.
      sql/sp.cc:
        Rewrite sp_use_new_db: this is a cleanup that I needed in order to understand
        this function and ensure that it has no bugs.
      sql/sp.h:
        Add a new declaration for sp_use_new_db (uses LEX_STRINGs) and a comment.
      sql/sp_head.cc:
        - drop sp_name_current_db_new - a creator of sp_name class that was used
        when sp_name was created for an identifier without an explicitly initialized
        database. Now we pass thd->db to constructor of sp_name right in the 
        parser.
        - rewrite sp_head::init_strings: name->m_db is always set now
        - use the new variant of sp_use_new_db
        - we don't need to update thd->db with SP MEM_ROOT pointer anymore when
        parsing a stored procedure, as noone will refer to it (yes!)
      sql/sp_head.h:
        - remove unneded methods and members
      sql/sql_class.h:
        - introduce 3 THD  methods to work with THD::db:
          .set_db to assign the current database
          .reset_db to reset the current database (temporarily) or set it to NULL
          .opt_copy_db_to - to deep-copy thd->db to a pointer if it's not NULL
      sql/sql_db.cc:
        While we are at it, replace direct access to thd->db with a method.
        Should simplify future conversion of THD::db to LEX_STRING.
      sql/sql_insert.cc:
        - replace checks with asserts: table_list->db must be always set in the parser.
      sql/sql_lex.h:
        - add a comment
      sql/sql_parse.cc:
        - implement the invariant described in the changeset comment.
        - remove juggling with lex->sphead in SQLCOM_CREATE_PROCEDURE:
          now db_load_routine uses its own LEX object and doesn't damage the main
          LEX.
        - add DBUG_ASSERT(0) to unused "check_db_used"
      sql/sql_table.cc:
        - replace a check with an assert (table_ident->db)
      sql/sql_trigger.cc:
        While we are at it, replace direct access to thd->db with a method.
        Should simplify future conversion of THD::db to LEX_STRING.
      sql/sql_udf.cc:
        - use thd->set_db instead of direct modification of to thd->db
      sql/sql_view.cc:
        - replace a check with an assert (view->db)
      sql/sql_yacc.yy:
        - make sure that we always copy table->db or name->db or ident->db or
          select_lex->db from thd->db if the former is not set. If thd->db
          is not set but is accessed, return an error.
      sql/tztime.cc:
        - be nice, never copy thd->db by pointer.
      d6bcbfbe
    • unknown's avatar
      Merge mysql.com:/home/alik/MySQL/devel/5.0-tree · c3cb4690
      unknown authored
      into  mysql.com:/home/alik/MySQL/devel/5.0-rt
      
      
      c3cb4690
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint · 90ff8fbd
      unknown authored
      into  mysql.com:/home/tnurnberg/mysql-5.0-maint-18462
      
      
      mysql-test/r/mysqldump.result:
        Auto merged
      mysql-test/t/mysqldump.test:
        Auto merged
      client/mysqldump.c:
        SCCS merged
      90ff8fbd
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · eef15bdf
      unknown authored
      into  mysql.com:/data0/bk/mysql-5.0-maint
      
      
      sql/sp_head.cc:
        Auto merged
      sql/table.cc:
        Auto merged
      eef15bdf
  2. 24 Jun, 2006 2 commits
    • unknown's avatar
      Merge knielsen@10.100.52.19:/usr/local/mysql/tmp-5.0 · 9d7799e7
      unknown authored
      into  mysql.com:/data0/knielsen/tmp-5.0
      
      
      9d7799e7
    • unknown's avatar
      Fix race condition in test case wait_timeout. · 4a9a0b9a
      unknown authored
      Sometimes the helper connection (that is watching for the main connection
      to time out) would itself time out first, causing the test to fail.
      
      
      mysql-test/t/wait_timeout.test:
        Increase connection timeout in connection wait_con so we will not loose
        the connection that is watching for the real wait_timeout to trigger.
      4a9a0b9a
  3. 23 Jun, 2006 9 commits
  4. 22 Jun, 2006 13 commits
    • unknown's avatar
      mysql.spec.sh: · 92ad3d5b
      unknown authored
        Disable the simplistic auto dependency scan for test/bench (bug#20078)
      
      
      support-files/mysql.spec.sh:
        Disable the simplistic auto dependency scan for test/bench (bug#20078)
      92ad3d5b
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint · 357755fc
      unknown authored
      into  mysql.com:/home/tnurnberg/mysql-5.0-maint-19409
      
      
      357755fc
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · 0f0e518e
      unknown authored
      into  mysql.com:/opt/local/work/mysql-5.0-runtime
      
      
      0f0e518e
    • unknown's avatar
      Merge clam.ndb.mysql.com:/space/pekka/ndb/version/my50 · 1c288073
      unknown authored
      into  clam.ndb.mysql.com:/space/pekka/ndb/version/my50-bug18781
      
      
      ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
        Auto merged
      ndb/src/ndbapi/ndberror.c:
        Auto merged
      1c288073
    • unknown's avatar
      #19409: Test 'func_timestamp' fails on Windows x64 · 0271faa8
      unknown authored
      - The setting of "ENV{'TZ'}" doesn't affect the timezone
        used by MySQL Server on Windows.
      - Explicitly set timezone in test cases before doing UTC/localtime
        conversions so tests produce deterministic results
      
      
      mysql-test/r/func_timestamp.result:
        Update test results
      mysql-test/r/type_timestamp.result:
        Update test results
      mysql-test/t/func_timestamp.test:
        Specifically set timezone to make tests that do localtime/UTC conversions deterministic
      mysql-test/t/type_timestamp.test:
        Specifically set timezone to make tests that do localtime/UTC conversions deterministic
      0271faa8
    • unknown's avatar
      Bug#19408 Test 'func_time' fails on Windows x64 · e8beb72c
      unknown authored
      - The setting of "ENV{'TZ'}" doesn't affect the timezone
        used by MySQL Server on Windows.
      - Explicitly set timezone to "+03:00" in test case before
        doing the calculatiosn to check that there is three hours
        difference between utc and local time.
      (Magnus' fix)
      
      
      mysql-test/r/func_time.result:
        Update test results
      mysql-test/t/func_time.test:
        Set timezone to GMT-3, to make it possible to use "interval 3 hour"
      e8beb72c
    • unknown's avatar
      Merge mysql.com:/home/tomash/src/mysql_ab/mysql-5.0 · dca36865
      unknown authored
      into  mysql.com:/home/tomash/src/mysql_ab/mysql-5.0-bug15811
      
      
      dca36865
    • unknown's avatar
      Merge mysql.com:/opt/local/work/mysql-5.0-root · 8eb00d0a
      unknown authored
      into  mysql.com:/opt/local/work/mysql-5.0-runtime
      
      
      8eb00d0a
    • unknown's avatar
      Merge mysql.com:/home/tomash/src/mysql_ab/mysql-5.0 · a887fa9e
      unknown authored
      into  mysql.com:/home/tomash/src/mysql_ab/mysql-5.0-bug15811
      
      
      a887fa9e
    • unknown's avatar
      A fix and a test case for Bug#15217 "Using a SP cursor on a table created · 67fd3c4a
      unknown authored
       with PREPARE fails with weird error".
      More generally, re-executing a stored procedure with a complex SP cursor query
      could lead to a crash.
      
      The cause of the problem was that SP cursor queries were not optimized 
      properly at first execution: their parse tree belongs to sp_instr_cpush,
      not sp_instr_copen, and thus the tree was tagged "EXECUTED" when the
      cursor was declared, not when it was opened. This led to loss of optimization
      transformations performed at first execution, as sp_instr_copen saw that the
      query is already "EXECUTED" and therefore either not ran first-execution 
      related blocks or wrongly rolled back the transformations caused by 
      first-execution code.
      The fix is to update the state of the parsed tree only when the tree is
      executed, as opposed to when the instruction containing the tree is executed.
      Assignment if i->state is moved to reset_lex_and_exec_core.
      
      
      mysql-test/r/sp.result:
        Test results fixed (Bug#15217)
      mysql-test/t/sp.test:
        Add a test case for Bug#15217
      sql/sp_head.cc:
        Move assignment of stmt_arena->state to reset_lex_and_exec_core
      67fd3c4a
    • unknown's avatar
      Bug#15811: extremely long time for mysql client to execute long INSERT · 15ac6406
      unknown authored
      The problem was in redundant calls to strlen() in string functions,
      where we may then return after checking only the small number of characters.
      
      No test case is provided since it's a performance fix.
      
      
      strings/ctype-mb.c:
        Do not use strlen() where arbitrary horizon of at least
        CHARSET_INFO::mbmaxlen character is sufficient.
      15ac6406
    • unknown's avatar
      Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0 · 6e8cb4d6
      unknown authored
      into moonbone.local:/work/tmp_merge-5.0-opt-mysql
      
      
      6e8cb4d6
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint · 41af8b9e
      unknown authored
      into  zippy.(none):/home/cmiller/work/mysql/mysql-5.0__bug19904
      
      
      41af8b9e
  5. 21 Jun, 2006 11 commits
    • unknown's avatar
      Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · 5cb66b11
      unknown authored
      into moonbone.local:/work/tmp_merge-5.0-opt-mysql
      
      
      5cb66b11
    • unknown's avatar
      Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.0 · 41b9884d
      unknown authored
      into  a193-229-222-105.elisa-laajakaista.fi:/home/jani/mysql-5.0
      
      
      41b9884d
    • unknown's avatar
      Manual merge · 0041c317
      unknown authored
      
      mysql-test/r/ctype_utf8.result:
        Auto merged
      mysql-test/t/ctype_utf8.test:
        Auto merged
      0041c317
    • unknown's avatar
      Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0 · ab6059c8
      unknown authored
      into moonbone.local:/work/tmp_merge-5.0-opt-mysql
      
      
      ab6059c8
    • unknown's avatar
      Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1 · d5797063
      unknown authored
      into moonbone.local:/work/tmp_merge-4.1-opt-mysql
      
      
      d5797063
    • unknown's avatar
      Fixed bug #14896. · 822e8866
      unknown authored
      This bug in Field_string::cmp resulted in a wrong comparison 
      with keys in partial indexes over multi-byte character fields.
      Given field a is declared as a varchar(16) collate utf8_unicode_ci
      INDEX(a(4)) gives us an example of such an index.
        
      Wrong key comparisons could lead to wrong result sets if 
      the selected query execution plan used a range scan by 
      a partial index over a utf8 character field.
      This also caused wrong results in many other cases.
      
      
      mysql-test/t/ctype_utf8.test:
        Added test cases for bug #14896.
      mysql-test/r/ctype_utf8.result:
        Added test cases for bug #14896.
      sql/field.cc:
        Fixed bug #14896.
        This bug in Field_string::cmp resulted in a wrong comparison 
        with keys in partial indexes over multi-byte character fields.
        Given field a is declared as a varchar(16) collate utf8_unicode_ci
        INDEX(a(4)) gives us an example of such an index.
             
        Wrong key comparisons could lead to wrong result sets if 
        the selected query execution plan used a range scan by 
        a partial index over a utf8 character field.
        This also caused wrong results in many other cases.
      822e8866
    • unknown's avatar
      Merge mkindahl@bk-internal.mysql.com:/home/bk/mysql-5.0 · 37511b3b
      unknown authored
      into  mysql.com:/home/bk/fix-mysql-5.0
      
      
      37511b3b
    • unknown's avatar
      Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.0 · 7b2a3d50
      unknown authored
      into  a193-229-222-105.elisa-laajakaista.fi:/home/jani/mysql-5.0
      
      
      7b2a3d50
    • unknown's avatar
      Merge bk://localhost:5559 · f0ba641b
      unknown authored
      into  a193-229-222-105.elisa-laajakaista.fi:/home/jani/mysql-5.0
      
      
      f0ba641b
    • unknown's avatar
      Cleanup to patch for Bug#18246, "compilation error with tcp_wrapper" · e8e52a6a
      unknown authored
      
      include/my_libwrap.h:
        Changed includes to the header file.
      mysys/my_libwrap.c:
        Added comment and .c file now takes needed includes from
        the corresponding .h file.
      sql/mysqld.cc:
        Include this block from my_libwra.h now.
        Moved two variables out of the otherwise
        same block.
      e8e52a6a
    • unknown's avatar
      Merge bk-internal.mysql.com:/home/bk/mysql-5.0 · 88547195
      unknown authored
      into  zippy.(none):/home/cmiller/work/mysql/mysql-5.0-maint
      
      
      88547195